# quantumwake/parley architecture

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

- Interactive diagram: https://gitdiagram.com/quantumwake/parley
- Repository: https://github.com/quantumwake/parley

## Overview

Parley is an enrolled, multi-agent conversation-recording and coordination product. Agent hooks and transcript tailers capture lifecycle, prompts, tools, and assistant text; the daemon pushes those events into conversations that agents and people can read, post to, follow, and coordinate through. The same capabilities are exposed through CLI/MCP, a local browser console, and a terminal UI. The graph follows documented flows and sampled references; some feature-to-plugin internals are unsampled, so those links are documented at the subsystem level.

Main entry points: [`cmd/parley/main.go`](https://github.com/quantumwake/parley/blob/main/cmd/parley/main.go) (Parley CLI), [`pkg/conversation/conversation.go`](https://github.com/quantumwake/parley/blob/main/pkg/conversation/conversation.go) (Conversation operations), [`pkg/capture/push.go`](https://github.com/quantumwake/parley/blob/main/pkg/capture/push.go) (Event pusher), [`pkg/console/console.go`](https://github.com/quantumwake/parley/blob/main/pkg/console/console.go) (Local console API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Capture and ingest"]
  node_hooks["Hook capture<br/>[hooks.go]"]
  node_transcripts["Transcript readers<br/>[transcript.go]"]
  node_daemon["Capture daemon<br/>[daemon.go]"]
  node_pusher["Event pusher<br/>[push.go]"]
  node_spool[("Local event spool<br/>[spool.go]")]
end

subgraph group_domain["Conversation domain"]
  node_event["Event contract<br/>[event.go]"]
  node_plugin["Coordination commands<br/>[shared.go]"]
  node_sessions["Session discovery<br/>[sessions.go]"]
  node_wait["Follow and wait<br/>[wait.go]"]
  node_conversation["Conversation operations<br/>[conversation.go]"]
end

subgraph group_interfaces["Agent and user interfaces"]
  node_binary["Parley CLI<br/>[main.go]"]
  node_setup["Agent setup<br/>[setup.go]"]
  node_mcp["MCP tools<br/>[tools.go]"]
  node_consoleapi["Local console API<br/>[console.go]"]
  node_webapp["Browser console<br/>[App.jsx]"]
  node_webmain["Console entry<br/>[main.jsx]"]
  node_pane["Conversation pane<br/>[Pane.jsx]"]
  node_tui["Terminal UI<br/>[tui.go]"]
end

subgraph group_persistence["Identity and storage"]
  node_enrollment["Enrollment<br/>[enroll.go]"]
  node_store["Store interface<br/>[store.go]"]
  node_statefs[("Statefs adapter<br/>[statefs.go]")]
  node_filestore[("Offline file store<br/>[file.go]")]
end

node_person(("People and admins"))
node_agent(("Agent CLIs"))
node_org(("statefs.ai organization"))

node_person -->|"runs commands"| node_binary
node_agent -->|"registers integration"| node_setup
node_binary -->|"dispatches setup"| node_setup
node_binary -->|"serves MCP"| node_mcp
node_binary -->|"starts console"| node_consoleapi
node_binary -->|"starts TUI"| node_tui
node_person -->|"enrolls identity"| node_enrollment
node_org -->|"issues tokens"| node_enrollment
node_setup -->|"registers hooks and MCP"| node_agent
node_agent -->|"sends lifecycle events"| node_hooks
node_hooks -->|"shares capture path"| node_daemon
node_daemon -->|"tails transcripts"| node_transcripts
node_daemon -.->|"pushes captured events"| node_pusher
node_pusher -->|"drains events"| node_spool
node_pusher -->|"appends events"| node_conversation
node_pusher -->|"prepares events"| node_event
node_conversation -->|"reads and writes"| node_store
node_statefs -->|"implements port"| node_store
node_filestore -->|"implements port"| node_store
node_mcp -->|"calls coordination commands"| node_plugin
node_plugin -->|"uses conversation operations"| node_conversation
node_sessions -->|"queries namespaces"| node_store
node_person -->|"opens viewer"| node_webmain
node_webmain -->|"renders"| node_webapp
node_webapp -->|"shows conversation detail"| node_pane
node_webapp -->|"requests API data"| node_consoleapi
node_consoleapi -->|"reads and posts"| node_conversation
node_consoleapi -->|"uses plugin features"| node_plugin
node_person -->|"uses terminal viewer"| node_tui
node_tui -->|"lists and reads"| node_plugin
node_wait -->|"subscribes to posts"| node_conversation

click node_binary "https://github.com/quantumwake/parley/blob/main/cmd/parley/main.go"
click node_setup "https://github.com/quantumwake/parley/blob/main/cmd/parley/setup.go"
click node_enrollment "https://github.com/quantumwake/parley/blob/main/pkg/enroll/enroll.go"
click node_hooks "https://github.com/quantumwake/parley/blob/main/pkg/capture/hooks.go"
click node_transcripts "https://github.com/quantumwake/parley/blob/main/pkg/capture/transcript.go"
click node_daemon "https://github.com/quantumwake/parley/blob/main/pkg/plugin/daemon.go"
click node_pusher "https://github.com/quantumwake/parley/blob/main/pkg/capture/push.go"
click node_spool "https://github.com/quantumwake/parley/blob/main/pkg/spool/spool.go"
click node_event "https://github.com/quantumwake/parley/blob/main/pkg/event/event.go"
click node_plugin "https://github.com/quantumwake/parley/blob/main/pkg/plugin/shared.go"
click node_sessions "https://github.com/quantumwake/parley/blob/main/pkg/plugin/sessions.go"
click node_wait "https://github.com/quantumwake/parley/blob/main/pkg/plugin/wait.go"
click node_conversation "https://github.com/quantumwake/parley/blob/main/pkg/conversation/conversation.go"
click node_store "https://github.com/quantumwake/parley/blob/main/pkg/store/store.go"
click node_statefs "https://github.com/quantumwake/parley/blob/main/pkg/store/statefs/statefs.go"
click node_filestore "https://github.com/quantumwake/parley/blob/main/pkg/store/file.go"
click node_mcp "https://github.com/quantumwake/parley/blob/main/pkg/mcp/tools.go"
click node_consoleapi "https://github.com/quantumwake/parley/blob/main/pkg/console/console.go"
click node_webapp "https://github.com/quantumwake/parley/blob/main/console/src/App.jsx"
click node_webmain "https://github.com/quantumwake/parley/blob/main/console/src/main.jsx"
click node_pane "https://github.com/quantumwake/parley/blob/main/console/src/Pane.jsx"
click node_tui "https://github.com/quantumwake/parley/blob/main/pkg/tui/tui.go"

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_hooks,node_transcripts,node_daemon,node_pusher,node_spool toneBlue
class node_event,node_plugin,node_sessions,node_wait,node_conversation toneAmber
class node_binary,node_setup,node_mcp,node_consoleapi,node_webapp,node_webmain,node_pane,node_tui toneMint
class node_enrollment,node_store,node_statefs,node_filestore toneRose
class node_person,node_agent,node_org toneIndigo
```

## Components

### Capture and ingest

- [Hook capture](https://github.com/quantumwake/parley/blob/main/pkg/capture/hooks.go): `pkg/capture/hooks.go`
- [Transcript readers](https://github.com/quantumwake/parley/blob/main/pkg/capture/transcript.go): `pkg/capture/transcript.go`
- [Capture daemon](https://github.com/quantumwake/parley/blob/main/pkg/plugin/daemon.go): `pkg/plugin/daemon.go`
- [Event pusher](https://github.com/quantumwake/parley/blob/main/pkg/capture/push.go): `pkg/capture/push.go`
- [Local event spool](https://github.com/quantumwake/parley/blob/main/pkg/spool/spool.go): `pkg/spool/spool.go`

### Conversation domain

- [Event contract](https://github.com/quantumwake/parley/blob/main/pkg/event/event.go): `pkg/event/event.go`
- [Coordination commands](https://github.com/quantumwake/parley/blob/main/pkg/plugin/shared.go): `pkg/plugin/shared.go`
- [Session discovery](https://github.com/quantumwake/parley/blob/main/pkg/plugin/sessions.go): `pkg/plugin/sessions.go`
- [Follow and wait](https://github.com/quantumwake/parley/blob/main/pkg/plugin/wait.go): `pkg/plugin/wait.go`
- [Conversation operations](https://github.com/quantumwake/parley/blob/main/pkg/conversation/conversation.go): `pkg/conversation/conversation.go`

### Agent and user interfaces

- [Parley CLI](https://github.com/quantumwake/parley/blob/main/cmd/parley/main.go): `cmd/parley/main.go`
- [Agent setup](https://github.com/quantumwake/parley/blob/main/cmd/parley/setup.go): `cmd/parley/setup.go`
- [MCP tools](https://github.com/quantumwake/parley/blob/main/pkg/mcp/tools.go): `pkg/mcp/tools.go`
- [Local console API](https://github.com/quantumwake/parley/blob/main/pkg/console/console.go): `pkg/console/console.go`
- [Browser console](https://github.com/quantumwake/parley/blob/main/console/src/App.jsx): `console/src/App.jsx`
- [Console entry](https://github.com/quantumwake/parley/blob/main/console/src/main.jsx): `console/src/main.jsx`
- [Conversation pane](https://github.com/quantumwake/parley/blob/main/console/src/Pane.jsx): `console/src/Pane.jsx`
- [Terminal UI](https://github.com/quantumwake/parley/blob/main/pkg/tui/tui.go): `pkg/tui/tui.go`

### Identity and storage

- [Enrollment](https://github.com/quantumwake/parley/blob/main/pkg/enroll/enroll.go): `pkg/enroll/enroll.go`
- [Store interface](https://github.com/quantumwake/parley/blob/main/pkg/store/store.go): `pkg/store/store.go`
- [Statefs adapter](https://github.com/quantumwake/parley/blob/main/pkg/store/statefs/statefs.go): `pkg/store/statefs/statefs.go`
- [Offline file store](https://github.com/quantumwake/parley/blob/main/pkg/store/file.go): `pkg/store/file.go`

### Other components

- **People and admins**
- **Agent CLIs**
- **statefs.ai organization**

## Connections

- People and admins → Parley CLI: runs commands (evidence: `README.md`)
- Agent CLIs → Agent setup: registers integration (evidence: `README.md`)
- Parley CLI → Agent setup: dispatches setup (evidence: `cmd/parley/main.go`)
- Parley CLI → MCP tools: serves MCP (evidence: `cmd/parley/main.go`)
- Parley CLI → Local console API: starts console (evidence: `cmd/parley/main.go`)
- Parley CLI → Terminal UI: starts TUI (evidence: `cmd/parley/main.go`)
- People and admins → Enrollment: enrolls identity (evidence: `README.md`)
- statefs.ai organization → Enrollment: issues tokens (evidence: `README.md`)
- Agent setup → Agent CLIs: registers hooks and MCP (evidence: `README.md`)
- Agent CLIs → Hook capture: sends lifecycle events (evidence: `README.md`)
- Hook capture → Capture daemon: shares capture path (evidence: `README.md`)
- Capture daemon → Transcript readers: tails transcripts (evidence: `README.md`)
- Capture daemon → Event pusher: pushes captured events
- Event pusher → Local event spool: drains events (evidence: `pkg/capture/push.go`)
- Event pusher → Conversation operations: appends events (evidence: `pkg/capture/push.go`)
- Event pusher → Event contract: prepares events (evidence: `pkg/capture/push.go`)
- Conversation operations → Store interface: reads and writes (evidence: `pkg/conversation/conversation.go`)
- Statefs adapter → Store interface: implements port (evidence: `pkg/store/statefs/statefs.go`)
- Offline file store → Store interface: implements port (evidence: `pkg/store/file.go`)
- MCP tools → Coordination commands: calls coordination commands (evidence: `pkg/mcp/tools.go`)
- Coordination commands → Conversation operations: uses conversation operations
- Session discovery → Store interface: queries namespaces (evidence: `pkg/plugin/sessions.go`)
- People and admins → Console entry: opens viewer (evidence: `README.md`)
- Console entry → Browser console: renders (evidence: `console/src/main.jsx`)
- Browser console → Conversation pane: shows conversation detail (evidence: `console/src/App.jsx`)
- Browser console → Local console API: requests API data (evidence: `README.md`)
- Local console API → Conversation operations: reads and posts (evidence: `pkg/console/console.go`)
- Local console API → Coordination commands: uses plugin features (evidence: `pkg/console/console.go`)
- People and admins → Terminal UI: uses terminal viewer (evidence: `README.md`)
- Terminal UI → Coordination commands: lists and reads (evidence: `pkg/tui/tui.go`)
- Follow and wait → Conversation operations: subscribes to posts (evidence: `pkg/plugin/wait.go`)
