Skip to content

Commit 7e1c59e

Browse files
committed
Fix project structure
1 parent 4d10580 commit 7e1c59e

File tree

3 files changed

+249
-27
lines changed

3 files changed

+249
-27
lines changed

README.md

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,88 @@
1-
## A2A Protocol Inspector
1+
# A2A Protocol Inspector
2+
23
The A2A Inspector is a web-based tool designed to help developers inspect, debug, and validate servers that implement the Google A2A (Agent-to-Agent) protocol. It provides a user-friendly interface to interact with an A2A agent, view communication, and ensure specification compliance.
34

4-
The application is built with FastAPI and uses Socket.IO for real-time communication.
5+
The application is built with a FastAPI backend and a TypeScript frontend.
6+
7+
## Features
8+
9+
- **Connect to a local A2A Agent:** Specify the base URL of any agent server to connect (e.g., `http://localhost:5555`).
10+
- **View Agent Card:** Automatically fetches and displays the agent's card.
11+
- **Spec Compliance Checks:** Performs basic validation on the agent card to ensure it adheres to the A2A specification.
12+
- **Live Chat:** A chat interface to send and receive messages with the connected agent.
13+
- **Debug Console:** A slide-out console shows the raw JSON-RPC 2.0 messages sent and received between the inspector and the agent server.
14+
15+
## Prerequisites
16+
17+
- Python 3.10+
18+
- [uv](https://github.com/astral-sh/uv)
19+
- Node.js and npm
520

6-
### Features
7-
* Connect to a local A2A Agent: Specify the base URL of any agent server to connect (e.g. http://localhost:5555).
8-
* View Agent Card: Automatically fetches and displays the agent's card.
9-
* Spec Compliance Checks: Performs basic validation on the agent card to ensure it adheres to the A2A specification.
10-
* Messages: A chat interface to send and receive text messages with the connected agent.
11-
* Debug Console: A slide-out console at the bottom of the screen shows the raw JSON-RPC 2.0 messages sent and received between the inspector and the agent server.
21+
## Project Structure
1222

23+
This repository is organized into two main parts:
1324

14-
### Prerequisites
15-
Python 3.10+
16-
uv
17-
Node.js and npm
25+
- `./backend/`: Contains the Python FastAPI server that handles WebSocket connections and communication with the A2A agent.
26+
- `./frontend/`: Contains the TypeScript and CSS source files for the web interface.
1827

19-
### Setup and Installation
20-
Follow these steps to get the A2A Inspector running on your local machine.
28+
## Setup and Running the Application
2129

30+
Follow these steps to get the A2A Inspector running on your local machine. The setup is a three-step process: install Python dependencies, install Node.js dependencies, and then run the two processes.
31+
32+
### 1. Clone the repository
33+
34+
```sh
35+
git clone https://github.com/google-a2a/a2a-inspector.git
2236
cd a2a-inspector
37+
```
38+
39+
### 2. Install Dependencies
40+
41+
First, install the Python dependencies for the backend from the root directory. `uv sync` reads the `uv.lock` file and installs the exact versions of the packages into a virtual environment.
2342

24-
#### Install Dependencies
25-
Install all required packages from the requirements.txt file using uv.
43+
```sh
44+
# Run from the root of the project
45+
uv sync
46+
```
2647

27-
uv pip install -r requirements.txt
48+
Next, install the Node.js dependencies for the frontend.
2849

29-
From the inspector folder, run:
50+
```sh
51+
# Navigate to the frontend directory
52+
cd frontend
53+
54+
# Install npm packages
3055
npm install
3156

32-
#### Running the Application
33-
##### Build the frontend.
34-
npm run build
57+
# Go back to the root directory
58+
cd ..
59+
```
60+
61+
### 3. Run the Application
62+
63+
The application requires two processes to run concurrently: the frontend build process (in watch mode) and the backend server.
64+
65+
**In your first terminal**, run the frontend development server. This will build the assets and automatically rebuild them when you make changes.
66+
67+
```sh
68+
# Navigate to the frontend directory
69+
cd frontend
70+
71+
# Build the frontend and watch for changes
72+
npm run build -- --watch
73+
```
74+
75+
**In a second terminal**, run the backend Python server.
76+
77+
```sh
78+
# Navigate to the backend directory
79+
cd backend
3580

81+
# Run the FastAPI server with live reload
3682
uv run app.py
83+
```
3784

85+
### 4. Access the Inspector
3886

39-
#### Access the Inspector
40-
Open your web browser and navigate to:
41-
http://127.0.0.1:5001
87+
Once both processes are running, open your web browser and navigate to:
88+
**[http://127.0.0.1:5001](http://127.0.0.1:5001)**

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "a2a-inspector"
2+
name = "a2a-inspector-workspace"
33
version = "0.1.0"
44
readme = "README.md"
55
requires-python = ">=3.12"
@@ -14,10 +14,17 @@ dependencies = [
1414
"starlette>=0.46.1",
1515
"typing-extensions>=4.12.2",
1616
"uvicorn>=0.34.0",
17+
"python-socketio",
1718
"Flask",
19+
"jinja2",
1820
"flask_cors",
1921
]
2022
[tool.uv.workspace]
21-
members = [
22-
"inspector",
23+
members = ["backend"]
24+
25+
[dependency-groups]
26+
dev = [
27+
"mypy>=1.15.0",
28+
"ruff>=0.11.6",
29+
"types-requests",
2330
]

0 commit comments

Comments
 (0)