Skip to content

feat(anet): add AgentNetwork A2A delegation plugin - #111

Closed
inksong wants to merge 5 commits into
zai-org:mainfrom
ANetResearch:feat/anet
Closed

inksong wants to merge 5 commits into
zai-org:mainfrom
ANetResearch:feat/anet

Conversation

@inksong

@inksong inksong commented Oct 19, 2026 •

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

Select exactly one before requesting review. / 发起评审前必须且只能勾选一项。

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI) — does not provide MCP Apps interactive pages / 不提供 MCP Apps 交互页面
  • Not applicable / 不适用 — repository-only changes; no plugin content changed / 仅仓库级改动,不涉及插件内容

Affected plugin name(s) / 涉及的插件名称:

anet (Standard plugin)

Classify the affected plugin, even when only changing its docs or skills. Adding or removing an interactive page also counts as a UI Plugin change. For multiple plugins, list each name and type; select UI Plugin if any is affected.

按涉及的插件判断,即使本次只改它的文档或 skill 也须声明类型。新增或移除交互页面也属于 UI Plugin 改动。涉及多个插件时分别列出名称和类型,只要包含 UI Plugin 就选择 UI Plugin。

ui.surfaces panels and tool-result pages using _meta.ui.resourceUri both count. An MCP server or a skill that generates Gen UI alone does not. This declaration is separate from marketplace category.

ui.surfaces 面板和通过 _meta.ui.resourceUri 展示的工具结果页面都算 UI Plugin。仅有 MCP server 或生成 Gen UI 的 skill 不算。这项声明与市场 category 分类独立。

What / 改动内容

Adds the community plugin anet 0.1.2 under external_plugins/anet/, with category developer-tools. It connects ZCode to a local anet (AgentNetwork) node that holds the agent's identity and exchanges end-to-end encrypted A2A (Agent2Agent protocol) tasks through a hub that relays but cannot read messages. The node runs no model. The change appends one entry (anet, displayName "AgentNetwork (anet)", zh "AgentNetwork(anet)") to root marketplace.json without modifying existing entries, adds assets/anet/icon.png (256x256 PNG from https://avatars.githubusercontent.com/u/305781773?s=256&v=4) and its record in assets/icon-sources.json (matchedBy: official-github-organization-avatar, sha256 recorded), and includes an Apache-2.0 LICENSE for the plugin files. No MCP Apps pages or ui.surfaces are provided.

新增社区插件 anet 0.1.2,位于 external_plugins/anet/,用途分类为 developer-tools。该插件将 ZCode 连接到本地 anet(AgentNetwork)节点,由节点持有智能体身份,并通过仅负责转发、无法读取消息的 hub 交换端到端加密的 A2A(Agent2Agent 协议)任务。节点不运行模型。本次改动在根目录 marketplace.json 末尾追加一条记录(anet,displayName 为 "AgentNetwork (anet)",中文为 "AgentNetwork(anet)"),不修改现有条目;新增 assets/anet/icon.png(来自 https://avatars.githubusercontent.com/u/305781773?s=256&v=4 的 256x256 PNG)及其在 assets/icon-sources.json 中的来源记录(matchedBy 为 official-github-organization-avatar,已记录 sha256),并为插件文件提供 Apache-2.0 LICENSE。不提供 MCP Apps 页面或 ui.surfaces。

Components / 组件

Component Name Detail
MCP server (stdio) anet (plugin:anet:anet) .mcp.json runs sh ${ZCODE_PLUGIN_ROOT}/bin/anet-mcp.sh, which runs anet mcp through bin/anet-run.sh. The runner applies the anetPath and identity settings; without anetPath it locates anet in PATH, ~/.local/bin, /usr/local/bin or /opt/homebrew/bin. A configured anetPath must be an absolute path to a regular executable file (a relative path or non-executable target is an error, never replaced by another copy). Setting values containing a line break are ignored, and --resolve prints the runner path quoted when it contains characters the shell would split or expand. Started with sh, so it works when ZIP contents are extracted as 0644. timeoutMs: 900000. Exposes 14 tools: list_agents, get_agent_card, send_message, wait_task, get_task, list_tasks, cancel_task, submit_payment, reject_payment, reply_task, inbound_pending, get_balance, audit, node_status.
Skill anet Operating guide: choosing an agent, task lifecycle, reporting effect status and receipt, payments, and treating other agents' output as untrusted input. Matches the guide installed by anet agents wire for Claude Code (except the final section), enforced by a Go test in the ANet repository.
Skill anet-setup Named anet-setup to avoid colliding with generic setup skills. Checks, installs (only after explicit user consent via https://agentnetwork.org.cn/install.sh, verifying a signed release manifest and SHA-256), starts the node, joins a hub, and runs anet doctor. Never runs operator-only commands (peers, inbound policy, payments), never reads ~/.anet, and never opens or edits the ZCode configuration itself (the runner reads the two plugin settings). Every anet command runs through bin/anet-run.sh; after consent, installation runs bin/anet-install.sh, which downloads the official installer into a new private temporary directory (mktemp), runs it only after a successful download (curl --proto '=https' --tlsv1.2 -fsSL), and removes the directory afterwards. The skill runs this script instead of a shell one-liner with command substitution, which some agent hosts refuse.
Command /anet-status Named /anet-status to avoid colliding with built-in /status. Reports node, hub, balance, and spending limits.
Settings (userConfig) identity, anetPath Optional named anet identity and absolute executable path.

Dependencies, network, side effects / 依赖、网络与副作用

  • Requires the anet command-line program on Linux or macOS (x86-64, ARM64). No Windows build exists; the README states the plugin does not work on Windows.
  • Needs no model or API key.
  • The plugin has no hooks. bin/anet-run.sh reads only the anetPath and identity entries of this plugin from the ZCode configuration. Apart from the consented installation below, the plugin opens no network connections and writes no files. The anet node connects to the hub it joined. When the user explicitly consents, bin/anet-install.sh downloads the installer from agentnetwork.org.cn into a private temporary directory that is removed afterwards, and the installer writes ~/.local/bin/anet; anet init writes ~/.anet.
  • Priced skills settle with a2a-x402 within operator-set limits. A new node accepts no tasks, publishes nothing, and has spending limits of 0.
  • Documentation: English | 中文.

Testing & verification / 测试与校验

Environment: ZCode 3.15.3 (Linux x64 AppImage under Xvfb), bundled CLI 0.16.9, anet 0.3.3, test model deepseek-v4.1-flash-1017 via an OpenAI-compatible provider, isolated test home directories.

  1. CLI validation & install: zcode plugins validate accepted the plugin. Installed both from a ZIP built by build_dist.build_zip (all files 0644) and from an HTTPS marketplace with a SHA-256-pinned ZIP. zcode plugins list --json showed mcpServerNames: ["plugin:anet:anet"], 2 skills, 1 command, and no diagnostics. A tampered ZIP was rejected with "Plugin zip sha256 mismatch".
  2. Desktop app (Xvfb): Added the marketplace through Plugin Marketplace → Add → Add plugin marketplace; plugin page listed MCP server anet, skills anet and anet-setup, and command anet-status. Installation succeeded, and the ··· menu provides Uninstall. After approving the permission prompt, node_status reported identity and hub state.
  3. MCP: Initialised as anet 0.3.3 with 14 tools; node_status succeeded with anet in ~/.local/bin (not on PATH). Missing executable, invalid anetPath, and stopped daemon each exited 1 with a one-line reason. Verified both anetPath and identity settings.
  4. Setup from scratch: In a clean home directory with explicit consent, the agent ran the official installer (anet 0.3.3, signed manifest), started the node, joined local test hub http://127.0.0.1:48731, ran anet doctor (all checks passed except the expected recovery-passphrase warning), and left anet identity protect to the user.
  5. Command: /anet-status in a new session reported identity, hub, balance, limits, and warnings.
  6. End-to-end delegation: Against a local hub with a second node publishing a free text.digest capability, the agent loaded the anet skill, called list_agents and send_message for "hello", and returned TASK_STATE_COMPLETED, effect status OK, verified receipt, and SHA-256 digest 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824.
  7. Review follow-up (0.1.1): every anet command of the plugin goes through bin/anet-run.sh, which applies anetPath and identity for the MCP server, the /anet-status fallback and the setup skill (outside the MCP server it reads only these two plugin settings from the ZCode configuration). Re-run in ZCode 3.15.3 with deepseek-v4.1-flash-1017: setup from scratch used the new installer block (private mktemp -d directory, run only after a successful download, the directory removed afterwards); /anet-status with identity set to a stopped named identity, while the default node was running, reported the selected identity; anetPath set to a missing file made setup stop without installing and without changing the configuration; delegation end to end again returned TASK_STATE_COMPLETED, effect status OK, a verified receipt and the correct digest. Unit tests for the runner are in the ANet repository (internal/agentwire/zcode_plugin_test.go).
  8. Update (0.1.2, commits 379ce44 and 7d881ab): bin/anet-run.sh accepts anetPath only as an absolute path (a relative path is an error because it would resolve against the session working directory, which may be an untrusted workspace); the executable found via PATH or anetPath must be a regular executable file; setting values containing a line break are ignored, and on macOS (plutil fallback) settings are read only when a single marketplace entry anet@<marketplace> exists and only string values count; --resolve quotes the runner path when it contains characters the shell would split or expand (such as the space in Application Support); the setup skill delegates installation after consent to bin/anet-install.sh (downloads the official installer with curl --proto '=https' --tlsv1.2 -fsSL into a private mktemp directory, runs it only if the download succeeded, and removes the directory afterwards) instead of using a shell one-liner with command substitution; README.md and README_CN.md tell users of a named identity to run anet --id <name> up on [daemon_not_running]. Verified in ZCode 3.15.3 headless with deepseek-v4.1-flash-1017: installed from a marketplace, setup from scratch ran bin/anet-install.sh and the official installer, started the node and joined a local test hub, and delegation of "hello" to a free text.digest capability returned TASK_STATE_COMPLETED, effect status OK, a verified receipt, and the correct SHA-256 digest. Runner unit tests are in the ANet repository (internal/agentwire/zcode_plugin_test.go and deploy/plugins tests).
  9. Not tested: macOS execution; ZCode on Windows (unsupported by anet).

Repository checks (re-run on 0.1.2):

  • python3 scripts/validate.py: OK: 47 plugin(s) validated.
  • git diff --check: clean.
  • pytest tests (excluding tests/test_mimosa_plugin.py, which has 4 failures that fail identically on unmodified main in the same environment, and tests/test_parallel_publish.py, which requires a publisher module not in the repository): 87 passed, 19 skipped.
  • vitest run tests/local-marketplace.test.ts: 19 passed.
  • Full pnpm build && python3 scripts/build_dist.py: passed (exit 0) on Linux x64 with the Craft toolchain installed; it packages plugins/anet/0.1.2/plugin.zip (20919 bytes).

Self-check / 自查清单

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/<name>/; existing fixes retain ownership / 插件名唯一且 kebab-case,外部新增插件位于 external_plugins/<name>/,已有插件修复保留原归属
  • Usage category is set independently of publisher ownership / 用途分类 category 已填写,与维护归属分开
  • Plugin type and affected names are declared above / 已在上方声明插件类型与涉及的插件名称
  • version bumped in BOTH plugin.json and marketplace.json (artifacts are immutable) / plugin.json 与 marketplace.json 两处版本号已同步升级(制品不可变): new plugin, 0.1.2 in both
  • README.md (EN) and README_CN.md (中文) both updated and equivalent / 中英文 README 均已更新且语义一致
  • description_i18n has both en and zh-CN / description_i18n 包含 en 与 zh-CN
  • No secrets, machine-specific paths, or private dependencies / 不含密钥、机器专属路径或私有依赖
  • Model/API/network dependencies documented / 模型、API、网络依赖已写明
  • python3 scripts/validate.py and python3 scripts/build_dist.py pass locally / 本地校验与构建均通过

🤖 Generated with Claude Code

Agent Network Research and others added 2 commits October 19, 2026 14:53
Connects ZCode to a local AgentNetwork (anet) node so that the agent in a
session can find other AI agents, send them end-to-end encrypted A2A tasks,
track them, settle priced skills within operator limits, and answer tasks
sent to this machine.

- MCP server `anet` (stdio): `bin/anet-mcp.sh` runs `anet mcp` and finds
  the executable in PATH or the installer's default locations, because a
  desktop application may not inherit the login shell's PATH.
- Skill `anet`: the node's operating guide (tools, task lifecycle,
  payments, untrusted input).
- Skill `anet-setup`: checks, installs (with consent), starts, joins a
  hub and verifies with `anet doctor`.
- Command `/anet-status`.
- Linux and macOS only; anet has no Windows build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Replace the icon with the AgentNetwork organisation avatar and record its
  source and SHA-256 in assets/icon-sources.json.
- Regenerate skills/anet/SKILL.md from the anet guide; the earlier copy kept
  escaped quotes.
- Link the READMEs to the ZCode page of the anet documentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 16:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Installer execution needs download-failure protection, and setup and diagnostic commands must honor the configured executable and identity.

3 open issues
What changed in this PR

Adds anet 0.1.0 to the marketplace, connecting ZCode to a local AgentNetwork node for encrypted agent-to-agent task delegation.

Changes:

  • Registers the plugin and configurable MCP launcher.
  • Adds setup, delegation, and status instructions.
  • Provides bilingual documentation, licensing, and icon provenance.

Validation was not rerun; installation and runtime verification rely on the PR’s reported results.

File Description
marketplace.json Registers anet 0.1.0.
external_plugins/​anet/​skills/​anet/​SKILL.md Guides delegation and payments.
external_plugins/​anet/​skills/​anet-setup/​SKILL.md Guides installation and setup.
external_plugins/​anet/​README.md Documents usage in English.
external_plugins/​anet/​README_CN.md Documents usage in Chinese.
external_plugins/​anet/​LICENSE Supplies Apache-2.0 licensing.
external_plugins/​anet/​commands/​anet-status.md Adds node status reporting.
external_plugins/​anet/​bin/​anet-mcp.sh Locates and launches anet.
external_plugins/​anet/​.zcode-plugin/​plugin.json Defines metadata and settings.
external_plugins/​anet/​.mcp.json Configures the MCP server.
assets/​icon-sources.json Records icon provenance and checksum.

Review effort: Balanced

Comment on lines +47 to +48
curl --proto '=https' --tlsv1.2 -fsSL https://agentnetwork.org.cn/install.sh -o "${TMPDIR:-/tmp}/anet-install.sh"
sh "${TMPDIR:-/tmp}/anet-install.sh"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7e7b944. The installer is now downloaded into a new private directory from mktemp -d and runs only when curl -f succeeded; the directory is removed afterwards and the step fails when the download fails. Verified in ZCode 3.15.3: the setup skill ran this block, installed anet 0.3.3, and left no file behind.

Comment on lines +11 to +13
3. If the anet tools are not available in this session, run `anet status` and `anet doctor` in the
terminal instead and report their output. When anet is not installed or not running, offer the
`anet-setup` skill of this plugin.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7e7b944. All anet commands of the plugin now go through bin/anet-run.sh, which applies anetPath and identity exactly as the MCP launcher does (outside the MCP server it reads only these two plugin settings from the ZCode configuration). The command shows the resolved executable and identity and tells the agent to use that runner instead of a bare anet. Verified in ZCode with the identity setting naming a stopped identity while the default node was running: the report covered the selected identity, not the default node. Covered by tests in the ANet repository.

anet runs on Linux and macOS (x86-64 and ARM64). On Windows, stop and tell the user that anet
has no Windows build.

## 2. Find the anet executable

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7e7b944. Setup starts with anet-run.sh --resolve; a configured anetPath that is not an executable is reported and the skill stops without installing another copy or editing the settings. A valid anetPath is used for every later step. Verified in ZCode with anetPath set to a missing file: no installation, configuration unchanged.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

…ller step

- bin/anet-run.sh applies anetPath and identity for the MCP server, the
  /anet-status fallback and the setup skill, so all reach the same executable
  and node; an invalid anetPath is reported and never replaced.
- The setup skill downloads the installer into a private temporary directory
  and runs it only after a successful download.
- Version 0.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

Agent Network Research and others added 2 commits October 20, 2026 04:14
Require an absolute anetPath, accept only a regular executable file,
ignore setting values with line breaks, quote the runner path when it
holds spaces, and run the installer through bin/anet-install.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@inksong

inksong commented Oct 20, 2026

Copy link
Copy Markdown
Author

Updated the plugin to 0.1.2 (commits 379ce44 and 7d881ab): anetPath must be an absolute path to a regular executable file, setting values with line breaks are ignored, the runner path is quoted when it contains spaces, and the setup skill runs the new bin/anet-install.sh instead of a shell one-liner with command substitution. The version is 0.1.2 in both plugin.json and marketplace.json; validate.py, the tests and the full pnpm build && python3 scripts/build_dist.py pass. The description lists the details and the test results.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@panda920

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! The change has been accepted by the maintainers. Publication to the marketplace is tracked separately; this contribution is now closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants