Skip to content

Commit 9faec52

Browse files
committed
docs: add bilingual Codex guides and improve GitHub documentation
1 parent da23902 commit 9faec52

8 files changed

Lines changed: 270 additions & 270 deletions

‎README.md‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,24 +167,24 @@ Process identity, PID/parent relationships, and creation-time validation belong
167167

168168
## 4. Runtime Overview
169169

170-
```mermaid
171-
flowchart LR
172-
U[Lark User] --> B[lark-channel-bridge]
173-
B --> S[Lark scope / Session binding]
174-
S --> C[Codex CLI]
175-
176-
W[Windows Terminal / codex3] --> C2[Codex CLI]
177-
C2 --> R[Codex rollout JSONL]
178-
179-
A[Attach-CodexObserver.ps1] --> R
180-
A --> O[Watch-CodexSession.ps1]
181-
A --> RA[Watch-CodexRelease.ps1]
182-
183-
O --> M[.codex-monitor/status]
184-
RA --> Q[release request/result]
185-
186-
B --> M
187-
B --> Q
170+
```mermaid
171+
flowchart LR
172+
U["Lark User"] --> B["lark-channel-bridge"]
173+
B --> S["Lark scope / Session binding"]
174+
S --> C["Codex CLI"]
175+
176+
W["Windows Terminal / codex3"] --> C2["Codex CLI"]
177+
C2 --> R["Codex rollout JSONL"]
178+
179+
A["Attach-CodexObserver.ps1"] --> R
180+
A --> O["Watch-CodexSession.ps1"]
181+
A --> RA["Watch-CodexRelease.ps1"]
182+
183+
O --> M[".codex-monitor/status"]
184+
RA --> Q["release request/result"]
185+
186+
B --> M
187+
B --> Q
188188
```
189189

190190
See [local-docs/02-lark-bridge-codex-architecture.md](./local-docs/02-lark-bridge-codex-architecture.md) for details.

‎README.zh-CN.md‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -181,24 +181,24 @@ Release-CodexSession.ps1
181181

182182
## 4. 运行机制概览
183183

184-
```mermaid
185-
flowchart LR
186-
U[Lark User] --> B[lark-channel-bridge]
187-
B --> S[Lark scope / Session binding]
188-
S --> C[Codex CLI]
189-
190-
W[Windows Terminal / codex3] --> C2[Codex CLI]
191-
C2 --> R[Codex rollout JSONL]
192-
193-
A[Attach-CodexObserver.ps1] --> R
194-
A --> O[Watch-CodexSession.ps1]
195-
A --> RA[Watch-CodexRelease.ps1]
196-
197-
O --> M[.codex-monitor/status]
198-
RA --> Q[release request/result]
199-
200-
B --> M
201-
B --> Q
184+
```mermaid
185+
flowchart LR
186+
U["Lark User"] --> B["lark-channel-bridge"]
187+
B --> S["Lark scope / Session binding"]
188+
S --> C["Codex CLI"]
189+
190+
W["Windows Terminal / codex3"] --> C2["Codex CLI"]
191+
C2 --> R["Codex rollout JSONL"]
192+
193+
A["Attach-CodexObserver.ps1"] --> R
194+
A --> O["Watch-CodexSession.ps1"]
195+
A --> RA["Watch-CodexRelease.ps1"]
196+
197+
O --> M[".codex-monitor/status"]
198+
RA --> Q["release request/result"]
199+
200+
B --> M
201+
B --> Q
202202
```
203203

204204
更详细的原理见:

‎local-docs/01-codex-third-party-api-key.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ thread index
3030
other local Codex state
3131
```
3232

33-
```mermaid
34-
flowchart LR
35-
PS[PowerShell] --> C3[codex3 wrapper]
36-
C3 --> CH[CODEX_HOME=.codex-cli-thirdparty]
37-
CH --> CFG[config.toml]
38-
CFG --> P[Third-party Provider]
39-
P --> API[Responses-compatible API]
33+
```mermaid
34+
flowchart LR
35+
PS["PowerShell"] --> C3["codex3 wrapper"]
36+
C3 --> CH["CODEX_HOME=.codex-cli-thirdparty"]
37+
CH --> CFG["config.toml"]
38+
CFG --> P["Third-party Provider"]
39+
P --> API["Responses-compatible API"]
4040
```
4141

4242
---

‎local-docs/01-codex-third-party-api-key.zh-CN.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ Third-party Codex
3030

3131
逻辑如下:
3232

33-
```mermaid
34-
flowchart LR
35-
PS[PowerShell] --> C3[codex3 wrapper]
36-
C3 --> CH[CODEX_HOME=.codex-cli-thirdparty]
37-
CH --> CFG[config.toml]
38-
CFG --> P[Third-party Provider]
39-
P --> API[Responses-compatible API]
33+
```mermaid
34+
flowchart LR
35+
PS["PowerShell"] --> C3["codex3 wrapper"]
36+
C3 --> CH["CODEX_HOME=.codex-cli-thirdparty"]
37+
CH --> CFG["config.toml"]
38+
CFG --> P["Third-party Provider"]
39+
P --> API["Responses-compatible API"]
4040
```
4141

4242
---

‎local-docs/02-lark-bridge-codex-architecture.md‎

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ It observes already-running Windows Codex sessions and provides safe writer rele
5555

5656
## 2. Normal Lark → Codex Flow
5757

58-
```mermaid
59-
sequenceDiagram
60-
participant U as User
61-
participant L as Lark
62-
participant B as lark-channel-bridge
63-
participant S as Session Store
64-
participant C as Codex CLI
65-
66-
U->>L: normal message
67-
L->>B: message event
68-
B->>S: resolve scope cwd/sessionId
69-
B->>C: start/resume Codex
70-
C-->>B: stream/result
71-
B-->>L: card/markdown
72-
L-->>U: response
58+
```mermaid
59+
sequenceDiagram
60+
participant U as "User"
61+
participant L as "Lark"
62+
participant B as "lark-channel-bridge"
63+
participant S as "Session Store"
64+
participant C as "Codex CLI"
65+
66+
U->>L: normal message
67+
L->>B: message event
68+
B->>S: resolve scope cwd/sessionId
69+
B->>C: start/resume Codex
70+
C-->>B: stream/result
71+
B-->>L: card/markdown
72+
L-->>U: response
7373
```
7474

7575
---
@@ -163,17 +163,17 @@ Release only the Codex writer.
163163

164164
## 6. Attach Lifecycle
165165

166-
```mermaid
167-
flowchart TD
168-
A[codex3 starts] --> B[Record LaunchId/CWD/owner PID]
169-
B --> C[Find Codex process]
170-
C --> D[Wait for matching session/rollout]
171-
D --> E[Claim Session]
172-
E --> F[Start Observer]
173-
E --> G[Start Release Agent]
174-
F --> H[status-SessionId.json]
175-
G --> I[Wait for release requests]
176-
E --> J[launch mapping]
166+
```mermaid
167+
flowchart TD
168+
A["codex3 starts"] --> B["Record LaunchId/CWD/owner PID"]
169+
B --> C["Find Codex process"]
170+
C --> D["Wait for matching session/rollout"]
171+
D --> E["Claim Session"]
172+
E --> F["Start Observer"]
173+
E --> G["Start Release Agent"]
174+
F --> H["status-SessionId.json"]
175+
G --> I["Wait for release requests"]
176+
E --> J["launch mapping"]
177177
```
178178

179179
A newly opened Codex TUI may exist before a persistent rollout/session has been created. Such a process is best considered a **Pending Launch**, not yet a fully discovered session.
@@ -221,23 +221,23 @@ Watch-CodexRelease.ps1
221221

222222
The bridge does not directly kill the Windows Codex process. Instead it submits a local request:
223223

224-
```mermaid
225-
sequenceDiagram
226-
participant L as Lark Bridge
227-
participant R as Request-CodexRelease.ps1
228-
participant Q as Request JSON
229-
participant A as Watch-CodexRelease.ps1
230-
participant X as Release-CodexSession.ps1
231-
participant C as Codex Writer
232-
233-
L->>R: release Session
234-
R->>Q: write request
235-
A->>Q: consume request
236-
A->>X: validate target
237-
X->>C: terminate writer
238-
X-->>A: RELEASED / ERROR
239-
A-->>R: result JSON
240-
R-->>L: OK|RELEASED|...
224+
```mermaid
225+
sequenceDiagram
226+
participant L as "Lark Bridge"
227+
participant R as "Request-CodexRelease.ps1"
228+
participant Q as "Request JSON"
229+
participant A as "Watch-CodexRelease.ps1"
230+
participant X as "Release-CodexSession.ps1"
231+
participant C as "Codex Writer"
232+
233+
L->>R: release Session
234+
R->>Q: write request
235+
A->>Q: consume request
236+
A->>X: validate target
237+
X->>C: terminate writer
238+
X-->>A: RELEASED / ERROR
239+
A-->>R: result JSON
240+
R-->>L: OK|RELEASED|...
241241
```
242242

243243
The PowerShell layer performs the authoritative safety validation.
@@ -280,19 +280,19 @@ attachedAt
280280
/local-handoff <Thread-name-or-Session-ID-prefix>
281281
```
282282

283-
```mermaid
284-
flowchart TD
285-
A[/local-handoff] --> B[Resolve unique Session]
286-
B --> C{Bound to another Lark scope?}
287-
C -- Yes --> X[Reject: handback from original scope]
288-
C -- No --> D{Windows session busy?}
289-
D -- Yes --> Y[Reject: wait for current turn]
290-
D -- No --> E[Request-CodexRelease]
291-
E --> F{PowerShell release successful?}
292-
F -- No --> Z[Do not alter Lark binding]
293-
F -- Yes --> G[Set scope cwd]
294-
G --> H[Set scope sessionId]
295-
H --> I[Next normal Lark message resumes the same Session]
283+
```mermaid
284+
flowchart TD
285+
A["/local-handoff"] --> B["Resolve unique Session"]
286+
B --> C{"Bound to another Lark scope?"}
287+
C -- Yes --> X["Reject: handback from original scope"]
288+
C -- No --> D{"Windows session busy?"}
289+
D -- Yes --> Y["Reject: wait for current turn"]
290+
D -- No --> E["Request-CodexRelease"]
291+
E --> F{"PowerShell release successful?"}
292+
F -- No --> Z["Do not alter Lark binding"]
293+
F -- Yes --> G["Set scope cwd"]
294+
G --> H["Set scope sessionId"]
295+
H --> I["Next normal Lark message resumes the same Session"]
296296
```
297297

298298
The order must be:

0 commit comments

Comments
 (0)