# acrognale/pasture architecture

> Architecture diagram of the GitHub repository acrognale/pasture, 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/acrognale/pasture
- Repository: https://github.com/acrognale/pasture

## Overview

Pasture is a Tauri desktop GUI for Codex, with a web transcript-sharing viewer. The primary workflow is composing a prompt, running and viewing a Codex conversation, then reviewing its output and optionally sending consolidated feedback. Conversation branching, handoff/read-thread, approvals, workspace tools, and generated titles are additional product capabilities. The graph includes the native command layer and sharing backend; source excerpts were limited, so uncertain implementation wiring is omitted.

Main entry points: [`apps/desktop/src/conversation/ConversationPane.tsx`](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/ConversationPane.tsx) (Conversation pane), [`apps/desktop/src/renderer.tsx`](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/renderer.tsx) (Desktop UI), [`apps/desktop/src-tauri/src/commands/registry.rs`](https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/commands/registry.rs) (Native commands), [`apps/web/src/routes/s.$id.tsx`](https://github.com/acrognale/pasture/blob/main/apps/web/src/routes/s.%24id.tsx) (Shared transcript)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop shell"]
  node_desktop_ui["Desktop UI<br/>[renderer.tsx]"]
  node_workspace["Workspace"]
end

subgraph group_conversation["Conversation workflow"]
  node_composer["Prompt composer<br/>[ComposerBar.tsx]"]
  node_conversation_pane["Conversation pane"]
  node_conversation_state["Conversation state<br/>[store.ts]"]
  node_send_message["Message sending<br/>[useSendMessage.ts]"]
  node_codex_client["Codex client<br/>[client.ts]"]
  node_transcript["Transcript rendering"]
  node_branching["Thread management<br/>[threads.rs]"]
  node_handoff_read["Handoff and read<br/>[handoff.rs]"]
  node_approval_ui["Approval handling<br/>[useApprovals.ts]"]
end

subgraph group_review["Review and feedback"]
  node_review_ui["Diff review<br/>[RepoReviewPane.tsx]"]
  node_turn_review["Turn review"]
  node_message_comments["Message comments<br/>[hooks.ts]"]
end

subgraph group_native["Native services"]
  node_native_commands["Native commands<br/>[registry.rs]"]
  node_native_db[("Local database<br/>[init.rs]")]
  node_title_generation["Title generation"]
end

subgraph group_sharing["Transcript sharing"]
  node_share_api["Sharing API<br/>[api.share.tsx]"]
  node_share_db[("Share database<br/>[db.ts]")]
  node_share_viewer["Shared transcript<br/>[s.$id.tsx]"]
  node_web_viewer["Web viewer<br/>[TranscriptView.tsx]"]
end

node_developer(("Developer"))
node_codex_runtime{{"Codex runtime"}}
node_public_reader(("Public reader"))

node_developer -->|"uses"| node_desktop_ui
node_desktop_ui -->|"opens"| node_workspace
node_workspace -->|"selects thread"| node_conversation_pane
node_developer -->|"composes prompt"| node_composer
node_composer -->|"submits"| node_send_message
node_send_message -->|"sends request"| node_codex_client
node_codex_client -->|"communicates"| node_codex_runtime
node_codex_runtime -->|"streams events"| node_codex_client
node_conversation_pane -->|"reads state"| node_conversation_state
node_conversation_state -->|"provides turns"| node_transcript
node_conversation_pane -->|"manages threads"| node_branching
node_conversation_pane -->|"requests context"| node_handoff_read
node_conversation_pane -->|"shows approvals"| node_approval_ui
node_conversation_pane -->|"opens review"| node_review_ui
node_review_ui -->|"selects turn range"| node_turn_review
node_conversation_pane -->|"annotates messages"| node_message_comments
node_desktop_ui -->|"invokes commands"| node_native_commands
node_native_commands -->|"persists state"| node_native_db
node_native_commands -->|"generates titles"| node_title_generation
node_developer -->|"shares transcript"| node_share_api
node_share_api -->|"stores share"| node_share_db
node_public_reader -->|"opens link"| node_share_viewer
node_share_viewer -->|"loads transcript"| node_share_db
node_share_viewer -->|"renders transcript"| node_web_viewer

click node_desktop_ui "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/renderer.tsx"
click node_workspace "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/workspace/WorkspaceProvider.tsx"
click node_composer "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/composer/components/ComposerBar.tsx"
click node_conversation_pane "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/ConversationPane.tsx"
click node_conversation_state "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/store/store.ts"
click node_send_message "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/hooks/useSendMessage.ts"
click node_codex_client "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/codex/client.ts"
click node_transcript "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/components/ConversationTranscriptSection.tsx"
click node_branching "https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/commands/threads.rs"
click node_handoff_read "https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/handoff.rs"
click node_approval_ui "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/approvals/hooks/useApprovals.ts"
click node_review_ui "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/review/RepoReviewPane.tsx"
click node_turn_review "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/review/TurnReviewContext.tsx"
click node_message_comments "https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/comments/hooks.ts"
click node_native_commands "https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/commands/registry.rs"
click node_native_db "https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/db/init.rs"
click node_title_generation "https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/title_generation.rs"
click node_share_api "https://github.com/acrognale/pasture/blob/main/apps/web/src/routes/api.share.tsx"
click node_share_db "https://github.com/acrognale/pasture/blob/main/apps/web/src/lib/db.ts"
click node_share_viewer "https://github.com/acrognale/pasture/blob/main/apps/web/src/routes/s.%24id.tsx"
click node_web_viewer "https://github.com/acrognale/pasture/blob/main/apps/web/src/components/transcript/TranscriptView.tsx"

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_desktop_ui,node_workspace toneBlue
class node_composer,node_conversation_pane,node_conversation_state,node_send_message,node_codex_client,node_transcript,node_branching,node_handoff_read,node_approval_ui toneAmber
class node_review_ui,node_turn_review,node_message_comments toneMint
class node_native_commands,node_native_db,node_title_generation toneRose
class node_share_api,node_share_db,node_share_viewer,node_web_viewer,node_developer,node_codex_runtime,node_public_reader toneIndigo
```

## Components

### Desktop shell

- [Desktop UI](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/renderer.tsx): `apps/desktop/src/renderer.tsx`
- [Workspace](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/workspace/WorkspaceProvider.tsx): `apps/desktop/src/workspace/WorkspaceProvider.tsx`

### Conversation workflow

- [Prompt composer](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/composer/components/ComposerBar.tsx): `apps/desktop/src/composer/components/ComposerBar.tsx`
- [Conversation pane](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/ConversationPane.tsx): `apps/desktop/src/conversation/ConversationPane.tsx`
- [Conversation state](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/store/store.ts): `apps/desktop/src/conversation/store/store.ts`
- [Message sending](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/hooks/useSendMessage.ts): `apps/desktop/src/conversation/hooks/useSendMessage.ts`
- [Codex client](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/codex/client.ts): `apps/desktop/src/codex/client.ts`
- [Transcript rendering](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/components/ConversationTranscriptSection.tsx): `apps/desktop/src/conversation/components/ConversationTranscriptSection.tsx`
- [Thread management](https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/commands/threads.rs): `apps/desktop/src-tauri/src/commands/threads.rs`
- [Handoff and read](https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/handoff.rs): `apps/desktop/src-tauri/src/handoff.rs`
- [Approval handling](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/approvals/hooks/useApprovals.ts): `apps/desktop/src/approvals/hooks/useApprovals.ts`

### Review and feedback

- [Diff review](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/review/RepoReviewPane.tsx): `apps/desktop/src/review/RepoReviewPane.tsx`
- [Turn review](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/review/TurnReviewContext.tsx): `apps/desktop/src/review/TurnReviewContext.tsx`
- [Message comments](https://github.com/acrognale/pasture/blob/main/apps/desktop/src/conversation/comments/hooks.ts): `apps/desktop/src/conversation/comments/hooks.ts`

### Native services

- [Native commands](https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/commands/registry.rs): `apps/desktop/src-tauri/src/commands/registry.rs`
- [Local database](https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/db/init.rs): `apps/desktop/src-tauri/src/db/init.rs`
- [Title generation](https://github.com/acrognale/pasture/blob/main/apps/desktop/src-tauri/src/title_generation.rs): `apps/desktop/src-tauri/src/title_generation.rs`

### Transcript sharing

- [Sharing API](https://github.com/acrognale/pasture/blob/main/apps/web/src/routes/api.share.tsx): `apps/web/src/routes/api.share.tsx`
- [Share database](https://github.com/acrognale/pasture/blob/main/apps/web/src/lib/db.ts): `apps/web/src/lib/db.ts`
- [Shared transcript](https://github.com/acrognale/pasture/blob/main/apps/web/src/routes/s.%24id.tsx): `apps/web/src/routes/s.$id.tsx`
- [Web viewer](https://github.com/acrognale/pasture/blob/main/apps/web/src/components/transcript/TranscriptView.tsx): `apps/web/src/components/transcript/TranscriptView.tsx`

### Other components

- **Developer**
- **Codex runtime**
- **Public reader**

## Connections

- Developer → Desktop UI: uses
- Desktop UI → Workspace: opens
- Workspace → Conversation pane: selects thread
- Developer → Prompt composer: composes prompt
- Prompt composer → Message sending: submits
- Message sending → Codex client: sends request
- Codex client → Codex runtime: communicates
- Codex runtime → Codex client: streams events
- Conversation pane → Conversation state: reads state
- Conversation state → Transcript rendering: provides turns
- Conversation pane → Thread management: manages threads
- Conversation pane → Handoff and read: requests context
- Conversation pane → Approval handling: shows approvals
- Conversation pane → Diff review: opens review
- Diff review → Turn review: selects turn range
- Conversation pane → Message comments: annotates messages
- Desktop UI → Native commands: invokes commands
- Native commands → Local database: persists state
- Native commands → Title generation: generates titles
- Developer → Sharing API: shares transcript
- Sharing API → Share database: stores share
- Public reader → Shared transcript: opens link
- Shared transcript → Share database: loads transcript
- Shared transcript → Web viewer: renders transcript
