# shashikanth-gs/a2a-schema-contract-reference architecture

> Architecture diagram of the GitHub repository shashikanth-gs/a2a-schema-contract-reference, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shashikanth-gs/a2a-schema-contract-reference
- Repository: https://github.com/shashikanth-gs/a2a-schema-contract-reference

## Overview

This repository is a runnable JavaScript/TypeScript reference application for A2A Schema Contract clients and agents, not the SDK itself. Its principal workflow is client discovery of an agent’s catalog and schemas, explicit contract selection and invocation, server-side execution, then validation of task, message, or streaming results. Separate examples exercise skill-associated flight discovery and security/resolver behavior. The graph reflects README-documented capabilities; sampled excerpts show key client, harness, flight-agent, and server wiring, but not every implementation detail.

Main entry points: [`js/src/client/run.mjs`](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/run.mjs) (Scenario client), [`js/src/server/main.ts`](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/server/main.ts) (Contract agent), [`js/scripts/flight-agent.mjs`](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/scripts/flight-agent.mjs) (Flight agent setup), [`js/scripts/harness.mjs`](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/scripts/harness.mjs) (Agent lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client applications"]
  node_scenario_runner["Scenario client<br/>[run.mjs]"]
  node_typed_client["Typed invocation<br/>[invoke.ts]"]
  node_flight_discovery["Flight discovery<br/>[discovery.mjs]"]
  node_flight_client["Typed flight client<br/>[discover.ts]"]
  node_security_examples["Security examples<br/>[security.mjs]"]
end

subgraph group_agent["Agent application"]
  node_agent_server["Contract agent<br/>[main.ts]"]
end

subgraph group_fixtures["Reference data"]
  node_catalog["Invoice catalog<br/>[catalog.json]"]
  node_flight_catalog["Flight catalog"]
  node_scenario_manifest["Scenario expectations<br/>[scenarios.json]"]
end

subgraph group_runtime["Runtime support"]
  node_agent_harness["Agent lifecycle<br/>[harness.mjs]"]
  node_flight_harness["Flight agent setup<br/>[flight-agent.mjs]"]
end

node_user(("Reference user"))
node_contract_sdk["Contract SDK"]
node_a2a_sdk["A2A SDK"]
node_resolver_service[("External schema origin")]

node_user -->|"runs scenarios"| node_scenario_runner
node_scenario_runner -->|"reads expectations"| node_scenario_manifest
node_scenario_runner -->|"starts agent"| node_agent_harness
node_scenario_runner -->|"uses typed call"| node_typed_client
node_scenario_runner -->|"discovers and invokes"| node_contract_sdk
node_typed_client -->|"invokes contract"| node_contract_sdk
node_agent_harness -->|"launches process"| node_agent_server
node_agent_server -->|"loads catalog"| node_catalog
node_agent_server -->|"creates contract server"| node_contract_sdk
node_agent_server -->|"serves A2A"| node_a2a_sdk
node_flight_discovery -->|"sets up agent"| node_flight_harness
node_flight_discovery -->|"discovers contracts"| node_contract_sdk
node_flight_discovery -->|"checks typed flow"| node_flight_client
node_flight_harness -->|"loads catalog"| node_flight_catalog
node_flight_harness -->|"runs agent"| node_agent_harness
node_flight_harness -->|"hosts schemas"| node_resolver_service
node_flight_client -->|"discovers and invokes"| node_contract_sdk
node_security_examples -->|"starts agent"| node_agent_harness
node_security_examples -->|"tests client behavior"| node_contract_sdk
node_security_examples -->|"checks resolution"| node_resolver_service
node_contract_sdk -.->|"exchanges HTTP and SSE"| node_agent_server
node_contract_sdk -.->|"resolves schemas"| node_resolver_service

click node_scenario_runner "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/run.mjs"
click node_typed_client "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/invoke.ts"
click node_flight_discovery "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/discovery.mjs"
click node_flight_client "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/discover.ts"
click node_security_examples "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/security.mjs"
click node_agent_server "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/server/main.ts"
click node_catalog "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/fixtures/catalog.json"
click node_flight_catalog "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/fixtures/flight-catalog.json"
click node_scenario_manifest "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/fixtures/scenarios.json"
click node_agent_harness "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/scripts/harness.mjs"
click node_flight_harness "https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/scripts/flight-agent.mjs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scenario_runner,node_typed_client,node_flight_discovery,node_flight_client,node_security_examples,node_user toneBlue
class node_agent_server,node_resolver_service toneAmber
class node_catalog,node_flight_catalog,node_scenario_manifest toneMint
class node_agent_harness,node_flight_harness toneRose
class node_contract_sdk,node_a2a_sdk toneIndigo
```

## Components

### Client applications

- [Scenario client](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/run.mjs): `js/src/client/run.mjs`
- [Typed invocation](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/invoke.ts): `js/src/client/invoke.ts`
- [Flight discovery](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/discovery.mjs): `js/src/client/discovery.mjs`
- [Typed flight client](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/discover.ts): `js/src/client/discover.ts`
- [Security examples](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/client/security.mjs): `js/src/client/security.mjs`

### Agent application

- [Contract agent](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/src/server/main.ts): `js/src/server/main.ts`

### Reference data

- [Invoice catalog](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/fixtures/catalog.json): `fixtures/catalog.json`
- [Flight catalog](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/fixtures/flight-catalog.json): `fixtures/flight-catalog.json`
- [Scenario expectations](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/fixtures/scenarios.json): `fixtures/scenarios.json`

### Runtime support

- [Agent lifecycle](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/scripts/harness.mjs): `js/scripts/harness.mjs`
- [Flight agent setup](https://github.com/shashikanth-gs/a2a-schema-contract-reference/blob/main/js/scripts/flight-agent.mjs): `js/scripts/flight-agent.mjs`

### Other components

- **Reference user**
- **Contract SDK**
- **A2A SDK**
- **External schema origin**

## Connections

- Reference user → Scenario client: runs scenarios (evidence: `README.md`)
- Scenario client → Scenario expectations: reads expectations (evidence: `js/src/client/run.mjs`)
- Scenario client → Agent lifecycle: starts agent (evidence: `js/src/client/run.mjs`)
- Scenario client → Typed invocation: uses typed call (evidence: `js/src/client/run.mjs`)
- Scenario client → Contract SDK: discovers and invokes (evidence: `js/src/client/run.mjs`)
- Typed invocation → Contract SDK: invokes contract (evidence: `js/src/client/invoke.ts`)
- Agent lifecycle → Contract agent: launches process (evidence: `js/scripts/harness.mjs`)
- Contract agent → Invoice catalog: loads catalog (evidence: `js/src/server/main.ts`)
- Contract agent → Contract SDK: creates contract server (evidence: `js/src/server/main.ts`)
- Contract agent → A2A SDK: serves A2A (evidence: `js/src/server/main.ts`)
- Flight discovery → Flight agent setup: sets up agent (evidence: `js/src/client/discovery.mjs`)
- Flight discovery → Contract SDK: discovers contracts (evidence: `js/src/client/discovery.mjs`)
- Flight discovery → Typed flight client: checks typed flow (evidence: `js/src/client/discovery.mjs`)
- Flight agent setup → Flight catalog: loads catalog (evidence: `js/scripts/flight-agent.mjs`)
- Flight agent setup → Agent lifecycle: runs agent (evidence: `js/scripts/flight-agent.mjs`)
- Flight agent setup → External schema origin: hosts schemas (evidence: `js/scripts/flight-agent.mjs`)
- Typed flight client → Contract SDK: discovers and invokes (evidence: `js/src/client/discover.ts`)
- Security examples → Agent lifecycle: starts agent (evidence: `js/src/client/security.mjs`)
- Security examples → Contract SDK: tests client behavior (evidence: `js/src/client/security.mjs`)
- Security examples → External schema origin: checks resolution (evidence: `js/src/client/security.mjs`)
- Contract SDK → Contract agent: exchanges HTTP and SSE (evidence: `README.md`)
- Contract SDK → External schema origin: resolves schemas (evidence: `README.md`)
