# v7ren/lane architecture

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

- Interactive diagram: https://gitdiagram.com/v7ren/lane
- Repository: https://github.com/v7ren/lane

## Overview

Loomria is a desktop workspace for running multiple coding-agent TUIs, with manifest-discovered agents, terminal panes, session-aware chat, and supporting editor/review and settings surfaces. The main flow starts in the React app shell, which coordinates panes and sessions; the terminal/session hooks connect UI activity to Tauri operations, while protocol modules support agent-specific events. The README also documents custom TOML agents. Some Rust command wiring and several UI subsystems were not sampled, so their links are omitted or marked unverified rather than inferred.

Main entry points: [`packages/app/src/App.tsx`](https://github.com/v7ren/lane/blob/main/packages/app/src/App.tsx) (Application entry), [`packages/app/src/lib/tauri.ts`](https://github.com/v7ren/lane/blob/main/packages/app/src/lib/tauri.ts) (Tauri client), [`packages/app/src/hooks/useAgentSession.ts`](https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/useAgentSession.ts) (Agent session state), [`packages/app/src/hooks/usePaneRegistry.ts`](https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/usePaneRegistry.ts) (Pane registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["Application entry<br/>[App.tsx]"]
  node_shell["Workspace shell<br/>[AppShell.tsx]"]
end

subgraph group_sessions["Agent sessions"]
  node_agent_view["Agent view<br/>[AgentView.tsx]"]
  node_session_hook["Agent session state<br/>[useAgentSession.ts]"]
  node_session_events["Agent event model<br/>[agent-events.ts]"]
  node_session_rail["Session rail state<br/>[useSessionRail.ts]"]
end

subgraph group_terminal["Terminal runtime"]
  node_pane_registry["Pane registry<br/>[usePaneRegistry.ts]"]
  node_terminal_hook["Terminal lifecycle"]
  node_terminal_runtime["Terminal session"]
  node_terminal_stream["Pane stream<br/>[pane-stream.ts]"]
end

subgraph group_integrations["Agent integrations"]
  node_tauri_client["Tauri client<br/>[tauri.ts]"]
  node_rust_commands["Desktop commands<br/>[commands.rs]"]
  node_agent_catalog["Agent catalog<br/>[catalog.rs]"]
  node_agent_manifest["Manifest loading<br/>[manifest.rs]"]
  node_protocol_hub["Protocol modules<br/>[mod.rs]"]
  node_claude_protocol["Claude streams"]
  node_codex_protocol["Codex events"]
  node_codex_ws["Codex WebSocket<br/>[codex_ws.rs]"]
  node_opencode["OpenCode client<br/>[client.rs]"]
  node_bridge["Session bridge<br/>[bridge.ts]"]
end

subgraph group_workspace["Workspace tools"]
  node_editor["Editor context<br/>[EditorContext.tsx]"]
  node_filesystem["Scoped filesystem<br/>[fs-client.ts]"]
  node_review["Diff review<br/>[ReviewPanel.tsx]"]
  node_settings["Settings storage<br/>[settings.ts]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_shell
node_app -->|"creates"| node_pane_registry
node_app -->|"subscribes"| node_session_rail
node_shell -->|"renders"| node_agent_view
node_shell -->|"uses"| node_pane_registry
node_pane_registry -->|"manages panes"| node_tauri_client
node_pane_registry -->|"creates streams"| node_terminal_stream
node_agent_view -->|"loads session"| node_session_hook
node_session_hook -->|"reduces events"| node_session_events
node_session_hook -->|"loads history"| node_tauri_client
node_session_hook -.->|"optional chat"| node_opencode
node_terminal_hook -->|"mounts"| node_terminal_runtime
node_terminal_hook -->|"resizes and writes"| node_tauri_client
node_protocol_hub -->|"declares module"| node_claude_protocol
node_protocol_hub -->|"declares module"| node_codex_protocol
node_protocol_hub -->|"declares module"| node_codex_ws
node_tauri_client -.->|"invokes commands"| node_rust_commands
node_editor -->|"reads and writes"| node_filesystem
node_review -->|"opens file"| node_editor
node_review -.->|"requests diffs"| node_tauri_client
node_session_rail -->|"subscribes events"| node_bridge
node_app -->|"loads settings"| node_settings
node_agent_catalog -.->|"loads manifests"| node_agent_manifest

click node_app "https://github.com/v7ren/lane/blob/main/packages/app/src/App.tsx"
click node_shell "https://github.com/v7ren/lane/blob/main/packages/app/src/components/shell/AppShell.tsx"
click node_pane_registry "https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/usePaneRegistry.ts"
click node_agent_view "https://github.com/v7ren/lane/blob/main/packages/app/src/components/agent/AgentView.tsx"
click node_session_hook "https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/useAgentSession.ts"
click node_session_events "https://github.com/v7ren/lane/blob/main/packages/app/src/lib/agent-events.ts"
click node_session_rail "https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/useSessionRail.ts"
click node_terminal_hook "https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/useTerminalSession.ts"
click node_terminal_runtime "https://github.com/v7ren/lane/blob/main/packages/app/src/terminal/terminal-session.ts"
click node_terminal_stream "https://github.com/v7ren/lane/blob/main/packages/app/src/terminal/pane-stream.ts"
click node_tauri_client "https://github.com/v7ren/lane/blob/main/packages/app/src/lib/tauri.ts"
click node_rust_commands "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/commands.rs"
click node_agent_catalog "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/agents/catalog.rs"
click node_agent_manifest "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/agents/manifest.rs"
click node_protocol_hub "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/mod.rs"
click node_claude_protocol "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/claude_stream_json.rs"
click node_codex_protocol "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/codex_notifications.rs"
click node_codex_ws "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/codex_ws.rs"
click node_opencode "https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/opencode/client.rs"
click node_editor "https://github.com/v7ren/lane/blob/main/packages/app/src/lib/editor/EditorContext.tsx"
click node_filesystem "https://github.com/v7ren/lane/blob/main/packages/app/src/lib/editor/fs-client.ts"
click node_review "https://github.com/v7ren/lane/blob/main/packages/app/src/components/review/ReviewPanel.tsx"
click node_settings "https://github.com/v7ren/lane/blob/main/packages/app/src/lib/settings.ts"
click node_bridge "https://github.com/v7ren/lane/blob/main/packages/app/src/lib/bridge.ts"

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_app,node_shell,node_user toneBlue
class node_agent_view,node_session_hook,node_session_events,node_session_rail toneAmber
class node_pane_registry,node_terminal_hook,node_terminal_runtime,node_terminal_stream toneMint
class node_tauri_client,node_rust_commands,node_agent_catalog,node_agent_manifest,node_protocol_hub,node_claude_protocol,node_codex_protocol,node_codex_ws,node_opencode,node_bridge toneRose
class node_editor,node_filesystem,node_review,node_settings toneIndigo
```

## Components

### App shell

- [Application entry](https://github.com/v7ren/lane/blob/main/packages/app/src/App.tsx): `packages/app/src/App.tsx`
- [Workspace shell](https://github.com/v7ren/lane/blob/main/packages/app/src/components/shell/AppShell.tsx): `packages/app/src/components/shell/AppShell.tsx`

### Agent sessions

- [Agent view](https://github.com/v7ren/lane/blob/main/packages/app/src/components/agent/AgentView.tsx): `packages/app/src/components/agent/AgentView.tsx`
- [Agent session state](https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/useAgentSession.ts): `packages/app/src/hooks/useAgentSession.ts`
- [Agent event model](https://github.com/v7ren/lane/blob/main/packages/app/src/lib/agent-events.ts): `packages/app/src/lib/agent-events.ts`
- [Session rail state](https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/useSessionRail.ts): `packages/app/src/hooks/useSessionRail.ts`

### Terminal runtime

- [Pane registry](https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/usePaneRegistry.ts): `packages/app/src/hooks/usePaneRegistry.ts`
- [Terminal lifecycle](https://github.com/v7ren/lane/blob/main/packages/app/src/hooks/useTerminalSession.ts): `packages/app/src/hooks/useTerminalSession.ts`
- [Terminal session](https://github.com/v7ren/lane/blob/main/packages/app/src/terminal/terminal-session.ts): `packages/app/src/terminal/terminal-session.ts`
- [Pane stream](https://github.com/v7ren/lane/blob/main/packages/app/src/terminal/pane-stream.ts): `packages/app/src/terminal/pane-stream.ts`

### Agent integrations

- [Tauri client](https://github.com/v7ren/lane/blob/main/packages/app/src/lib/tauri.ts): `packages/app/src/lib/tauri.ts`
- [Desktop commands](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/commands.rs): `packages/app/src-tauri/src/commands.rs`
- [Agent catalog](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/agents/catalog.rs): `packages/app/src-tauri/src/agents/catalog.rs`
- [Manifest loading](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/agents/manifest.rs): `packages/app/src-tauri/src/agents/manifest.rs`
- [Protocol modules](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/mod.rs): `packages/app/src-tauri/src/protocol/mod.rs`
- [Claude streams](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/claude_stream_json.rs): `packages/app/src-tauri/src/protocol/claude_stream_json.rs`
- [Codex events](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/codex_notifications.rs): `packages/app/src-tauri/src/protocol/codex_notifications.rs`
- [Codex WebSocket](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/protocol/codex_ws.rs): `packages/app/src-tauri/src/protocol/codex_ws.rs`
- [OpenCode client](https://github.com/v7ren/lane/blob/main/packages/app/src-tauri/src/opencode/client.rs): `packages/app/src-tauri/src/opencode/client.rs`
- [Session bridge](https://github.com/v7ren/lane/blob/main/packages/app/src/lib/bridge.ts): `packages/app/src/lib/bridge.ts`

### Workspace tools

- [Editor context](https://github.com/v7ren/lane/blob/main/packages/app/src/lib/editor/EditorContext.tsx): `packages/app/src/lib/editor/EditorContext.tsx`
- [Scoped filesystem](https://github.com/v7ren/lane/blob/main/packages/app/src/lib/editor/fs-client.ts): `packages/app/src/lib/editor/fs-client.ts`
- [Diff review](https://github.com/v7ren/lane/blob/main/packages/app/src/components/review/ReviewPanel.tsx): `packages/app/src/components/review/ReviewPanel.tsx`
- [Settings storage](https://github.com/v7ren/lane/blob/main/packages/app/src/lib/settings.ts): `packages/app/src/lib/settings.ts`

### Other components

- **User**

## Connections

- User → Application entry: uses
- Application entry → Workspace shell: renders (evidence: `packages/app/src/App.tsx`)
- Application entry → Pane registry: creates (evidence: `packages/app/src/App.tsx`)
- Application entry → Session rail state: subscribes (evidence: `packages/app/src/App.tsx`)
- Workspace shell → Agent view: renders (evidence: `packages/app/src/components/shell/AppShell.tsx`)
- Workspace shell → Pane registry: uses (evidence: `packages/app/src/components/shell/AppShell.tsx`)
- Pane registry → Tauri client: manages panes (evidence: `packages/app/src/hooks/usePaneRegistry.ts`)
- Pane registry → Pane stream: creates streams (evidence: `packages/app/src/hooks/usePaneRegistry.ts`)
- Agent view → Agent session state: loads session
- Agent session state → Agent event model: reduces events (evidence: `packages/app/src/hooks/useAgentSession.ts`)
- Agent session state → Tauri client: loads history (evidence: `packages/app/src/hooks/useAgentSession.ts`)
- Agent session state → OpenCode client: optional chat (evidence: `packages/app/src/hooks/useAgentSession.ts`)
- Terminal lifecycle → Terminal session: mounts (evidence: `packages/app/src/hooks/useTerminalSession.ts`)
- Terminal lifecycle → Tauri client: resizes and writes (evidence: `packages/app/src/hooks/useTerminalSession.ts`)
- Protocol modules → Claude streams: declares module (evidence: `packages/app/src-tauri/src/protocol/mod.rs`)
- Protocol modules → Codex events: declares module (evidence: `packages/app/src-tauri/src/protocol/mod.rs`)
- Protocol modules → Codex WebSocket: declares module (evidence: `packages/app/src-tauri/src/protocol/mod.rs`)
- Tauri client → Desktop commands: invokes commands
- Editor context → Scoped filesystem: reads and writes (evidence: `packages/app/src/lib/editor/EditorContext.tsx`)
- Diff review → Editor context: opens file (evidence: `packages/app/src/components/review/ReviewPanel.tsx`)
- Diff review → Tauri client: requests diffs
- Session rail state → Session bridge: subscribes events (evidence: `packages/app/src/hooks/useSessionRail.ts`)
- Application entry → Settings storage: loads settings (evidence: `packages/app/src/App.tsx`)
- Agent catalog → Manifest loading: loads manifests
