Skip to content

Commit 3b2904b

Browse files
authored
Merge branch 'main' into fix/mobile-remote-paths-tilde-recents
2 parents f82c39b + 0e9ceef commit 3b2904b

44 files changed

Lines changed: 1610 additions & 371 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+
```

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ jobs:
9090
TAURI_SIGNING_PRIVATE_KEY="$(cat "$HOME/.tauri/codexmonitor.key")"
9191
npm run tauri -- build --bundles app
9292
93+
- name: Build daemon binaries
94+
run: |
95+
set -euo pipefail
96+
cd src-tauri
97+
cargo build --release --bin codex_monitor_daemon --bin codex_monitor_daemonctl
98+
9399
- name: Bundle OpenSSL and re-sign
94100
run: |
95101
set -euo pipefail

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):

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codex-monitor",
33
"private": true,
4-
"version": "0.7.58",
4+
"version": "0.7.59",
55
"type": "module",
66
"scripts": {
77
"sync:material-icons": "node scripts/sync-material-icons.mjs",

scripts/build_run_ios_device.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,17 @@ fi
205205

206206
if [[ "$SKIP_BUILD" -eq 0 ]]; then
207207
sync_ios_icons
208+
BUILD_CMD=("$NPM_BIN" run tauri -- ios build -d -t "$TARGET")
209+
if [[ ${#TAURI_CONFIG_ARGS[@]} -gt 0 ]]; then
210+
BUILD_CMD+=("${TAURI_CONFIG_ARGS[@]}")
211+
fi
208212
if [[ "$OPEN_XCODE" -eq 1 ]]; then
209-
"$NPM_BIN" run tauri -- ios build -d -t "$TARGET" "${TAURI_CONFIG_ARGS[@]}" --open
213+
BUILD_CMD+=(--open)
214+
"${BUILD_CMD[@]}"
210215
exit 0
211216
fi
212-
"$NPM_BIN" run tauri -- ios build -d -t "$TARGET" "${TAURI_CONFIG_ARGS[@]}" --ci
217+
BUILD_CMD+=(--ci)
218+
"${BUILD_CMD[@]}"
213219
fi
214220

215221
APP_PATH="src-tauri/gen/apple/build/arm64/Codex Monitor.app"

scripts/macos-fix-openssl.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,29 @@ frameworks_dir="${app_path}/Contents/Frameworks"
4747
bin_path="${app_path}/Contents/MacOS/codex-monitor"
4848
daemon_path="${app_path}/Contents/MacOS/codex_monitor_daemon"
4949
daemonctl_path="${app_path}/Contents/MacOS/codex_monitor_daemonctl"
50+
daemon_source="${DAEMON_BINARY_PATH:-src-tauri/target/release/codex_monitor_daemon}"
51+
daemonctl_source="${DAEMONCTL_BINARY_PATH:-src-tauri/target/release/codex_monitor_daemonctl}"
52+
53+
copy_if_missing() {
54+
local source_path="$1"
55+
local destination_path="$2"
56+
local label="$3"
57+
58+
if [[ -f "${destination_path}" ]]; then
59+
return
60+
fi
61+
62+
if [[ -f "${source_path}" ]]; then
63+
cp -f "${source_path}" "${destination_path}"
64+
chmod +x "${destination_path}"
65+
echo "Bundled ${label} binary from ${source_path}"
66+
else
67+
echo "Warning: ${label} binary not found in app or at ${source_path}"
68+
fi
69+
}
70+
71+
copy_if_missing "${daemon_source}" "${daemon_path}" "daemon"
72+
copy_if_missing "${daemonctl_source}" "${daemonctl_path}" "daemonctl"
5073

5174
if [[ ! -f "${libssl}" || ! -f "${libcrypto}" ]]; then
5275
echo "OpenSSL dylibs not found at ${openssl_prefix}/lib"

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)