oh-my-codex 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +56 -23
  2. package/dist/cli/__tests__/doctor-team.test.d.ts +2 -0
  3. package/dist/cli/__tests__/doctor-team.test.d.ts.map +1 -0
  4. package/dist/cli/__tests__/doctor-team.test.js +151 -0
  5. package/dist/cli/__tests__/doctor-team.test.js.map +1 -0
  6. package/dist/cli/__tests__/index.test.js +31 -1
  7. package/dist/cli/__tests__/index.test.js.map +1 -1
  8. package/dist/cli/__tests__/session-scoped-runtime.test.js +2 -0
  9. package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
  10. package/dist/cli/__tests__/setup-gh-star.test.d.ts +2 -0
  11. package/dist/cli/__tests__/setup-gh-star.test.d.ts.map +1 -0
  12. package/dist/cli/__tests__/setup-gh-star.test.js +59 -0
  13. package/dist/cli/__tests__/setup-gh-star.test.js.map +1 -0
  14. package/dist/cli/doctor.d.ts +1 -0
  15. package/dist/cli/doctor.d.ts.map +1 -1
  16. package/dist/cli/doctor.js +172 -1
  17. package/dist/cli/doctor.js.map +1 -1
  18. package/dist/cli/index.d.ts +2 -0
  19. package/dist/cli/index.d.ts.map +1 -1
  20. package/dist/cli/index.js +140 -2
  21. package/dist/cli/index.js.map +1 -1
  22. package/dist/cli/setup.d.ts.map +1 -1
  23. package/dist/cli/setup.js +34 -0
  24. package/dist/cli/setup.js.map +1 -1
  25. package/dist/cli/team.d.ts +6 -0
  26. package/dist/cli/team.d.ts.map +1 -0
  27. package/dist/cli/team.js +140 -0
  28. package/dist/cli/team.js.map +1 -0
  29. package/dist/cli/tmux-hook.d.ts +1 -0
  30. package/dist/cli/tmux-hook.d.ts.map +1 -1
  31. package/dist/cli/tmux-hook.js +131 -24
  32. package/dist/cli/tmux-hook.js.map +1 -1
  33. package/dist/config/__tests__/generator-notify.test.js +79 -12
  34. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  35. package/dist/config/generator.d.ts.map +1 -1
  36. package/dist/config/generator.js +12 -5
  37. package/dist/config/generator.js.map +1 -1
  38. package/dist/hooks/__tests__/keyword-detector.test.d.ts +2 -0
  39. package/dist/hooks/__tests__/keyword-detector.test.d.ts.map +1 -0
  40. package/dist/hooks/__tests__/keyword-detector.test.js +39 -0
  41. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -0
  42. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts +2 -0
  43. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts.map +1 -0
  44. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +99 -0
  45. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -0
  46. package/dist/hooks/__tests__/tmux-hook-engine.test.js +36 -0
  47. package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +1 -1
  48. package/dist/hooks/emulator.d.ts.map +1 -1
  49. package/dist/hooks/emulator.js +3 -0
  50. package/dist/hooks/emulator.js.map +1 -1
  51. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  52. package/dist/hooks/keyword-detector.js +2 -1
  53. package/dist/hooks/keyword-detector.js.map +1 -1
  54. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts +2 -0
  55. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts.map +1 -0
  56. package/dist/mcp/__tests__/state-server-team-tools.test.js +128 -0
  57. package/dist/mcp/__tests__/state-server-team-tools.test.js.map +1 -0
  58. package/dist/mcp/__tests__/state-server.test.d.ts +2 -0
  59. package/dist/mcp/__tests__/state-server.test.d.ts.map +1 -0
  60. package/dist/mcp/__tests__/state-server.test.js +52 -0
  61. package/dist/mcp/__tests__/state-server.test.js.map +1 -0
  62. package/dist/mcp/state-server.d.ts +18 -1
  63. package/dist/mcp/state-server.d.ts.map +1 -1
  64. package/dist/mcp/state-server.js +752 -6
  65. package/dist/mcp/state-server.js.map +1 -1
  66. package/dist/team/__tests__/mcp-comm.test.d.ts +2 -0
  67. package/dist/team/__tests__/mcp-comm.test.d.ts.map +1 -0
  68. package/dist/team/__tests__/mcp-comm.test.js +93 -0
  69. package/dist/team/__tests__/mcp-comm.test.js.map +1 -0
  70. package/dist/team/__tests__/runtime.test.d.ts +2 -0
  71. package/dist/team/__tests__/runtime.test.d.ts.map +1 -0
  72. package/dist/team/__tests__/runtime.test.js +271 -0
  73. package/dist/team/__tests__/runtime.test.js.map +1 -0
  74. package/dist/team/__tests__/state.test.d.ts +2 -0
  75. package/dist/team/__tests__/state.test.d.ts.map +1 -0
  76. package/dist/team/__tests__/state.test.js +556 -0
  77. package/dist/team/__tests__/state.test.js.map +1 -0
  78. package/dist/team/__tests__/tmux-session.test.d.ts +2 -0
  79. package/dist/team/__tests__/tmux-session.test.d.ts.map +1 -0
  80. package/dist/team/__tests__/tmux-session.test.js +140 -0
  81. package/dist/team/__tests__/tmux-session.test.js.map +1 -0
  82. package/dist/team/__tests__/worker-bootstrap.test.d.ts +2 -0
  83. package/dist/team/__tests__/worker-bootstrap.test.d.ts.map +1 -0
  84. package/dist/team/__tests__/worker-bootstrap.test.js +174 -0
  85. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -0
  86. package/dist/team/mcp-comm.d.ts +45 -0
  87. package/dist/team/mcp-comm.d.ts.map +1 -0
  88. package/dist/team/mcp-comm.js +26 -0
  89. package/dist/team/mcp-comm.js.map +1 -0
  90. package/dist/team/runtime.d.ts +72 -0
  91. package/dist/team/runtime.d.ts.map +1 -0
  92. package/dist/team/runtime.js +676 -0
  93. package/dist/team/runtime.js.map +1 -0
  94. package/dist/team/state.d.ts +217 -0
  95. package/dist/team/state.d.ts.map +1 -0
  96. package/dist/team/state.js +1114 -0
  97. package/dist/team/state.js.map +1 -0
  98. package/dist/team/team-ops.d.ts +48 -0
  99. package/dist/team/team-ops.d.ts.map +1 -0
  100. package/dist/team/team-ops.js +58 -0
  101. package/dist/team/team-ops.js.map +1 -0
  102. package/dist/team/tmux-session.d.ts +21 -0
  103. package/dist/team/tmux-session.d.ts.map +1 -0
  104. package/dist/team/tmux-session.js +425 -0
  105. package/dist/team/tmux-session.js.map +1 -0
  106. package/dist/team/worker-bootstrap.d.ts +39 -0
  107. package/dist/team/worker-bootstrap.d.ts.map +1 -0
  108. package/dist/team/worker-bootstrap.js +183 -0
  109. package/dist/team/worker-bootstrap.js.map +1 -0
  110. package/package.json +1 -1
  111. package/scripts/notify-hook.js +240 -78
  112. package/scripts/tmux-hook-engine.js +11 -2
  113. package/skills/cancel/SKILL.md +50 -55
  114. package/skills/hud/SKILL.md +5 -4
  115. package/skills/team/SKILL.md +171 -773
  116. package/skills/worker/SKILL.md +65 -0
  117. package/templates/AGENTS.md +2 -1
@@ -24,8 +24,8 @@ Automatically detects which mode is active and cancels it:
24
24
  - **Swarm**: Stops coordinated agent swarm, releases claimed tasks
25
25
  - **Ultrapilot**: Stops parallel autopilot workers
26
26
  - **Pipeline**: Stops sequential agent pipeline
27
- - **Team**: Sends shutdown_request to all teammates, waits for responses, calls TeamDelete, clears linked ralph if present
28
- - **Team+Ralph (linked)**: Cancels team first (graceful shutdown), then clears ralph state. Cancelling ralph when linked also cancels team first.
27
+ - **Team**: Sends shutdown inbox to all workers, waits for exit, kills tmux session, clears linked ralph if present
28
+ - **Team+Ralph (linked)**: Cancels team first (tmux shutdown + state cleanup), then clears ralph state
29
29
 
30
30
  ## Usage
31
31
 
@@ -52,7 +52,7 @@ Active modes are still cancelled in dependency order:
52
52
  6. Swarm (standalone)
53
53
  7. Ultrapilot (standalone)
54
54
  8. Pipeline (standalone)
55
- 9. Team (Codex CLI native)
55
+ 9. Team (tmux-based)
56
56
  10. Plan Consensus (standalone)
57
57
 
58
58
  ## Force Clear All
@@ -71,7 +71,7 @@ Steps under the hood:
71
71
  1. `state_list_active` enumerates `.omx/state/sessions/{sessionId}/…` to find every known session.
72
72
  2. `state_clear` runs once per session to drop that session’s files.
73
73
  3. A global `state_clear` without `session_id` removes legacy files under `.omx/state/*.json`, `.omx/state/swarm*.db`, and compatibility artifacts (see list).
74
- 4. Team artifacts (`~/.claude/teams/*/`, `~/.claude/tasks/*/`, `.omx/state/team-state.json`) are best-effort cleared as part of the legacy fallback.
74
+ 4. Team artifacts (`.omx/state/team/*/`, tmux sessions matching `omx-team-*`) are best-effort cleared as part of the legacy fallback.
75
75
 
76
76
  Every `state_clear` command honors the `session_id` argument, so even force mode still uses the session-aware paths first before deleting legacy files.
77
77
 
@@ -130,71 +130,69 @@ Use force mode to clear every session plus legacy artifacts via `state_clear`. D
130
130
 
131
131
  ### 3B. Smart Cancellation (default)
132
132
 
133
- #### If Team Active (Codex CLI native)
133
+ #### If Team Active (tmux-based)
134
134
 
135
- Teams are detected by checking for config files in `~/.claude/teams/`:
135
+ Teams are detected by checking for config files in `.omx/state/team/`:
136
136
 
137
137
  ```bash
138
138
  # Check for active teams
139
- TEAM_CONFIGS=$(find ~/.claude/teams -name config.json -maxdepth 2 2>/dev/null)
139
+ ls .omx/state/team/*/config.json 2>/dev/null
140
140
  ```
141
141
 
142
142
  **Two-pass cancellation protocol:**
143
143
 
144
144
  **Pass 1: Graceful Shutdown**
145
145
  ```
146
- For each team found in ~/.claude/teams/:
147
- 1. Read config.json to get team_name and members list
148
- 2. For each non-lead member:
149
- a. Send shutdown_request via SendMessage
150
- b. Wait up to 15 seconds for shutdown_response
151
- c. If response received: member terminates and is auto-removed
152
- d. If timeout: mark member as unresponsive, continue to next
153
- 3. Log: "Graceful pass: X/Y members responded"
146
+ For each team found in .omx/state/team/:
147
+ 1. Read config.json to get team_name and workers list
148
+ 2. For each worker:
149
+ a. Write shutdown inbox to .omx/state/team/{name}/workers/{worker}/inbox.md
150
+ b. Send short trigger via tmux send-keys
151
+ c. Wait up to 15 seconds for worker tmux pane to exit
152
+ d. If still alive: mark as unresponsive
154
153
  ```
155
154
 
156
- **Pass 2: Reconciliation**
155
+ **Pass 2: Force Kill**
157
156
  ```
158
157
  After graceful pass:
159
- 1. Re-read config.json to check remaining members
160
- 2. If only lead remains (or config is empty): proceed to TeamDelete
161
- 3. If unresponsive members remain:
162
- a. Wait 5 more seconds (they may still be processing)
163
- b. Re-read config.json again
164
- c. If still stuck: attempt TeamDelete anyway
165
- d. If TeamDelete fails: report manual cleanup path
158
+ 1. For each remaining alive worker:
159
+ a. Send C-c via tmux send-keys
160
+ b. Wait 2 seconds
161
+ c. Kill the tmux window if still alive
162
+ 2. Destroy the tmux session: tmux kill-session -t omx-team-{name}
166
163
  ```
167
164
 
168
- **TeamDelete + Cleanup:**
165
+ **Cleanup:**
169
166
  ```
170
- 1. Call TeamDelete() removes ~/.claude/teams/{name}/ and ~/.claude/tasks/{name}/
171
- 2. Clear team state: state_clear(mode="team")
172
- 3. Check for linked ralph: state_read(mode="ralph") — if linked_team is true:
167
+ 1. Strip AGENTS.md team worker overlay (<!-- OMX:TEAM:WORKER:START/END -->)
168
+ 2. Remove team state directory: rm -rf .omx/state/team/{name}/
169
+ 3. Clear team mode state: state_clear(mode="team")
170
+ 4. Check for linked ralph: state_read(mode="ralph") — if linked_team is true:
173
171
  a. Clear ralph state: state_clear(mode="ralph")
174
172
  b. Clear linked ultrawork if present: state_clear(mode="ultrawork")
175
- 4. Emit structured cancel report
173
+ 5. Emit structured cancel report
176
174
  ```
177
175
 
178
176
  **Structured Cancel Report:**
179
177
  ```
180
178
  Team "{team_name}" cancelled:
181
- - Members signaled: N
182
- - Responses received: M
183
- - Unresponsive: K (list names if any)
184
- - TeamDelete: success/failed
185
- - Manual cleanup needed: yes/no
186
- Path: ~/.claude/teams/{name}/ and ~/.claude/tasks/{name}/
179
+ - Workers signaled: N
180
+ - Graceful exits: M
181
+ - Force killed: K
182
+ - tmux session destroyed: yes/no
183
+ - State cleaned up: yes/no
187
184
  ```
188
185
 
189
186
  **Implementation note:** The cancel skill is executed by the LLM, not as a bash script. When you detect an active team:
190
- 1. Read `~/.claude/teams/*/config.json` to find active teams
191
- 2. If multiple teams exist, cancel oldest first (by `createdAt`)
192
- 3. For each non-lead member, call `SendMessage(type: "shutdown_request", recipient: member-name, content: "Cancelling")`
193
- 4. Wait briefly for shutdown responses (15s per member timeout)
194
- 5. Re-read config.json to check for remaining members (reconciliation pass)
195
- 6. Call `TeamDelete()` to clean up
196
- 7. Remove any local state: `rm -f .omx/state/team-state.json`
197
- 8. Report structured summary to user
187
+ 1. Check `.omx/state/team/*/config.json` for active teams
188
+ 2. For each worker in config.workers, write shutdown inbox and send trigger
189
+ 3. Wait briefly for workers to exit (15s timeout)
190
+ 4. Force kill remaining workers via tmux
191
+ 5. Destroy tmux session: `tmux kill-session -t omx-team-{name}`
192
+ 6. Strip AGENTS.md overlay
193
+ 7. Remove state: `rm -rf .omx/state/team/{name}/`
194
+ 8. `state_clear(mode="team")`
195
+ 9. Report structured summary to user
198
196
 
199
197
  #### If Autopilot Active
200
198
 
@@ -322,7 +320,7 @@ The cancel skill runs as follows:
322
320
  2. Use `state_list_active` to enumerate known session ids and `state_get_status` to learn the active mode (`autopilot`, `ralph`, `ultrawork`, etc.) for each session.
323
321
  3. When operating in default mode, call `state_clear` with that session_id to remove only the session’s files, then run mode-specific cleanup (autopilot → ralph → …) based on the state tool signals.
324
322
  4. In force mode, iterate every active session, call `state_clear` per session, then run a global `state_clear` without `session_id` to drop legacy files (`.omx/state/*.json`, compatibility artifacts) and report success. Swarm remains a shared SQLite/marker mode outside session scoping.
325
- 5. Team artifacts (`~/.claude/teams/*/`, `~/.claude/tasks/*/`, `.omx/state/team-state.json`) remain best-effort cleanup items invoked during the legacy/global pass.
323
+ 5. Team artifacts (`.omx/state/team/*/`, tmux sessions matching `omx-team-*`) remain best-effort cleanup items invoked during the legacy/global pass.
326
324
 
327
325
  State tools always honor the `session_id` argument, so even force mode still clears the session-scoped paths before deleting compatibility-only legacy state.
328
326
 
@@ -364,24 +362,21 @@ Mode-specific subsections below describe what extra cleanup each handler perform
364
362
  - **Safe**: Only clears linked Ultrawork, preserves standalone Ultrawork
365
363
  - **Local-only**: Clears state files in `.omx/state/` directory
366
364
  - **Resume-friendly**: Autopilot state is preserved for seamless resume
367
- - **Team-aware**: Detects native Codex CLI teams and performs graceful shutdown
365
+ - **Team-aware**: Detects tmux-based teams and performs graceful shutdown with force-kill fallback
368
366
 
369
- ## MCP Worker Cleanup
367
+ ## Tmux Team Cleanup
370
368
 
371
- When cancelling modes that may have spawned MCP workers (team bridge daemons), the cancel skill should also:
369
+ When cancelling team mode, the cancel skill should:
372
370
 
373
- 1. **Check for active MCP workers**: Look for heartbeat files at `.omx/state/team-bridge/{team}/*.heartbeat.json`
374
- 2. **Send shutdown signals**: Write shutdown signal files for each active worker
375
- 3. **Kill tmux sessions**: Run `tmux kill-session -t omc-team-{team}-{worker}` for each worker
376
- 4. **Clean up heartbeat files**: Remove all heartbeat files for the team
377
- 5. **Clean up shadow registry**: Remove `.omx/state/team-mcp-workers.json`
371
+ 1. **Kill all team tmux sessions**: `tmux list-sessions -F '#{session_name}' 2>/dev/null | grep '^omx-team-'` and kill each
372
+ 2. **Remove team state directories**: `rm -rf .omx/state/team/*/`
373
+ 3. **Strip AGENTS.md overlay**: Remove content between `<!-- OMX:TEAM:WORKER:START -->` and `<!-- OMX:TEAM:WORKER:END -->`
378
374
 
379
375
  ### Force Clear Addition
380
376
 
381
377
  When `--force` is used, also clean up:
382
378
  ```bash
383
- rm -rf .omx/state/team-bridge/ # Heartbeat files
384
- rm -f .omx/state/team-mcp-workers.json # Shadow registry
385
- # Kill all omc-team-* tmux sessions
386
- tmux list-sessions -F '#{session_name}' 2>/dev/null | grep '^omc-team-' | while read s; do tmux kill-session -t "$s" 2>/dev/null; done
379
+ rm -rf .omx/state/team/ # All team state
380
+ # Kill all omx-team-* tmux sessions
381
+ tmux list-sessions -F '#{session_name}' 2>/dev/null | grep '^omx-team-' | while read s; do tmux kill-session -t "$s" 2>/dev/null; done
387
382
  ```
@@ -1,8 +1,8 @@
1
1
  ---
2
- name: hud
3
- description: Show or configure the OMX HUD (two-layer statusline)
4
- role: display
5
- scope: .omx/**
2
+ name: "hud"
3
+ description: "Show or configure the OMX HUD (two-layer statusline)"
4
+ role: "display"
5
+ scope: ".omx/**"
6
6
  ---
7
7
 
8
8
  # HUD Skill
@@ -46,6 +46,7 @@ The OMX HUD uses a two-layer architecture:
46
46
  `omx setup` automatically configures both layers:
47
47
  - Adds `[tui] status_line` to `~/.codex/config.toml` (Layer 1)
48
48
  - Writes `.omx/hud-config.json` with default preset (Layer 2)
49
+ - Default preset is `focused`; if HUD/statusline changes do not appear, restart Codex CLI once.
49
50
 
50
51
  ## Layer 1: Codex Built-in StatusLine
51
52