@agenticprimitives/fulfillment

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

FulfillmentCase lifecycle + Task/Message/Artifact (re-exported from mcp-runtime/a2a) + HandoffPolicy + EvidenceCredential + OutcomeCredential issuance.

原始使用文档
文档目录5 节
  1. What ships today
  2. What lands in the waves (designed, not shipped)
  3. Where this is heading / market context
  4. Build
  5. Status — honest version

@agenticprimitives/fulfillment

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

Status: STUB (Wave 0.5 of the W1 implementation wave). State machines, types, and invariant guards ship today; the full fulfillment runtime lands in Wave 7b per the w1 implementation wave plan.

An agreement between two agents is worthless if no one can say, afterward, what actually happened. Who did the work, who was it handed to, what did they produce, and does the outcome match what was promised? Agent frameworks orchestrate tasks; almost none of them produce evidence. This package is the designed answer: a FulfillmentCase container where every task, message, artifact, and handoff is bound to canonical Smart Agent identities, gated by typed policy, and promoted into credentials — an OutcomeCredential that cannot exist without citing the EvidenceCredential backing it. The claim "we delivered" is structurally forced to point at proof.

This is the fulfillment slice of the substrate — spine Layers 10–12, spec'd in full, scaffolded now, landing in the implementation waves — and it shares one trust chain with the delegations that authorize the work and the payment mandates that settle it.

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.

What ships today

Types, state machines, and invariant guards — no runtime, storage, or credential issuance yet:

  • FulfillmentCase type + lifecycle state machine — thirteen states (drafted → … → archived / canceled / disputed) with canTransition enforcing legal edges. Note: transitions are shape-checked only; actor authorization is wave work.
  • A2A Task state machine — canTaskTransition per spec 245, including the auth-required suspension loop for tasks awaiting a fresh delegation.
  • HandoffPolicy type + isHandoffAllowed — typed authority binding for cross-agent handoffs. Today's check covers the agent/class allowlists only; requiresUserApproval, preservePrivacyTier, allowedScopes, and maxHopCount enforcement is wave work (tracked openly as NEW-FLF-1 in the findings ledger).
  • Artifact + OutcomeCredentialSubject types — hash-anchored artifacts (body never on-chain) and assertOutcomeCitations, the FLF-OUT-1 guard: an outcome with zero evidence citations throws.
  • IntentTraceSpan — typed trace spans (parse / resolve / handoff / tool_call / user_approval / …) for end-to-end execution forensics.

What lands in the waves (designed, not shipped)

The operational runtime: buildFulfillmentCase, transitionLifecycle with actor authorization, handoffTask with full policy enforcement, message threads, artifact publication, promoteToEvidence / assertOutcome credential issuance into the attestation layer, trace-tree assembly, and lifecycle ↔ agreement-status reconciliation (FLF-INV-01). Workflow engines stay app-layer; this package is engine-agnostic.

Where this is heading / market context

  • Google A2A defines the Task/Message/Artifact wire model; we adopt it (via mcp-runtime, spec 245) rather than invent a rival — this package adds the case container, handoff policy, and evidence promotion A2A leaves out.
  • Upstream gate (spec 336): a fulfillment Task is created only after the intent is understood, an acceptable signed FulfillmentOffer exists, and the mandate is present and unexpired — never straight from a discovery match. The execution transition arrives as an explicit typed command (offer digest + acceptance digest + mandate presentation + idempotency key), and the closing FulfillmentReceipt binds intent, offer, mandate, task, and outcome by digest — a redirect is not a receipt, and neither is a successful poll.
  • Google AP2 and x402 give agents payment mandates; a FulfillmentCase binds those mandates to the tasks they pay for (ContextBinding.taskId, FLF-INV-11), so a machine payment is never unmoored from the work it settled.
  • The differentiated combination: task execution, handoff authority, payment binding, and outcome evidence under one delegation + custody + audit substrate — the seam where stitched stacks lose the thread is exactly what Layers 10–12 are designed to hold.

Authoritative spec: spec 244 — fulfillment (see spec.md). Owns spine layers 10–12; bounded surface in CLAUDE.md and capability.manifest.json.

Build

pnpm --filter @agenticprimitives/fulfillment typecheck
pnpm --filter @agenticprimitives/fulfillment test
pnpm --filter @agenticprimitives/fulfillment build

Status — honest version

STUB. What ships is the typed skeleton plus pure guards; everything operational is wave work, and the two known enforcement gaps (handoff policy fields, transition authorization) are logged publicly in docs/audits/findings.yaml rather than papered over. Wave sequencing: w1-implementation-wave-plan.md.

版本与发布记录

@agenticprimitives/fulfillment 共发布 41 个版本,首次发布于 2026/06/11;过去 12 个月发布了 41 个版本。

版本发布日期距今
0.0.0-alpha.43latest2026/10/2610 天前
0.0.0-alpha.422026/10/2610 天前
0.0.0-alpha.412026/10/1720 天前
0.0.0-alpha.402026/10/1720 天前
0.0.0-alpha.392026/10/1620 天前
0.0.0-alpha.382026/10/1620 天前

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

关于 @agenticprimitives/fulfillment 的常见问题

@agenticprimitives/fulfillment 是什么?

FulfillmentCase lifecycle + Task/Message/Artifact (re-exported from mcp-runtime/a2a) + HandoffPolicy + EvidenceCredential + OutcomeCredential issuance.

如何安装 @agenticprimitives/fulfillment?

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

@agenticprimitives/fulfillment 支持 TypeScript 吗?

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

@agenticprimitives/fulfillment 支持 ESM 还是 CommonJS?

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

@agenticprimitives/fulfillment 可以商用吗?

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

@agenticprimitives/fulfillment 的下载量有多少?

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

@agenticprimitives/fulfillment 还在维护吗?

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