# @agenticprimitives/treasury-service-agent 中文文档

规范地址：https://npmcn.com/package/%40agenticprimitives/treasury-service-agent/

版本：0\.0\.0-alpha\.33
npm 元数据更新时间：2026-10-26T11:49:30.070Z
中文译文更新时间：2026-11-06T07:59:13.960Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40agenticprimitives/treasury-service-agent
原文对照：https://npmcn.com/package/%40agenticprimitives/treasury-service-agent/?lang=original
项目主页：https://github.com/agentictrustlabs/agenticprimitives#readme
源码仓库：https://github.com/agentictrustlabs/agenticprimitives

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：268 kB，107 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：6 个
- 首次发布：2026-07-14T15:52:14.586Z
- 最新版本发布：2026-10-26T11:49:27.050Z
- 近 30 天下载量：4029（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：29（近 12 个月 29 个）

## 中文简介

意向-本土 DeFi 金库代理(第284项):域名构成高于服务-代理——技能目录+简介+金库授权范围/接收帮助者,向意向解析,解析者中介,以及DAG执行方向发展. Catalog = 定义+ pl

## 安装

```sh
npm install @agenticprimitives/treasury-service-agent
```

也可以使用：`pnpm add @agenticprimitives/treasury-service-agent`、`yarn add @agenticprimitives/treasury-service-agent`、`bun add @agenticprimitives/treasury-service-agent`

## README

# @ agenticprimitives/treasury-service-agent 代理服务器

> **状态 :** (Spec 284 PR-A——从 `packages/treasury`) (中文(简体) ).

意图 **DeFi 财务代理**: 意向编译器 + DeFi 技能织物 + 解析器经纪人 + 和解协调员(见e/cn.4/sub.2/2000/l.31) [第284区](https://npmcn.com/package/specs/284-intent-native-treasury-agent.md)A级 **域名 组成** 结束 [`@agenticprimitives/service-agent`](https://npmcn.com/package/packages/service-agent),而非通用 `packages/*` 原始的。 原始的.

PR-A号运输船 **分类/概况基线** 钱包操作表面为 **供应商中性技能 定义、计划和概况** (这是 `payments` 大型代理人简介)。 有意解决问题, 解决者经纪、DAG执行、自主战略以及后期阶段的土地风险. **目录 = 定义+计划——没有提供者执行.** 具体供应商(EVM转让/签名, 互换/perp/预测地点、市场数据、RPC(ADR-0037)居住在外部重置处并登记在主机内; 演示应用软件伪造了船名.

## 里面的东西

-   **`TREASURY_CAPABILITIES`** - 逻辑能力词汇技能需要(`account.read`, (中文(简体) ), `transfer.execute`, (中文(简体) ), `signing.sign`, (中文(简体) ), `swap.execute`(中文(简体) ).
-   **目录** ——跨服务/网络/账户/市场数据/签名/交易/26个技能 转让 / 互换 / perp / 预测 / 授权 / 应享权利。 每个声明 `effect` (单位:千美元)`read|sign|spend|trade|admin`),默认 `exposure`,所需能力,a `compile()` 计划.
-   **简介** —— 说 `readonly`, (中文(简体) ), `payments`, (中文(简体) ), `markets`, (中文(简体) ), `administration`, (中文(简体) ), `full`。 。 。 .
-   **`TreasuryAuthorityScope` + 键 `treasuryScopeToCaveatTerms`** ——连接-库的中性输入 ; 仪式将抽象的提醒词映射到真实的 `delegation` 戒备.
-   **`summarizeTreasuryReceipt`** - 通用项目 `ExecutionReceipt` 成为财务审计摘要.

## 饮食

| 技能类型 | 接触 | 门 |
| --- | --- | --- |
| 服务/网络/市场数据 | 公开 | 无 |
| 账户/引文/位置/模拟/应享权利。检查 | 认证 | 应享权利 |
| / 互换. execut / perp / 预测. bet | 认证 | 授权政策(+分类账准备金/最后敲定) |
| 签署/交易.发送/授权。 \*/应享待遇 | **私营** | 授权政策 |

盖茨是倒闭和单调的——第一次否认抛出而无所继续跑. 掌握技能 证明主机可以运行它; 逐个调用的权限在引用时仍然决定新鲜.

## 示例

```ts
import { ServiceAgent, createPrimitiveRegistry } from '@agenticprimitives/service-agent';
import { paymentsProfile, ASSET_TYPE } from '@agenticprimitives/treasury';

const registry = createPrimitiveRegistry();
registry.register(myTransferProvider);  // advertises 'transfer.execute' (external / fake)
// …register account/network/market-data providers…

const agent = new ServiceAgent({
  descriptor: { id: treasurySaAddress, name: 'Treasury', version: '1.0.0' },
  primitives: registry,
  entitlements, delegations, policies, ledger,   // injected: tool-policy / delegation / entitlements / ledger
});
agent.defineProfile(paymentsProfile);
await agent.assert();   // asserts the skills whose providers are present

const receipt = await agent.invoke({
  skillId: 'treasury.transfer.native',
  input: { account: treasurySaAddress, network: 'eip155:84532', to, asset: { type: ASSET_TYPE.native }, amount: '100' },
  idempotencyKey: 'transfer-0001',
});
```

## 住在别的地方

-   框架(登记、计划执行者、, `ServiceAgent`,断言) + `@agenticprimitives/service-agent`。 。 。 .
-   提供商 → 外部回购(ADR-0037); 假 → 演示应用(PR3) + 此套件的测试.
-   连接-财务仪式 + 国库UI → demo-so-next / demo-web-pay (PR4).

## 常见问题

### @agenticprimitives/treasury-service-agent 是什么？

意向-本土 DeFi 金库代理\(第284项\):域名构成高于服务-代理——技能目录\+简介\+金库授权范围/接收帮助者,向意向解析,解析者中介,以及DAG执行方向发展\. Catalog = 定义\+ pl

### 如何安装 @agenticprimitives/treasury-service-agent？

在项目目录运行 npm install @agenticprimitives/treasury-service-agent，或使用 pnpm add / yarn add / bun add。

### @agenticprimitives/treasury-service-agent 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @agenticprimitives/treasury-service-agent 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @agenticprimitives/treasury-service-agent 可以商用吗？

@agenticprimitives/treasury-service-agent 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @agenticprimitives/treasury-service-agent 的下载量有多少？

根据 npm 官方下载统计，@agenticprimitives/treasury-service-agent 在 2026/10/05 – 2026/11/03 这 30 天内被下载 4,029 次，日均约 134 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @agenticprimitives/treasury-service-agent 还在维护吗？

最新版本 0\.0\.0-alpha\.33 发布于 2026/10/26（12 天前）；至今共发布 29 个版本，其中过去 12 个月发布了 29 个；首次发布于 2026/07/14。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

