# ayushi-begin/agora architecture

> Architecture diagram of the GitHub repository ayushi-begin/agora, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ayushi-begin/agora
- Repository: https://github.com/ayushi-begin/agora

## Overview

Agora is a browser-based demo of an agent hiring and payment protocol, with an interactive operations interface. Its principal workflow is mission dispatch: the orchestrator queries agent reputation, selects a specialist, initiates an x402 payment guarded by spending controls, creates a validation artifact, and records an outcome. The implementation is a client-side simulation: the README describes on-chain capabilities, while the sampled protocol code uses in-memory state and simulated receipts. The graph follows documented stages and excerpted calls; unsampled UI wiring and external chain interactions are not inferred.

Main entry points: [`js/app.js`](https://github.com/ayushi-begin/agora/blob/main/js/app.js) (UI coordinator), [`js/orchestrator.js`](https://github.com/ayushi-begin/agora/blob/main/js/orchestrator.js) (Mission orchestrator), [`js/protocol-erc8004.js`](https://github.com/ayushi-begin/agora/blob/main/js/protocol-erc8004.js) (ERC-8004 registry), [`js/data.js`](https://github.com/ayushi-begin/agora/blob/main/js/data.js) (Demo protocol state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Demo interface"]
  node_page["Browser interface<br/>[index.html]"]
  node_app["UI coordinator<br/>[app.js]"]
  node_topology["Topology visualizer<br/>[visualizer.js]"]
  node_audio["Audio feedback<br/>[audio.js]"]
  node_styles["Interface styles<br/>[components.css]"]
end

subgraph group_workflow["Mission workflow"]
  node_orchestrator["Mission orchestrator<br/>[orchestrator.js]"]
  node_validation["Work validation<br/>[orchestrator.js]"]
end

subgraph group_protocols["Trust and payment"]
  node_registry["ERC-8004 registry"]
  node_payments["x402 payment rail<br/>[protocol-x402.js]"]
  node_guardrails["Security guardrails"]
end

subgraph group_state["State and controls"]
  node_state[("Demo protocol state<br/>[data.js]")]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_page
node_page -->|"loads interface"| node_app
node_app -->|"initializes"| node_topology
node_app -->|"dispatches mission"| node_orchestrator
node_app -->|"reads passport"| node_registry
node_app -->|"updates caps"| node_guardrails
node_app -->|"plays feedback"| node_audio
node_app -.->|"uses styling"| node_styles
node_orchestrator -->|"queries candidates"| node_registry
node_orchestrator -->|"executes handshake"| node_payments
node_orchestrator -->|"creates proof"| node_validation
node_orchestrator -.->|"records outcome"| node_registry
node_payments -->|"checks payment"| node_guardrails
node_orchestrator -->|"plays step cues"| node_audio
node_orchestrator -.->|"reads and updates"| node_state
node_registry -.->|"reads and updates"| node_state
node_payments -->|"records payment"| node_state
node_guardrails -->|"records security events"| node_state
node_topology -->|"shows task cycle"| node_operator

click node_page "https://github.com/ayushi-begin/agora/blob/main/index.html"
click node_app "https://github.com/ayushi-begin/agora/blob/main/js/app.js"
click node_topology "https://github.com/ayushi-begin/agora/blob/main/js/visualizer.js"
click node_audio "https://github.com/ayushi-begin/agora/blob/main/js/audio.js"
click node_orchestrator "https://github.com/ayushi-begin/agora/blob/main/js/orchestrator.js"
click node_validation "https://github.com/ayushi-begin/agora/blob/main/js/orchestrator.js"
click node_registry "https://github.com/ayushi-begin/agora/blob/main/js/protocol-erc8004.js"
click node_payments "https://github.com/ayushi-begin/agora/blob/main/js/protocol-x402.js"
click node_guardrails "https://github.com/ayushi-begin/agora/blob/main/js/security-guardrails.js"
click node_state "https://github.com/ayushi-begin/agora/blob/main/js/data.js"
click node_styles "https://github.com/ayushi-begin/agora/blob/main/css/components.css"

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_page,node_app,node_topology,node_audio,node_styles toneBlue
class node_orchestrator,node_validation toneAmber
class node_registry,node_payments,node_guardrails toneMint
class node_state toneRose
class node_operator toneIndigo
```

## Components

### Demo interface

- [Browser interface](https://github.com/ayushi-begin/agora/blob/main/index.html): `index.html`
- [UI coordinator](https://github.com/ayushi-begin/agora/blob/main/js/app.js): `js/app.js`
- [Topology visualizer](https://github.com/ayushi-begin/agora/blob/main/js/visualizer.js): `js/visualizer.js`
- [Audio feedback](https://github.com/ayushi-begin/agora/blob/main/js/audio.js): `js/audio.js`
- [Interface styles](https://github.com/ayushi-begin/agora/blob/main/css/components.css): `css/components.css`

### Mission workflow

- [Mission orchestrator](https://github.com/ayushi-begin/agora/blob/main/js/orchestrator.js): `js/orchestrator.js`
- [Work validation](https://github.com/ayushi-begin/agora/blob/main/js/orchestrator.js): `js/orchestrator.js`

### Trust and payment

- [ERC-8004 registry](https://github.com/ayushi-begin/agora/blob/main/js/protocol-erc8004.js): `js/protocol-erc8004.js`
- [x402 payment rail](https://github.com/ayushi-begin/agora/blob/main/js/protocol-x402.js): `js/protocol-x402.js`
- [Security guardrails](https://github.com/ayushi-begin/agora/blob/main/js/security-guardrails.js): `js/security-guardrails.js`

### State and controls

- [Demo protocol state](https://github.com/ayushi-begin/agora/blob/main/js/data.js): `js/data.js`

### Other components

- **Operator**

## Connections

- Operator → Browser interface: uses (evidence: `README.md`)
- Browser interface → UI coordinator: loads interface (evidence: `README.md`)
- UI coordinator → Topology visualizer: initializes (evidence: `js/app.js`)
- UI coordinator → Mission orchestrator: dispatches mission (evidence: `js/app.js`)
- UI coordinator → ERC-8004 registry: reads passport (evidence: `js/app.js`)
- UI coordinator → Security guardrails: updates caps (evidence: `js/app.js`)
- UI coordinator → Audio feedback: plays feedback (evidence: `js/app.js`)
- UI coordinator → Interface styles: uses styling
- Mission orchestrator → ERC-8004 registry: queries candidates (evidence: `js/orchestrator.js`)
- Mission orchestrator → x402 payment rail: executes handshake (evidence: `js/orchestrator.js`)
- Mission orchestrator → Work validation: creates proof (evidence: `js/orchestrator.js`)
- Mission orchestrator → ERC-8004 registry: records outcome (evidence: `README.md`)
- x402 payment rail → Security guardrails: checks payment (evidence: `js/protocol-x402.js`)
- Mission orchestrator → Audio feedback: plays step cues (evidence: `js/orchestrator.js`)
- Mission orchestrator → Demo protocol state: reads and updates
- ERC-8004 registry → Demo protocol state: reads and updates
- x402 payment rail → Demo protocol state: records payment (evidence: `js/protocol-x402.js`)
- Security guardrails → Demo protocol state: records security events (evidence: `js/security-guardrails.js`)
- Topology visualizer → Operator: shows task cycle (evidence: `js/visualizer.js`)
