@agenticprimitives/related-agents

中文文档
0.0.0-alpha.42发布于 2026/10/26MITTypeScriptES Module近 30 天下载 4149

Private, holder-resident related-agent credentials (person↔org links as vault situation credentials, never on-chain edges — ADR-0025) + scoped-delegation read caveats + list-query shapes. Composes verifiable-credentials + delegation.

原始使用文档
文档目录6 节
  1. Usage
  2. How it's different
  3. Boundaries
  4. Validation
  5. Status
  6. License

@agenticprimitives/related-agents

Part of Agentic Primitives — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. Developer kit · All packages

Some relationships are nobody else's business. When a person creates an organization through a relying app, that person↔org link is among the most sensitive facts in the whole identity stack — and the default in most systems is to leak it: into an app database, into a public graph, into an index. This package makes the private path the only path. A person↔org link is a private, holder-resident vault credential — never an on-chain relationship, never relying-app-local person→org state (ADR-0025). The public trust graph stays org↔org, and only on explicit bilateral consent.

Part of agenticprimitives — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.

It ships three things: the credential builder that links a person to a related agent (e.g. an org they created via a relying app), the scoped-delegation read caveats a grantee receives, and the list-query wire shapes the session broker serves — shapes that deliberately carry no person id, so even the listing surface cannot leak the link.

Composes verifiable-credentials (DOLCE+DnS Situation + EIP-712 proof) and delegation (caveats). Sibling of agent-relationships, which owns public, on-chain edges only — the two are firewalled by design: this package may not import that one, and person↔org is never written as an edge.

Usage

import { buildRelatedAgentCredential, relatedAgentReadCaveats } from '@agenticprimitives/related-agents';
import { signCredential } from '@agenticprimitives/verifiable-credentials';

// The broker mints this during org-create, signed by the person's ROOT credential:
const unsigned = buildRelatedAgentCredential({
  holder: personSA, relatedAgent: orgSA,
  purpose: 'adopter-org', requestedBy: 'relying-app',
  issuerCaip10: `eip155:84532:${personSA}`,
  body: { agentName: 'acme-co.agent' },
  validFrom: new Date().toISOString(),
});
const credential = await signCredential(unsigned, personRootSigner);

// The scoped org→grantee delegation caveats:
const caveats = relatedAgentReadCaveats({
  enforcers: { timestamp, value, allowedTargets },
  validUntil, allowedTargets: [orgSA],
});

The credential is self-issued (holder = issuer = the person's Smart Agent), visibility = private, holder-resident. The caveat set a grantee receives is time-bound, zero-value, and target-scoped — the grantee can read the org, not move anything. purpose is a free string supplied by the app; this package carries no vertical vocabulary.

How it's different

The competing pattern is app-local membership tables and public social graphs — either the relying app owns the person→org row (and the user cannot take it elsewhere or revoke the app's knowledge of it), or the link is published to a graph anyone can crawl:

  • Holder-resident, not app-resident. The credential lives in the person's vault; the relying app gets a scoped, revocable, time-bound delegation — never the link itself.
  • Privacy is structural, not a setting. There is no "public" flag on a person↔org link. The on-chain graph (agent-relationships) is reserved for org↔org edges with explicit bilateral consent.
  • Anchored to canonical identities. Both ends are Smart Agent addresses, so the private link survives credential rotation and name changes — the same facet doctrine the rest of the substrate runs on.

Boundaries

  • Storage is not here. The vault (broker-home KV) and the query endpoints are app/broker-level; this package is shape + builder only.
  • The VC envelope and signing belong to verifiable-credentials; delegation minting belongs to delegation. This package composes both, owns neither.
  • Wire shapes — RelatedAgentLink, ListRelatedAgentsResponse, DelegatedAgentLink, ListDelegatedAgentsResponse — carry no person id.

Canonical spec: specs/246-related-agents-vault.md.

Validation

pnpm --filter @agenticprimitives/related-agents typecheck
pnpm --filter @agenticprimitives/related-agents test

Status

w1-foundational — the credential builder, caveat set, and wire shapes above are what ships today; storage and serving land at the app/broker layer. Testnet/pilot-ready; production launch is gated on the public checklist in the root README.md — including third-party contract audit and governance key rotation. Track every security finding live in docs/audits/findings.yaml.

License

UNLICENSED (internal monorepo, not published).

版本与发布记录

@agenticprimitives/related-agents 共发布 40 个版本,首次发布于 2026/06/11;过去 12 个月发布了 40 个版本。

版本发布日期距今
0.0.0-alpha.42latest2026/10/2612 天前
0.0.0-alpha.412026/10/2612 天前
0.0.0-alpha.402026/10/1721 天前
0.0.0-alpha.392026/10/1722 天前
0.0.0-alpha.382026/10/1622 天前
0.0.0-alpha.372026/10/1622 天前

其他发布通道:alpha → 0.0.0-alpha.3。

关于 @agenticprimitives/related-agents 的常见问题

@agenticprimitives/related-agents 是什么?

Private, holder-resident related-agent credentials (person↔org links as vault situation credentials, never on-chain edges — ADR-0025) + scoped-delegation read caveats + list-query shapes. Composes verifiable-credentials + delegation.

如何安装 @agenticprimitives/related-agents?

在项目目录运行 npm install @agenticprimitives/related-agents,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:viem(^2.52.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@agenticprimitives/related-agents 支持 TypeScript 吗?

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

@agenticprimitives/related-agents 支持 ESM 还是 CommonJS?

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

@agenticprimitives/related-agents 可以商用吗?

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

@agenticprimitives/related-agents 的下载量有多少?

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

@agenticprimitives/related-agents 还在维护吗?

最新版本 0.0.0-alpha.42 发布于 2026/10/26(12 天前);至今共发布 40 个版本,其中过去 12 个月发布了 40 个;首次发布于 2026/06/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。