Skip to content

Commit 13146fe

Browse files
authored
Merge branch 'main' into feature/transcription-cancel-button
2 parents 3ed424c + 1526ce1 commit 13146fe

54 files changed

Lines changed: 2310 additions & 171 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: app-server-events-sync
3+
description: Maintain CodexMonitor and Codex app-server protocol parity. Use when asked to audit supported or missing app-server notifications/requests, trace event routing, diagnose schema drift in app-server payloads, or update docs/app-server-events.md after upstream Codex changes.
4+
---
5+
6+
# App-Server Events Sync
7+
8+
Use this skill to keep CodexMonitor app-server integration accurate as `../Codex` evolves.
9+
10+
## Canonical Source
11+
12+
Start with:
13+
- `docs/app-server-events.md`
14+
15+
Treat that file as the canonical runbook and update it when behavior changes.
16+
17+
## Workflow
18+
19+
1. Confirm upstream baseline:
20+
- Read Codex hash from `../Codex` and update the hash in `docs/app-server-events.md` title.
21+
22+
2. Compare notification methods:
23+
- Diff Codex v2 notification method set against CodexMonitor routing in `src/utils/appServerEvents.ts` and `src/features/app/hooks/useAppServerEvents.ts`.
24+
- Update `Supported Events` and `Missing Events` sections in `docs/app-server-events.md`.
25+
26+
3. Compare request methods:
27+
- Diff Codex v2 client/server request sets against CodexMonitor outgoing and inbound handling.
28+
- Update `Supported Requests`, `Missing Client Requests`, and `Server Requests` sections.
29+
30+
4. Investigate schema drift when lists look unchanged:
31+
- Inspect v2 payload structs in `../Codex/codex-rs/app-server-protocol/src/protocol/v2.rs`.
32+
- Compare parser and normalization edges in `src/utils/appServerEvents.ts`, `src/features/app/hooks/useAppServerEvents.ts`, and `src/features/threads/utils/threadNormalize.ts`.
33+
34+
5. Implement support when requested:
35+
- Add method/type support at parsing edges first.
36+
- Route in app event hook.
37+
- Update thread/item reducers and rendering only if needed.
38+
- Keep app/daemon parity and avoid duplicated logic.
39+
40+
6. Validate:
41+
- Run targeted tests for touched files.
42+
- Run `npm run typecheck`.
43+
- Run `npm run test` for frontend behavior changes.
44+
- Run `cd src-tauri && cargo check` for backend changes.
45+
46+
## Key Files
47+
48+
- Routing/types: `src/utils/appServerEvents.ts`
49+
- Event router: `src/features/app/hooks/useAppServerEvents.ts`
50+
- Handler composition: `src/features/threads/hooks/useThreadEventHandlers.ts`
51+
- Item/turn handlers: `src/features/threads/hooks/useThreadItemEvents.ts`, `src/features/threads/hooks/useThreadTurnEvents.ts`
52+
- Normalization: `src/features/threads/utils/threadNormalize.ts`
53+
- State: `src/features/threads/hooks/useThreadsReducer.ts`
54+
- Outgoing requests: `src/services/tauri.ts`, `src-tauri/src/shared/codex_core.rs`
55+
- Daemon RPC: `src-tauri/src/bin/codex_monitor_daemon/rpc.rs` and `rpc/*`
56+
57+
## References
58+
59+
- Quick command set: `references/quick-commands.md`
60+
- Canonical runbook: `docs/app-server-events.md`
61+
62+
## Output Expectations
63+
64+
When asked for an audit or update:
65+
- Report concrete supported and missing method deltas.
66+
- Cite exact files that need edits.
67+
- Update `docs/app-server-events.md` in the same change when behavior changed.
68+
- Call out deliberate non-support explicitly (for example deprecated methods).
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "App-Server Events Sync"
3+
short_description: "Audit CodexMonitor app-server event parity"
4+
default_prompt: "Use $app-server-events-sync to compare CodexMonitor routing and requests against ../Codex and update docs/app-server-events.md."
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Quick Commands
2+
3+
Use these from repo root.
4+
5+
## Baseline
6+
7+
```bash
8+
git -C ../Codex rev-parse HEAD
9+
```
10+
11+
## Notifications
12+
13+
```bash
14+
(rg -N -o '=>\s*"[^"]+"\s*\(v2::[^)]*Notification\)' ../Codex/codex-rs/app-server-protocol/src/protocol/common.rs | sed -E 's/.*"([^"]+)".*/\1/'; printf '%s\n' 'account/login/completed') | sort -u
15+
rg -n "SUPPORTED_APP_SERVER_METHODS" src/utils/appServerEvents.ts
16+
```
17+
18+
## Requests
19+
20+
```bash
21+
awk '/client_request_definitions! \{/,/\/\/\/ DEPRECATED APIs below/' ../Codex/codex-rs/app-server-protocol/src/protocol/common.rs | rg -N -o '=>\s*"[^"]+"\s*\{' | sed -E 's/.*"([^"]+)".*/\1/' | sort -u
22+
awk '/server_request_definitions! \{/,/\/\/\/ DEPRECATED APIs below/' ../Codex/codex-rs/app-server-protocol/src/protocol/common.rs | rg -N -o '=>\s*"[^"]+"\s*\{' | sed -E 's/.*"([^"]+)".*/\1/' | sort -u
23+
perl -0777 -ne 'while(/send_request\(\s*"([^"]+)"/g){print "$1\n"}' $(rg --files src-tauri/src -g '*.rs') | sort -u
24+
```
25+
26+
## Schema Drift
27+
28+
```bash
29+
rg -n "struct .*Notification" ../Codex/codex-rs/app-server-protocol/src/protocol/v2.rs
30+
rg -n "enum ThreadItem|CommandExecution|FileChange|McpToolCall|EnteredReviewMode|ExitedReviewMode|ContextCompaction" ../Codex/codex-rs/app-server-protocol/src/protocol/v2.rs
31+
```

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ public/assets/material-icons/
3636

3737
# Nix
3838
result
39+
skills-lock.json

docs/app-server-events.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# App-Server Events Reference (Codex `8e9312958d9c71fa8850605852595754bb522fed`)
1+
# App-Server Events Reference (Codex `9501669a2485969a78b8bdea3da4b3b2a626e0d3`)
22

33
This document helps agents quickly answer:
44
- Which app-server events CodexMonitor supports right now.
@@ -13,6 +13,9 @@ When updating this document:
1313
4. Compare Codex server request methods vs CodexMonitor inbound request handling.
1414
5. Update supported and missing lists below.
1515

16+
Related project skill:
17+
- `.codex/skills/app-server-events-sync/SKILL.md`
18+
1619
## Where To Look In CodexMonitor
1720

1821
Primary app-server event source of truth (methods + typed parsing helpers):

src-tauri/capabilities/default.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"window-state:default",
1717
"liquid-glass:default",
1818
"notification:default",
19+
"core:window:allow-close",
20+
"core:window:allow-is-maximized",
21+
"core:window:allow-minimize",
22+
"core:window:allow-toggle-maximize",
1923
"core:window:allow-set-effects",
2024
"core:window:allow-start-dragging"
2125
]

0 commit comments

Comments
 (0)