oh-my-codex 0.18.6 → 0.18.8
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.
- package/Cargo.lock +6 -6
- package/Cargo.toml +1 -1
- package/README.md +59 -10
- package/crates/omx-sparkshell/tests/execution.rs +1 -1
- package/dist/agents/__tests__/definitions.test.js +11 -0
- package/dist/agents/__tests__/definitions.test.js.map +1 -1
- package/dist/agents/__tests__/native-config.test.js +56 -6
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/definitions.d.ts +10 -0
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +5 -1
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/native-config.d.ts +5 -1
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js +19 -4
- package/dist/agents/native-config.js.map +1 -1
- package/dist/autopilot/__tests__/fsm.test.d.ts +2 -0
- package/dist/autopilot/__tests__/fsm.test.d.ts.map +1 -0
- package/dist/autopilot/__tests__/fsm.test.js +75 -0
- package/dist/autopilot/__tests__/fsm.test.js.map +1 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.d.ts +2 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.d.ts.map +1 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.js +79 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -0
- package/dist/autopilot/deep-interview-gate.d.ts +18 -0
- package/dist/autopilot/deep-interview-gate.d.ts.map +1 -0
- package/dist/autopilot/deep-interview-gate.js +256 -0
- package/dist/autopilot/deep-interview-gate.js.map +1 -0
- package/dist/autopilot/fsm.d.ts +13 -0
- package/dist/autopilot/fsm.d.ts.map +1 -0
- package/dist/autopilot/fsm.js +70 -0
- package/dist/autopilot/fsm.js.map +1 -0
- package/dist/autopilot/ralplan-gate.d.ts +17 -0
- package/dist/autopilot/ralplan-gate.d.ts.map +1 -0
- package/dist/autopilot/ralplan-gate.js +61 -0
- package/dist/autopilot/ralplan-gate.js.map +1 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js +512 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +39 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +83 -7
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +175 -6
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +8 -4
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +100 -0
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +13 -0
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +14 -0
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +89 -0
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +83 -0
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/state.test.js +21 -0
- package/dist/cli/__tests__/state.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +2 -2
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +110 -2
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +8 -1
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +14 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +298 -50
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +14 -2
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +62 -15
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/question.d.ts.map +1 -1
- package/dist/cli/question.js +36 -5
- package/dist/cli/question.js.map +1 -1
- package/dist/cli/ralph.d.ts.map +1 -1
- package/dist/cli/ralph.js +3 -1
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/setup-preferences.d.ts +2 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -1
- package/dist/cli/setup-preferences.js +4 -0
- package/dist/cli/setup-preferences.js.map +1 -1
- package/dist/cli/setup.d.ts +3 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +166 -27
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/state.d.ts.map +1 -1
- package/dist/cli/state.js +8 -1
- package/dist/cli/state.js.map +1 -1
- package/dist/cli/tmux-hook.d.ts.map +1 -1
- package/dist/cli/tmux-hook.js +16 -0
- package/dist/cli/tmux-hook.js.map +1 -1
- package/dist/cli/update.d.ts +2 -0
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +47 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/deep-interview.test.js +7 -6
- package/dist/config/__tests__/deep-interview.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +1 -0
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/deep-interview.d.ts.map +1 -1
- package/dist/config/deep-interview.js +14 -4
- package/dist/config/deep-interview.js.map +1 -1
- package/dist/config/generator.d.ts +2 -2
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +2 -2
- package/dist/config/generator.js.map +1 -1
- package/dist/config/team-mode.d.ts +12 -0
- package/dist/config/team-mode.d.ts.map +1 -0
- package/dist/config/team-mode.js +91 -0
- package/dist/config/team-mode.js.map +1 -0
- package/dist/hooks/__tests__/agents-overlay.test.js +88 -0
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +8 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.js +8 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +10 -0
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +1072 -14
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +64 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +189 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +35 -2
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +3 -3
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
- package/dist/hooks/__tests__/session.test.js +25 -0
- package/dist/hooks/__tests__/session.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-guidance-contract.test.js +21 -0
- package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
- package/dist/hooks/agents-overlay.d.ts.map +1 -1
- package/dist/hooks/agents-overlay.js +36 -50
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/deep-interview-config-instruction.js +1 -1
- package/dist/hooks/deep-interview-config-instruction.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js +31 -0
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js.map +1 -1
- package/dist/hooks/extensibility/plugin-runner.js +17 -21
- package/dist/hooks/extensibility/plugin-runner.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +1 -0
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +428 -32
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/keyword-registry.d.ts.map +1 -1
- package/dist/hooks/keyword-registry.js +1 -0
- package/dist/hooks/keyword-registry.js.map +1 -1
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +6 -0
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/session.d.ts +3 -0
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +13 -5
- package/dist/hooks/session.js.map +1 -1
- package/dist/hud/__tests__/authority.test.js +469 -31
- package/dist/hud/__tests__/authority.test.js.map +1 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.js +2 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +210 -2
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +588 -28
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/render.test.js +61 -0
- package/dist/hud/__tests__/render.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +208 -0
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +314 -22
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/authority.d.ts +5 -0
- package/dist/hud/authority.d.ts.map +1 -1
- package/dist/hud/authority.js +337 -30
- package/dist/hud/authority.js.map +1 -1
- package/dist/hud/index.d.ts +20 -2
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +103 -26
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/reconcile.d.ts +3 -3
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +129 -20
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +35 -0
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +64 -50
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/tmux.d.ts +26 -6
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +173 -38
- package/dist/hud/tmux.js.map +1 -1
- package/dist/hud/types.d.ts +11 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/mcp/__tests__/hermes-bridge.test.js +203 -7
- package/dist/mcp/__tests__/hermes-bridge.test.js.map +1 -1
- package/dist/mcp/__tests__/state-paths.test.js +71 -1
- package/dist/mcp/__tests__/state-paths.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +13 -1
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/hermes-bridge.d.ts +12 -2
- package/dist/mcp/hermes-bridge.d.ts.map +1 -1
- package/dist/mcp/hermes-bridge.js +83 -9
- package/dist/mcp/hermes-bridge.js.map +1 -1
- package/dist/mcp/state-paths.d.ts +32 -0
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +113 -17
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/mcp/state-server.d.ts +4 -4
- package/dist/modes/__tests__/base-autoresearch-contract.test.js +7 -1
- package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -1
- package/dist/pipeline/__tests__/stages.test.js +130 -0
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/orchestrator.js +1 -1
- package/dist/pipeline/orchestrator.js.map +1 -1
- package/dist/pipeline/stages/ralplan.d.ts +1 -0
- package/dist/pipeline/stages/ralplan.d.ts.map +1 -1
- package/dist/pipeline/stages/ralplan.js +14 -5
- package/dist/pipeline/stages/ralplan.js.map +1 -1
- package/dist/question/__tests__/deep-interview.test.js +160 -2
- package/dist/question/__tests__/deep-interview.test.js.map +1 -1
- package/dist/question/__tests__/policy.test.js +63 -3
- package/dist/question/__tests__/policy.test.js.map +1 -1
- package/dist/question/__tests__/renderer.test.js +191 -2
- package/dist/question/__tests__/renderer.test.js.map +1 -1
- package/dist/question/__tests__/state.test.js +94 -3
- package/dist/question/__tests__/state.test.js.map +1 -1
- package/dist/question/__tests__/ui.test.js +4 -0
- package/dist/question/__tests__/ui.test.js.map +1 -1
- package/dist/question/autopilot-wait.d.ts +12 -2
- package/dist/question/autopilot-wait.d.ts.map +1 -1
- package/dist/question/autopilot-wait.js +158 -47
- package/dist/question/autopilot-wait.js.map +1 -1
- package/dist/question/deep-interview.d.ts.map +1 -1
- package/dist/question/deep-interview.js +22 -6
- package/dist/question/deep-interview.js.map +1 -1
- package/dist/question/policy.d.ts.map +1 -1
- package/dist/question/policy.js +2 -5
- package/dist/question/policy.js.map +1 -1
- package/dist/question/renderer.d.ts +12 -0
- package/dist/question/renderer.d.ts.map +1 -1
- package/dist/question/renderer.js +87 -3
- package/dist/question/renderer.js.map +1 -1
- package/dist/question/state.d.ts +8 -1
- package/dist/question/state.d.ts.map +1 -1
- package/dist/question/state.js +54 -14
- package/dist/question/state.js.map +1 -1
- package/dist/question/types.d.ts +1 -1
- package/dist/question/types.d.ts.map +1 -1
- package/dist/question/ui.d.ts +1 -0
- package/dist/question/ui.d.ts.map +1 -1
- package/dist/question/ui.js +1 -0
- package/dist/question/ui.js.map +1 -1
- package/dist/ralplan/__tests__/runtime.test.js +191 -0
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/consensus-gate.d.ts +9 -1
- package/dist/ralplan/consensus-gate.d.ts.map +1 -1
- package/dist/ralplan/consensus-gate.js +84 -2
- package/dist/ralplan/consensus-gate.js.map +1 -1
- package/dist/ralplan/runtime.d.ts +9 -0
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +32 -11
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +2315 -280
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-state-io.test.js +72 -1
- package/dist/scripts/__tests__/notify-state-io.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-tmux-injection.test.d.ts +2 -0
- package/dist/scripts/__tests__/notify-tmux-injection.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/notify-tmux-injection.test.js +57 -0
- package/dist/scripts/__tests__/notify-tmux-injection.test.js.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.js +74 -0
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-agents.test.js +65 -0
- package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +431 -56
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +79 -1
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/eval/eval-parity-smoke.js +1 -1
- package/dist/scripts/eval/eval-parity-smoke.js.map +1 -1
- package/dist/scripts/hook-payload-guard.d.ts +9 -0
- package/dist/scripts/hook-payload-guard.d.ts.map +1 -0
- package/dist/scripts/hook-payload-guard.js +111 -0
- package/dist/scripts/hook-payload-guard.js.map +1 -0
- package/dist/scripts/notify-fallback-watcher.js +8 -1
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/__tests__/payload-guard.test.d.ts +2 -0
- package/dist/scripts/notify-hook/__tests__/payload-guard.test.d.ts.map +1 -0
- package/dist/scripts/notify-hook/__tests__/payload-guard.test.js +39 -0
- package/dist/scripts/notify-hook/__tests__/payload-guard.test.js.map +1 -0
- package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.js +3 -1
- package/dist/scripts/notify-hook/auto-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.js +3 -10
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -1
- package/dist/scripts/notify-hook/state-io.d.ts.map +1 -1
- package/dist/scripts/notify-hook/state-io.js +62 -38
- package/dist/scripts/notify-hook/state-io.js.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.js +7 -0
- package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.js +234 -86
- package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.d.ts +7 -0
- package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js +24 -18
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
- package/dist/scripts/notify-hook.js +86 -13
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/run-test-files.js +193 -22
- package/dist/scripts/run-test-files.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +61 -3
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/scripts/verify-native-agents.d.ts.map +1 -1
- package/dist/scripts/verify-native-agents.js +58 -1
- package/dist/scripts/verify-native-agents.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +1125 -1
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/skill-active.test.js +46 -1
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/__tests__/workflow-transition.test.js +98 -7
- package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +159 -2
- package/dist/state/operations.js.map +1 -1
- package/dist/state/skill-active.js +6 -8
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts +6 -0
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +38 -15
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/state/workflow-transition.d.ts.map +1 -1
- package/dist/state/workflow-transition.js +10 -3
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/subagents/__tests__/tracker.test.js +139 -0
- package/dist/subagents/__tests__/tracker.test.js.map +1 -1
- package/dist/subagents/tracker.d.ts +3 -0
- package/dist/subagents/tracker.d.ts.map +1 -1
- package/dist/subagents/tracker.js +41 -4
- package/dist/subagents/tracker.js.map +1 -1
- package/dist/team/__tests__/coordination-protocol.test.d.ts +2 -0
- package/dist/team/__tests__/coordination-protocol.test.d.ts.map +1 -0
- package/dist/team/__tests__/coordination-protocol.test.js +173 -0
- package/dist/team/__tests__/coordination-protocol.test.js.map +1 -0
- package/dist/team/__tests__/runtime.test.js +52 -3
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +9 -4
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +83 -0
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +240 -2
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +84 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/__tests__/worker-runtime-identity.test.js +4 -2
- package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -1
- package/dist/team/coordination-protocol.d.ts +14 -0
- package/dist/team/coordination-protocol.d.ts.map +1 -0
- package/dist/team/coordination-protocol.js +244 -0
- package/dist/team/coordination-protocol.js.map +1 -0
- package/dist/team/runtime.d.ts +1 -0
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +19 -3
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +3 -2
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +24 -0
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/state/types.d.ts +21 -1
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state.d.ts +17 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +12 -5
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-ops.d.ts +1 -1
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +2 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +161 -13
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +63 -0
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/utils/__tests__/agents-model-table.test.js +4 -2
- package/dist/utils/__tests__/agents-model-table.test.js.map +1 -1
- package/dist/utils/agents-model-table.d.ts.map +1 -1
- package/dist/utils/agents-model-table.js +3 -0
- package/dist/utils/agents-model-table.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +81 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/package.json +8 -8
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +334 -21
- package/plugins/oh-my-codex/hooks/hooks.json +1 -2
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +13 -6
- package/plugins/oh-my-codex/skills/code-review/SKILL.md +7 -7
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +9 -4
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +22 -22
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +12 -0
- package/plugins/oh-my-codex/skills/team/SKILL.md +16 -0
- package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +9 -0
- package/plugins/oh-my-codex/skills/worker/SKILL.md +14 -0
- package/skills/autopilot/SKILL.md +13 -6
- package/skills/code-review/SKILL.md +7 -7
- package/skills/deep-interview/SKILL.md +9 -4
- package/skills/ralph/SKILL.md +22 -22
- package/skills/ralplan/SKILL.md +12 -0
- package/skills/team/SKILL.md +16 -0
- package/skills/ultraqa/SKILL.md +9 -0
- package/skills/worker/SKILL.md +14 -0
- package/src/scripts/__tests__/codex-native-hook.test.ts +4435 -2083
- package/src/scripts/__tests__/notify-state-io.test.ts +95 -0
- package/src/scripts/__tests__/notify-tmux-injection.test.ts +82 -0
- package/src/scripts/__tests__/run-test-files.test.ts +102 -0
- package/src/scripts/__tests__/verify-native-agents.test.ts +75 -0
- package/src/scripts/codex-native-hook.ts +536 -51
- package/src/scripts/codex-native-pre-post.ts +80 -0
- package/src/scripts/demo-team-e2e.sh +10 -7
- package/src/scripts/eval/eval-parity-smoke.ts +1 -1
- package/src/scripts/hook-payload-guard.ts +113 -0
- package/src/scripts/notify-fallback-watcher.ts +8 -1
- package/src/scripts/notify-hook/__tests__/payload-guard.test.ts +41 -0
- package/src/scripts/notify-hook/auto-nudge.ts +3 -1
- package/src/scripts/notify-hook/ralph-session-resume.ts +2 -8
- package/src/scripts/notify-hook/state-io.ts +75 -37
- package/src/scripts/notify-hook/team-leader-nudge.ts +7 -0
- package/src/scripts/notify-hook/team-worker-stop.ts +193 -52
- package/src/scripts/notify-hook/tmux-injection.ts +35 -19
- package/src/scripts/notify-hook.ts +105 -6
- package/src/scripts/run-test-files.ts +192 -22
- package/src/scripts/sync-plugin-mirror.ts +98 -9
- package/src/scripts/verify-native-agents.ts +65 -1
package/dist/cli/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync }
|
|
|
8
8
|
import { copyFile, cp, lstat, mkdir, readFile, readdir, rm, symlink, writeFile } from "fs/promises";
|
|
9
9
|
import { constants as osConstants, homedir } from "os";
|
|
10
10
|
import { createHash } from "crypto";
|
|
11
|
-
import { setup, SETUP_MCP_MODES, SETUP_SCOPES, } from "./setup.js";
|
|
11
|
+
import { setup, SETUP_MCP_MODES, SETUP_SCOPES, SETUP_TEAM_MODES, } from "./setup.js";
|
|
12
12
|
import { uninstall } from "./uninstall.js";
|
|
13
13
|
import { version } from "./version.js";
|
|
14
14
|
import { tmuxHookCommand } from "./tmux-hook.js";
|
|
@@ -54,8 +54,8 @@ import { codexConfigPath, omxRoot, rememberOmxLaunchContext, resolveOmxEntryPath
|
|
|
54
54
|
import { cleanCodexModelAvailabilityNuxIfNeeded, extractSharedMcpRegistryServersFromConfig, repairConfigIfNeeded, repairProjectScopeTrustStateForLaunch, syncProjectScopeTrustStateFromRuntime } from "../config/generator.js";
|
|
55
55
|
import { OMX_FIRST_PARTY_MCP_SERVER_NAMES } from "../config/omx-first-party-mcp.js";
|
|
56
56
|
import { HUD_TMUX_HEIGHT_LINES } from "../hud/constants.js";
|
|
57
|
-
import {
|
|
58
|
-
import { createHudWatchPane as createSharedHudWatchPane, killTmuxPane as killSharedTmuxPane, listCurrentWindowHudPaneIds, listCurrentWindowPanes,
|
|
57
|
+
import { readUltragoalState } from "../hud/state.js";
|
|
58
|
+
import { createHudWatchPane as createSharedHudWatchPane, killTmuxPane as killSharedTmuxPane, listCurrentWindowHudPaneIds, listCurrentWindowPanes, buildHudRuntimeEnv, parsePaneIdFromTmuxOutput, reapDeadHudPanes, registerHudResizeHook, resizeTmuxPane, } from "../hud/tmux.js";
|
|
59
59
|
export { parseTmuxPaneSnapshot, isHudWatchPane, findHudWatchPaneIds } from "../hud/tmux.js";
|
|
60
60
|
rememberOmxLaunchContext();
|
|
61
61
|
import { classifySpawnError, resolveTmuxBinaryForPlatform, spawnPlatformCommandSync, } from "../utils/platform-command.js";
|
|
@@ -177,6 +177,11 @@ Options:
|
|
|
177
177
|
Explicit setup MCP mode (default: none; compat enables first-party MCP compatibility and shared registry sync)
|
|
178
178
|
--no-mcp Alias for --mcp=none
|
|
179
179
|
--with-mcp Alias for --mcp=compat
|
|
180
|
+
--disable-team
|
|
181
|
+
Disable Team skill/context generation for setup (default remains enabled)
|
|
182
|
+
--enable-team Re-enable Team skill/context generation for setup
|
|
183
|
+
--team-mode <enabled|disabled>
|
|
184
|
+
Explicit Team setup mode
|
|
180
185
|
--keep-config Skip config.toml cleanup during uninstall
|
|
181
186
|
--purge Remove .omx/ cache directory during uninstall
|
|
182
187
|
--verbose Show detailed output
|
|
@@ -367,6 +372,45 @@ export function resolveSetupScopeArg(args) {
|
|
|
367
372
|
}
|
|
368
373
|
throw new Error(`Invalid setup scope: ${value}. Expected one of: ${SETUP_SCOPES.join(", ")}`);
|
|
369
374
|
}
|
|
375
|
+
export function resolveSetupTeamModeArg(args) {
|
|
376
|
+
let value;
|
|
377
|
+
const setValue = (next, source) => {
|
|
378
|
+
if (value && value !== next) {
|
|
379
|
+
throw new Error(`Conflicting setup Team mode flags: ${source} selects ${next}, but another flag already selected ${value}`);
|
|
380
|
+
}
|
|
381
|
+
value = next;
|
|
382
|
+
};
|
|
383
|
+
const parseValue = (next) => {
|
|
384
|
+
if (!SETUP_TEAM_MODES.includes(next)) {
|
|
385
|
+
throw new Error(`Invalid setup Team mode: ${next}. Expected one of: enabled, disabled`);
|
|
386
|
+
}
|
|
387
|
+
return next;
|
|
388
|
+
};
|
|
389
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
390
|
+
const arg = args[index];
|
|
391
|
+
if (arg === "--disable-team" || arg === "--no-team") {
|
|
392
|
+
setValue("disabled", arg);
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
if (arg === "--enable-team" || arg === "--team") {
|
|
396
|
+
setValue("enabled", arg);
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
if (arg === "--team-mode") {
|
|
400
|
+
const next = args[index + 1];
|
|
401
|
+
if (!next || next.startsWith("-")) {
|
|
402
|
+
throw new Error(`Missing setup Team mode value after --team-mode. Expected one of: enabled, disabled`);
|
|
403
|
+
}
|
|
404
|
+
setValue(parseValue(next), arg);
|
|
405
|
+
index += 1;
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
if (arg.startsWith("--team-mode=")) {
|
|
409
|
+
setValue(parseValue(arg.slice("--team-mode=".length)), "--team-mode");
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return value;
|
|
413
|
+
}
|
|
370
414
|
export function resolveCliInvocation(args) {
|
|
371
415
|
const firstArg = args[0];
|
|
372
416
|
if (firstArg === "--help" || firstArg === "-h") {
|
|
@@ -597,6 +641,75 @@ function execTmuxFileSync(args, options) {
|
|
|
597
641
|
...(process.platform === "win32" ? { windowsHide: true } : {}),
|
|
598
642
|
});
|
|
599
643
|
}
|
|
644
|
+
export const DETACHED_TMUX_HISTORY_LIMIT = 500;
|
|
645
|
+
const TMUX_HOOK_INDEX_MAX = 1_000_000;
|
|
646
|
+
function setDetachedTmuxSessionHistoryLimit(sessionName, leaderPaneId) {
|
|
647
|
+
const boundedHistoryLimit = String(DETACHED_TMUX_HISTORY_LIMIT);
|
|
648
|
+
try {
|
|
649
|
+
execTmuxFileSync(["set-option", "-q", "-t", sessionName, "history-limit", boundedHistoryLimit], { stdio: "ignore" });
|
|
650
|
+
}
|
|
651
|
+
catch (err) {
|
|
652
|
+
logCliOperationFailure(err);
|
|
653
|
+
}
|
|
654
|
+
if (!leaderPaneId)
|
|
655
|
+
return;
|
|
656
|
+
try {
|
|
657
|
+
execTmuxFileSync(["set-option", "-pq", "-t", leaderPaneId, "history-limit", boundedHistoryLimit], { stdio: "ignore" });
|
|
658
|
+
}
|
|
659
|
+
catch (err) {
|
|
660
|
+
logCliOperationFailure(err);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
function clearDetachedTmuxSessionHistoryIfUnattached(sessionName, leaderPaneId) {
|
|
664
|
+
try {
|
|
665
|
+
const attached = execTmuxFileSync(["display-message", "-p", "-t", sessionName, "#{session_attached}"], {
|
|
666
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
667
|
+
encoding: "utf-8",
|
|
668
|
+
}).trim();
|
|
669
|
+
if (attached !== "0")
|
|
670
|
+
return;
|
|
671
|
+
execTmuxFileSync(["clear-history", "-t", leaderPaneId], {
|
|
672
|
+
stdio: "ignore",
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
catch (err) {
|
|
676
|
+
logCliOperationFailure(err);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
function readTmuxSessionInstanceId(sessionName) {
|
|
680
|
+
try {
|
|
681
|
+
return execTmuxFileSync(["show-options", "-qv", "-t", sessionName, OMX_INSTANCE_OPTION], {
|
|
682
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
683
|
+
encoding: "utf-8",
|
|
684
|
+
}).trim();
|
|
685
|
+
}
|
|
686
|
+
catch {
|
|
687
|
+
return null;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
function tmuxPaneBelongsToSession(paneId, sessionName) {
|
|
691
|
+
try {
|
|
692
|
+
const paneSessionName = execTmuxFileSync(["display-message", "-p", "-t", paneId, "#{session_name}"], {
|
|
693
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
694
|
+
encoding: "utf-8",
|
|
695
|
+
}).trim();
|
|
696
|
+
return paneSessionName === sessionName;
|
|
697
|
+
}
|
|
698
|
+
catch {
|
|
699
|
+
return false;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
function buildDetachedHistoryPruneHookCommand(leaderPaneId) {
|
|
703
|
+
return `if-shell -F '#{==:#{session_attached},0}' 'clear-history -t ${leaderPaneId}'`;
|
|
704
|
+
}
|
|
705
|
+
function buildDetachedHistoryPruneHookSlot(sessionName, leaderPaneId) {
|
|
706
|
+
const key = `${sessionName}:${leaderPaneId}:omx-history-prune`;
|
|
707
|
+
let hash = 0;
|
|
708
|
+
for (let i = 0; i < key.length; i++) {
|
|
709
|
+
hash = ((hash << 5) - hash + key.charCodeAt(i)) | 0;
|
|
710
|
+
}
|
|
711
|
+
return `client-detached[${Math.abs(hash) % TMUX_HOOK_INDEX_MAX}]`;
|
|
712
|
+
}
|
|
600
713
|
function hasErrnoCode(error, code) {
|
|
601
714
|
return Boolean(error &&
|
|
602
715
|
typeof error === "object" &&
|
|
@@ -825,6 +938,42 @@ export function resolveOmxRootForLaunch(cwd, env = process.env) {
|
|
|
825
938
|
return undefined;
|
|
826
939
|
return isCrossPlatformAbsolutePath(raw) ? raw : join(cwd, raw);
|
|
827
940
|
}
|
|
941
|
+
function resolveLaunchPath(cwd, raw) {
|
|
942
|
+
return isCrossPlatformAbsolutePath(raw) ? raw : join(cwd, raw);
|
|
943
|
+
}
|
|
944
|
+
function resolveHudRuntimeRootSource(omxRootOverride, env = process.env) {
|
|
945
|
+
if (env.OMX_TEAM_STATE_ROOT?.trim())
|
|
946
|
+
return 'team-env';
|
|
947
|
+
if (env.OMX_ROOT?.trim() || omxRootOverride)
|
|
948
|
+
return 'omx-root-env';
|
|
949
|
+
if (env.OMX_STATE_ROOT?.trim())
|
|
950
|
+
return 'omx-state-root-env';
|
|
951
|
+
return 'cwd-default';
|
|
952
|
+
}
|
|
953
|
+
export function resolveHudRuntimeRootForLaunch(cwd, env = process.env) {
|
|
954
|
+
const omxTeamStateRoot = env.OMX_TEAM_STATE_ROOT?.trim();
|
|
955
|
+
if (omxTeamStateRoot) {
|
|
956
|
+
return {
|
|
957
|
+
omxTeamStateRoot: resolveLaunchPath(cwd, omxTeamStateRoot),
|
|
958
|
+
rootSource: 'team-env',
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
const omxRoot = env.OMX_ROOT?.trim();
|
|
962
|
+
if (omxRoot) {
|
|
963
|
+
return {
|
|
964
|
+
omxRoot: resolveLaunchPath(cwd, omxRoot),
|
|
965
|
+
rootSource: 'omx-root-env',
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
const omxStateRoot = env.OMX_STATE_ROOT?.trim();
|
|
969
|
+
if (omxStateRoot) {
|
|
970
|
+
return {
|
|
971
|
+
omxStateRoot: resolveLaunchPath(cwd, omxStateRoot),
|
|
972
|
+
rootSource: 'omx-state-root-env',
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
return { rootSource: 'cwd-default' };
|
|
976
|
+
}
|
|
828
977
|
function hasExplicitOmxRootEnv(env = process.env) {
|
|
829
978
|
return [env.OMX_ROOT, env.OMX_STATE_ROOT].some((value) => typeof value === "string" && value.trim() !== "");
|
|
830
979
|
}
|
|
@@ -945,12 +1094,24 @@ function readMadmaxDetachedActiveRecord(recordPath) {
|
|
|
945
1094
|
argv: [...parsed.argv],
|
|
946
1095
|
run_dir: parsed.run_dir,
|
|
947
1096
|
tmux_session_name: parsed.tmux_session_name,
|
|
1097
|
+
...(typeof parsed.session_id === "string" ? { session_id: parsed.session_id } : {}),
|
|
1098
|
+
...(typeof parsed.tmux_pane_id === "string" ? { tmux_pane_id: parsed.tmux_pane_id } : {}),
|
|
948
1099
|
};
|
|
949
1100
|
}
|
|
950
1101
|
catch {
|
|
951
1102
|
return null;
|
|
952
1103
|
}
|
|
953
1104
|
}
|
|
1105
|
+
function isReusableMadmaxDetachedActiveRecord(record) {
|
|
1106
|
+
if (!detachedTmuxSessionExists(record.tmux_session_name))
|
|
1107
|
+
return false;
|
|
1108
|
+
if (!record.session_id || !record.tmux_pane_id)
|
|
1109
|
+
return false;
|
|
1110
|
+
if (readTmuxSessionInstanceId(record.tmux_session_name) !== record.session_id) {
|
|
1111
|
+
return false;
|
|
1112
|
+
}
|
|
1113
|
+
return tmuxPaneBelongsToSession(record.tmux_pane_id, record.tmux_session_name);
|
|
1114
|
+
}
|
|
954
1115
|
function detachedTmuxSessionExists(sessionName) {
|
|
955
1116
|
try {
|
|
956
1117
|
execTmuxFileSync(["has-session", "-t", sessionName], { stdio: "ignore" });
|
|
@@ -1198,6 +1359,7 @@ export async function main(args) {
|
|
|
1198
1359
|
scope: resolveSetupScopeArg(args.slice(1)),
|
|
1199
1360
|
installMode: resolveSetupInstallModeArg(args.slice(1)),
|
|
1200
1361
|
mcpMode: resolveSetupMcpModeArg(args.slice(1)),
|
|
1362
|
+
teamMode: resolveSetupTeamModeArg(args.slice(1)),
|
|
1201
1363
|
});
|
|
1202
1364
|
break;
|
|
1203
1365
|
case "update":
|
|
@@ -1363,7 +1525,12 @@ async function showStatus() {
|
|
|
1363
1525
|
try {
|
|
1364
1526
|
const refs = await listModeStateFilesWithScopePreference(cwd);
|
|
1365
1527
|
const states = refs.map((ref) => ref.path);
|
|
1528
|
+
const ultragoalState = await readUltragoalState(cwd).catch(() => null);
|
|
1366
1529
|
if (states.length === 0) {
|
|
1530
|
+
if (ultragoalState?.active) {
|
|
1531
|
+
console.log(`ultragoal: ACTIVE (phase: ${ultragoalState.status})`);
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1367
1534
|
console.log("No active modes.");
|
|
1368
1535
|
return;
|
|
1369
1536
|
}
|
|
@@ -1379,8 +1546,13 @@ async function showStatus() {
|
|
|
1379
1546
|
}
|
|
1380
1547
|
const file = basename(path);
|
|
1381
1548
|
const mode = file.replace("-state.json", "");
|
|
1549
|
+
if (mode === "ultragoal" && ultragoalState?.active)
|
|
1550
|
+
continue;
|
|
1382
1551
|
console.log(`${mode}: ${state.active === true ? "ACTIVE" : "inactive"} (phase: ${String(state.current_phase || "n/a")})`);
|
|
1383
1552
|
}
|
|
1553
|
+
if (ultragoalState?.active) {
|
|
1554
|
+
console.log(`ultragoal: ACTIVE (phase: ${ultragoalState.status})`);
|
|
1555
|
+
}
|
|
1384
1556
|
}
|
|
1385
1557
|
catch (err) {
|
|
1386
1558
|
logCliOperationFailure(err);
|
|
@@ -2248,6 +2420,7 @@ function buildDetachedSessionLeaderCommand(cwd, sessionName, codexCmd, sessionId
|
|
|
2248
2420
|
"};",
|
|
2249
2421
|
"trap omx_detached_session_cleanup 0 INT TERM HUP;",
|
|
2250
2422
|
parentEnvSource,
|
|
2423
|
+
"unset OMX_HERMES_MCP_BRIDGE;",
|
|
2251
2424
|
"omx_codex_started_at=$(date +%s 2>/dev/null || printf 0);",
|
|
2252
2425
|
`${codexCmd} <&3 &`,
|
|
2253
2426
|
"omx_codex_pid=$!;",
|
|
@@ -2433,6 +2606,23 @@ export function buildDetachedSessionBootstrapSteps(sessionName, cwd, codexCmd, h
|
|
|
2433
2606
|
const detachedLeaderCmd = nativeWindows
|
|
2434
2607
|
? "powershell.exe"
|
|
2435
2608
|
: buildDetachedSessionLeaderCommand(cwd, sessionName, codexCmd, sessionId, codexHomeOverride, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup, parentEnvFilePath);
|
|
2609
|
+
const resolvedEnvStateRoot = env.OMX_STATE_ROOT?.trim()
|
|
2610
|
+
? resolveLaunchPath(cwd, env.OMX_STATE_ROOT.trim())
|
|
2611
|
+
: undefined;
|
|
2612
|
+
const hasExplicitRootOverride = Boolean(env.OMX_ROOT?.trim()
|
|
2613
|
+
|| (omxRootOverride && omxRootOverride !== resolvedEnvStateRoot));
|
|
2614
|
+
const hudRuntimeRoot = env.OMX_TEAM_STATE_ROOT?.trim()
|
|
2615
|
+
? resolveHudRuntimeRootForLaunch(cwd, env)
|
|
2616
|
+
: hasExplicitRootOverride
|
|
2617
|
+
? {
|
|
2618
|
+
omxRoot: omxRootOverride,
|
|
2619
|
+
rootSource: resolveHudRuntimeRootSource(omxRootOverride, env),
|
|
2620
|
+
}
|
|
2621
|
+
: resolveHudRuntimeRootForLaunch(cwd, env);
|
|
2622
|
+
const hudRuntimeEnv = buildHudRuntimeEnv({
|
|
2623
|
+
sessionId,
|
|
2624
|
+
...hudRuntimeRoot,
|
|
2625
|
+
}).env;
|
|
2436
2626
|
const newSessionArgs = [
|
|
2437
2627
|
"new-session",
|
|
2438
2628
|
"-d",
|
|
@@ -2446,12 +2636,9 @@ export function buildDetachedSessionBootstrapSteps(sessionName, cwd, codexCmd, h
|
|
|
2446
2636
|
...(workerLaunchArgs
|
|
2447
2637
|
? ["-e", `${TEAM_WORKER_LAUNCH_ARGS_ENV}=${workerLaunchArgs}`]
|
|
2448
2638
|
: []),
|
|
2449
|
-
...(
|
|
2450
|
-
...(sessionId ? ["-e", `${OMX_TMUX_HUD_OWNER_ENV}=1`] : []),
|
|
2639
|
+
...Object.entries(hudRuntimeEnv).map(([key, value]) => ["-e", `${key}=${value}`]).flat(),
|
|
2451
2640
|
...(codexHomeOverride ? ["-e", `CODEX_HOME=${codexHomeOverride}`] : []),
|
|
2452
2641
|
...(sqliteHomeOverride ? ["-e", `${CODEX_SQLITE_HOME_ENV}=${sqliteHomeOverride}`] : []),
|
|
2453
|
-
...(omxRootOverride ? ["-e", `OMX_ROOT=${omxRootOverride}`] : []),
|
|
2454
|
-
...(env.OMX_STATE_ROOT ? ["-e", `OMX_STATE_ROOT=${env.OMX_STATE_ROOT}`] : []),
|
|
2455
2642
|
...(env.OMXBOX_ACTIVE ? ["-e", `OMXBOX_ACTIVE=${env.OMXBOX_ACTIVE}`] : []),
|
|
2456
2643
|
...(env.OMX_SOURCE_CWD ? ["-e", `OMX_SOURCE_CWD=${env.OMX_SOURCE_CWD}`] : []),
|
|
2457
2644
|
...(notifyTempContractRaw
|
|
@@ -2501,8 +2688,27 @@ async function readLaunchAppendInstructions() {
|
|
|
2501
2688
|
const { readFile } = await import("fs/promises");
|
|
2502
2689
|
return (await readFile(appendixPath, "utf-8")).trim();
|
|
2503
2690
|
}
|
|
2504
|
-
export function
|
|
2691
|
+
export function shouldAttachDetachedTmuxSession(env = process.env) {
|
|
2692
|
+
return env.OMX_HERMES_MCP_BRIDGE !== "1";
|
|
2693
|
+
}
|
|
2694
|
+
function stripHermesMcpBridgeEnv(env) {
|
|
2695
|
+
const { OMX_HERMES_MCP_BRIDGE: _bridge, ...rest } = env;
|
|
2696
|
+
return rest;
|
|
2697
|
+
}
|
|
2698
|
+
export function buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWindowIndex, enableMouse, nativeWindows = false, attachSession = true, leaderPaneId = null) {
|
|
2505
2699
|
const steps = [];
|
|
2700
|
+
if (!nativeWindows && leaderPaneId) {
|
|
2701
|
+
steps.push({
|
|
2702
|
+
name: "register-detached-history-prune-hook",
|
|
2703
|
+
args: [
|
|
2704
|
+
"set-hook",
|
|
2705
|
+
"-t",
|
|
2706
|
+
sessionName,
|
|
2707
|
+
buildDetachedHistoryPruneHookSlot(sessionName, leaderPaneId),
|
|
2708
|
+
buildDetachedHistoryPruneHookCommand(leaderPaneId),
|
|
2709
|
+
],
|
|
2710
|
+
});
|
|
2711
|
+
}
|
|
2506
2712
|
if (!nativeWindows && hudPaneId && hookWindowIndex) {
|
|
2507
2713
|
const hookTarget = buildResizeHookTarget(sessionName, hookWindowIndex);
|
|
2508
2714
|
const hookName = buildResizeHookName("launch", sessionName, hookWindowIndex, hudPaneId);
|
|
@@ -2534,10 +2740,12 @@ export function buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWi
|
|
|
2534
2740
|
args: [],
|
|
2535
2741
|
});
|
|
2536
2742
|
}
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2743
|
+
if (attachSession) {
|
|
2744
|
+
steps.push({
|
|
2745
|
+
name: "attach-session",
|
|
2746
|
+
args: ["attach-session", "-t", sessionName],
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2541
2749
|
return steps;
|
|
2542
2750
|
}
|
|
2543
2751
|
export function buildDetachedSessionRollbackSteps(sessionName, hookTarget, hookName, clientAttachedHookName) {
|
|
@@ -3027,27 +3235,26 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
|
|
|
3027
3235
|
}
|
|
3028
3236
|
const omxRootOverride = resolveOmxRootForLaunch(cwd, process.env);
|
|
3029
3237
|
const currentPaneId = process.env.TMUX_PANE;
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
...
|
|
3035
|
-
];
|
|
3238
|
+
const hudRuntimeRoot = resolveHudRuntimeRootForLaunch(cwd, process.env);
|
|
3239
|
+
const hudEnvArgs = Object.entries(buildHudRuntimeEnv({
|
|
3240
|
+
sessionId,
|
|
3241
|
+
leaderPaneId: currentPaneId,
|
|
3242
|
+
...hudRuntimeRoot,
|
|
3243
|
+
}).env).map(([key, value]) => `${key}=${value}`);
|
|
3036
3244
|
const hudCmd = nativeWindows
|
|
3037
3245
|
? buildWindowsPromptCommand("node", [omxBin, "hud", "--watch"])
|
|
3038
3246
|
: buildTmuxPaneCommand("env", [...hudEnvArgs, "node", omxBin, "hud", "--watch"]);
|
|
3039
3247
|
const inheritLeaderFlags = process.env[TEAM_INHERIT_LEADER_FLAGS_ENV] !== "0";
|
|
3040
3248
|
const workerLaunchArgs = resolveTeamWorkerLaunchArgsEnv(process.env[TEAM_WORKER_LAUNCH_ARGS_ENV], launchArgs, inheritLeaderFlags, workerDefaultModel);
|
|
3041
3249
|
const codexBaseEnv = {
|
|
3042
|
-
...process.env,
|
|
3250
|
+
...stripHermesMcpBridgeEnv(process.env),
|
|
3043
3251
|
...(codexHomeOverride ? { CODEX_HOME: codexHomeOverride } : {}),
|
|
3044
3252
|
...(sqliteHomeOverride ? { [CODEX_SQLITE_HOME_ENV]: sqliteHomeOverride } : {}),
|
|
3045
3253
|
...(omxRootOverride ? { OMX_ROOT: omxRootOverride } : {}),
|
|
3046
3254
|
};
|
|
3047
3255
|
const codexEnvWithSession = {
|
|
3048
3256
|
...codexBaseEnv,
|
|
3049
|
-
|
|
3050
|
-
[OMX_TMUX_HUD_OWNER_ENV]: "1",
|
|
3257
|
+
...buildHudRuntimeEnv({ sessionId }).env,
|
|
3051
3258
|
};
|
|
3052
3259
|
const codexEnv = workerLaunchArgs
|
|
3053
3260
|
? { ...codexEnvWithSession, [TEAM_WORKER_LAUNCH_ARGS_ENV]: workerLaunchArgs }
|
|
@@ -3077,22 +3284,37 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
|
|
|
3077
3284
|
const staleHudPaneIds = currentPaneId
|
|
3078
3285
|
? listHudWatchPaneIdsInCurrentWindow(currentPaneId, { sessionId, leaderPaneId: currentPaneId })
|
|
3079
3286
|
: [];
|
|
3080
|
-
|
|
3287
|
+
let hudPaneId = null;
|
|
3288
|
+
const [keeperHudPaneId, ...duplicateHudPaneIds] = staleHudPaneIds;
|
|
3289
|
+
for (const paneId of duplicateHudPaneIds) {
|
|
3081
3290
|
killTmuxPane(paneId);
|
|
3082
3291
|
}
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3292
|
+
if (keeperHudPaneId) {
|
|
3293
|
+
hudPaneId = keeperHudPaneId;
|
|
3294
|
+
try {
|
|
3295
|
+
resizeTmuxPane(hudPaneId, HUD_TMUX_HEIGHT_LINES);
|
|
3296
|
+
if (currentPaneId) {
|
|
3297
|
+
registerHudResizeHook(hudPaneId, currentPaneId, HUD_TMUX_HEIGHT_LINES);
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
catch (err) {
|
|
3301
|
+
logCliOperationFailure(err);
|
|
3091
3302
|
}
|
|
3092
3303
|
}
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3304
|
+
else {
|
|
3305
|
+
try {
|
|
3306
|
+
hudPaneId = createHudWatchPane(cwd, hudCmd, {
|
|
3307
|
+
heightLines: HUD_TMUX_HEIGHT_LINES,
|
|
3308
|
+
targetPaneId: currentPaneId,
|
|
3309
|
+
});
|
|
3310
|
+
if (hudPaneId && currentPaneId) {
|
|
3311
|
+
registerHudResizeHook(hudPaneId, currentPaneId, HUD_TMUX_HEIGHT_LINES);
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3314
|
+
catch (err) {
|
|
3315
|
+
logCliOperationFailure(err);
|
|
3316
|
+
// HUD split failed, continue without it
|
|
3317
|
+
}
|
|
3096
3318
|
}
|
|
3097
3319
|
// Enable mouse scrolling at session start so scroll works before team
|
|
3098
3320
|
// expansion. Previously this was only called from createTeamSession().
|
|
@@ -3160,8 +3382,14 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
|
|
|
3160
3382
|
: null;
|
|
3161
3383
|
if (activeRecord &&
|
|
3162
3384
|
activeRecord.context_key === contextKey &&
|
|
3163
|
-
|
|
3385
|
+
isReusableMadmaxDetachedActiveRecord(activeRecord)) {
|
|
3164
3386
|
cleanupCurrentMadmaxReuseRunRoot(process.env, runsRoot);
|
|
3387
|
+
setDetachedTmuxSessionHistoryLimit(activeRecord.tmux_session_name, activeRecord.tmux_pane_id);
|
|
3388
|
+
if (!shouldAttachDetachedTmuxSession(process.env)) {
|
|
3389
|
+
clearDetachedTmuxSessionHistoryIfUnattached(activeRecord.tmux_session_name, activeRecord.tmux_pane_id);
|
|
3390
|
+
process.stderr.write(`[omx] madmax detached launch already active for this context; reusing ${activeRecord.tmux_session_name} without attaching because this launch is a Hermes MCP bridge.\n`);
|
|
3391
|
+
return { postLaunchHandledExternally: true };
|
|
3392
|
+
}
|
|
3165
3393
|
process.stderr.write(`[omx] madmax detached launch already active for this context; attaching ${activeRecord.tmux_session_name} instead of starting a duplicate.\n`);
|
|
3166
3394
|
try {
|
|
3167
3395
|
execTmuxFileSync(["attach-session", "-t", activeRecord.tmux_session_name], {
|
|
@@ -3177,15 +3405,28 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
|
|
|
3177
3405
|
if (activeRecordPath && activeRecord) {
|
|
3178
3406
|
rmSync(activeRecordPath, { force: true });
|
|
3179
3407
|
}
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3408
|
+
let detachedSessionBindingWrite = Promise.resolve();
|
|
3409
|
+
const writeDetachedSessionBinding = (tmuxPaneId) => {
|
|
3410
|
+
detachedSessionBindingWrite = detachedSessionBindingWrite
|
|
3411
|
+
.catch((err) => {
|
|
3412
|
+
logCliOperationFailure(err);
|
|
3413
|
+
})
|
|
3414
|
+
.then(() => writeSessionStart(cwd, sessionId, {
|
|
3415
|
+
tmuxSessionName: sessionName,
|
|
3416
|
+
...(tmuxPaneId ? { tmuxPaneId } : {}),
|
|
3417
|
+
}));
|
|
3418
|
+
void detachedSessionBindingWrite.catch((err) => {
|
|
3419
|
+
logCliOperationFailure(err);
|
|
3420
|
+
// Non-fatal: managed tmux recovery can still use compatibility fallback.
|
|
3421
|
+
});
|
|
3422
|
+
};
|
|
3423
|
+
writeDetachedSessionBinding();
|
|
3184
3424
|
let createdDetachedSession = false;
|
|
3185
3425
|
let registeredHookTarget = null;
|
|
3186
3426
|
let registeredHookName = null;
|
|
3187
3427
|
let registeredClientAttachedHookName = null;
|
|
3188
3428
|
let detachedParentEnvFilePath;
|
|
3429
|
+
let detachedLeaderPaneId = null;
|
|
3189
3430
|
try {
|
|
3190
3431
|
// This path is the user-shell interactive launch: OMX creates a tmux
|
|
3191
3432
|
// session and immediately attaches the user's terminal to it. If a tmux
|
|
@@ -3204,18 +3445,25 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
|
|
|
3204
3445
|
});
|
|
3205
3446
|
if (step.name === "new-session") {
|
|
3206
3447
|
createdDetachedSession = true;
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3448
|
+
const leaderPaneId = parsePaneIdFromTmuxOutput(output || "");
|
|
3449
|
+
if (leaderPaneId) {
|
|
3450
|
+
detachedLeaderPaneId = leaderPaneId;
|
|
3451
|
+
setDetachedTmuxSessionHistoryLimit(sessionName, leaderPaneId);
|
|
3452
|
+
if (activeRecordPath && contextKey) {
|
|
3453
|
+
writeMadmaxDetachedActiveRecord(activeRecordPath, {
|
|
3454
|
+
version: 1,
|
|
3455
|
+
context_key: contextKey,
|
|
3456
|
+
created_at: new Date().toISOString(),
|
|
3457
|
+
source_cwd: process.env.OMX_SOURCE_CWD || cwd,
|
|
3458
|
+
argv: args,
|
|
3459
|
+
run_dir: process.env.OMX_ROOT || cwd,
|
|
3460
|
+
tmux_session_name: sessionName,
|
|
3461
|
+
session_id: sessionId,
|
|
3462
|
+
tmux_pane_id: leaderPaneId,
|
|
3463
|
+
});
|
|
3464
|
+
}
|
|
3465
|
+
writeDetachedSessionBinding(leaderPaneId);
|
|
3217
3466
|
}
|
|
3218
|
-
parsePaneIdFromTmuxOutput(output || "");
|
|
3219
3467
|
}
|
|
3220
3468
|
if (step.name === "split-and-capture-hud-pane") {
|
|
3221
3469
|
const hudPaneId = parsePaneIdFromTmuxOutput(output || "");
|
|
@@ -3231,7 +3479,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
|
|
|
3231
3479
|
const clientAttachedHookName = hudPaneId && hookWindowIndex
|
|
3232
3480
|
? buildClientAttachedReconcileHookName("launch", sessionName, hookWindowIndex, hudPaneId)
|
|
3233
3481
|
: null;
|
|
3234
|
-
const finalizeSteps = buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWindowIndex, process.env.OMX_MOUSE !== "0", nativeWindows);
|
|
3482
|
+
const finalizeSteps = buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWindowIndex, process.env.OMX_MOUSE !== "0", nativeWindows, shouldAttachDetachedTmuxSession(process.env), detachedLeaderPaneId);
|
|
3235
3483
|
if (nativeWindows && detachedWindowsCodexCmd) {
|
|
3236
3484
|
scheduleDetachedWindowsCodexLaunch(sessionName, detachedWindowsCodexCmd);
|
|
3237
3485
|
}
|