# azzurroooo/rind architecture

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

- Interactive diagram: https://gitdiagram.com/azzurroooo/rind
- Repository: https://github.com/azzurroooo/rind

## Overview

Rind is a local coding agent whose shared Python worker serves terminal, desktop, browser, and messaging interfaces. The main workflow is user input through a client and runtime protocol into a session turn; the worker builds model context, calls a configured model, executes tools, streams results, and persists session state. Teams add delegated specialist workspaces and handoffs; scripts can also run or send work to sessions. README documentation establishes the shared-worker and client boundaries; sampled source is partial, so uncertain internal call wiring is omitted.

Main entry points: [`agent/runtime/core/turn_runner.py`](https://github.com/azzurroooo/rind/blob/main/agent/runtime/core/turn_runner.py) (Turn execution), [`agent/runtime/server/app_server.py`](https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/app_server.py) (Runtime server), [`agent/runtime/server/session_service.py`](https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/session_service.py) (Session service), [`agent/runtime/server/websocket.py`](https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/websocket.py) (WebSocket transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User interfaces"]
  node_cli["Terminal client"]
  node_desktop["Desktop client<br/>[runtime.ts]"]
  node_web["Browser client<br/>[App.jsx]"]
end

subgraph group_worker["Runtime and sessions"]
  node_app_server["Runtime server<br/>[app_server.py]"]
  node_protocol["Runtime protocol<br/>[protocol.py]"]
  node_session_service["Session service<br/>[session_service.py]"]
  node_turn_runner["Turn execution<br/>[turn_runner.py]"]
  node_websocket["WebSocket transport<br/>[websocket.py]"]
end

subgraph group_execution["Agent execution"]
  node_context["Context builder<br/>[manager.py]"]
  node_provider["Model provider service"]
  node_model_adapters["Model adapters"]
  node_tool_processor["Tool processing<br/>[processor.py]"]
  node_tool_executor["Tool executor<br/>[executor.py]"]
  node_tool_catalog["Built-in tools"]
  node_team["Team delegation<br/>[delegation.py]"]
end

subgraph group_state["Persistent state"]
  node_sessions[("Session history")]
  node_session_index[("Session index")]
  node_task_journal[("Task records<br/>[task_journal.py]")]
end

subgraph group_integrations["External channels"]
  node_gateway["Message gateway<br/>[main.py]"]
  node_channels["Chat channels"]
end

node_user(("User or script"))
node_model_service(("Model provider"))

node_user -->|"enters prompts"| node_cli
node_user -->|"enters prompts"| node_desktop
node_user -->|"enters prompts"| node_web
node_user -->|"sends messages"| node_channels
node_cli -->|"JSONL requests"| node_app_server
node_desktop -->|"launches worker"| node_app_server
node_web -->|"connects"| node_websocket
node_channels -->|"delivers messages"| node_gateway
node_gateway -->|"uses worker"| node_websocket
node_app_server -->|"serves requests"| node_protocol
node_websocket -->|"transports requests"| node_protocol
node_app_server -->|"manages sessions"| node_session_service
node_session_service -->|"loads and saves"| node_sessions
node_session_service -->|"updates index"| node_session_index
node_turn_runner -->|"builds context"| node_context
node_context -->|"reads messages"| node_sessions
node_turn_runner -->|"selects model"| node_provider
node_provider -->|"creates clients"| node_model_adapters
node_model_adapters -->|"model requests"| node_model_service
node_turn_runner -->|"processes tool calls"| node_tool_processor
node_tool_processor -->|"dispatches tools"| node_tool_executor
node_tool_executor -->|"runs tools"| node_tool_catalog
node_tool_catalog -.->|"supports delegation"| node_team
node_team -.->|"records tasks"| node_task_journal
node_turn_runner -->|"persists turn"| node_sessions

click node_cli "https://github.com/azzurroooo/rind/blob/main/frontend-cli/lib/frontend-cli-implementation.js"
click node_desktop "https://github.com/azzurroooo/rind/blob/main/desktop/src/main/runtime.ts"
click node_web "https://github.com/azzurroooo/rind/blob/main/frontend-web/src/App.jsx"
click node_gateway "https://github.com/azzurroooo/rind/blob/main/gateway/main.py"
click node_channels "https://github.com/azzurroooo/rind/tree/main/gateway/channels"
click node_app_server "https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/app_server.py"
click node_protocol "https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/protocol.py"
click node_session_service "https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/session_service.py"
click node_turn_runner "https://github.com/azzurroooo/rind/blob/main/agent/runtime/core/turn_runner.py"
click node_context "https://github.com/azzurroooo/rind/blob/main/agent/application/context/manager.py"
click node_provider "https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/llm/provider_service.py"
click node_model_adapters "https://github.com/azzurroooo/rind/tree/main/agent/infrastructure/llm"
click node_tool_processor "https://github.com/azzurroooo/rind/blob/main/agent/application/tools/processor.py"
click node_tool_executor "https://github.com/azzurroooo/rind/blob/main/agent/application/tools/executor.py"
click node_tool_catalog "https://github.com/azzurroooo/rind/tree/main/agent/infrastructure/tools"
click node_team "https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/team/delegation.py"
click node_sessions "https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/persistence/jsonl_session_store.py"
click node_session_index "https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/persistence/session_index_repository.py"
click node_task_journal "https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/persistence/task_journal.py"
click node_websocket "https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/websocket.py"

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_cli,node_desktop,node_web,node_user toneBlue
class node_app_server,node_protocol,node_session_service,node_turn_runner,node_websocket toneAmber
class node_context,node_provider,node_model_adapters,node_tool_processor,node_tool_executor,node_tool_catalog,node_team toneMint
class node_sessions,node_session_index,node_task_journal toneRose
class node_gateway,node_channels,node_model_service toneIndigo
```

## Components

### User interfaces

- [Terminal client](https://github.com/azzurroooo/rind/blob/main/frontend-cli/lib/frontend-cli-implementation.js): `frontend-cli/lib/frontend-cli-implementation.js`
- [Desktop client](https://github.com/azzurroooo/rind/blob/main/desktop/src/main/runtime.ts): `desktop/src/main/runtime.ts`
- [Browser client](https://github.com/azzurroooo/rind/blob/main/frontend-web/src/App.jsx): `frontend-web/src/App.jsx`

### Runtime and sessions

- [Runtime server](https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/app_server.py): `agent/runtime/server/app_server.py`
- [Runtime protocol](https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/protocol.py): `agent/runtime/server/protocol.py`
- [Session service](https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/session_service.py): `agent/runtime/server/session_service.py`
- [Turn execution](https://github.com/azzurroooo/rind/blob/main/agent/runtime/core/turn_runner.py): `agent/runtime/core/turn_runner.py`
- [WebSocket transport](https://github.com/azzurroooo/rind/blob/main/agent/runtime/server/websocket.py): `agent/runtime/server/websocket.py`

### Agent execution

- [Context builder](https://github.com/azzurroooo/rind/blob/main/agent/application/context/manager.py): `agent/application/context/manager.py`
- [Model provider service](https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/llm/provider_service.py): `agent/infrastructure/llm/provider_service.py`
- [Model adapters](https://github.com/azzurroooo/rind/tree/main/agent/infrastructure/llm): `agent/infrastructure/llm`
- [Tool processing](https://github.com/azzurroooo/rind/blob/main/agent/application/tools/processor.py): `agent/application/tools/processor.py`
- [Tool executor](https://github.com/azzurroooo/rind/blob/main/agent/application/tools/executor.py): `agent/application/tools/executor.py`
- [Built-in tools](https://github.com/azzurroooo/rind/tree/main/agent/infrastructure/tools): `agent/infrastructure/tools`
- [Team delegation](https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/team/delegation.py): `agent/infrastructure/team/delegation.py`

### Persistent state

- [Session history](https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/persistence/jsonl_session_store.py): `agent/infrastructure/persistence/jsonl_session_store.py`
- [Session index](https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/persistence/session_index_repository.py): `agent/infrastructure/persistence/session_index_repository.py`
- [Task records](https://github.com/azzurroooo/rind/blob/main/agent/infrastructure/persistence/task_journal.py): `agent/infrastructure/persistence/task_journal.py`

### External channels

- [Message gateway](https://github.com/azzurroooo/rind/blob/main/gateway/main.py): `gateway/main.py`
- [Chat channels](https://github.com/azzurroooo/rind/tree/main/gateway/channels): `gateway/channels`

### Other components

- **User or script**
- **Model provider**

## Connections

- User or script → Terminal client: enters prompts
- User or script → Desktop client: enters prompts
- User or script → Browser client: enters prompts
- User or script → Chat channels: sends messages
- Terminal client → Runtime server: JSONL requests
- Desktop client → Runtime server: launches worker
- Browser client → WebSocket transport: connects
- Chat channels → Message gateway: delivers messages
- Message gateway → WebSocket transport: uses worker
- Runtime server → Runtime protocol: serves requests
- WebSocket transport → Runtime protocol: transports requests
- Runtime server → Session service: manages sessions
- Session service → Session history: loads and saves
- Session service → Session index: updates index
- Turn execution → Context builder: builds context
- Context builder → Session history: reads messages
- Turn execution → Model provider service: selects model
- Model provider service → Model adapters: creates clients
- Model adapters → Model provider: model requests
- Turn execution → Tool processing: processes tool calls
- Tool processing → Tool executor: dispatches tools
- Tool executor → Built-in tools: runs tools
- Built-in tools → Team delegation: supports delegation
- Team delegation → Task records: records tasks
- Turn execution → Session history: persists turn
