Skip to content

Commit bec8ef8

Browse files
committed
Replace ASCII architecture diagram with Mermaid chart
1 parent d4dd2e0 commit bec8ef8

1 file changed

Lines changed: 43 additions & 19 deletions

File tree

README.md

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,51 @@ Use `--no-json` for human-readable plain text output.
6969

7070
## Architecture
7171

72-
```
73-
Agent (Claude, Codex, Gemini, etc.)
74-
| shell out
75-
shellwright (CLI binary)
76-
| IPC (Unix socket / Named pipe)
77-
shellwrightd (daemon — session host)
78-
|
79-
Session Manager (lifecycle, naming, lookup)
80-
|
81-
+---------------+
82-
| PTY Session | x N concurrent sessions
83-
+---------------+
84-
| PTY Runner | — portable-pty (Unix + Windows ConPTY)
85-
| VT Parser | — vt100 crate (ANSI strip, screen state)
86-
| Output Ring | — bounded buffer with cursor-based reads
87-
| Prompt Det. | — heuristic prompt detection
88-
| Transcript | — append-only log to disk
89-
+---------------+
72+
```mermaid
73+
graph TB
74+
Agent["AI Agent<br/><i>Claude, Codex, Gemini, etc.</i>"]
75+
CLI["shellwright<br/><i>CLI binary</i>"]
76+
IPC{{"IPC<br/><small>Unix socket / Named pipe</small>"}}
77+
Daemon["shellwrightd<br/><i>daemon</i>"]
78+
SM["Session Manager<br/><small>lifecycle · naming · cleanup</small>"]
79+
80+
Agent -- "shell out" --> CLI
81+
CLI -- "JSON over IPC" --> IPC
82+
IPC --> Daemon
83+
Daemon --> SM
84+
85+
subgraph Sessions ["PTY Sessions (x N concurrent)"]
86+
direction TB
87+
S1["PTY Runner<br/><small>portable-pty · ConPTY · Unix PTY</small>"]
88+
S2["VT Parser<br/><small>vt100 · ANSI strip · screen state</small>"]
89+
S3["Output Ring<br/><small>bounded buffer · cursor reads</small>"]
90+
S4["Prompt Detector<br/><small>15 patterns · calibration · settle</small>"]
91+
S5["Transcript<br/><small>append-only disk log</small>"]
92+
S6["Security<br/><small>danger detection · secret redaction</small>"]
93+
94+
S1 --> S2 --> S3
95+
S2 --> S4
96+
S3 --> S5
97+
S1 --> S6
98+
end
99+
100+
SM --> Sessions
101+
102+
style Agent fill:#4A90D9,color:#fff
103+
style CLI fill:#2D2D2D,color:#fff
104+
style Daemon fill:#2D2D2D,color:#fff
105+
style IPC fill:#F5A623,color:#fff
106+
style SM fill:#7B68EE,color:#fff
107+
style Sessions fill:#1a1a2e,color:#fff
108+
style S1 fill:#333,color:#fff
109+
style S2 fill:#333,color:#fff
110+
style S3 fill:#333,color:#fff
111+
style S4 fill:#333,color:#fff
112+
style S5 fill:#333,color:#fff
113+
style S6 fill:#333,color:#fff
90114
```
91115

92-
The daemon (`shellwrightd`) auto-starts on first `shellwright` command. Sessions persist across agent restarts. Orphaned sessions are cleaned up after a configurable timeout.
116+
The daemon (`shellwrightd`) auto-starts on first `shellwright` command. Sessions persist across agent restarts. Orphaned sessions are cleaned up after a configurable timeout. The daemon self-exits after 10 minutes with no active sessions.
93117

94118
## Key Features
95119

0 commit comments

Comments
 (0)