mcpField
R
reputation

reputation

github.com/aibtcdevAgent 工作流11147 次安装1 天前更新
代码仓库

关于 reputation

Reputation 是用于操作 ERC-8004 链上 Agent 声誉注册表的命令行技能。它支持无需钱包的声誉查询,也支持需钱包授权的反馈和审批操作。

主要功能

  1. 01读取 Agent 声誉摘要
  2. 02查询并分页浏览反馈
  3. 03按标签筛选反馈
  4. 04提交或撤销反馈
  5. 05为反馈添加回应
  6. 06按索引上限批准客户端

适用场景

  1. 01查看 Agent 的综合声誉
  2. 02审阅客户端提交的反馈
  3. 03撤销已提交的评分
  4. 04授权客户端提交 Agent 反馈

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/aibtcdev/skills --skill reputation

安装后在 Claude Code 中输入/reputation确认已加载。

附带文件AGENT.mdreputation.ts

详细介绍

Reputation Skill

使用 reputation-registry 合约执行 ERC-8004 链上 Agent 声誉操作。读取操作(get-summary、read-feedback、read-all-feedback、get-clients、get-feedback-count、get-approved-limit、get-last-index)无需钱包。写入操作(give-feedback、revoke-feedback、append-response、approve-client)需要已解锁的钱包。

用法

bun run reputation/reputation.ts <subcommand> [options]

子命令

give-feedback

在 ERC-8004 声誉注册表中为某个 Agent 提交反馈。需要已解锁的钱包。

bun run reputation/reputation.ts give-feedback --agent-id <id> --value <value> [--value-decimals <decimals>] [--tag1 <tag>] [--tag2 <tag>] [--endpoint <endpoint>] [--feedback-uri <uri>] [--feedback-hash <hex>] [--fee <fee>] [--sponsored]

选项:

  • --agent-id(必需)— 要提交反馈的 Agent ID(非负整数)
  • --value(必需)— 反馈值(有符号整数,例如正向反馈为 5,负向反馈为 -2)
  • --value-decimals(可选,默认值为 0)— 反馈值的小数精度(非负整数)
  • --tag1(可选)— 主要分类标签(例如,“helpful”“accuracy”)
  • --tag2(可选)— 次要分类标签
  • --endpoint(可选)— 反馈的端点或上下文标识符
  • --feedback-uri(可选)— 指向详细反馈数据的 URI
  • --feedback-hash(可选)— 反馈数据的 32 字节 SHA-256 哈希值,以十六进制字符串表示
  • --fee(可选)— 费用预设(low、medium、high)或 micro-STX 金额
  • --sponsored(标志)— 以赞助交易的形式提交

输出:

{
  "success": true,
  "txid": "0xabc...",
  "message": "Feedback submitted for agent 42.",
  "agentId": 42,
  "value": 5,
  "valueDecimals": 0,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/0xabc..."
}
revoke-feedback

撤销先前提交的反馈。只有原始反馈提交者(tx-sender)可以撤销自己提交的反馈。需要已解锁的钱包。

bun run reputation/reputation.ts revoke-feedback --agent-id <id> --index <index> [--fee <fee>] [--sponsored]

选项:

  • --agent-id(必需)— 要撤销其反馈的 Agent ID(非负整数)
  • --index(必需)— 要撤销的反馈索引(非负整数)
  • --fee(可选)— 费用预设(low、medium、high)或 micro-STX 金额
  • --sponsored(标志)— 以赞助交易的形式提交

输出:

{
  "success": true,
  "txid": "0xdef...",
  "message": "Feedback index 0 revoked for agent 42.",
  "agentId": 42,
  "index": 0,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/0xdef..."
}
append-response

为某条反馈追加回复。任何主体都可以追加回复;合约会跟踪每条反馈的唯一回复者。需要已解锁的钱包。

bun run reputation/reputation.ts append-response --agent-id <id> --client <address> --index <index> --response-uri <uri> --response-hash <hex> [--fee <fee>] [--sponsored]

选项:

  • --agent-id(必需)— 与该反馈关联的 Agent ID(非负整数)
  • --client(必需)— 原始反馈提交者的 Stacks 地址
  • --index(必需)— 要回复的反馈索引(非负整数)
  • --response-uri(必需)— 指向回复数据的 URI
  • --response-hash(必需)— 回复数据的 32 字节 SHA-256 哈希值,以十六进制字符串表示
  • --fee(可选)— 费用预设(low、medium、high)或 micro-STX 金额
  • --sponsored(标志)— 以赞助交易的形式提交

输出:

{
  "success": true,
  "txid": "0xghi...",
  "message": "Response appended to feedback index 0 for agent 42.",
  "agentId": 42,
  "client": "SP2...",
  "index": 0,
  "responseUri": "ipfs://response...",
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/0xghi..."
}
approve-client

批准某个客户端地址为 Agent 提交反馈,并指定索引上限。调用者必须是 Agent 所有者或已批准的操作员。需要已解锁的钱包。

bun run reputation/reputation.ts approve-client --agent-id <id> --client <address> --index-limit <limit> [--fee <fee>] [--sponsored]

选项:

  • --agent-id(必需)— 要配置批准权限的 Agent ID(非负整数)
  • --client(必需)— 要批准的客户端的 Stacks 地址
  • --index-limit(必需)— 客户端可提交的反馈条目数上限(非负整数)
  • --fee(可选)— 费用预设(low、medium、high)或 micro-STX 金额
  • --sponsored(标志)— 以赞助交易的形式提交

输出:

{
  "success": true,
  "txid": "0xjkl...",
  "message": "Client SP3... approved for agent 42 up to index limit 10.",
  "agentId": 42,
  "client": "SP3...",
  "indexLimit": 10,
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/0xjkl..."
}
get-summary

获取某个 Agent 的汇总声誉摘要。返回反馈总数和按 WAD 计算平均值的摘要值。无需钱包。

bun run reputation/reputation.ts get-summary --agent-id <id>

选项:

  • --agent-id(必需)— 要查询的 Agent ID(非负整数)

输出:

{
  "success": true,
  "agentId": 42,
  "totalFeedback": 7,
  "summaryValue": "5000000000000000000",
  "summaryValueDecimals": 18,
  "network": "mainnet"
}
read-feedback

通过 Agent ID、客户端地址和反馈索引读取指定的反馈条目。无需钱包。

bun run reputation/reputation.ts read-feedback --agent-id <id> --client <address> --index <index>

选项:

  • --agent-id(必需)— 要查询的 Agent ID(非负整数)
  • --client(必需)— 反馈提交者的 Stacks 地址
  • --index(必需)— 要读取的反馈索引(非负整数)

输出:

{
  "success": true,
  "agentId": 42,
  "client": "SP2...",
  "index": 0,
  "value": 5,
  "valueDecimals": 0,
  "wadValue": "5000000000000000000",
  "tag1": "helpful",
  "tag2": "",
  "isRevoked": false,
  "network": "mainnet"
}
read-all-feedback

获取某个 Agent 的所有反馈条目分页列表。支持按标签筛选和基于游标的分页(每页 14 条)。无需钱包。

bun run reputation/reputation.ts read-all-feedback --agent-id <id> [--tag1 <tag>] [--tag2 <tag>] [--include-revoked] [--cursor <cursor>]

选项:

  • --agent-id(必填)— 要查询的 Agent ID(非负整数)
  • --tag1(可选)— 按主标签筛选
  • --tag2(可选)— 按次标签筛选
  • --include-revoked(标志)— 在结果中包含已撤销的反馈条目
  • --cursor(可选)— 上一次响应中的分页游标

输出:

{
  "success": true,
  "agentId": 42,
  "items": [
    {
      "client": "SP2...",
      "index": 0,
      "value": 5,
      "valueDecimals": 0,
      "wadValue": "5000000000000000000",
      "tag1": "helpful",
      "tag2": "",
      "isRevoked": false
    }
  ],
  "cursor": null,
  "network": "mainnet"
}
get-clients

获取曾为某个 Agent 提交反馈的客户端地址分页列表。基于游标分页,每页 14 条。无需钱包。

bun run reputation/reputation.ts get-clients --agent-id <id> [--cursor <cursor>]

选项:

  • --agent-id(必填)— 要查询的 Agent ID(非负整数)
  • --cursor(可选)— 上一次响应中的分页游标

输出:

{
  "success": true,
  "agentId": 42,
  "clients": ["SP2...", "SP3..."],
  "cursor": null,
  "network": "mainnet"
}
get-feedback-count

获取某个 Agent 的反馈总数。无需钱包。

bun run reputation/reputation.ts get-feedback-count --agent-id <id>

选项:

  • --agent-id(必填)— 要查询的 Agent ID(非负整数)

输出:

{
  "success": true,
  "agentId": 42,
  "feedbackCount": 7,
  "network": "mainnet"
}
get-approved-limit

检查客户端在某个 Agent 上获准的反馈索引上限。如果客户端没有明确授权,则返回 0。无需钱包。

bun run reputation/reputation.ts get-approved-limit --agent-id <id> --client <address>

选项:

  • --agent-id(必填)— 要查询的 Agent ID(非负整数)
  • --client(必填)— 要检查的客户端的 Stacks 地址

输出:

{
  "success": true,
  "agentId": 42,
  "client": "SP3...",
  "approvedLimit": 10,
  "network": "mainnet"
}
get-last-index

获取客户端在某个 Agent 上的最后一个反馈索引。如果客户端尚未提交任何反馈,则返回 0。无需钱包。

bun run reputation/reputation.ts get-last-index --agent-id <id> --client <address>

选项:

  • --agent-id(必填)— 要查询的 Agent ID(非负整数)
  • --client(必填)— 要检查的客户端的 Stacks 地址

输出:

{
  "success": true,
  "agentId": 42,
  "client": "SP3...",
  "lastIndex": 2,
  "network": "mainnet"
}

注意事项

  • 读取操作(get-summary、read-feedback、read-all-feedback、get-clients、get-feedback-count、get-approved-limit、get-last-index)无需钱包即可执行
  • 写入操作需要已解锁的钱包(bun run wallet/wallet.ts unlock)
  • 反馈值为有符号整数;使用 --value-decimals 表示小数精度
  • --feedback-hash 和 --response-hash 必须恰好为 32 字节(64 个十六进制字符)
  • 只有原始反馈提交者才能调用 revoke-feedback(tx-sender 必须与提交反馈的客户端一致)
  • 只有 Agent 所有者或获准的身份操作员才能调用 approve-client
  • 分页使用基于游标的导航;将某个响应中的 cursor 传入下一次调用

评论

支持 Markdown