# pattern-ai-labs/agentcall architecture

> Architecture diagram of the GitHub repository pattern-ai-labs/agentcall, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pattern-ai-labs/agentcall
- Repository: https://github.com/pattern-ai-labs/agentcall

## Overview

#### Purpose and Integration Surface
`join-meeting` is an AgentCall skill, not a standalone application. It lets coding-agent runtimes join Google Meet, Zoom, or Teams and treat a live meeting as an I/O channel for speech, transcripts, chat, screenshots, avatar video, and screensharing. The primary agent-facing contract is `SKILL.md`; platform packaging is supplied by `.claude-plugin/plugin.json` and `gemini-extension.json`.

#### Runtime Entrypoints
The skill selects either Python 3.10+ or Node.js 18+ scripts. Shell dispatch is centralized in `scripts/run.sh`. Equivalent language implementations expose operational commands:
- Join/control call: `scripts/python/join.py`, `scripts/node/join.js`
- Bidirectional meeting bridge: `scripts/python/bridge.py`, `scripts/node/bridge.js`
- Agent-initiated outbound calls: `scripts/python/agentcall.py`, `scripts/node/agentcall.js`

These subprocesses communicate status, events, and commands through stdout/stdin so a host coding agent can supervise them.

#### Identity, Registration, and Service Boundary
Before calls, registration and API-key handling establish access to AgentCall’s hosted service. `scripts/python/register.py` and `scripts/node/register.js` implement first-run account/key setup; keys persist outside the repository in the user AgentCall configuration. `scripts/python/check_update.py` and `scripts/node/check_update.js` support lifecycle/version checks. AgentCall is the central external service for meeting transport, TTS, transcription, call state, and associated hosted capabilities.

#### Meeting Connection and Event Bridge
`join` creates or reconnects a meeting participant, while `bridge` maintains the long-running live interaction channel. The bridge receives real-time transcript/call events, accepts instructions such as speaking or chat actions, and manages WebSocket reconnection and active-call recovery. Visual-mode variants, `scripts/python/bridge-visual.py` and `scripts/node/bridge-visual.js`, add camera/avatar and presentation-oriented capabilities. The boundary is explicit: agent reasoning remains in the host agent process; media/session operations remain in AgentCall scripts and APIs.

#### Agent Control Loop
A coding agent launches a bridge subprocess, reads emitted events, decides what to say or do using its existing workspace context, then writes commands back to stdin. `scripts/node/stdin-commands.js` is the Node command parser/control layer; Python bridge behavior is exercised through `tests/test_bridge_stdin.py`. This design permits direct agent-controlled speech or collaborative timing through GetSun voice intelligence, without embedding an LLM runtime in this repository.

#### Visual and Presentation Pipeline
Webpage AV modes use hosted/custom webpages as the bot’s camera feed and can screenshare dynamic URLs. Reusable HTML/JS sources are under `ui-templates/`, including `ui-templates/avatar/index.html`, `ui-templates/dashboard/index.html`, and `ui-templates/voice-agent/index.html`. Audio-oriented browser behavior is represented by `ui-templates/agentcall-audio.js`. `scripts/python/tunnel.py` and `scripts/node/tunnel.js` expose local content for meeting-accessible presentation or visual URLs.

#### Operational Patterns and Reference Implementations
The repository documents its protocol and advanced control semantics in `references/api.md`, `references/guides/collaborative-mode.md`, and `references/guides/crash-recovery.md`. Runnable examples demonstrate the intended host-agent orchestration rather than a shared application framework: `examples/meeting-assistant/assistant.py`, `examples/meeting-assistant-smart/assistant.py`, and `examples/coding-companion/bridge.py`. They show how transcript events, voice responses, tools, and persistent coding context combine around the bridge.

Main entry points: [`scripts/python/bridge.py`](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/bridge.py) (Live meeting bridge), [`scripts/run.sh`](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/run.sh) (Runtime dispatcher), [`scripts/python/bridge-visual.py`](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/bridge-visual.py) (Visual bridge), [`scripts/python/tunnel.py`](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/tunnel.py) (Local content tunnel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_contracts["Skill Contract"]
  node_skill["Skill instructions<br/>agent contract<br/>[SKILL.md]"]
  node_packaging["Plugin packaging<br/>extension manifests<br/>[plugin.json]"]
  node_protocol_docs["Protocol reference<br/>API documentation<br/>[api.md]"]
  node_recovery_guide["Recovery guidance<br/>operational guide<br/>[crash-recovery.md]"]
end

subgraph group_runtime["AgentCall Runtime"]
  node_dispatcher["Runtime dispatcher<br/>shell launcher<br/>[run.sh]"]
  node_registration["Registration and updates<br/>account lifecycle<br/>[register.py]"]
  node_join["Join and call control<br/>meeting client<br/>[join.py]"]
  node_bridge["Live meeting bridge<br/>bidirectional bridge<br/>[bridge.py]"]
  node_node_commands["Node stdin commands<br/>command parser<br/>[stdin-commands.js]"]
  node_agentcall["Outbound calling<br/>call initiator<br/>[agentcall.py]"]
end

subgraph group_host["Host Agent Integration"]
  node_host_agent{{"Coding agent<br/>agent runtime"}}
  node_examples["Orchestration examples<br/>reference implementation<br/>[assistant.py]"]
end

subgraph group_visual["Visual Pipeline"]
  node_visual_bridge["Visual bridge<br/>camera and presentation bridge<br/>[bridge-visual.py]"]
  node_tunnel["Local content tunnel<br/>URL exposure<br/>[tunnel.py]"]
  node_avatar_ui["Avatar webpage<br/>camera source<br/>[index.html]"]
  node_dashboard_ui["Dashboard webpage<br/>presentation source<br/>[index.html]"]
end

node_agentcall_service{{"AgentCall hosted service<br/>external meeting service"}}

node_skill -->|"invokes"| node_dispatcher
node_packaging -->|"packages"| node_skill
node_dispatcher -->|"runs setup"| node_registration
node_dispatcher -->|"launches"| node_join
node_dispatcher -->|"launches"| node_bridge
node_dispatcher -->|"launches"| node_agentcall
node_registration -->|"establishes access"| node_agentcall_service
node_join -->|"joins meeting through"| node_agentcall_service
node_bridge -->|"streams events and actions"| node_agentcall_service
node_agentcall -->|"initiates calls through"| node_agentcall_service
node_host_agent -->|"starts subprocess"| node_bridge
node_bridge -->|"stdout events"| node_host_agent
node_host_agent -->|"stdin commands"| node_bridge
node_node_commands -->|"parses Node commands"| node_bridge
node_examples -.->|"demonstrates orchestration"| node_host_agent
node_visual_bridge -->|"extends"| node_bridge
node_visual_bridge -->|"sends visual media"| node_agentcall_service
node_tunnel -->|"provides reachable URLs"| node_visual_bridge
node_avatar_ui -->|"exposes"| node_tunnel
node_dashboard_ui -->|"exposes"| node_tunnel
node_protocol_docs -.->|"documents protocol"| node_bridge
node_recovery_guide -.->|"documents recovery"| node_bridge

click node_skill "https://github.com/pattern-ai-labs/agentcall/blob/main/SKILL.md"
click node_packaging "https://github.com/pattern-ai-labs/agentcall/blob/main/.claude-plugin/plugin.json"
click node_dispatcher "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/run.sh"
click node_registration "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/register.py"
click node_join "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/join.py"
click node_bridge "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/bridge.py"
click node_node_commands "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/node/stdin-commands.js"
click node_agentcall "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/agentcall.py"
click node_examples "https://github.com/pattern-ai-labs/agentcall/blob/main/examples/meeting-assistant/assistant.py"
click node_visual_bridge "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/bridge-visual.py"
click node_tunnel "https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/tunnel.py"
click node_avatar_ui "https://github.com/pattern-ai-labs/agentcall/blob/main/ui-templates/avatar/index.html"
click node_dashboard_ui "https://github.com/pattern-ai-labs/agentcall/blob/main/ui-templates/dashboard/index.html"
click node_protocol_docs "https://github.com/pattern-ai-labs/agentcall/blob/main/references/api.md"
click node_recovery_guide "https://github.com/pattern-ai-labs/agentcall/blob/main/references/guides/crash-recovery.md"

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_skill,node_packaging,node_protocol_docs,node_recovery_guide toneBlue
class node_dispatcher,node_registration,node_join,node_bridge,node_node_commands,node_agentcall toneAmber
class node_host_agent,node_examples toneMint
class node_visual_bridge,node_tunnel,node_avatar_ui,node_dashboard_ui toneRose
class node_agentcall_service toneNeutral
```

## Components

### Skill Contract

- [Skill instructions](https://github.com/pattern-ai-labs/agentcall/blob/main/SKILL.md): agent contract · Primary contract for coding-agent runtimes. · `SKILL.md`
- [Plugin packaging](https://github.com/pattern-ai-labs/agentcall/blob/main/.claude-plugin/plugin.json): extension manifests · `.claude-plugin/plugin.json`
- [Protocol reference](https://github.com/pattern-ai-labs/agentcall/blob/main/references/api.md): API documentation · `references/api.md`
- [Recovery guidance](https://github.com/pattern-ai-labs/agentcall/blob/main/references/guides/crash-recovery.md): operational guide · `references/guides/crash-recovery.md`

### AgentCall Runtime

- [Runtime dispatcher](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/run.sh): shell launcher · Selects Python or Node implementations. · `scripts/run.sh`
- [Registration and updates](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/register.py): account lifecycle · Sets up hosted-service access and checks versions. · `scripts/python/register.py`
- [Join and call control](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/join.py): meeting client · Creates or reconnects a meeting participant. · `scripts/python/join.py`
- [Live meeting bridge](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/bridge.py): bidirectional bridge · Streams call events and accepts agent commands. · `scripts/python/bridge.py`
- [Node stdin commands](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/node/stdin-commands.js): command parser · `scripts/node/stdin-commands.js`
- [Outbound calling](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/agentcall.py): call initiator · `scripts/python/agentcall.py`

### Host Agent Integration

- **Coding agent**: agent runtime · Keeps reasoning and workspace context outside this skill.
- [Orchestration examples](https://github.com/pattern-ai-labs/agentcall/blob/main/examples/meeting-assistant/assistant.py): reference implementation · Shows transcript-driven host-agent control loops. · `examples/meeting-assistant/assistant.py`

### Visual Pipeline

- [Visual bridge](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/bridge-visual.py): camera and presentation bridge · Adds avatar-camera and presentation capabilities. · `scripts/python/bridge-visual.py`
- [Local content tunnel](https://github.com/pattern-ai-labs/agentcall/blob/main/scripts/python/tunnel.py): URL exposure · Makes local visual content reachable from meetings. · `scripts/python/tunnel.py`
- [Avatar webpage](https://github.com/pattern-ai-labs/agentcall/blob/main/ui-templates/avatar/index.html): camera source · `ui-templates/avatar/index.html`
- [Dashboard webpage](https://github.com/pattern-ai-labs/agentcall/blob/main/ui-templates/dashboard/index.html): presentation source · `ui-templates/dashboard/index.html`

### Other components

- **AgentCall hosted service**: external meeting service · Provides meeting transport, media, transcription, TTS, and call state.

## Connections

- Skill instructions → Runtime dispatcher: invokes
- Plugin packaging → Skill instructions: packages
- Runtime dispatcher → Registration and updates: runs setup
- Runtime dispatcher → Join and call control: launches
- Runtime dispatcher → Live meeting bridge: launches
- Runtime dispatcher → Outbound calling: launches
- Registration and updates → AgentCall hosted service: establishes access
- Join and call control → AgentCall hosted service: joins meeting through
- Live meeting bridge → AgentCall hosted service: streams events and actions
- Outbound calling → AgentCall hosted service: initiates calls through
- Coding agent → Live meeting bridge: starts subprocess
- Live meeting bridge → Coding agent: stdout events
- Coding agent → Live meeting bridge: stdin commands
- Node stdin commands → Live meeting bridge: parses Node commands
- Orchestration examples → Coding agent: demonstrates orchestration
- Visual bridge → Live meeting bridge: extends
- Visual bridge → AgentCall hosted service: sends visual media
- Local content tunnel → Visual bridge: provides reachable URLs
- Avatar webpage → Local content tunnel: exposes
- Dashboard webpage → Local content tunnel: exposes
- Protocol reference → Live meeting bridge: documents protocol
- Recovery guidance → Live meeting bridge: documents recovery
