@nightowlsdev/engine-a2a
EngineAdapter, reduced governanceThe A2A (Agent2Agent) protocol adapter engine, renders any A2A v1.0 endpoint (Bedrock AgentCore, Azure AI Foundry/Copilot Studio, Google ADK/Vertex Agent Engine) as a single Night Owls agent. Adapter tier: reduced governance, tier-1 events (opaque remote, no tool visibility).
What it does
@nightowlsdev/engine-a2a is a protocol ADAPTER (not a native engine) in the `engine-*` family: it renders any A2A (Agent2Agent, Linux-Foundation-standard v1.0) endpoint as a single Night Owls agent, one client, three hyperscaler runtimes (Amazon Bedrock AgentCore, Azure AI Foundry Agent Service + Microsoft Copilot Studio, Google ADK/Vertex Agent Engine) for zero marginal engineering beyond auth wiring. `a2aEngine({ endpoint, auth?, agentCard?, dialect? })` fetches the remote's Agent Card and speaks the A2A wire (`@a2a-js/sdk`) underneath; auth strategies cover static headers, bearer tokens, API keys, SigV4 (Bedrock), and OAuth2 client-credentials (Copilot Studio/Vertex/Azure Entra). Its capability descriptor is honest about the reduced-governance adapter tier: `kind: 'adapter'`, `events.tier: 1` (message/status/HITL only, A2A agents are opaque, so there is no tool-call granularity to surface), and `governance` all `false`/`'none'` (our pre-generation veto, fail-closed tool gate, and cost caps cannot reach a remote we don't execute inside of). `hitl.durableResume` is STATICALLY `true`, A2A tasks are durable and resumable by the remote (`taskId`/`contextId`), independent of what our own storage persists. `hitl.ask` maps A2A's `input-required`/`auth-required` task states onto the normal `ask`/suspend/resume loop; `hitl.approval` is `false` (no per-tool approval surface exists to gate). Engine-wall clean: peer-depends only on `@nightowlsdev/core` plus `@a2a-js/sdk`.
Install
pnpm add @nightowlsdev/engine-a2aKey exports
- a2aEngine
- A2aEngine
- A2A_ENGINE_CAPABILITIES
- createA2aTransport
- noneAuth / staticHeaders / bearerToken / apiKey / sigV4Auth / oauth2ClientCredentials
- mapTaskEvent
- nightOwlsPlugin
Usage
import { defineSwarm } from "@nightowlsdev/core";
import { a2aEngine, A2A_ENGINE_CAPABILITIES } from "@nightowlsdev/engine-a2a";
// An ADAPTER, not a native engine, renders any A2A v1.0 endpoint (Bedrock AgentCore, Azure AI
// Foundry/Copilot Studio, Google ADK/Vertex Agent Engine) as one opaque Night Owls agent.
const swarm = defineSwarm({ agents, engine: a2aEngine({ endpoint: "https://agent.example.com" }) });
// Reduced-governance adapter tier, our pre-generation/tool gate can't reach a remote we don't run.
console.log(A2A_ENGINE_CAPABILITIES.kind); // "adapter"
console.log(A2A_ENGINE_CAPABILITIES.governance.preToolCall); // "none", nothing to gate (opaque remote)