Skip to content

Repository files navigation

Datalayer

Become a Sponsor

πŸ€– πŸ‘₯ Agent Teams

PyPI - Version npm

The Datalayer orchestration extension

agent_teams.a2a (Python) and @datalayer/agent-teams (TypeScript) implement the Datalayer orchestration extension β€” an optional A2A extension that lets a worker and an orchestrator say the things about delegated work that A2A leaves unsaid: which execution a delegation is part of and where it sits in its tree, a budget to decline before exceeding, a checkpoint to resume from, and instructions delivered to a turn already in progress.

from agent_teams.a2a import ExecutionRef, build_delegation_meta

meta = build_delegation_meta(
    ExecutionRef(execution_id="exec_1", root_execution_id="exec_1", depth=0),
    budget={"outputTokens": 4000},
)
import { buildDelegationMeta } from '@datalayer/agent-teams';

const meta = buildDelegationMeta(
  { executionId: 'exec_1', rootExecutionId: 'exec_1', depth: 0 },
  { budget: { outputTokens: 4000 } },
);

Nothing here requires the rest of this package, and nothing here imports Datalayer's own platform β€” agent_teams.a2a.orchestration_extension and @datalayer/agent-teams's src/orchestrationExtension.ts are each a standalone module (Python built on fasta2a alone; TypeScript with zero runtime dependencies at all) implementing the identical wire shape, field for field. A worker implementing none of it still runs; see the normative specification and its JSON Schema at docs/extension-v1.md for the full field-by-field contract both modules implement.

This is distinct from agent_teams.a2a.extensions' own team-coordination extension (https://datalayer.io/ext/team-coordination/v1) β€” member assignment, task dependencies, health and reactions for a team's own internal coordination. The two extensions are independent and separately negotiated; a card may advertise either, both, or neither.

A reference worker, and a public conformance suite

agent_teams.a2a.reference_worker is the smallest thing that speaks the extension correctly: no model, no framework beyond fasta2a, no Datalayer control plane. Run it standalone β€”

python -m agent_teams.a2a.reference_worker  # serves on :8000

β€” point any A2A client at it, and its card advertises the extension. It answers a turn with what it "spent" (a character count, not a model call, so this needs no API key), declines a delegation whose budget already reads outputTokens: 0 naming the limit, and answers a pause request by ending the turn at a checkpoint it makes up on the spot.

tests/test_reference_worker_conformance.py drives it over real ASGI HTTP (httpx.ASGITransport, no socket) with hand-built JSON-RPC requests matching docs/extension-v1.md's documented wire shapes β€” negotiation, a declined budget, pause and resume β€” runnable by anyone against their own worker, with no Datalayer service in the loop.

Releases

Sponsor this project

Contributors

Languages