reputation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Reputation Skill

声誉管理Skill

Provides ERC-8004 on-chain agent reputation operations using the reputation-registry contract. Read operations (get-summary, read-feedback, read-all-feedback, get-clients, get-feedback-count, get-approved-limit, get-last-index) work without a wallet. Write operations (give-feedback, revoke-feedback, append-response, approve-client) require an unlocked wallet.
通过声誉注册合约提供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)需要解锁的钱包。

Usage

使用方法

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

Subcommands

子命令

give-feedback

提交反馈

Submit feedback for an agent in the ERC-8004 reputation registry. Requires an unlocked wallet.
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]
Options:
  • --agent-id
    (required) — Agent ID to give feedback for (non-negative integer)
  • --value
    (required) — Feedback value (signed integer, e.g., 5 for positive, -2 for negative)
  • --value-decimals
    (optional, default 0) — Decimal precision for the value (non-negative integer)
  • --tag1
    (optional) — Primary classification tag (e.g., "helpful", "accuracy")
  • --tag2
    (optional) — Secondary classification tag
  • --endpoint
    (optional) — Endpoint or context identifier for the feedback
  • --feedback-uri
    (optional) — URI pointing to detailed feedback data
  • --feedback-hash
    (optional) — 32-byte SHA-256 hash of the feedback data as a hex string
  • --fee
    (optional) — Fee preset (
    low
    ,
    medium
    ,
    high
    ) or micro-STX amount
  • --sponsored
    (flag) — Submit as a sponsored transaction
Output:
json
{
  "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..."
}
在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
    (标志)——作为赞助交易提交
输出:
json
{
  "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

撤回反馈

Revoke previously submitted feedback. Only the original feedback submitter (tx-sender) can revoke their own feedback. Requires an unlocked wallet.
bun run reputation/reputation.ts revoke-feedback --agent-id <id> --index <index> [--fee <fee>] [--sponsored]
Options:
  • --agent-id
    (required) — Agent ID whose feedback you want to revoke (non-negative integer)
  • --index
    (required) — Feedback index to revoke (non-negative integer)
  • --fee
    (optional) — Fee preset (
    low
    ,
    medium
    ,
    high
    ) or micro-STX amount
  • --sponsored
    (flag) — Submit as a sponsored transaction
Output:
json
{
  "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..."
}
撤回之前提交的反馈。只有原反馈提交者(交易发送方)才能撤回自己的反馈。需要解锁的钱包。
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
    (标志)——作为赞助交易提交
输出:
json
{
  "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

追加回复

Append a response to a feedback entry. Any principal can append a response; the contract tracks unique responders per feedback entry. Requires an unlocked wallet.
bun run reputation/reputation.ts append-response --agent-id <id> --client <address> --index <index> --response-uri <uri> --response-hash <hex> [--fee <fee>] [--sponsored]
Options:
  • --agent-id
    (required) — Agent ID associated with the feedback (non-negative integer)
  • --client
    (required) — Stacks address of the original feedback submitter
  • --index
    (required) — Feedback index to respond to (non-negative integer)
  • --response-uri
    (required) — URI pointing to the response data
  • --response-hash
    (required) — 32-byte SHA-256 hash of the response data as a hex string
  • --fee
    (optional) — Fee preset (
    low
    ,
    medium
    ,
    high
    ) or micro-STX amount
  • --sponsored
    (flag) — Submit as a sponsored transaction
Output:
json
{
  "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..."
}
为反馈条目追加回复。任何主体都可以追加回复;合约会跟踪每个反馈条目的唯一回复者。需要解锁的钱包。
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
    (标志)——作为赞助交易提交
输出:
json
{
  "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

批准客户端

Approve a client address to submit feedback for an agent up to a specified index limit. Caller must be the agent owner or an approved operator. Requires an unlocked wallet.
bun run reputation/reputation.ts approve-client --agent-id <id> --client <address> --index-limit <limit> [--fee <fee>] [--sponsored]
Options:
  • --agent-id
    (required) — Agent ID to configure approval for (non-negative integer)
  • --client
    (required) — Stacks address of the client to approve
  • --index-limit
    (required) — Maximum number of feedback entries the client may submit (non-negative integer)
  • --fee
    (optional) — Fee preset (
    low
    ,
    medium
    ,
    high
    ) or micro-STX amount
  • --sponsored
    (flag) — Submit as a sponsored transaction
Output:
json
{
  "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..."
}
批准一个客户端地址为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
    (标志)——作为赞助交易提交
输出:
json
{
  "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

获取声誉摘要

Get the aggregated reputation summary for an agent. Returns total feedback count and WAD-averaged summary value. Does not require a wallet.
bun run reputation/reputation.ts get-summary --agent-id <id>
Options:
  • --agent-id
    (required) — Agent ID to query (non-negative integer)
Output:
json
{
  "success": true,
  "agentId": 42,
  "totalFeedback": 7,
  "summaryValue": "5000000000000000000",
  "summaryValueDecimals": 18,
  "network": "mainnet"
}
获取Agent的聚合声誉摘要。返回总反馈数和WAD平均的摘要分值。无需钱包。
bun run reputation/reputation.ts get-summary --agent-id <id>
选项:
  • --agent-id
    (必填)——要查询的Agent ID(非负整数)
输出:
json
{
  "success": true,
  "agentId": 42,
  "totalFeedback": 7,
  "summaryValue": "5000000000000000000",
  "summaryValueDecimals": 18,
  "network": "mainnet"
}

read-feedback

读取单个反馈

Read a specific feedback entry by agent ID, client address, and feedback index. Does not require a wallet.
bun run reputation/reputation.ts read-feedback --agent-id <id> --client <address> --index <index>
Options:
  • --agent-id
    (required) — Agent ID to query (non-negative integer)
  • --client
    (required) — Stacks address of the feedback submitter
  • --index
    (required) — Feedback index to read (non-negative integer)
Output:
json
{
  "success": true,
  "agentId": 42,
  "client": "SP2...",
  "index": 0,
  "value": 5,
  "valueDecimals": 0,
  "wadValue": "5000000000000000000",
  "tag1": "helpful",
  "tag2": "",
  "isRevoked": false,
  "network": "mainnet"
}
通过Agent ID、客户端地址和反馈索引读取特定的反馈条目。无需钱包。
bun run reputation/reputation.ts read-feedback --agent-id <id> --client <address> --index <index>
选项:
  • --agent-id
    (必填)——要查询的Agent ID(非负整数)
  • --client
    (必填)——反馈提交者的Stacks地址
  • --index
    (必填)——要读取的反馈索引(非负整数)
输出:
json
{
  "success": true,
  "agentId": 42,
  "client": "SP2...",
  "index": 0,
  "value": 5,
  "valueDecimals": 0,
  "wadValue": "5000000000000000000",
  "tag1": "helpful",
  "tag2": "",
  "isRevoked": false,
  "network": "mainnet"
}

read-all-feedback

读取所有反馈

Get a paginated list of all feedback entries for an agent. Supports optional tag filtering and cursor-based pagination (page size: 14). Does not require a wallet.
bun run reputation/reputation.ts read-all-feedback --agent-id <id> [--tag1 <tag>] [--tag2 <tag>] [--include-revoked] [--cursor <cursor>]
Options:
  • --agent-id
    (required) — Agent ID to query (non-negative integer)
  • --tag1
    (optional) — Filter by primary tag
  • --tag2
    (optional) — Filter by secondary tag
  • --include-revoked
    (flag) — Include revoked feedback entries in results
  • --cursor
    (optional) — Pagination cursor from a previous response
Output:
json
{
  "success": true,
  "agentId": 42,
  "items": [
    {
      "client": "SP2...",
      "index": 0,
      "value": 5,
      "valueDecimals": 0,
      "wadValue": "5000000000000000000",
      "tag1": "helpful",
      "tag2": "",
      "isRevoked": false
    }
  ],
  "cursor": null,
  "network": "mainnet"
}
获取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
    (可选)——来自上一次响应的分页游标
输出:
json
{
  "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

获取客户端列表

Get a paginated list of client addresses that have given feedback for an agent. Cursor-based pagination with page size 14. Does not require a wallet.
bun run reputation/reputation.ts get-clients --agent-id <id> [--cursor <cursor>]
Options:
  • --agent-id
    (required) — Agent ID to query (non-negative integer)
  • --cursor
    (optional) — Pagination cursor from a previous response
Output:
json
{
  "success": true,
  "agentId": 42,
  "clients": ["SP2...", "SP3..."],
  "cursor": null,
  "network": "mainnet"
}
获取已为Agent提交反馈的客户端地址分页列表。基于游标的分页,每页大小14。无需钱包。
bun run reputation/reputation.ts get-clients --agent-id <id> [--cursor <cursor>]
选项:
  • --agent-id
    (必填)——要查询的Agent ID(非负整数)
  • --cursor
    (可选)——来自上一次响应的分页游标
输出:
json
{
  "success": true,
  "agentId": 42,
  "clients": ["SP2...", "SP3..."],
  "cursor": null,
  "network": "mainnet"
}

get-feedback-count

获取反馈总数

Get the total feedback count for an agent. Does not require a wallet.
bun run reputation/reputation.ts get-feedback-count --agent-id <id>
Options:
  • --agent-id
    (required) — Agent ID to query (non-negative integer)
Output:
json
{
  "success": true,
  "agentId": 42,
  "feedbackCount": 7,
  "network": "mainnet"
}
获取Agent的总反馈数。无需钱包。
bun run reputation/reputation.ts get-feedback-count --agent-id <id>
选项:
  • --agent-id
    (必填)——要查询的Agent ID(非负整数)
输出:
json
{
  "success": true,
  "agentId": 42,
  "feedbackCount": 7,
  "network": "mainnet"
}

get-approved-limit

获取已批准上限

Check the approved feedback index limit for a client on an agent. Returns 0 if the client has no explicit approval. Does not require a wallet.
bun run reputation/reputation.ts get-approved-limit --agent-id <id> --client <address>
Options:
  • --agent-id
    (required) — Agent ID to query (non-negative integer)
  • --client
    (required) — Stacks address of the client to check
Output:
json
{
  "success": true,
  "agentId": 42,
  "client": "SP3...",
  "approvedLimit": 10,
  "network": "mainnet"
}
查询客户端针对Agent的已批准反馈索引上限。如果客户端没有明确批准,则返回0。无需钱包。
bun run reputation/reputation.ts get-approved-limit --agent-id <id> --client <address>
选项:
  • --agent-id
    (必填)——要查询的Agent ID(非负整数)
  • --client
    (必填)——要查询的客户端的Stacks地址
输出:
json
{
  "success": true,
  "agentId": 42,
  "client": "SP3...",
  "approvedLimit": 10,
  "network": "mainnet"
}

get-last-index

获取最后反馈索引

Get the last feedback index for a client on an agent. Returns 0 if the client has not given any feedback. Does not require a wallet.
bun run reputation/reputation.ts get-last-index --agent-id <id> --client <address>
Options:
  • --agent-id
    (required) — Agent ID to query (non-negative integer)
  • --client
    (required) — Stacks address of the client to check
Output:
json
{
  "success": true,
  "agentId": 42,
  "client": "SP3...",
  "lastIndex": 2,
  "network": "mainnet"
}
查询客户端针对Agent提交的最后一条反馈的索引。如果客户端未提交任何反馈,则返回0。无需钱包。
bun run reputation/reputation.ts get-last-index --agent-id <id> --client <address>
选项:
  • --agent-id
    (必填)——要查询的Agent ID(非负整数)
  • --client
    (必填)——要查询的客户端的Stacks地址
输出:
json
{
  "success": true,
  "agentId": 42,
  "client": "SP3...",
  "lastIndex": 2,
  "network": "mainnet"
}

Notes

注意事项

  • Read operations (get-summary, read-feedback, read-all-feedback, get-clients, get-feedback-count, get-approved-limit, get-last-index) work without a wallet
  • Write operations require an unlocked wallet (
    bun run wallet/wallet.ts unlock
    )
  • Feedback values are signed integers; use
    --value-decimals
    to express fractional precision
  • --feedback-hash
    and
    --response-hash
    must be exactly 32 bytes (64 hex characters)
  • revoke-feedback
    can only be called by the original feedback submitter (tx-sender must match the client who submitted)
  • approve-client
    can only be called by the agent owner or an approved identity operator
  • Pagination uses cursor-based navigation; pass the
    cursor
    from one response into the next call
  • 读取操作(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
    只能由原反馈提交者调用(交易发送方必须与提交反馈的客户端匹配)
  • approve-client
    只能由Agent所有者或已批准的身份操作员调用
  • 分页使用基于游标的导航;将上一次响应中的
    cursor
    传入下一次调用