@agenticprimitives/coordination

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

Coordination core: Endeavor, OutcomeSpecification, CoordinationPlan, Participation — spec 332 W1.

原始使用文档
文档目录6 节
  1. Install
  2. Model
  3. Usage
  4. Invariants (spec 332 §6/§9)
  5. Boundaries
  6. Spec

@agenticprimitives/coordination

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

The Endeavor coordination core (spec 332, Wave 1): a durable, shared, multi-principal coordination object — someone posted a request; the group adopted it as a goal; a shared plan was proposed, revised, and adopted; participants were allocated and committed; work executed against plan steps; the outcome was validated — expressed as a pure, deterministic, event-sourced machine.

Install

pnpm add @agenticprimitives/coordination

Subpath exports: . (everything), ./core (records, commands, events, reducer, provenance inputs), ./planning (plans, steps, edges, milestones, content hash, acyclicity), ./participation (participations, proposals, allocations, signed commitments). ./profiles, ./decisions, and ./projections are reserved stubs whose real contents land with spec 333/334.

Model

  • EndeavorRequestV1 — structured intake before adoption (ereq_ id). Any entry point (Home request, discussion ask, inbox ask, A2A intent) produces the same request and drives the same machinery.
  • EndeavorV1 — the durable multi-principal Situation (end_ id) pursuing an OutcomeSpecificationV1 (observable success criteria, versioned).
  • CoordinationPlanV1 — the durable shared plan (p-plan:Plan grounding). Revisions are immutable; planContentHash is sha256(JCS(steps + edges + milestones)); adoption is an explicit decision, never implicit; at most one revision is adopted at a time.
  • EndeavorParticipationV1 — a participant's relationship to the Endeavor (role + scope + validity), asserted through invitation/acceptance or allocation/commitment.
  • ContributionProposalV1 → AllocationDecisionV1 → ContributionCommitmentV1 — offer, selection, and the participant's signed acceptance. A commitment binds an exact plan revision hash; a stale hash is rejected.

Usage

import {
  initialCoordinationState,
  validateCoordinationCommand,
  applyCoordinationEvent,
  deriveProvenanceInputs,
} from '@agenticprimitives/coordination/core';

let state = initialCoordinationState();
const result = validateCoordinationCommand(state, {
  kind: 'SubmitEndeavorRequest',
  actor: requesterAddress,
  issuedAt: new Date().toISOString(),
  requestId: 'ereq_1',
  targetPrincipal: orgAddress,
  goal: 'Produce the Q3 treasury report',
  entryPoint: 'home-request',
});
if (!result.ok) throw new Error(result.reason);
for (const event of result.events) state = applyCoordinationEvent(state, event);

validateCoordinationCommand rejects before append (fail-closed) and returns the events to persist; applyCoordinationEvent is a pure reducer that enforces monotonic revisions. Replaying the event log always reproduces the state; deriveProvenanceInputs(events) yields a structural summary (entities, activities, agents, correspondsToStep links) a P-Plan/PROV projection can consume.

Invariants (spec 332 §6/§9)

  1. Allocation is never authority. No gate reads an apcoord: record; capable / available / allocated / committed / authorized / performing / satisfied are seven separate facts.
  2. Commitments are signed by the participant against the exact adopted plan revision hash.
  3. Conversation never mutates state. Only signed commands produce events; PlanRejected is the only way a plan proposal dies; unknown command kinds are rejected fail-closed.
  4. One mechanism (ADR-0013): the reducer is the only state-transition path.
  5. Deterministic: ids and timestamps come from commands/events, never from the reducer.

Boundaries

Depends on @agenticprimitives/types, @agenticprimitives/situations (EntityRef, validity, JCS), and @agenticprimitives/ontology (apcoord: IRIs). Never imports fabric/home/a2a/delegation/vault — those layers consume coordination. Vendor adapters (Linear, Jira, Temporal, LangGraph, …) live in external repos; only ExternalObjectBindingV1 (the adapter contract surface) ships here.

Spec

specs/332-coordination-endeavor-core.md · ADR-0054 · golden fixtures in test/fixtures/.

版本与发布记录

@agenticprimitives/coordination 共发布 28 个版本,首次发布于 2026/07/22;过去 12 个月发布了 28 个版本。

版本发布日期距今
0.0.0-alpha.29latest2026/10/2612 天前
0.0.0-alpha.282026/10/2612 天前
0.0.0-alpha.272026/10/1721 天前
0.0.0-alpha.262026/10/1722 天前
0.0.0-alpha.252026/10/1622 天前
0.0.0-alpha.242026/10/1622 天前

关于 @agenticprimitives/coordination 的常见问题

@agenticprimitives/coordination 是什么?

Coordination core: Endeavor, OutcomeSpecification, CoordinationPlan, Participation — spec 332 W1.

如何安装 @agenticprimitives/coordination?

在项目目录运行 npm install @agenticprimitives/coordination,或使用 pnpm add / yarn add / bun add。

@agenticprimitives/coordination 支持 TypeScript 吗?

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

@agenticprimitives/coordination 支持 ESM 还是 CommonJS?

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

@agenticprimitives/coordination 可以商用吗?

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

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

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

@agenticprimitives/coordination 还在维护吗?

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