# arisros/tmprl architecture

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

- Interactive diagram: https://gitdiagram.com/arisros/tmprl
- Repository: https://github.com/arisros/tmprl

## Overview

tmprl is a keyboard-driven terminal client for inspecting and operating Temporal workflows. A user’s key input enters the TUI event loop and application reducer; the app uses core models and the Temporal client to load workflow lists or histories, inspect payloads, and perform operations, then renders results in panes. The README documents search, saved views, schedules, mutations, codec decoding, splits, and tabs. The graph follows those documented capabilities and the crate layout; wiring within unsampled app and client code is shown only at the documented crate boundaries.

Main entry points: [`crates/tmprl-tui/src/app/mod.rs`](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/mod.rs) (App reducer), [`crates/tmprl-tui/src/app/query.rs`](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/query.rs) (Workflow browsing), [`crates/tmprl-tui/src/app/history.rs`](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/history.rs) (History browsing), [`crates/tmprl-tui/src/main.rs`](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/main.rs) (TUI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_terminal["Terminal interface"]
  node_tui["TUI entry<br/>[main.rs]"]
  node_events["Input loop<br/>[event.rs]"]
  node_render["Terminal rendering<br/>[mod.rs]"]
end

subgraph group_app["Application state"]
  node_appstate["App reducer<br/>[mod.rs]"]
  node_workflowview["Workflow browsing<br/>[query.rs]"]
  node_historyview["History browsing<br/>[history.rs]"]
  node_find["Find workflows<br/>[find.rs]"]
  node_mutations["Workflow actions<br/>[mutate.rs]"]
  node_payloadview["Payload inspection<br/>[payload.rs]"]
end

subgraph group_domain["Workflow domain"]
  node_corequery["Visibility queries<br/>[query.rs]"]
  node_search["On-screen search<br/>[search.rs]"]
  node_historymodel["History model<br/>[history.rs]"]
  node_timeline["Timeline model<br/>[timeline.rs]"]
  node_schedulemodel["Schedule model<br/>[schedule.rs]"]
end

subgraph group_client["Temporal access"]
  node_connection["Connection<br/>[conn.rs]"]
  node_workflowops["Workflow RPCs<br/>[workflow.rs]"]
  node_historyops["History RPCs<br/>[history.rs]"]
  node_scheduleops["Schedule RPCs<br/>[schedule.rs]"]
  node_mutationops["Mutation RPCs<br/>[mutate.rs]"]
  node_codec["Payload codec<br/>[codec.rs]"]
end

subgraph group_layout["Window layout"]
  node_windowtree["Splits and tabs<br/>[tree.rs]"]
  node_layoutapi["Window model<br/>[lib.rs]"]
end

node_user(("Operator"))
node_temporal[("Temporal service")]
node_codecsvc[("Codec server")]

node_user -->|"presses keys"| node_events
node_tui -->|"connects"| node_connection
node_tui -->|"starts app"| node_appstate
node_tui -->|"runs loop"| node_events
node_events -->|"dispatches input"| node_appstate
node_appstate -->|"renders state"| node_render
node_appstate -->|"arranges panes"| node_windowtree
node_windowtree -->|"uses model"| node_layoutapi
node_appstate -->|"dispatches commands"| node_workflowview
node_appstate -->|"dispatches commands"| node_historyview
node_appstate -->|"dispatches commands"| node_find
node_appstate -->|"dispatches commands"| node_mutations
node_appstate -->|"dispatches commands"| node_payloadview
node_workflowview -->|"builds queries"| node_corequery
node_workflowview -->|"loads workflows"| node_workflowops
node_workflowview -->|"loads schedules"| node_scheduleops
node_find -->|"looks up workflows"| node_workflowops
node_find -->|"forms ID query"| node_corequery
node_historyview -->|"loads history"| node_historyops
node_historyview -->|"uses model"| node_historymodel
node_historyview -->|"builds timeline"| node_timeline
node_mutations -->|"sends actions"| node_mutationops
node_payloadview -->|"decodes payloads"| node_codec
node_connection -->|"connects"| node_temporal
node_workflowops -->|"sends RPCs"| node_temporal
node_historyops -->|"reads history"| node_temporal
node_scheduleops -->|"manages schedules"| node_temporal
node_mutationops -->|"mutates workflows"| node_temporal
node_codec -.->|"requests decoding"| node_codecsvc
node_user -->|"searches visible rows"| node_search

click node_tui "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/main.rs"
click node_events "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/event.rs"
click node_render "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/ui/mod.rs"
click node_appstate "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/mod.rs"
click node_workflowview "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/query.rs"
click node_historyview "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/history.rs"
click node_find "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/find.rs"
click node_mutations "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/mutate.rs"
click node_payloadview "https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/payload.rs"
click node_corequery "https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/query.rs"
click node_search "https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/search.rs"
click node_historymodel "https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/history.rs"
click node_timeline "https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/timeline.rs"
click node_schedulemodel "https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/schedule.rs"
click node_connection "https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/conn.rs"
click node_workflowops "https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/workflow.rs"
click node_historyops "https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/history.rs"
click node_scheduleops "https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/schedule.rs"
click node_mutationops "https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/mutate.rs"
click node_codec "https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/codec.rs"
click node_windowtree "https://github.com/arisros/tmprl/blob/main/crates/tmprl-ui/src/tree.rs"
click node_layoutapi "https://github.com/arisros/tmprl/blob/main/crates/tmprl-ui/src/lib.rs"

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_tui,node_events,node_render toneBlue
class node_appstate,node_workflowview,node_historyview,node_find,node_mutations,node_payloadview,node_temporal,node_codecsvc toneAmber
class node_corequery,node_search,node_historymodel,node_timeline,node_schedulemodel toneMint
class node_connection,node_workflowops,node_historyops,node_scheduleops,node_mutationops,node_codec toneRose
class node_windowtree,node_layoutapi,node_user toneIndigo
```

## Components

### Terminal interface

- [TUI entry](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/main.rs): `crates/tmprl-tui/src/main.rs`
- [Input loop](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/event.rs): `crates/tmprl-tui/src/event.rs`
- [Terminal rendering](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/ui/mod.rs): `crates/tmprl-tui/src/ui/mod.rs`

### Application state

- [App reducer](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/mod.rs): `crates/tmprl-tui/src/app/mod.rs`
- [Workflow browsing](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/query.rs): `crates/tmprl-tui/src/app/query.rs`
- [History browsing](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/history.rs): `crates/tmprl-tui/src/app/history.rs`
- [Find workflows](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/find.rs): `crates/tmprl-tui/src/app/find.rs`
- [Workflow actions](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/mutate.rs): `crates/tmprl-tui/src/app/mutate.rs`
- [Payload inspection](https://github.com/arisros/tmprl/blob/main/crates/tmprl-tui/src/app/payload.rs): `crates/tmprl-tui/src/app/payload.rs`

### Workflow domain

- [Visibility queries](https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/query.rs): `crates/tmprl-core/src/query.rs`
- [On-screen search](https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/search.rs): `crates/tmprl-core/src/search.rs`
- [History model](https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/history.rs): `crates/tmprl-core/src/history.rs`
- [Timeline model](https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/timeline.rs): `crates/tmprl-core/src/timeline.rs`
- [Schedule model](https://github.com/arisros/tmprl/blob/main/crates/tmprl-core/src/schedule.rs): `crates/tmprl-core/src/schedule.rs`

### Temporal access

- [Connection](https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/conn.rs): `crates/tmprl-client/src/conn.rs`
- [Workflow RPCs](https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/workflow.rs): `crates/tmprl-client/src/ops/workflow.rs`
- [History RPCs](https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/history.rs): `crates/tmprl-client/src/ops/history.rs`
- [Schedule RPCs](https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/schedule.rs): `crates/tmprl-client/src/ops/schedule.rs`
- [Mutation RPCs](https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/mutate.rs): `crates/tmprl-client/src/ops/mutate.rs`
- [Payload codec](https://github.com/arisros/tmprl/blob/main/crates/tmprl-client/src/ops/codec.rs): `crates/tmprl-client/src/ops/codec.rs`

### Window layout

- [Splits and tabs](https://github.com/arisros/tmprl/blob/main/crates/tmprl-ui/src/tree.rs): `crates/tmprl-ui/src/tree.rs`
- [Window model](https://github.com/arisros/tmprl/blob/main/crates/tmprl-ui/src/lib.rs): `crates/tmprl-ui/src/lib.rs`

### Other components

- **Operator**
- **Temporal service**
- **Codec server**

## Connections

- Operator → Input loop: presses keys
- TUI entry → Connection: connects
- TUI entry → App reducer: starts app
- TUI entry → Input loop: runs loop
- Input loop → App reducer: dispatches input
- App reducer → Terminal rendering: renders state
- App reducer → Splits and tabs: arranges panes
- Splits and tabs → Window model: uses model
- App reducer → Workflow browsing: dispatches commands
- App reducer → History browsing: dispatches commands
- App reducer → Find workflows: dispatches commands
- App reducer → Workflow actions: dispatches commands
- App reducer → Payload inspection: dispatches commands
- Workflow browsing → Visibility queries: builds queries
- Workflow browsing → Workflow RPCs: loads workflows
- Workflow browsing → Schedule RPCs: loads schedules
- Find workflows → Workflow RPCs: looks up workflows
- Find workflows → Visibility queries: forms ID query
- History browsing → History RPCs: loads history
- History browsing → History model: uses model
- History browsing → Timeline model: builds timeline
- Workflow actions → Mutation RPCs: sends actions
- Payload inspection → Payload codec: decodes payloads
- Connection → Temporal service: connects
- Workflow RPCs → Temporal service: sends RPCs
- History RPCs → Temporal service: reads history
- Schedule RPCs → Temporal service: manages schedules
- Mutation RPCs → Temporal service: mutates workflows
- Payload codec → Codec server: requests decoding
- Operator → On-screen search: searches visible rows
