# zakariaelaimani/agent-robot-avatar architecture

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

- Interactive diagram: https://gitdiagram.com/zakariaelaimani/agent-robot-avatar
- Repository: https://github.com/zakariaelaimani/agent-robot-avatar

## Overview

Agent Robot Avatar is a zero-dependency JavaScript Web Component that renders an expressive SVG robot and exposes actions, lifecycle controls, events, and pointer interactions. The main workflow is host application → public module entry → registered custom element → action or runtime behavior → visual state and lifecycle events. Feature modules extend a shared core through an extension host. The README documents additional controls and feedback capabilities; several module-to-module links below are supported by the SOURCE INDEX, but unsampled internals are not inferred.

Main entry points: [`agent-robot-avatar.js`](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/agent-robot-avatar.js) (Public module), [`src/agent-robot-avatar-extension-host.js`](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-extension-host.js) (Extension registry), [`src/agent-robot-avatar-waiting.js`](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-waiting.js) (Waiting states), [`src/agent-robot-avatar-antenna.js`](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-antenna.js) (Antenna motion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Public entry"]
  node_public_module["Public module"]
  node_version["Version export"]
end

subgraph group_engine["Avatar engine"]
  node_extension_host["Extension registry"]
  node_avatar_core["Custom element core"]
  node_runtime["Runtime policies"]
  node_geometry["Head geometry"]
end

subgraph group_actions["Actions and expressions"]
  node_actions_api["Action API"]
  node_waiting["Waiting states"]
  node_failure["Failure feedback"]
  node_inspection["Inspect and review"]
  node_love["Love expression"]
  node_random["Random expression"]
  node_wrap["Wrap waiting view"]
end

subgraph group_interaction["Motion and interaction"]
  node_antenna["Antenna motion"]
  node_antenna_flash["Antenna status flash"]
  node_gestures["Pointer gestures"]
  node_roundness["Head roundness"]
end

node_host_app(("Host application"))

node_host_app -->|"imports component"| node_public_module
node_public_module -->|"imports registry"| node_extension_host
node_public_module -->|"loads extension"| node_actions_api
node_public_module -->|"loads extension"| node_waiting
node_public_module -->|"loads extension"| node_failure
node_public_module -->|"loads extension"| node_inspection
node_public_module -->|"loads extension"| node_love
node_public_module -->|"loads extension"| node_random
node_public_module -->|"loads extension"| node_antenna
node_public_module -->|"loads extension"| node_antenna_flash
node_public_module -->|"loads extension"| node_gestures
node_public_module -->|"loads extension"| node_roundness
node_public_module -->|"loads extension"| node_runtime
node_public_module -->|"imports version"| node_version
node_extension_host -->|"imports core"| node_avatar_core
node_actions_api -->|"registers hooks"| node_extension_host
node_waiting -->|"registers hooks"| node_extension_host
node_failure -->|"registers hooks"| node_extension_host
node_inspection -->|"registers hooks"| node_extension_host
node_love -->|"registers hooks"| node_extension_host
node_random -->|"registers hooks"| node_extension_host
node_antenna -->|"registers hooks"| node_extension_host
node_antenna_flash -->|"registers hooks"| node_extension_host
node_gestures -->|"registers hooks"| node_extension_host
node_roundness -->|"registers hooks"| node_extension_host
node_runtime -->|"imports core interface"| node_extension_host
node_antenna -->|"uses geometry"| node_geometry
node_roundness -->|"uses geometry"| node_geometry
node_waiting -->|"draws variant"| node_wrap

click node_public_module "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/agent-robot-avatar.js"
click node_extension_host "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-extension-host.js"
click node_avatar_core "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-core.js"
click node_runtime "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-runtime.js"
click node_version "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-version.js"
click node_actions_api "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-actions.js"
click node_waiting "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-waiting.js"
click node_failure "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-failure.js"
click node_inspection "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-inspect.js"
click node_love "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-love.js"
click node_random "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-random.js"
click node_antenna "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-antenna.js"
click node_antenna_flash "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-antenna-flash.js"
click node_gestures "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-gestures.js"
click node_roundness "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-head-roundness.js"
click node_geometry "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-geometry.js"
click node_wrap "https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-wrap.js"

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_public_module,node_version toneBlue
class node_extension_host,node_avatar_core,node_runtime,node_geometry toneAmber
class node_actions_api,node_waiting,node_failure,node_inspection,node_love,node_random,node_wrap toneMint
class node_antenna,node_antenna_flash,node_gestures,node_roundness toneRose
class node_host_app toneIndigo
```

## Components

### Public entry

- [Public module](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/agent-robot-avatar.js): `agent-robot-avatar.js`
- [Version export](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-version.js): `src/agent-robot-avatar-version.js`

### Avatar engine

- [Extension registry](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-extension-host.js): `src/agent-robot-avatar-extension-host.js`
- [Custom element core](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-core.js): `src/agent-robot-avatar-core.js`
- [Runtime policies](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-runtime.js): `src/agent-robot-avatar-runtime.js`
- [Head geometry](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-geometry.js): `src/agent-robot-avatar-geometry.js`

### Actions and expressions

- [Action API](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-actions.js): `src/agent-robot-avatar-actions.js`
- [Waiting states](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-waiting.js): `src/agent-robot-avatar-waiting.js`
- [Failure feedback](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-failure.js): `src/agent-robot-avatar-failure.js`
- [Inspect and review](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-inspect.js): `src/agent-robot-avatar-inspect.js`
- [Love expression](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-love.js): `src/agent-robot-avatar-love.js`
- [Random expression](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-random.js): `src/agent-robot-avatar-random.js`
- [Wrap waiting view](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-wrap.js): `src/agent-robot-avatar-wrap.js`

### Motion and interaction

- [Antenna motion](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-antenna.js): `src/agent-robot-avatar-antenna.js`
- [Antenna status flash](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-antenna-flash.js): `src/agent-robot-avatar-antenna-flash.js`
- [Pointer gestures](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-gestures.js): `src/agent-robot-avatar-gestures.js`
- [Head roundness](https://github.com/zakariaelaimani/agent-robot-avatar/blob/main/src/agent-robot-avatar-head-roundness.js): `src/agent-robot-avatar-head-roundness.js`

### Other components

- **Host application**

## Connections

- Host application → Public module: imports component (evidence: `README.md`)
- Public module → Extension registry: imports registry (evidence: `agent-robot-avatar.js`)
- Public module → Action API: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Waiting states: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Failure feedback: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Inspect and review: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Love expression: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Random expression: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Antenna motion: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Antenna status flash: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Pointer gestures: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Head roundness: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Runtime policies: loads extension (evidence: `agent-robot-avatar.js`)
- Public module → Version export: imports version (evidence: `agent-robot-avatar.js`)
- Extension registry → Custom element core: imports core (evidence: `src/agent-robot-avatar-extension-host.js`)
- Action API → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-actions.js`)
- Waiting states → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-waiting.js`)
- Failure feedback → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-failure.js`)
- Inspect and review → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-inspect.js`)
- Love expression → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-love.js`)
- Random expression → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-random.js`)
- Antenna motion → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-antenna.js`)
- Antenna status flash → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-antenna-flash.js`)
- Pointer gestures → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-gestures.js`)
- Head roundness → Extension registry: registers hooks (evidence: `src/agent-robot-avatar-head-roundness.js`)
- Runtime policies → Extension registry: imports core interface (evidence: `src/agent-robot-avatar-runtime.js`)
- Antenna motion → Head geometry: uses geometry (evidence: `src/agent-robot-avatar-antenna.js`)
- Head roundness → Head geometry: uses geometry (evidence: `src/agent-robot-avatar-head-roundness.js`)
- Waiting states → Wrap waiting view: draws variant (evidence: `src/agent-robot-avatar-waiting.js`)
