Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/content/2.agentkit-cli/2.commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ agentkit add harness --name <name> [options]
| `--register-network-type` | 注册网络类型。 | `--register-network-type public` |
| `--directory` | 写入 `<name>.harness.json` 的目录(默认当前目录)。 | `--directory ./my_harness` |

配置 A2A registry 时,CLI 会在解析出 SpaceId 后调用 `UpdateA2aSpace`,将该空间的 `IntentEnabled` 设置为 `true`,因此调用方需要 `agentkit:UpdateA2aSpace` 权限。部署后的 Harness Runtime 会在每轮对话前用用户输入的前 2048 个 UTF-8 bytes 调用 `SearchAgentCards`,再通过 `GetA2aAgent` 把本轮命中的远程 Agent 临时挂载为 `remote_a2a_*` 动态工具。
配置 A2A registry 时,CLI 会在解析出 SpaceId 后调用 `UpdateA2aSpace`,将该空间的 `IntentEnabled` 设置为 `true`,因此调用方需要 `agentkit:UpdateA2aSpace` 权限。部署后的 Harness Runtime 会在每轮对话前用用户输入的前 2048 个 UTF-8 bytes 调用 `SearchAgentCards`,再通过 `GetA2aAgent` 把本轮命中的远程 Agent 临时挂载为 `remote_a2a_*` 动态工具。远程 Agent 可使用 `apiKey` 或 `oauth2.clientCredentials` 鉴权;OAuth 类型会自动通过 Identity UserPool 的 M2M client 换取 access token,并以 `Authorization: Bearer <access_token>` 调用 `message/send` / `tasks/get`。

### 组件参数

Expand Down Expand Up @@ -1620,6 +1620,7 @@ agentkit invoke harness <name> [消息内容] [选项]
- `--registry default` 等价于 `--registry "agentkit://a2a-registry?space_name=Default&region=cn-beijing&endpoint=https://open.volcengineapi.com/"`
- `--registry-space-name` 和 URI 中的 `space_name` 会在本地通过 `ListA2aSpaces` 解析为 space id 后传给运行时
- 解析出 space id 后会调用 `UpdateA2aSpace` 开启 `IntentEnabled=true`
- 命中的 remote-agent 若是 OAuth 类型,运行时会根据 `GetA2aAgent` 返回的 AgentCard 中的 `oauth2.clientCredentials.tokenUrl` 自动获取 Bearer token
- URI 中只支持 `space_name`,不支持 `registry_space_name` 等别名
- 示例:`agentkit invoke harness my-harness --registry-space-name my-space --registry-region cn-beijing "找一个财务专家"`

Expand Down
4 changes: 4 additions & 0 deletions docs/content/2.agentkit-cli/5.harness.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ agentkit add harness --name my-harness --registry default

部署后的 Harness Runtime 在每轮用户对话开始前,会用用户原始输入的前 2048 个 UTF-8 bytes 调用 `SearchAgentCards`;对本轮返回的每个 AgentCard,再调用 `GetA2aAgent` 获取 endpoint 与鉴权信息,并临时包装为本轮可用的 `remote_a2a_*` 工具。这些动态工具只对当前轮次生效,不写回 spec,也不污染已部署的基础 Agent。

远程 Agent 的调用鉴权由 Runtime 自动处理:`apiKey` 类型 AgentCard 会按 `securitySchemes` 中声明的 header 注入;`oauth2` 且声明 `clientCredentials.tokenUrl` 的 AgentCard 会从 token URL 解析火山引擎 Identity UserPool,查询其中的 `MACHINE_TO_MACHINE` client,使用 `client_credentials` 换取 access token,并以 `Authorization: Bearer <access_token>` 调用远程 A2A endpoint。通常无需额外配置;如果 `registry endpoint` 不是公网 OpenAPI 网关且无法同时访问 Identity OpenAPI,可用 `REGISTRY_ID_ENDPOINT` / `AGENTKIT_ID_ENDPOINT` 指定 Identity OpenAPI 地址。

`--registry-endpoint` 用于指定 Harness Runtime 后续访问 A2A Registry OpenAPI 的地址。通常不传时会按 region 推导默认 endpoint;如果部署后的运行时环境无法解析 region 专属域名,或需要统一走火山引擎公网 OpenAPI 网关,可以显式设置为 `https://open.volcengineapi.com/`:

```bash
Expand Down Expand Up @@ -376,6 +378,8 @@ agentkit add harness --name my-harness \

当本次调用通过 `--registry` / `--registry-space-id` / `--registry-space-name` 指定了 A2A SpaceId 时,CLI 同样会先调用 `UpdateA2aSpace` 开启 `IntentEnabled=true`,再把 registry 覆写发送给 Harness Runtime。

本次调用若命中 OAuth 类型 remote-agent,鉴权行为与部署时的 registry 配置一致:Runtime 会在 `GetA2aAgent` 后根据 AgentCard 的 `oauth2.clientCredentials.tokenUrl` 自动获取 access token,并在动态 `remote_a2a_*` 工具执行 `message/send` / `tasks/get` 时附加 Bearer token。

```bash
# 基础调用(run_sse,默认,流式)
agentkit invoke harness my-harness "今天杭州天气如何?"
Expand Down