@agent-assistant/coordination

中文文档
0.4.37发布于 2026/10/04MITTypeScriptES Module构建来源已验证近 30 天下载 3.7万

Minimal coordinator, specialist registry, delegation, and synthesis runtime for Agent Assistant SDK

原始使用文档
文档目录11 节
  1. Scope
  2. Install Shape
  3. Core Concepts
  4. Specialist registry
  5. Delegation plan
  6. Coordinator
  7. Connectivity Boundary
  8. Routing Integration
  9. Synthesis
  10. Failure Model
  11. Development

@agent-assistant/coordination

@agent-assistant/coordination implements the bounded v1 many-agents-one-assistant runtime for Agent Assistant SDK. It provides a specialist registry, delegation plan validation, sequential coordinator execution, synthesis helpers, and clean integration with @agent-assistant/connectivity for handoffs, conflicts, and escalations.

Scope

This package owns:

  • specialist registration and lookup
  • delegation plan validation and bounded execution
  • coordinator lifecycle for one in-memory coordination turn
  • synthesis of multiple specialist outputs into one assistant-facing result
  • consumption of connectivity signals during delegation without taking over connectivity itself

This package does not own:

  • routing policy or model selection
  • memory retrieval or persistence
  • surface formatting or delivery
  • transport, relaycast, queues, or cross-process orchestration
  • product-specific specialist lineups or dispatch heuristics

Install Shape

The package is TypeScript-first and builds to dist/.

import {
  createCoordinator,
  createDelegationPlan,
  createSpecialistRegistry,
  createSynthesizer,
  validateDelegationPlan,
} from '@agent-assistant/coordination';

Core Concepts

Specialist registry

Products register their own specialists. The package only enforces uniqueness and lookup.

const registry = createSpecialistRegistry();

registry.register({
  name: 'researcher',
  description: 'Collects relevant evidence',
  capabilities: ['research'],
  handler: {
    async execute(instruction, context) {
      return {
        specialistName: 'researcher',
        output: `Evidence for: ${instruction}`,
        status: 'complete',
      };
    },
  },
});

Delegation plan

Plans are ordered and sequential in v1.

createDelegationPlan() is a validating factory: it throws if the structure is invalid or if any step references an unknown registered specialist. If a product needs to construct a plan before registry population, it can build a raw DelegationPlan object and call validateDelegationPlan() later.

const plan = createDelegationPlan(
  {
    intent: 'produce one coherent answer',
    steps: [
      { specialistName: 'researcher', instruction: 'gather evidence' },
      { specialistName: 'writer', instruction: 'write final answer' },
    ],
  },
  registry,
);

Coordinator

The coordinator validates the plan, executes each step in order, observes connectivity signals on the turn thread, and synthesizes a final output.

import { createConnectivityLayer } from '@agent-assistant/connectivity';

const connectivity = createConnectivityLayer();

const coordinator = createCoordinator({
  registry,
  connectivity,
  synthesis: { strategy: 'last-wins' },
});

const turn = await coordinator.execute(plan);
console.log(turn.output.text);

Connectivity Boundary

Coordination depends on @agent-assistant/connectivity as a signaling substrate only.

What coordination does with connectivity:

  • passes the connectivity layer into each specialist context
  • registers a per-turn selected-audience resolver scoped to the plan participants
  • observes per-turn signals such as handoff.ready, confidence.blocker, conflict.active, and escalation.interrupt
  • resolves consumable signals after synthesis or coordinator action
  • exposes the observed signal set on the returned coordination turn

What coordination does not do:

  • choose routing modes
  • import or call the routing package
  • own transport delivery for signals
  • persist signal history outside the in-memory layer supplied by the consumer

Routing Integration

Coordination can optionally accept a router via createCoordinator({ router, ... }).

When a router is present:

  • each specialist step receives context.routingDecision
  • the returned turn may include turn.routingDecisions
  • specialist-reported metadata.cost values are recorded back to the router per thread

Current v1 limitation:

  • coordination does not yet pass activeEscalations into router.decide(), so the escalation-routing path remains a documented v1 gap rather than a complete end-to-end flow

Synthesis

v1 includes three synthesis modes:

  • concatenate
  • last-wins
  • custom

custom requires a function and keeps product-specific output shaping outside the package core.

Failure Model

v1 execution is intentionally simple:

  • steps run sequentially
  • optional step failures are skipped and degrade output quality instead of aborting the whole turn
  • confidence.blocker and escalation.interrupt halt the turn
  • unresolved conflicts degrade synthesis quality but do not introduce routing or policy ownership

Development

Run inside packages/coordination:

npm install
npm test
npm run build

The test suite covers 45 tests across five groups:

  • specialist registry (7 tests): duplicate rejection, defensive copy, empty or whitespace names, unregister/get edge cases
  • delegation plan validation (7 tests): empty intent, steps, instruction, and specialist name handling; multi-error accumulation; maxSteps; copy isolation
  • synthesis strategies (8 tests): concatenate, last-wins, custom, degraded quality, and failure exclusion
  • coordinator lifecycle and signal handling (13 tests): sequential handoff, optional and required step failure, blocker halt, conflict tracking, turnId prefix, offSignal cleanup, advanceStep, selected-audience resolver
  • routing integration (10 tests): per-step mode selection, cost accumulation, ceiling enforcement, and fallback without a router

COORDINATION_PACKAGE_IMPLEMENTED

版本与发布记录

@agent-assistant/coordination 共发布 59 个版本,首次发布于 2026/04/14;过去 12 个月发布了 59 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.37latest2026/10/041 个月前
0.4.362026/10/041 个月前
0.4.352026/05/235 个月前
0.4.332026/05/155 个月前
0.4.322026/05/125 个月前
0.4.312026/05/086 个月前

关于 @agent-assistant/coordination 的常见问题

@agent-assistant/coordination 是什么?

Minimal coordinator, specialist registry, delegation, and synthesis runtime for Agent Assistant SDK

如何安装 @agent-assistant/coordination?

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

@agent-assistant/coordination 支持 TypeScript 吗?

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

@agent-assistant/coordination 支持 ESM 还是 CommonJS?

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

@agent-assistant/coordination 可以商用吗?

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

@agent-assistant/coordination 的下载量有多少?

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

@agent-assistant/coordination 还在维护吗?

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