### Install dependencies with npm install Source: https://github.com/agentdmai/a2a-simulator/blob/master/README.md Installs project dependencies before running the simulator. ```bash npm install ``` -------------------------------- ### Build and start production server Source: https://github.com/agentdmai/a2a-simulator/blob/master/README.md Builds the client and server, then starts the production server on port 3000 with the agent name "Agent Alpha". The production build serves the React SPA and A2A endpoints from the same Express server on a single port. ```bash npm run build:client npm run build npm start -- --port 3000 --name "Agent Alpha" ``` -------------------------------- ### Run two simulator instances with npm run dev Source: https://github.com/agentdmai/a2a-simulator/blob/master/README.md Starts two simulator instances on different ports with distinct names to test bidirectional communication. Run each command in a separate terminal. ```bash # Terminal 1 npm run dev -- --port 3000 --name "Agent Alpha" # Terminal 2 npm run dev -- --port 3001 --name "Agent Beta" ``` -------------------------------- ### VS Code launch.json for running both agents Source: https://github.com/agentdmai/a2a-simulator/blob/master/README.md VS Code launch configuration to run both agents from the editor. Use the 'Both Agents' compound launch to start both instances at once. ```json { "version": "0.2.0", "configurations": [ { "name": "Agent Alpha (:3000)", "type": "node", "request": "launch", "runtimeExecutable": "npx", "runtimeArgs": ["tsx", "src/server/index.ts", "--port", "3000", "--name", "Agent Alpha"], "console": "integratedTerminal", "skipFiles": ["/**"] }, { "name": "Agent Beta (:3001)", "type": "node", "request": "launch", "runtimeExecutable": "npx", "runtimeArgs": ["tsx", "src/server/index.ts", "--port", "3001", "--name", "Agent Beta"], "console": "integratedTerminal", "skipFiles": ["/**"] } ], "compounds": [ { "name": "Both Agents", "configurations": ["Agent Alpha (:3000)", "Agent Beta (:3001)"] } ] } ``` -------------------------------- ### Project structure for a2a-simulator Source: https://github.com/agentdmai/a2a-simulator/blob/master/README.md Shows the directory layout of the project, separating server and client source files. Use it to understand where each module lives before modifying or extending the codebase. ```text src/ server/ index.ts Entry point, CLI arg parsing app.ts Express app factory executor.ts Bridges incoming A2A messages to the UI reply-handler.ts Handles human replies to pending tasks api-routes.ts REST API for the browser a2a-client.ts Wraps @a2a-js/sdk client for outbound calls sse-bridge.ts SSE connection manager agent-card.ts Agent card builder state.ts In-memory app state client/ App.tsx Root component context/ Connection state (useReducer) hooks/ useSSE, useApi, useRelativeTime components/ All UI components types/ TypeScript interfaces ``` -------------------------------- ### Set public URL for agent card Source: https://github.com/agentdmai/a2a-simulator/blob/master/README.md Sets the public URL for the agent card when running behind a public domain. Use either the PUBLIC_URL environment variable or the --public-url flag; a trailing slash is added automatically if omitted. ```bash PUBLIC_URL=https://alpha.a2a.dev.agentdm.ai npm start -- --port 8080 --name "Agent Alpha" # or npm start -- --port 8080 --name "Agent Alpha" --public-url https://alpha.a2a.dev.agentdm.ai ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.