Agent / foldkit-agent-a2a

AgentA2a

namespace · packages/agent-a2a/src/agentA2a.ts:1

export * as AgentA2a from './agentA2a.js'

In the guides

Members

AgentA2a.A2A_VERSION

const · packages/agent-a2a/src/card.ts:53

const A2A_VERSION: '0.3.0'

AgentA2a.AGENT_CARD_PATH

const · packages/agent-a2a/src/card.ts:5

const AGENT_CARD_PATH: '/.well-known/agent-card.json'

Where an A2A client looks for the card.

AgentA2a.AgentCard

interface · packages/agent-a2a/src/card.ts:33

interface AgentCard {
  readonly protocolVersion: string
  readonly name: string
  readonly description: string
  readonly url: string
  readonly preferredTransport: 'JSONRPC'
  readonly version: string
  readonly capabilities: {
    readonly streaming: boolean
    readonly pushNotifications: boolean
  }
  readonly defaultInputModes: ReadonlyArray<string>
  readonly defaultOutputModes: ReadonlyArray<string>
  readonly skills: ReadonlyArray<AgentSkill>
  readonly securitySchemes?: Record<string, unknown> | undefined
  readonly security?:
    ReadonlyArray<Record<string, ReadonlyArray<string>>> | undefined
}

AgentA2a.agentCard

function · packages/agent-a2a/src/card.ts:73

function agentCard(definition: Definition, options: AgentCardOptions): AgentCard

Builds the card an A2A client fetches before calling.

Skills are the exposed capabilities: the same descriptors MCP lists as tools. A capability that is only available in some Model states is tagged, because a card is static while availability is not.

AgentA2a.AgentCardOptions

interface · packages/agent-a2a/src/card.ts:55

interface AgentCardOptions {
  readonly name: string
  readonly description: string
  readonly url: string
  readonly version?: string | undefined
  readonly securitySchemes?: Record<string, unknown> | undefined
  readonly security?:
    ReadonlyArray<Record<string, ReadonlyArray<string>>> | undefined
}

AgentA2a.AgentSkill

interface · packages/agent-a2a/src/card.ts:8

interface AgentSkill {
  readonly id: string
  readonly name: string
  readonly description: string
  readonly tags: ReadonlyArray<string>
  readonly inputSchema: Record<string, unknown>
}

One thing this agent can do. Derived from an exposed capability.

AgentA2a.Handler

interface · packages/agent-a2a/src/handler.ts:28

interface Handler {
  readonly handle: (message: unknown) => Promise<Response | undefined>
  readonly close: () => void
}

AgentA2a.handler

function · packages/agent-a2a/src/handler.ts:77

function handler(options: HandlerOptions): Handler

Serves a contract as an A2A agent, with no transport attached.

One exposed capability is one skill. A capability with no completion contract finishes at validated dispatch, so its task is completed immediately; one that declares completion finishes when its Message arrives.

AgentA2a.HandlerOptions

interface · packages/agent-a2a/src/handler.ts:19

interface HandlerOptions {
  readonly agent: AgentRuntime
  readonly capacity?: number | undefined
  readonly newId?: (() => string) | undefined
  readonly clock?: (() => Date) | undefined
}