oh-my-codex 0.14.4 → 0.15.1
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/.agents/plugins/marketplace.json +20 -0
- package/Cargo.lock +6 -6
- package/Cargo.toml +2 -1
- package/README.md +40 -7
- package/crates/omx-explore/Cargo.toml +1 -0
- package/crates/omx-explore/src/main.rs +246 -24
- package/crates/omx-mux/Cargo.toml +1 -0
- package/crates/omx-runtime/Cargo.toml +1 -0
- package/crates/omx-runtime-core/Cargo.toml +1 -0
- package/crates/omx-runtime-core/src/dispatch.rs +2 -1
- package/crates/omx-runtime-core/src/engine.rs +2 -2
- package/crates/omx-runtime-core/src/mailbox.rs +2 -1
- package/crates/omx-sparkshell/Cargo.toml +1 -0
- package/crates/omx-sparkshell/src/codex_bridge.rs +1 -0
- package/crates/omx-sparkshell/src/prompt.rs +1 -0
- package/crates/omx-sparkshell/src/threshold.rs +1 -0
- package/dist/agents/__tests__/native-config.test.js +98 -4
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/native-config.d.ts +4 -0
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js +19 -3
- package/dist/agents/native-config.js.map +1 -1
- package/dist/agents/policy.d.ts +10 -0
- package/dist/agents/policy.d.ts.map +1 -0
- package/dist/agents/policy.js +61 -0
- package/dist/agents/policy.js.map +1 -0
- package/dist/catalog/__tests__/generator.test.js +2 -0
- package/dist/catalog/__tests__/generator.test.js.map +1 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +2 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +1 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +72 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -0
- package/dist/catalog/installable.d.ts +5 -0
- package/dist/catalog/installable.d.ts.map +1 -0
- package/dist/catalog/installable.js +13 -0
- package/dist/catalog/installable.js.map +1 -0
- package/dist/catalog/skill-mirror.d.ts +20 -0
- package/dist/catalog/skill-mirror.d.ts.map +1 -0
- package/dist/catalog/skill-mirror.js +104 -0
- package/dist/catalog/skill-mirror.js.map +1 -0
- package/dist/cli/__tests__/ask.test.js +4 -1
- package/dist/cli/__tests__/ask.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +2 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +1 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js +210 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-team.test.js +46 -1
- package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +225 -111
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +96 -1
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/explore.test.js +26 -9
- package/dist/cli/__tests__/explore.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +301 -7
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +358 -4
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/list.test.d.ts +2 -0
- package/dist/cli/__tests__/list.test.d.ts.map +1 -0
- package/dist/cli/__tests__/list.test.js +38 -0
- package/dist/cli/__tests__/list.test.js.map +1 -0
- package/dist/cli/__tests__/mcp-parity.test.js +86 -0
- package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-serve.test.d.ts +2 -0
- package/dist/cli/__tests__/mcp-serve.test.d.ts.map +1 -0
- package/dist/cli/__tests__/mcp-serve.test.js +38 -0
- package/dist/cli/__tests__/mcp-serve.test.js.map +1 -0
- package/dist/cli/__tests__/nested-help-routing.test.js +1 -0
- package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +58 -3
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +209 -5
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +146 -3
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-install-mode.test.js +873 -0
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -0
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js +83 -22
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +120 -2
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +32 -13
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
- package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sidecar.test.js +24 -0
- package/dist/cli/__tests__/sidecar.test.js.map +1 -0
- package/dist/cli/__tests__/team.test.js +90 -42
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/version-sync-contract.test.js +11 -0
- package/dist/cli/__tests__/version-sync-contract.test.js.map +1 -1
- package/dist/cli/codex-home.d.ts +4 -5
- package/dist/cli/codex-home.d.ts.map +1 -1
- package/dist/cli/codex-home.js +9 -37
- package/dist/cli/codex-home.js.map +1 -1
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +509 -278
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +13 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +351 -60
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/list.d.ts +2 -0
- package/dist/cli/list.d.ts.map +1 -0
- package/dist/cli/list.js +40 -0
- package/dist/cli/list.js.map +1 -0
- package/dist/cli/mcp-serve.d.ts +12 -0
- package/dist/cli/mcp-serve.d.ts.map +1 -0
- package/dist/cli/mcp-serve.js +63 -0
- package/dist/cli/mcp-serve.js.map +1 -0
- package/dist/cli/plugin-marketplace.d.ts +13 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -0
- package/dist/cli/plugin-marketplace.js +77 -0
- package/dist/cli/plugin-marketplace.js.map +1 -0
- package/dist/cli/question.d.ts.map +1 -1
- package/dist/cli/question.js +27 -2
- package/dist/cli/question.js.map +1 -1
- package/dist/cli/setup-preferences.d.ts +20 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -0
- package/dist/cli/setup-preferences.js +71 -0
- package/dist/cli/setup-preferences.js.map +1 -0
- package/dist/cli/setup.d.ts +12 -3
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +1080 -254
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts +1 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +22 -3
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +2 -8
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +100 -3
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +6 -5
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
- package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
- package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
- package/dist/config/__tests__/models.test.js +35 -2
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/codex-hooks.d.ts.map +1 -1
- package/dist/config/codex-hooks.js +2 -7
- package/dist/config/codex-hooks.js.map +1 -1
- package/dist/config/generator.d.ts +10 -0
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +259 -76
- package/dist/config/generator.js.map +1 -1
- package/dist/config/models.d.ts +13 -3
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +25 -5
- package/dist/config/models.js.map +1 -1
- package/dist/config/omx-first-party-mcp.d.ts +18 -0
- package/dist/config/omx-first-party-mcp.d.ts.map +1 -0
- package/dist/config/omx-first-party-mcp.js +76 -0
- package/dist/config/omx-first-party-mcp.js.map +1 -0
- package/dist/document-refresh/__tests__/enforcer.test.d.ts +2 -0
- package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +1 -0
- package/dist/document-refresh/__tests__/enforcer.test.js +128 -0
- package/dist/document-refresh/__tests__/enforcer.test.js.map +1 -0
- package/dist/document-refresh/config.d.ts +9 -0
- package/dist/document-refresh/config.d.ts.map +1 -0
- package/dist/document-refresh/config.js +70 -0
- package/dist/document-refresh/config.js.map +1 -0
- package/dist/document-refresh/enforcer.d.ts +43 -0
- package/dist/document-refresh/enforcer.d.ts.map +1 -0
- package/dist/document-refresh/enforcer.js +329 -0
- package/dist/document-refresh/enforcer.js.map +1 -0
- package/dist/exec/followup.d.ts +44 -0
- package/dist/exec/followup.d.ts.map +1 -0
- package/dist/exec/followup.js +349 -0
- package/dist/exec/followup.js.map +1 -0
- package/dist/hooks/__tests__/codebase-map.test.js +63 -1
- package/dist/hooks/__tests__/codebase-map.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +10 -7
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +89 -0
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +84 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +23 -2
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +43 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +17 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +53 -0
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js +4 -4
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +103 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +27 -13
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +70 -3
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js +5 -0
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +3 -2
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +28 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/triage-heuristic.test.js +59 -4
- package/dist/hooks/__tests__/triage-heuristic.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +2 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.js +44 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -0
- package/dist/hooks/codebase-map.d.ts.map +1 -1
- package/dist/hooks/codebase-map.js +83 -6
- package/dist/hooks/codebase-map.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +19 -14
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/prompt-guidance-contract.d.ts +6 -0
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +89 -0
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/session.d.ts +2 -0
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +6 -0
- package/dist/hooks/session.js.map +1 -1
- package/dist/hooks/triage-heuristic.d.ts +2 -2
- package/dist/hooks/triage-heuristic.d.ts.map +1 -1
- package/dist/hooks/triage-heuristic.js +97 -20
- package/dist/hooks/triage-heuristic.js.map +1 -1
- package/dist/hooks/triage-state.d.ts +1 -1
- package/dist/hooks/triage-state.d.ts.map +1 -1
- package/dist/hooks/triage-state.js +2 -1
- package/dist/hooks/triage-state.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +4 -4
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +4 -0
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/types.test.js +27 -0
- package/dist/hud/__tests__/types.test.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +8 -0
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +9 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +3 -0
- package/dist/hud/types.js.map +1 -1
- package/dist/mcp/__tests__/bootstrap.test.js +45 -5
- package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +50 -7
- package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +67 -9
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/bootstrap.d.ts +12 -1
- package/dist/mcp/bootstrap.d.ts.map +1 -1
- package/dist/mcp/bootstrap.js +87 -29
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/state-server.d.ts +5 -11
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/state-server.js +16 -432
- package/dist/mcp/state-server.js.map +1 -1
- package/dist/planning/__tests__/artifacts.test.js +152 -1
- package/dist/planning/__tests__/artifacts.test.js.map +1 -1
- package/dist/planning/artifacts.d.ts +9 -0
- package/dist/planning/artifacts.d.ts.map +1 -1
- package/dist/planning/artifacts.js +60 -1
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/question/__tests__/deep-interview.test.js +1 -1
- package/dist/question/__tests__/deep-interview.test.js.map +1 -1
- package/dist/question/__tests__/renderer.test.js +70 -0
- package/dist/question/__tests__/renderer.test.js.map +1 -1
- package/dist/question/__tests__/ui.test.js +49 -0
- package/dist/question/__tests__/ui.test.js.map +1 -1
- package/dist/question/renderer.d.ts +14 -1
- package/dist/question/renderer.d.ts.map +1 -1
- package/dist/question/renderer.js +109 -10
- package/dist/question/renderer.js.map +1 -1
- package/dist/question/state.d.ts +2 -0
- package/dist/question/state.d.ts.map +1 -1
- package/dist/question/state.js +4 -0
- package/dist/question/state.js.map +1 -1
- package/dist/question/types.d.ts +2 -1
- package/dist/question/types.d.ts.map +1 -1
- package/dist/question/types.js.map +1 -1
- package/dist/question/ui.d.ts.map +1 -1
- package/dist/question/ui.js +28 -8
- package/dist/question/ui.js.map +1 -1
- package/dist/runtime/__tests__/bridge.test.js +143 -1
- package/dist/runtime/__tests__/bridge.test.js.map +1 -1
- package/dist/runtime/bridge.d.ts +21 -0
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +54 -4
- package/dist/runtime/bridge.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +1904 -230
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/generate-release-body.test.js +90 -1
- package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -1
- package/dist/scripts/__tests__/hook-derived-watcher.test.js +110 -2
- package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -1
- package/dist/scripts/__tests__/postinstall.test.js +7 -93
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
- package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.d.ts +2 -0
- package/dist/scripts/__tests__/run-test-files.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.js +62 -0
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -0
- package/dist/scripts/__tests__/smoke-packed-install.test.js +13 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts +2 -0
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/verify-native-agents.test.js +166 -0
- package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -0
- package/dist/scripts/codex-execution-surface.d.ts +16 -0
- package/dist/scripts/codex-execution-surface.d.ts.map +1 -0
- package/dist/scripts/codex-execution-surface.js +42 -0
- package/dist/scripts/codex-execution-surface.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +418 -76
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts +8 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +133 -19
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/generate-release-body.d.ts +1 -0
- package/dist/scripts/generate-release-body.d.ts.map +1 -1
- package/dist/scripts/generate-release-body.js +32 -3
- package/dist/scripts/generate-release-body.js.map +1 -1
- package/dist/scripts/hook-derived-watcher.js +46 -7
- package/dist/scripts/hook-derived-watcher.js.map +1 -1
- package/dist/scripts/notify-fallback-watcher.js +59 -9
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
- package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
- package/dist/scripts/notify-hook/managed-tmux.js +18 -1
- package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
- package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
- package/dist/scripts/notify-hook/process-runner.js +7 -3
- package/dist/scripts/notify-hook/process-runner.js.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +96 -11
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +3 -3
- package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
- package/dist/scripts/notify-hook/team-worker.d.ts +1 -1
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +3 -43
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook.js +36 -5
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/postinstall.d.ts +1 -5
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +3 -42
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/scripts/prompt-inventory.d.ts +29 -0
- package/dist/scripts/prompt-inventory.d.ts.map +1 -0
- package/dist/scripts/prompt-inventory.js +178 -0
- package/dist/scripts/prompt-inventory.js.map +1 -0
- package/dist/scripts/run-test-files.js +32 -2
- package/dist/scripts/run-test-files.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +3 -0
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +9 -1
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts +13 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -0
- package/dist/scripts/sync-plugin-mirror.js +242 -0
- package/dist/scripts/sync-plugin-mirror.js.map +1 -0
- package/dist/scripts/verify-native-agents.d.ts +16 -0
- package/dist/scripts/verify-native-agents.d.ts.map +1 -0
- package/dist/scripts/verify-native-agents.js +188 -0
- package/dist/scripts/verify-native-agents.js.map +1 -0
- package/dist/session-history/search.d.ts.map +1 -1
- package/dist/session-history/search.js +7 -2
- package/dist/session-history/search.js.map +1 -1
- package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
- package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/boundary.test.js +48 -0
- package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
- package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
- package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/collector.test.js +162 -0
- package/dist/sidecar/__tests__/collector.test.js.map +1 -0
- package/dist/sidecar/__tests__/render.test.d.ts +2 -0
- package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/render.test.js +67 -0
- package/dist/sidecar/__tests__/render.test.js.map +1 -0
- package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
- package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/tmux.test.js +30 -0
- package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
- package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
- package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/watch.test.js +42 -0
- package/dist/sidecar/__tests__/watch.test.js.map +1 -0
- package/dist/sidecar/collector.d.ts +4 -0
- package/dist/sidecar/collector.d.ts.map +1 -0
- package/dist/sidecar/collector.js +377 -0
- package/dist/sidecar/collector.js.map +1 -0
- package/dist/sidecar/index.d.ts +25 -0
- package/dist/sidecar/index.d.ts.map +1 -0
- package/dist/sidecar/index.js +165 -0
- package/dist/sidecar/index.js.map +1 -0
- package/dist/sidecar/render.d.ts +3 -0
- package/dist/sidecar/render.d.ts.map +1 -0
- package/dist/sidecar/render.js +72 -0
- package/dist/sidecar/render.js.map +1 -0
- package/dist/sidecar/tmux.d.ts +13 -0
- package/dist/sidecar/tmux.d.ts.map +1 -0
- package/dist/sidecar/tmux.js +44 -0
- package/dist/sidecar/tmux.js.map +1 -0
- package/dist/sidecar/types.d.ts +125 -0
- package/dist/sidecar/types.d.ts.map +1 -0
- package/dist/sidecar/types.js +2 -0
- package/dist/sidecar/types.js.map +1 -0
- package/dist/state/__tests__/operations.test.js +50 -22
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/operations.d.ts +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +19 -7
- package/dist/state/operations.js.map +1 -1
- package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
- package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
- package/dist/team/__tests__/commit-hygiene.test.js +93 -0
- package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
- package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
- package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
- package/dist/team/__tests__/delegation-policy.test.js +69 -0
- package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
- package/dist/team/__tests__/events.test.js +54 -4
- package/dist/team/__tests__/events.test.js.map +1 -1
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +18 -2
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.js +95 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -0
- package/dist/team/__tests__/runtime.test.js +677 -17
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js +177 -1
- package/dist/team/__tests__/state-root.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +110 -0
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +301 -2
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +94 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/commit-hygiene.d.ts +22 -3
- package/dist/team/commit-hygiene.d.ts.map +1 -1
- package/dist/team/commit-hygiene.js +134 -2
- package/dist/team/commit-hygiene.js.map +1 -1
- package/dist/team/contracts.d.ts +1 -1
- package/dist/team/contracts.d.ts.map +1 -1
- package/dist/team/contracts.js +2 -0
- package/dist/team/contracts.js.map +1 -1
- package/dist/team/dag-schema.d.ts +38 -0
- package/dist/team/dag-schema.d.ts.map +1 -0
- package/dist/team/dag-schema.js +221 -0
- package/dist/team/dag-schema.js.map +1 -0
- package/dist/team/delegation-policy.d.ts +3 -0
- package/dist/team/delegation-policy.d.ts.map +1 -0
- package/dist/team/delegation-policy.js +82 -0
- package/dist/team/delegation-policy.js.map +1 -0
- package/dist/team/model-contract.d.ts +3 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +44 -5
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/repo-aware-decomposition.d.ts +60 -0
- package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
- package/dist/team/repo-aware-decomposition.js +229 -0
- package/dist/team/repo-aware-decomposition.js.map +1 -0
- package/dist/team/runtime.d.ts +34 -0
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +191 -50
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +33 -0
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/state/types.d.ts +23 -1
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state-root.d.ts +35 -0
- package/dist/team/state-root.d.ts.map +1 -1
- package/dist/team/state-root.js +281 -1
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts +27 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +6 -0
- package/dist/team/state.js.map +1 -1
- package/dist/team/tmux-session.d.ts +1 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +83 -6
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +3 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +77 -4
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/utils/__tests__/agents-model-table.test.js +8 -0
- package/dist/utils/__tests__/agents-model-table.test.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +42 -9
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/agents-md.d.ts +3 -0
- package/dist/utils/agents-md.d.ts.map +1 -1
- package/dist/utils/agents-md.js +25 -0
- package/dist/utils/agents-md.js.map +1 -1
- package/dist/utils/agents-model-table.d.ts.map +1 -1
- package/dist/utils/agents-model-table.js +2 -3
- package/dist/utils/agents-model-table.js.map +1 -1
- package/package.json +14 -7
- package/plugins/oh-my-codex/.app.json +3 -0
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +30 -0
- package/plugins/oh-my-codex/.mcp.json +44 -0
- package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +114 -0
- package/plugins/oh-my-codex/skills/analyze/SKILL.md +148 -0
- package/plugins/oh-my-codex/skills/ask-claude/SKILL.md +61 -0
- package/plugins/oh-my-codex/skills/ask-gemini/SKILL.md +61 -0
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +231 -0
- package/plugins/oh-my-codex/skills/autoresearch/SKILL.md +68 -0
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +399 -0
- package/plugins/oh-my-codex/skills/code-review/SKILL.md +290 -0
- package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +287 -0
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +464 -0
- package/plugins/oh-my-codex/skills/doctor/SKILL.md +239 -0
- package/plugins/oh-my-codex/skills/help/SKILL.md +202 -0
- package/plugins/oh-my-codex/skills/hud/SKILL.md +98 -0
- package/plugins/oh-my-codex/skills/note/SKILL.md +62 -0
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +135 -0
- package/plugins/oh-my-codex/skills/pipeline/SKILL.md +86 -0
- package/plugins/oh-my-codex/skills/plan/SKILL.md +276 -0
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +269 -0
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +162 -0
- package/plugins/oh-my-codex/skills/security-review/SKILL.md +300 -0
- package/plugins/oh-my-codex/skills/skill/SKILL.md +835 -0
- package/plugins/oh-my-codex/skills/team/SKILL.md +510 -0
- package/plugins/oh-my-codex/skills/trace/SKILL.md +33 -0
- package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +143 -0
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +175 -0
- package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +153 -0
- package/plugins/oh-my-codex/skills/visual-verdict/SKILL.md +76 -0
- package/plugins/oh-my-codex/skills/wiki/SKILL.md +57 -0
- package/plugins/oh-my-codex/skills/worker/SKILL.md +106 -0
- package/prompts/critic.md +35 -83
- package/prompts/executor.md +32 -109
- package/prompts/explore-harness.md +1 -1
- package/prompts/explore.md +37 -90
- package/prompts/planner.md +28 -58
- package/prompts/researcher.md +46 -78
- package/prompts/verifier.md +23 -31
- package/skills/autopilot/SKILL.md +1 -4
- package/skills/deep-interview/SKILL.md +8 -5
- package/skills/doctor/SKILL.md +45 -17
- package/skills/help/SKILL.md +2 -2
- package/skills/omx-setup/SKILL.md +52 -9
- package/skills/plan/SKILL.md +1 -4
- package/skills/ralph/SKILL.md +3 -5
- package/skills/ralplan/SKILL.md +2 -6
- package/skills/team/SKILL.md +2 -5
- package/skills/ultraqa/SKILL.md +1 -4
- package/skills/ultrawork/SKILL.md +2 -3
- package/skills/visual-ralph/SKILL.md +153 -0
- package/skills/web-clone/SKILL.md +12 -354
- package/src/scripts/__tests__/codex-native-hook.test.ts +2306 -224
- package/src/scripts/__tests__/generate-release-body.test.ts +109 -0
- package/src/scripts/__tests__/hook-derived-watcher.test.ts +132 -2
- package/src/scripts/__tests__/postinstall.test.ts +7 -104
- package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
- package/src/scripts/__tests__/run-test-files.test.ts +72 -0
- package/src/scripts/__tests__/smoke-packed-install.test.ts +15 -0
- package/src/scripts/__tests__/verify-native-agents.test.ts +204 -0
- package/src/scripts/codex-execution-surface.ts +73 -0
- package/src/scripts/codex-native-hook.ts +579 -82
- package/src/scripts/codex-native-pre-post.ts +157 -19
- package/src/scripts/generate-release-body.ts +34 -2
- package/src/scripts/hook-derived-watcher.ts +51 -8
- package/src/scripts/notify-fallback-watcher.ts +65 -9
- package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
- package/src/scripts/notify-hook/managed-tmux.ts +22 -4
- package/src/scripts/notify-hook/process-runner.ts +7 -3
- package/src/scripts/notify-hook/team-dispatch.ts +103 -11
- package/src/scripts/notify-hook/team-tmux-guard.ts +3 -3
- package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
- package/src/scripts/notify-hook/team-worker.ts +4 -48
- package/src/scripts/notify-hook.ts +36 -5
- package/src/scripts/postinstall.ts +4 -58
- package/src/scripts/prompt-inventory.ts +218 -0
- package/src/scripts/run-test-files.ts +41 -2
- package/src/scripts/smoke-packed-install.ts +10 -1
- package/src/scripts/sync-plugin-mirror.ts +360 -0
- package/src/scripts/verify-native-agents.ts +245 -0
- package/templates/AGENTS.md +26 -91
- package/templates/catalog-manifest.json +16 -1
package/dist/cli/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { version } from "./version.js";
|
|
|
12
12
|
import { tmuxHookCommand } from "./tmux-hook.js";
|
|
13
13
|
import { hooksCommand } from "./hooks.js";
|
|
14
14
|
import { hudCommand } from "../hud/index.js";
|
|
15
|
+
import { sidecarCommand } from "../sidecar/index.js";
|
|
15
16
|
import { teamCommand } from "./team.js";
|
|
16
17
|
import { ralphCommand } from "./ralph.js";
|
|
17
18
|
import { askCommand } from "./ask.js";
|
|
@@ -25,11 +26,13 @@ import { agentsCommand } from "./agents.js";
|
|
|
25
26
|
import { sessionCommand } from "./session-search.js";
|
|
26
27
|
import { autoresearchCommand } from "./autoresearch.js";
|
|
27
28
|
import { mcpParityCommand } from "./mcp-parity.js";
|
|
29
|
+
import { mcpServeCommand } from "./mcp-serve.js";
|
|
28
30
|
import { adaptCommand } from "./adapt.js";
|
|
31
|
+
import { listCommand } from "./list.js";
|
|
29
32
|
import { MADMAX_FLAG, CODEX_BYPASS_FLAG, HIGH_REASONING_FLAG, XHIGH_REASONING_FLAG, SPARK_FLAG, MADMAX_SPARK_FLAG, CONFIG_FLAG, LONG_CONFIG_FLAG, } from "./constants.js";
|
|
30
33
|
import { getBaseStateDir, getStateDir, listModeStateFilesWithScopePreference, } from "../mcp/state-paths.js";
|
|
31
|
-
import { resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, } from "./codex-home.js";
|
|
32
|
-
export { readPersistedSetupPreferences, readPersistedSetupScope, resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, } from "./codex-home.js";
|
|
34
|
+
import { resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, resolveProjectLocalCodexHomeForLaunch, } from "./codex-home.js";
|
|
35
|
+
export { readPersistedSetupPreferences, readPersistedSetupScope, resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, resolveProjectLocalCodexHomeForLaunch, } from "./codex-home.js";
|
|
33
36
|
import { SKILL_ACTIVE_STATE_MODE, syncCanonicalSkillStateForMode } from "../state/skill-active.js";
|
|
34
37
|
import { isTrackedWorkflowMode } from "../state/workflow-transition.js";
|
|
35
38
|
import { maybeCheckAndPromptUpdate, runImmediateUpdate } from "./update.js";
|
|
@@ -39,7 +42,7 @@ import { readSessionState, writeSessionStart, writeSessionEnd, resetSessionMetri
|
|
|
39
42
|
import { buildClientAttachedReconcileHookName, buildReconcileHudResizeArgs, buildRegisterClientAttachedReconcileArgs, buildRegisterResizeHookArgs, buildResizeHookName, buildResizeHookTarget, buildScheduleDelayedHudResizeArgs, buildUnregisterClientAttachedReconcileArgs, buildUnregisterResizeHookArgs, enableMouseScrolling, isMsysOrGitBash, isNativeWindows, isTmuxAvailable, mitigateCopyModeUnderlineArtifacts, } from "../team/tmux-session.js";
|
|
40
43
|
import { getPackageRoot } from "../utils/package.js";
|
|
41
44
|
import { codexConfigPath, rememberOmxLaunchContext, resolveOmxEntryPath } from "../utils/paths.js";
|
|
42
|
-
import { repairConfigIfNeeded } from "../config/generator.js";
|
|
45
|
+
import { cleanCodexModelAvailabilityNuxIfNeeded, repairConfigIfNeeded } from "../config/generator.js";
|
|
43
46
|
import { HUD_TMUX_HEIGHT_LINES } from "../hud/constants.js";
|
|
44
47
|
import { createHudWatchPane as createSharedHudWatchPane, killTmuxPane as killSharedTmuxPane, listCurrentWindowHudPaneIds, parsePaneIdFromTmuxOutput, } from "../hud/tmux.js";
|
|
45
48
|
export { parseTmuxPaneSnapshot, isHudWatchPane, findHudWatchPaneIds } from "../hud/tmux.js";
|
|
@@ -51,6 +54,7 @@ import { collectInheritableTeamWorkerArgs as collectInheritableTeamWorkerArgsSha
|
|
|
51
54
|
import { parseWorktreeMode, planWorktreeTarget, ensureWorktree, } from "../team/worktree.js";
|
|
52
55
|
import { ensureReusableNodeModules } from "../utils/repo-deps.js";
|
|
53
56
|
import { OMX_NOTIFY_TEMP_CONTRACT_ENV, parseNotifyTempContractFromArgs, serializeNotifyTempContract, } from "../notifications/temp-contract.js";
|
|
57
|
+
import { execInjectCommand } from "../exec/followup.js";
|
|
54
58
|
export function resolveNotifyFallbackWatcherScript(pkgRoot = getPackageRoot()) {
|
|
55
59
|
return resolveDistScript(pkgRoot, "notify-fallback-watcher.js");
|
|
56
60
|
}
|
|
@@ -67,12 +71,16 @@ export const HELP = `
|
|
|
67
71
|
oh-my-codex (omx) - Multi-agent orchestration for Codex CLI
|
|
68
72
|
|
|
69
73
|
Usage:
|
|
70
|
-
omx Launch Codex CLI (
|
|
74
|
+
omx Launch Codex CLI (detached tmux by default on supported interactive terminals)
|
|
71
75
|
omx exec Run codex exec non-interactively with OMX AGENTS/overlay injection
|
|
76
|
+
omx exec inject <session-id> --prompt <text>
|
|
77
|
+
Queue audited follow-up instructions for a running non-interactive exec job
|
|
72
78
|
omx setup Install skills, prompts, MCP servers, and scope-specific AGENTS.md
|
|
79
|
+
(user scope prompts for legacy vs plugin skill delivery when needed)
|
|
73
80
|
omx update Check npm now, update the global install immediately, then refresh setup
|
|
74
81
|
omx uninstall Remove OMX configuration and clean up installed artifacts
|
|
75
82
|
omx doctor Check installation health
|
|
83
|
+
omx list List packaged OMX skills and native agent prompts (--json)
|
|
76
84
|
omx cleanup Kill orphaned OMX MCP server processes and remove stale OMX /tmp directories
|
|
77
85
|
omx doctor --team Check team/swarm runtime health diagnostics
|
|
78
86
|
omx ask Ask local provider CLI (claude|gemini) and write artifact output
|
|
@@ -93,6 +101,7 @@ Usage:
|
|
|
93
101
|
omx tmux-hook Manage tmux prompt injection workaround (init|status|validate|test)
|
|
94
102
|
omx hooks Manage hook plugins (init|status|validate|test)
|
|
95
103
|
omx hud Show HUD statusline (--watch, --json, --preset=NAME)
|
|
104
|
+
omx sidecar Show read-only team/multi-agent visualization (--watch, --json, --tmux)
|
|
96
105
|
omx state Read/write/list OMX mode state via CLI parity surface
|
|
97
106
|
omx notepad CLI parity for OMX notepad MCP tools
|
|
98
107
|
omx project-memory
|
|
@@ -101,6 +110,7 @@ Usage:
|
|
|
101
110
|
omx code-intel
|
|
102
111
|
CLI parity for OMX code-intel MCP tools
|
|
103
112
|
omx wiki CLI parity for OMX wiki MCP tools
|
|
113
|
+
omx mcp-serve Launch an OMX stdio MCP server target (plugin/runtime use)
|
|
104
114
|
omx sparkshell <command> [args...]
|
|
105
115
|
omx sparkshell --tmux-pane <pane-id> [--tail-lines <100-1000>]
|
|
106
116
|
Run native sparkshell sidecar for direct command execution or explicit tmux-pane summarization
|
|
@@ -123,6 +133,7 @@ Options:
|
|
|
123
133
|
--madmax-spark spark model for workers + bypass approvals for leader and workers
|
|
124
134
|
(shorthand for: --spark --madmax)
|
|
125
135
|
--notify-temp Enable temporary notification routing for this run/session only
|
|
136
|
+
--direct Launch the interactive leader directly without OMX tmux/HUD management
|
|
126
137
|
--tmux Launch the interactive leader session in detached tmux
|
|
127
138
|
--discord Select Discord provider for temporary notification mode
|
|
128
139
|
--slack Select Slack provider for temporary notification mode
|
|
@@ -132,15 +143,32 @@ Options:
|
|
|
132
143
|
-w, --worktree[=<name>]
|
|
133
144
|
Launch Codex in a git worktree (detached when no name is given)
|
|
134
145
|
--force Force reinstall (overwrite existing files)
|
|
146
|
+
--merge-agents
|
|
147
|
+
Merge OMX-managed AGENTS.md sections into an existing AGENTS.md
|
|
148
|
+
instead of overwriting user-authored content
|
|
135
149
|
--dry-run Show what would be done without doing it
|
|
150
|
+
--plugin Use Codex plugin delivery for omx setup and remove legacy OMX-managed user/project components
|
|
151
|
+
--legacy Use legacy setup delivery for omx setup, overriding persisted plugin mode
|
|
152
|
+
--install-mode <legacy|plugin>
|
|
153
|
+
Explicit setup install mode (canonical form; --legacy/--plugin are aliases)
|
|
136
154
|
--keep-config Skip config.toml cleanup during uninstall
|
|
137
155
|
--purge Remove .omx/ cache directory during uninstall
|
|
138
156
|
--verbose Show detailed output
|
|
139
157
|
--scope Setup scope for "omx setup" only:
|
|
140
158
|
user | project
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
159
|
+
|
|
160
|
+
Launch policy:
|
|
161
|
+
OMX_LAUNCH_POLICY=direct|tmux|detached-tmux|auto
|
|
162
|
+
Choose the default leader launch policy when no CLI policy flag is present
|
|
163
|
+
unset OMX_LAUNCH_POLICY
|
|
164
|
+
Return to the auto/default policy (detached tmux on supported interactive terminals)
|
|
165
|
+
omx --direct --yolo
|
|
166
|
+
Run this launch without OMX tmux/HUD management
|
|
167
|
+
OMX_LAUNCH_POLICY=direct omx --yolo
|
|
168
|
+
Use direct launch from the environment
|
|
169
|
+
OMX_LAUNCH_POLICY=direct omx --tmux --yolo
|
|
170
|
+
CLI policy flags override the environment for one launch
|
|
171
|
+
Config files are intentionally not used for launch policy in this release.
|
|
144
172
|
`;
|
|
145
173
|
const REASONING_KEY = "model_reasoning_effort";
|
|
146
174
|
const MODEL_INSTRUCTIONS_FILE_KEY = "model_instructions_file";
|
|
@@ -167,6 +195,7 @@ const ALLOWED_SHELLS = new Set([
|
|
|
167
195
|
"/usr/local/bin/bash",
|
|
168
196
|
"/usr/local/bin/zsh",
|
|
169
197
|
"/usr/local/bin/fish",
|
|
198
|
+
"/opt/local/bin/zsh",
|
|
170
199
|
"/opt/homebrew/bin/zsh",
|
|
171
200
|
]);
|
|
172
201
|
const WINDOWS_DETACHED_BOOTSTRAP_DELAY_MS = 2500;
|
|
@@ -188,9 +217,12 @@ const NESTED_HELP_COMMANDS = new Set([
|
|
|
188
217
|
"deepinit",
|
|
189
218
|
"exec",
|
|
190
219
|
"hooks",
|
|
220
|
+
"list",
|
|
191
221
|
"hud",
|
|
222
|
+
"sidecar",
|
|
192
223
|
"state",
|
|
193
224
|
"wiki",
|
|
225
|
+
"mcp-serve",
|
|
194
226
|
"ralph",
|
|
195
227
|
"resume",
|
|
196
228
|
"session",
|
|
@@ -198,6 +230,46 @@ const NESTED_HELP_COMMANDS = new Set([
|
|
|
198
230
|
"team",
|
|
199
231
|
"tmux-hook",
|
|
200
232
|
]);
|
|
233
|
+
export function resolveSetupInstallModeArg(args) {
|
|
234
|
+
let value;
|
|
235
|
+
const setValue = (next, source) => {
|
|
236
|
+
if (value && value !== next) {
|
|
237
|
+
throw new Error(`Conflicting setup install mode flags: ${source} selects ${next}, but another flag already selected ${value}`);
|
|
238
|
+
}
|
|
239
|
+
value = next;
|
|
240
|
+
};
|
|
241
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
242
|
+
const arg = args[index];
|
|
243
|
+
if (arg === "--plugin") {
|
|
244
|
+
setValue("plugin", arg);
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
if (arg === "--legacy") {
|
|
248
|
+
setValue("legacy", arg);
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
if (arg === "--install-mode") {
|
|
252
|
+
const next = args[index + 1];
|
|
253
|
+
if (!next || next.startsWith("-")) {
|
|
254
|
+
throw new Error(`Missing setup install mode value after --install-mode. Expected one of: legacy, plugin`);
|
|
255
|
+
}
|
|
256
|
+
if (next !== "legacy" && next !== "plugin") {
|
|
257
|
+
throw new Error(`Invalid setup install mode: ${next}. Expected one of: legacy, plugin`);
|
|
258
|
+
}
|
|
259
|
+
setValue(next, arg);
|
|
260
|
+
index += 1;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if (arg.startsWith("--install-mode=")) {
|
|
264
|
+
const next = arg.slice("--install-mode=".length);
|
|
265
|
+
if (next !== "legacy" && next !== "plugin") {
|
|
266
|
+
throw new Error(`Invalid setup install mode: ${next}. Expected one of: legacy, plugin`);
|
|
267
|
+
}
|
|
268
|
+
setValue(next, "--install-mode");
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return value;
|
|
272
|
+
}
|
|
201
273
|
export function resolveSetupScopeArg(args) {
|
|
202
274
|
let value;
|
|
203
275
|
for (let index = 0; index < args.length; index += 1) {
|
|
@@ -250,6 +322,8 @@ export function resolveNotifyTempContract(args, env = process.env) {
|
|
|
250
322
|
export function commandOwnsLocalHelp(command) {
|
|
251
323
|
return NESTED_HELP_COMMANDS.has(command);
|
|
252
324
|
}
|
|
325
|
+
const OMX_LAUNCH_POLICY_ENV = "OMX_LAUNCH_POLICY";
|
|
326
|
+
let warnedInvalidEnvLaunchPolicy = false;
|
|
253
327
|
function splitLeaderLaunchPolicyArgs(args) {
|
|
254
328
|
const remainingArgs = [];
|
|
255
329
|
let explicitPolicy;
|
|
@@ -264,6 +338,10 @@ function splitLeaderLaunchPolicyArgs(args) {
|
|
|
264
338
|
remainingArgs.push(arg);
|
|
265
339
|
continue;
|
|
266
340
|
}
|
|
341
|
+
if (arg === "--direct") {
|
|
342
|
+
explicitPolicy = "direct";
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
267
345
|
if (arg === "--tmux") {
|
|
268
346
|
explicitPolicy = "detached-tmux";
|
|
269
347
|
continue;
|
|
@@ -275,13 +353,34 @@ function splitLeaderLaunchPolicyArgs(args) {
|
|
|
275
353
|
export function resolveLeaderLaunchPolicyOverride(args) {
|
|
276
354
|
return splitLeaderLaunchPolicyArgs(args).explicitPolicy;
|
|
277
355
|
}
|
|
356
|
+
export function resolveEnvLaunchPolicyOverride(env = process.env) {
|
|
357
|
+
const rawValue = env[OMX_LAUNCH_POLICY_ENV]?.trim();
|
|
358
|
+
if (!rawValue)
|
|
359
|
+
return undefined;
|
|
360
|
+
const value = rawValue.toLowerCase();
|
|
361
|
+
if (value === "auto")
|
|
362
|
+
return undefined;
|
|
363
|
+
if (value === "direct")
|
|
364
|
+
return "direct";
|
|
365
|
+
if (value === "tmux" || value === "detached-tmux")
|
|
366
|
+
return "detached-tmux";
|
|
367
|
+
if (!warnedInvalidEnvLaunchPolicy) {
|
|
368
|
+
warnedInvalidEnvLaunchPolicy = true;
|
|
369
|
+
console.warn(`[omx] warning: invalid ${OMX_LAUNCH_POLICY_ENV}="${rawValue}". ` +
|
|
370
|
+
"Expected direct, tmux, detached-tmux, or auto. Falling back to auto/default launch policy.");
|
|
371
|
+
}
|
|
372
|
+
return undefined;
|
|
373
|
+
}
|
|
374
|
+
export function resolveEffectiveLeaderLaunchPolicyOverride(args, env = process.env) {
|
|
375
|
+
return (resolveLeaderLaunchPolicyOverride(args) ?? resolveEnvLaunchPolicyOverride(env));
|
|
376
|
+
}
|
|
278
377
|
export function resolveCodexLaunchPolicy(env = process.env, _platform = process.platform, tmuxAvailable = isTmuxAvailable(), nativeWindows = isNativeWindows(), stdinIsTTY = Boolean(process.stdin.isTTY), stdoutIsTTY = Boolean(process.stdout.isTTY), explicitPolicy) {
|
|
378
|
+
if (explicitPolicy === "direct")
|
|
379
|
+
return "direct";
|
|
279
380
|
if (env.TMUX)
|
|
280
381
|
return "inside-tmux";
|
|
281
382
|
if (explicitPolicy === "detached-tmux")
|
|
282
383
|
return tmuxAvailable ? "detached-tmux" : "direct";
|
|
283
|
-
if (explicitPolicy === "direct")
|
|
284
|
-
return "direct";
|
|
285
384
|
if (_platform === "win32")
|
|
286
385
|
return "direct";
|
|
287
386
|
if (nativeWindows)
|
|
@@ -305,6 +404,60 @@ function hasErrnoCode(error, code) {
|
|
|
305
404
|
"code" in error &&
|
|
306
405
|
error.code === code);
|
|
307
406
|
}
|
|
407
|
+
function isMissingTmuxLaunchNoise(error) {
|
|
408
|
+
return error instanceof Error && /spawnSync tmux ENOENT/i.test(error.message);
|
|
409
|
+
}
|
|
410
|
+
function logCliOperationFailure(error) {
|
|
411
|
+
if (isMissingTmuxLaunchNoise(error))
|
|
412
|
+
return;
|
|
413
|
+
process.stderr.write(`[cli/index] operation failed: ${error}
|
|
414
|
+
`);
|
|
415
|
+
}
|
|
416
|
+
function tmuxFailureMessage(error) {
|
|
417
|
+
if (!error || typeof error !== "object")
|
|
418
|
+
return String(error);
|
|
419
|
+
const err = error;
|
|
420
|
+
const stderr = typeof err.stderr === "string" ? err.stderr : err.stderr?.toString();
|
|
421
|
+
const stdout = typeof err.stdout === "string" ? err.stdout : err.stdout?.toString();
|
|
422
|
+
const detail = (stderr || stdout || err.message || String(error)).trim();
|
|
423
|
+
return detail.replace(/\s+/g, " ");
|
|
424
|
+
}
|
|
425
|
+
function isBenignMissingTmuxServerMessage(message) {
|
|
426
|
+
return (/no server running/i.test(message) ||
|
|
427
|
+
/error connecting to .*\(No such file or directory\)/i.test(message));
|
|
428
|
+
}
|
|
429
|
+
export function checkDetachedTmuxLaunchHealth() {
|
|
430
|
+
try {
|
|
431
|
+
execTmuxFileSync(["list-sessions"], {
|
|
432
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
433
|
+
encoding: "utf-8",
|
|
434
|
+
});
|
|
435
|
+
return { usable: true };
|
|
436
|
+
}
|
|
437
|
+
catch (err) {
|
|
438
|
+
const reason = tmuxFailureMessage(err);
|
|
439
|
+
if (isBenignMissingTmuxServerMessage(reason)) {
|
|
440
|
+
return { usable: true };
|
|
441
|
+
}
|
|
442
|
+
return { usable: false, reason };
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function warnDetachedTmuxFallback(reason) {
|
|
446
|
+
const suffix = reason ? ` (${reason})` : "";
|
|
447
|
+
console.warn(`[omx] warning: tmux is installed but its server/socket is unusable${suffix}. Falling back to direct Codex launch.`);
|
|
448
|
+
}
|
|
449
|
+
function resolveTmuxAwareLaunchPolicy(explicitLaunchPolicy, nativeWindows) {
|
|
450
|
+
const launchPolicy = resolveCodexLaunchPolicy(process.env, process.platform, undefined, nativeWindows, undefined, undefined, explicitLaunchPolicy);
|
|
451
|
+
if (launchPolicy !== "detached-tmux") {
|
|
452
|
+
return { launchPolicy, effectiveExplicitLaunchPolicy: explicitLaunchPolicy };
|
|
453
|
+
}
|
|
454
|
+
const tmuxHealth = checkDetachedTmuxLaunchHealth();
|
|
455
|
+
if (tmuxHealth.usable) {
|
|
456
|
+
return { launchPolicy, effectiveExplicitLaunchPolicy: explicitLaunchPolicy };
|
|
457
|
+
}
|
|
458
|
+
warnDetachedTmuxFallback(tmuxHealth.reason);
|
|
459
|
+
return { launchPolicy: "direct", effectiveExplicitLaunchPolicy: "direct" };
|
|
460
|
+
}
|
|
308
461
|
export function resolveSignalExitCode(signal) {
|
|
309
462
|
if (!signal)
|
|
310
463
|
return 1;
|
|
@@ -393,6 +546,7 @@ export async function main(args) {
|
|
|
393
546
|
"exec",
|
|
394
547
|
"setup",
|
|
395
548
|
"update",
|
|
549
|
+
"list",
|
|
396
550
|
"agents",
|
|
397
551
|
"agents-init",
|
|
398
552
|
"deepinit",
|
|
@@ -412,7 +566,9 @@ export async function main(args) {
|
|
|
412
566
|
"tmux-hook",
|
|
413
567
|
"hooks",
|
|
414
568
|
"hud",
|
|
569
|
+
"sidecar",
|
|
415
570
|
"state",
|
|
571
|
+
"mcp-serve",
|
|
416
572
|
"status",
|
|
417
573
|
"cancel",
|
|
418
574
|
"help",
|
|
@@ -424,6 +580,7 @@ export async function main(args) {
|
|
|
424
580
|
const flags = new Set(args.filter((a) => a.startsWith("--")));
|
|
425
581
|
const options = {
|
|
426
582
|
force: flags.has("--force"),
|
|
583
|
+
mergeAgents: flags.has("--merge-agents"),
|
|
427
584
|
dryRun: flags.has("--dry-run"),
|
|
428
585
|
verbose: flags.has("--verbose"),
|
|
429
586
|
team: flags.has("--team"),
|
|
@@ -443,14 +600,19 @@ export async function main(args) {
|
|
|
443
600
|
case "setup":
|
|
444
601
|
await setup({
|
|
445
602
|
force: options.force,
|
|
603
|
+
mergeAgents: options.mergeAgents,
|
|
446
604
|
dryRun: options.dryRun,
|
|
447
605
|
verbose: options.verbose,
|
|
448
606
|
scope: resolveSetupScopeArg(args.slice(1)),
|
|
607
|
+
installMode: resolveSetupInstallModeArg(args.slice(1)),
|
|
449
608
|
});
|
|
450
609
|
break;
|
|
451
610
|
case "update":
|
|
452
611
|
await runImmediateUpdate(process.cwd());
|
|
453
612
|
break;
|
|
613
|
+
case "list":
|
|
614
|
+
await listCommand(args.slice(1));
|
|
615
|
+
break;
|
|
454
616
|
case "agents":
|
|
455
617
|
await agentsCommand(args.slice(1));
|
|
456
618
|
break;
|
|
@@ -493,7 +655,12 @@ export async function main(args) {
|
|
|
493
655
|
await exploreCommand(args.slice(1));
|
|
494
656
|
break;
|
|
495
657
|
case "exec":
|
|
496
|
-
|
|
658
|
+
if (launchArgs[0] === "inject") {
|
|
659
|
+
await execInjectCommand(launchArgs);
|
|
660
|
+
}
|
|
661
|
+
else {
|
|
662
|
+
await execWithOverlay(launchArgs);
|
|
663
|
+
}
|
|
497
664
|
break;
|
|
498
665
|
case "sparkshell":
|
|
499
666
|
await sparkshellCommand(args.slice(1));
|
|
@@ -513,6 +680,9 @@ export async function main(args) {
|
|
|
513
680
|
case "hud":
|
|
514
681
|
await hudCommand(args.slice(1));
|
|
515
682
|
break;
|
|
683
|
+
case "sidecar":
|
|
684
|
+
await sidecarCommand(args.slice(1));
|
|
685
|
+
break;
|
|
516
686
|
case "state":
|
|
517
687
|
await stateCommand(args.slice(1));
|
|
518
688
|
break;
|
|
@@ -531,6 +701,9 @@ export async function main(args) {
|
|
|
531
701
|
case "wiki":
|
|
532
702
|
await mcpParityCommand("wiki", args.slice(1));
|
|
533
703
|
break;
|
|
704
|
+
case "mcp-serve":
|
|
705
|
+
await mcpServeCommand(args.slice(1));
|
|
706
|
+
break;
|
|
534
707
|
case "tmux-hook":
|
|
535
708
|
await tmuxHookCommand(args.slice(1));
|
|
536
709
|
break;
|
|
@@ -585,7 +758,7 @@ async function showStatus() {
|
|
|
585
758
|
state = JSON.parse(content);
|
|
586
759
|
}
|
|
587
760
|
catch (err) {
|
|
588
|
-
|
|
761
|
+
logCliOperationFailure(err);
|
|
589
762
|
continue;
|
|
590
763
|
}
|
|
591
764
|
const file = basename(path);
|
|
@@ -594,7 +767,7 @@ async function showStatus() {
|
|
|
594
767
|
}
|
|
595
768
|
}
|
|
596
769
|
catch (err) {
|
|
597
|
-
|
|
770
|
+
logCliOperationFailure(err);
|
|
598
771
|
console.log("No active modes.");
|
|
599
772
|
}
|
|
600
773
|
}
|
|
@@ -657,9 +830,10 @@ export async function launchWithHud(args) {
|
|
|
657
830
|
const launchCwd = process.cwd();
|
|
658
831
|
const parsedWorktree = parseWorktreeMode(args);
|
|
659
832
|
const notifyTempResult = resolveNotifyTempContract(parsedWorktree.remainingArgs, process.env);
|
|
660
|
-
const explicitLaunchPolicy =
|
|
833
|
+
const explicitLaunchPolicy = resolveEffectiveLeaderLaunchPolicyOverride(notifyTempResult.passthroughArgs, process.env);
|
|
661
834
|
const codexHomeOverride = resolveCodexHomeForLaunch(launchCwd, process.env);
|
|
662
|
-
const
|
|
835
|
+
const projectLocalCodexHomeForCleanup = resolveProjectLocalCodexHomeForLaunch(launchCwd, process.env);
|
|
836
|
+
const { launchPolicy, effectiveExplicitLaunchPolicy } = resolveTmuxAwareLaunchPolicy(explicitLaunchPolicy, isNativeWindows());
|
|
663
837
|
const enableNotifyFallbackAuthority = launchPolicy === "direct";
|
|
664
838
|
const workerSparkModel = resolveWorkerSparkModel(notifyTempResult.passthroughArgs, codexHomeOverride);
|
|
665
839
|
const normalizedArgs = normalizeCodexLaunchArgs(notifyTempResult.passthroughArgs);
|
|
@@ -693,14 +867,14 @@ export async function launchWithHud(args) {
|
|
|
693
867
|
await maybeCheckAndPromptUpdate(cwd);
|
|
694
868
|
}
|
|
695
869
|
catch (err) {
|
|
696
|
-
|
|
870
|
+
logCliOperationFailure(err);
|
|
697
871
|
// Non-fatal: update checks must never block launch
|
|
698
872
|
}
|
|
699
873
|
try {
|
|
700
874
|
await maybePromptGithubStar();
|
|
701
875
|
}
|
|
702
876
|
catch (err) {
|
|
703
|
-
|
|
877
|
+
logCliOperationFailure(err);
|
|
704
878
|
// Non-fatal: star prompt must never block launch
|
|
705
879
|
}
|
|
706
880
|
// ── Phase 0.5: config repair ────────────────────────────────────────────
|
|
@@ -729,11 +903,11 @@ export async function launchWithHud(args) {
|
|
|
729
903
|
const notifyTempContractRaw = notifyTempResult.contract.active
|
|
730
904
|
? serializeNotifyTempContract(notifyTempResult.contract)
|
|
731
905
|
: null;
|
|
732
|
-
runCodex(cwd, normalizedArgs, sessionId, workerSparkModel, codexHomeOverride, notifyTempContractRaw,
|
|
906
|
+
runCodex(cwd, normalizedArgs, sessionId, workerSparkModel, codexHomeOverride, notifyTempContractRaw, effectiveExplicitLaunchPolicy);
|
|
733
907
|
}
|
|
734
908
|
finally {
|
|
735
909
|
// ── Phase 3: postLaunch ─────────────────────────────────────────────
|
|
736
|
-
await postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority);
|
|
910
|
+
await postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority, projectLocalCodexHomeForCleanup);
|
|
737
911
|
}
|
|
738
912
|
}
|
|
739
913
|
export async function execWithOverlay(args) {
|
|
@@ -741,6 +915,7 @@ export async function execWithOverlay(args) {
|
|
|
741
915
|
const parsedWorktree = parseWorktreeMode(args);
|
|
742
916
|
const notifyTempResult = resolveNotifyTempContract(parsedWorktree.remainingArgs, process.env);
|
|
743
917
|
const codexHomeOverride = resolveCodexHomeForLaunch(launchCwd, process.env);
|
|
918
|
+
const projectLocalCodexHomeForCleanup = resolveProjectLocalCodexHomeForLaunch(launchCwd, process.env);
|
|
744
919
|
const normalizedArgs = normalizeCodexLaunchArgs(notifyTempResult.passthroughArgs);
|
|
745
920
|
let cwd = launchCwd;
|
|
746
921
|
let worktreeDirty = false;
|
|
@@ -772,13 +947,13 @@ export async function execWithOverlay(args) {
|
|
|
772
947
|
await maybeCheckAndPromptUpdate(cwd);
|
|
773
948
|
}
|
|
774
949
|
catch (err) {
|
|
775
|
-
|
|
950
|
+
logCliOperationFailure(err);
|
|
776
951
|
}
|
|
777
952
|
try {
|
|
778
953
|
await maybePromptGithubStar();
|
|
779
954
|
}
|
|
780
955
|
catch (err) {
|
|
781
|
-
|
|
956
|
+
logCliOperationFailure(err);
|
|
782
957
|
}
|
|
783
958
|
try {
|
|
784
959
|
const repaired = await repairConfigIfNeeded(resolveCodexConfigPathForLaunch(launchCwd, process.env), getPackageRoot());
|
|
@@ -812,7 +987,7 @@ export async function execWithOverlay(args) {
|
|
|
812
987
|
runCodexBlocking(cwd, codexArgs, codexEnv);
|
|
813
988
|
}
|
|
814
989
|
finally {
|
|
815
|
-
await postLaunch(cwd, sessionId, codexHomeOverride, true);
|
|
990
|
+
await postLaunch(cwd, sessionId, codexHomeOverride, true, projectLocalCodexHomeForCleanup);
|
|
816
991
|
}
|
|
817
992
|
}
|
|
818
993
|
export function normalizeCodexLaunchArgs(args) {
|
|
@@ -1111,7 +1286,7 @@ export function detectDetachedSessionWindowIndex(sessionName) {
|
|
|
1111
1286
|
return parseWindowIndexFromTmuxOutput(output);
|
|
1112
1287
|
}
|
|
1113
1288
|
catch (err) {
|
|
1114
|
-
|
|
1289
|
+
logCliOperationFailure(err);
|
|
1115
1290
|
return null;
|
|
1116
1291
|
}
|
|
1117
1292
|
}
|
|
@@ -1143,6 +1318,24 @@ function resolveTmuxSocketPath(execFileSyncImpl = (file, tmuxArgs) => execFileSy
|
|
|
1143
1318
|
function tmuxExtendedKeysLeasePath(cwd, socketPath) {
|
|
1144
1319
|
return join(tmuxExtendedKeysLeaseRoot(cwd), `${sanitizeTmuxLeaseKey(socketPath)}.json`);
|
|
1145
1320
|
}
|
|
1321
|
+
function isTmuxExtendedKeysLeaseHolderRecord(holder) {
|
|
1322
|
+
if (!holder || typeof holder !== "object")
|
|
1323
|
+
return false;
|
|
1324
|
+
const record = holder;
|
|
1325
|
+
if (typeof record.id !== "string" || !record.id.trim())
|
|
1326
|
+
return false;
|
|
1327
|
+
if (!Number.isSafeInteger(record.pid) || Number(record.pid) <= 0)
|
|
1328
|
+
return false;
|
|
1329
|
+
if (record.platform !== undefined && typeof record.platform !== "string")
|
|
1330
|
+
return false;
|
|
1331
|
+
if (record.linuxStartTicks !== undefined &&
|
|
1332
|
+
!Number.isSafeInteger(record.linuxStartTicks))
|
|
1333
|
+
return false;
|
|
1334
|
+
return true;
|
|
1335
|
+
}
|
|
1336
|
+
function isTmuxExtendedKeysLeaseHolder(holder) {
|
|
1337
|
+
return typeof holder === "string" || isTmuxExtendedKeysLeaseHolderRecord(holder);
|
|
1338
|
+
}
|
|
1146
1339
|
function readTmuxExtendedKeysLeaseState(leasePath) {
|
|
1147
1340
|
if (!existsSync(leasePath))
|
|
1148
1341
|
return null;
|
|
@@ -1150,7 +1343,7 @@ function readTmuxExtendedKeysLeaseState(leasePath) {
|
|
|
1150
1343
|
const parsed = JSON.parse(readFileSync(leasePath, "utf-8"));
|
|
1151
1344
|
if (typeof parsed.originalMode !== "string" ||
|
|
1152
1345
|
!Array.isArray(parsed.holders) ||
|
|
1153
|
-
!parsed.holders.every(
|
|
1346
|
+
!parsed.holders.every(isTmuxExtendedKeysLeaseHolder)) {
|
|
1154
1347
|
return null;
|
|
1155
1348
|
}
|
|
1156
1349
|
return {
|
|
@@ -1166,6 +1359,81 @@ function writeTmuxExtendedKeysLeaseState(leasePath, state) {
|
|
|
1166
1359
|
mkdirSync(dirname(leasePath), { recursive: true });
|
|
1167
1360
|
writeFileSync(leasePath, JSON.stringify(state, null, 2));
|
|
1168
1361
|
}
|
|
1362
|
+
function parseTmuxExtendedKeysLeaseHolderPid(holder) {
|
|
1363
|
+
const match = /^([1-9]\d*)-/.exec(holder);
|
|
1364
|
+
if (!match)
|
|
1365
|
+
return null;
|
|
1366
|
+
const pid = Number.parseInt(match[1], 10);
|
|
1367
|
+
return Number.isSafeInteger(pid) && pid > 0 ? pid : null;
|
|
1368
|
+
}
|
|
1369
|
+
function getTmuxExtendedKeysLeaseHolderId(holder) {
|
|
1370
|
+
return typeof holder === "string" ? holder : holder.id;
|
|
1371
|
+
}
|
|
1372
|
+
function getTmuxExtendedKeysLeaseHolderPid(holder) {
|
|
1373
|
+
if (typeof holder === "string")
|
|
1374
|
+
return parseTmuxExtendedKeysLeaseHolderPid(holder);
|
|
1375
|
+
return Number.isSafeInteger(holder.pid) && holder.pid > 0 ? holder.pid : null;
|
|
1376
|
+
}
|
|
1377
|
+
function parseLinuxProcStartTicks(statContent) {
|
|
1378
|
+
const commandEnd = statContent.lastIndexOf(")");
|
|
1379
|
+
if (commandEnd === -1)
|
|
1380
|
+
return null;
|
|
1381
|
+
const remainder = statContent.slice(commandEnd + 1).trim();
|
|
1382
|
+
const fields = remainder.split(/\s+/);
|
|
1383
|
+
if (fields.length <= 19)
|
|
1384
|
+
return null;
|
|
1385
|
+
const startTicks = Number(fields[19]);
|
|
1386
|
+
return Number.isSafeInteger(startTicks) ? startTicks : null;
|
|
1387
|
+
}
|
|
1388
|
+
function readLinuxProcessStartTicks(pid) {
|
|
1389
|
+
try {
|
|
1390
|
+
return parseLinuxProcStartTicks(readFileSync(`/proc/${pid}/stat`, "utf-8"));
|
|
1391
|
+
}
|
|
1392
|
+
catch {
|
|
1393
|
+
return null;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
function createTmuxExtendedKeysLeaseHolder(id, pid) {
|
|
1397
|
+
const linuxStartTicks = process.platform === "linux"
|
|
1398
|
+
? readLinuxProcessStartTicks(pid) ?? undefined
|
|
1399
|
+
: undefined;
|
|
1400
|
+
return {
|
|
1401
|
+
id,
|
|
1402
|
+
pid,
|
|
1403
|
+
platform: process.platform,
|
|
1404
|
+
...(linuxStartTicks !== undefined ? { linuxStartTicks } : {}),
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
function isProcessAlive(pid) {
|
|
1408
|
+
try {
|
|
1409
|
+
process.kill(pid, 0);
|
|
1410
|
+
return true;
|
|
1411
|
+
}
|
|
1412
|
+
catch (err) {
|
|
1413
|
+
const code = err && typeof err === "object" && "code" in err
|
|
1414
|
+
? String(err.code)
|
|
1415
|
+
: "";
|
|
1416
|
+
return code === "EPERM";
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
function isTmuxExtendedKeysLeaseHolderAlive(holder) {
|
|
1420
|
+
const pid = getTmuxExtendedKeysLeaseHolderPid(holder);
|
|
1421
|
+
if (pid === null || !isProcessAlive(pid))
|
|
1422
|
+
return false;
|
|
1423
|
+
if (typeof holder === "string")
|
|
1424
|
+
return true;
|
|
1425
|
+
if (holder.platform !== "linux" || process.platform !== "linux")
|
|
1426
|
+
return true;
|
|
1427
|
+
if (holder.linuxStartTicks === undefined)
|
|
1428
|
+
return true;
|
|
1429
|
+
return readLinuxProcessStartTicks(pid) === holder.linuxStartTicks;
|
|
1430
|
+
}
|
|
1431
|
+
function reapDeadTmuxExtendedKeysLeaseHolders(state) {
|
|
1432
|
+
return {
|
|
1433
|
+
originalMode: state.originalMode,
|
|
1434
|
+
holders: state.holders.filter(isTmuxExtendedKeysLeaseHolderAlive),
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1169
1437
|
function withTmuxExtendedKeysLeaseLock(cwd, socketPath, run) {
|
|
1170
1438
|
const leaseRoot = tmuxExtendedKeysLeaseRoot(cwd);
|
|
1171
1439
|
mkdirSync(leaseRoot, { recursive: true });
|
|
@@ -1245,30 +1513,36 @@ function execTmuxSync(args, execFileSyncImpl = (file, tmuxArgs) => execFileSync(
|
|
|
1245
1513
|
export function acquireTmuxExtendedKeysLease(cwd, execFileSyncImpl = (file, tmuxArgs) => execFileSync(file, tmuxArgs, {
|
|
1246
1514
|
encoding: "utf-8",
|
|
1247
1515
|
...(process.platform === "win32" ? { windowsHide: true } : {}),
|
|
1248
|
-
})) {
|
|
1516
|
+
}), ownerPid = process.pid) {
|
|
1249
1517
|
try {
|
|
1250
1518
|
const socketPath = resolveTmuxSocketPath(execFileSyncImpl);
|
|
1251
1519
|
const leasePath = tmuxExtendedKeysLeasePath(cwd, socketPath);
|
|
1252
|
-
const
|
|
1520
|
+
const holderPid = Number.isSafeInteger(ownerPid) && ownerPid > 0 ? ownerPid : process.pid;
|
|
1521
|
+
const leaseId = `${holderPid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
1253
1522
|
withTmuxExtendedKeysLeaseLock(cwd, socketPath, () => {
|
|
1254
|
-
const
|
|
1523
|
+
const stateRaw = readTmuxExtendedKeysLeaseState(leasePath);
|
|
1524
|
+
const state = stateRaw ? reapDeadTmuxExtendedKeysLeaseHolders(stateRaw) : null;
|
|
1525
|
+
if (stateRaw && state?.holders.length === 0) {
|
|
1526
|
+
execTmuxSync(["set-option", "-sq", "extended-keys", state.originalMode], execFileSyncImpl);
|
|
1527
|
+
rmSync(leasePath, { force: true });
|
|
1528
|
+
}
|
|
1255
1529
|
if (!state || state.holders.length === 0) {
|
|
1256
1530
|
const previousMode = execTmuxSync(["show-options", "-sv", "extended-keys"], execFileSyncImpl) ||
|
|
1257
1531
|
TMUX_EXTENDED_KEYS_FALLBACK_MODE;
|
|
1258
1532
|
execTmuxSync(["set-option", "-sq", "extended-keys", TMUX_EXTENDED_KEYS_MODE], execFileSyncImpl);
|
|
1259
1533
|
writeTmuxExtendedKeysLeaseState(leasePath, {
|
|
1260
1534
|
originalMode: previousMode,
|
|
1261
|
-
holders: [leaseId],
|
|
1535
|
+
holders: [createTmuxExtendedKeysLeaseHolder(leaseId, holderPid)],
|
|
1262
1536
|
});
|
|
1263
1537
|
return;
|
|
1264
1538
|
}
|
|
1265
|
-
state.holders.push(leaseId);
|
|
1539
|
+
state.holders.push(createTmuxExtendedKeysLeaseHolder(leaseId, holderPid));
|
|
1266
1540
|
writeTmuxExtendedKeysLeaseState(leasePath, state);
|
|
1267
1541
|
});
|
|
1268
1542
|
return `${socketPath}\t${leaseId}`;
|
|
1269
1543
|
}
|
|
1270
1544
|
catch (err) {
|
|
1271
|
-
|
|
1545
|
+
logCliOperationFailure(err);
|
|
1272
1546
|
return null;
|
|
1273
1547
|
}
|
|
1274
1548
|
}
|
|
@@ -1285,12 +1559,16 @@ export function releaseTmuxExtendedKeysLease(cwd, leaseHandle, execFileSyncImpl
|
|
|
1285
1559
|
try {
|
|
1286
1560
|
const leasePath = tmuxExtendedKeysLeasePath(cwd, socketPath);
|
|
1287
1561
|
withTmuxExtendedKeysLeaseLock(cwd, socketPath, () => {
|
|
1288
|
-
const
|
|
1562
|
+
const stateRaw = readTmuxExtendedKeysLeaseState(leasePath);
|
|
1563
|
+
const state = stateRaw ? reapDeadTmuxExtendedKeysLeaseHolders(stateRaw) : null;
|
|
1289
1564
|
if (!state || state.holders.length === 0) {
|
|
1565
|
+
if (stateRaw) {
|
|
1566
|
+
execTmuxSync(["set-option", "-sq", "extended-keys", stateRaw.originalMode], execFileSyncImpl);
|
|
1567
|
+
}
|
|
1290
1568
|
rmSync(leasePath, { force: true });
|
|
1291
1569
|
return;
|
|
1292
1570
|
}
|
|
1293
|
-
const holders = state.holders.filter((holder) => holder !== leaseId);
|
|
1571
|
+
const holders = state.holders.filter((holder) => getTmuxExtendedKeysLeaseHolderId(holder) !== leaseId);
|
|
1294
1572
|
if (holders.length > 0) {
|
|
1295
1573
|
writeTmuxExtendedKeysLeaseState(leasePath, {
|
|
1296
1574
|
originalMode: state.originalMode,
|
|
@@ -1303,19 +1581,19 @@ export function releaseTmuxExtendedKeysLease(cwd, leaseHandle, execFileSyncImpl
|
|
|
1303
1581
|
});
|
|
1304
1582
|
}
|
|
1305
1583
|
catch (err) {
|
|
1306
|
-
|
|
1584
|
+
logCliOperationFailure(err);
|
|
1307
1585
|
}
|
|
1308
1586
|
}
|
|
1309
1587
|
function buildTmuxExtendedKeysHelperCommand(cwd, operation) {
|
|
1310
1588
|
const cwdLiteral = JSON.stringify(cwd);
|
|
1311
1589
|
const moduleUrlLiteral = JSON.stringify(import.meta.url);
|
|
1312
1590
|
const script = operation === "acquire"
|
|
1313
|
-
? `const mod = await import(${moduleUrlLiteral}); const lease = mod.acquireTmuxExtendedKeysLease(${cwdLiteral}); if (lease) process.stdout.write(lease);`
|
|
1591
|
+
? `const mod = await import(${moduleUrlLiteral}); const ownerPid = Number.parseInt(process.argv[1] ?? "", 10); const lease = mod.acquireTmuxExtendedKeysLease(${cwdLiteral}, undefined, Number.isSafeInteger(ownerPid) && ownerPid > 0 ? ownerPid : undefined); if (lease) process.stdout.write(lease);`
|
|
1314
1592
|
: `const mod = await import(${moduleUrlLiteral}); mod.releaseTmuxExtendedKeysLease(${cwdLiteral}, process.argv[1] ?? "");`;
|
|
1315
1593
|
return `${quoteShellArg(process.execPath)} --input-type=module -e ${quoteShellArg(script)}`;
|
|
1316
1594
|
}
|
|
1317
1595
|
function buildTmuxExtendedKeysAcquireShellSnippet(cwd) {
|
|
1318
|
-
return `OMX_TMUX_EXTENDED_KEYS_LEASE=$(${buildTmuxExtendedKeysHelperCommand(cwd, "acquire")} 2>/dev/null || true);`;
|
|
1596
|
+
return `OMX_TMUX_EXTENDED_KEYS_LEASE=$(${buildTmuxExtendedKeysHelperCommand(cwd, "acquire")} "$$" 2>/dev/null || true);`;
|
|
1319
1597
|
}
|
|
1320
1598
|
function buildTmuxExtendedKeysReleaseShellSnippet(cwd) {
|
|
1321
1599
|
return `if [ -n "\${OMX_TMUX_EXTENDED_KEYS_LEASE:-}" ]; then ${buildTmuxExtendedKeysHelperCommand(cwd, "release")} "\${OMX_TMUX_EXTENDED_KEYS_LEASE}" >/dev/null 2>&1 || true; fi;`;
|
|
@@ -1692,7 +1970,7 @@ async function preLaunch(cwd, sessionId, notifyTempContract, codexHomeOverride,
|
|
|
1692
1970
|
}
|
|
1693
1971
|
}
|
|
1694
1972
|
catch (err) {
|
|
1695
|
-
|
|
1973
|
+
logCliOperationFailure(err);
|
|
1696
1974
|
// Non-fatal
|
|
1697
1975
|
}
|
|
1698
1976
|
// 2. Generate runtime overlay + write session-scoped model instructions file
|
|
@@ -1716,7 +1994,7 @@ ${launchAppendix}${dirtyWorktreeGuidance}`
|
|
|
1716
1994
|
await startNotifyFallbackWatcher(cwd, { codexHomeOverride, enableAuthority: enableNotifyFallbackAuthority, sessionId });
|
|
1717
1995
|
}
|
|
1718
1996
|
catch (err) {
|
|
1719
|
-
|
|
1997
|
+
logCliOperationFailure(err);
|
|
1720
1998
|
// Non-fatal
|
|
1721
1999
|
}
|
|
1722
2000
|
// 5. Start derived watcher (best effort, opt-in)
|
|
@@ -1724,7 +2002,7 @@ ${launchAppendix}${dirtyWorktreeGuidance}`
|
|
|
1724
2002
|
await startHookDerivedWatcher(cwd);
|
|
1725
2003
|
}
|
|
1726
2004
|
catch (err) {
|
|
1727
|
-
|
|
2005
|
+
logCliOperationFailure(err);
|
|
1728
2006
|
// Non-fatal
|
|
1729
2007
|
}
|
|
1730
2008
|
// 6. Emit temp notification startup summary + warnings, then send session-start lifecycle notification (best effort)
|
|
@@ -1753,7 +2031,7 @@ ${launchAppendix}${dirtyWorktreeGuidance}`
|
|
|
1753
2031
|
});
|
|
1754
2032
|
}
|
|
1755
2033
|
catch (err) {
|
|
1756
|
-
|
|
2034
|
+
logCliOperationFailure(err);
|
|
1757
2035
|
// Non-fatal: notification failures must never block launch
|
|
1758
2036
|
}
|
|
1759
2037
|
// 7. Dispatch native hook event (best effort)
|
|
@@ -1768,7 +2046,7 @@ ${launchAppendix}${dirtyWorktreeGuidance}`
|
|
|
1768
2046
|
});
|
|
1769
2047
|
}
|
|
1770
2048
|
catch (err) {
|
|
1771
|
-
|
|
2049
|
+
logCliOperationFailure(err);
|
|
1772
2050
|
// Non-fatal
|
|
1773
2051
|
}
|
|
1774
2052
|
}
|
|
@@ -1798,7 +2076,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1798
2076
|
const codexEnvWithNotify = notifyTempContractRaw
|
|
1799
2077
|
? { ...codexEnv, [OMX_NOTIFY_TEMP_CONTRACT_ENV]: notifyTempContractRaw }
|
|
1800
2078
|
: codexEnv;
|
|
1801
|
-
const launchPolicy =
|
|
2079
|
+
const { launchPolicy } = resolveTmuxAwareLaunchPolicy(explicitLaunchPolicy, nativeWindows);
|
|
1802
2080
|
if (isCodexVersionRequest(launchArgs)) {
|
|
1803
2081
|
runCodexBlocking(cwd, launchArgs, codexEnvWithNotify);
|
|
1804
2082
|
return;
|
|
@@ -1815,7 +2093,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1815
2093
|
hudPaneId = createHudWatchPane(cwd, hudCmd);
|
|
1816
2094
|
}
|
|
1817
2095
|
catch (err) {
|
|
1818
|
-
|
|
2096
|
+
logCliOperationFailure(err);
|
|
1819
2097
|
// HUD split failed, continue without it
|
|
1820
2098
|
}
|
|
1821
2099
|
// Enable mouse scrolling at session start so scroll works before team
|
|
@@ -1834,7 +2112,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1834
2112
|
enableMouseScrolling(tmuxSession);
|
|
1835
2113
|
}
|
|
1836
2114
|
catch (err) {
|
|
1837
|
-
|
|
2115
|
+
logCliOperationFailure(err);
|
|
1838
2116
|
// Non-fatal: mouse scrolling is a convenience feature
|
|
1839
2117
|
}
|
|
1840
2118
|
}
|
|
@@ -1871,6 +2149,10 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1871
2149
|
? buildWindowsPromptCommand("codex", launchArgs)
|
|
1872
2150
|
: null;
|
|
1873
2151
|
const sessionName = buildDetachedTmuxSessionName(cwd, sessionId);
|
|
2152
|
+
void writeSessionStart(cwd, sessionId, { tmuxSessionName: sessionName }).catch((err) => {
|
|
2153
|
+
logCliOperationFailure(err);
|
|
2154
|
+
// Non-fatal: managed tmux recovery can still use compatibility fallback.
|
|
2155
|
+
});
|
|
1874
2156
|
let createdDetachedSession = false;
|
|
1875
2157
|
let registeredHookTarget = null;
|
|
1876
2158
|
let registeredHookName = null;
|
|
@@ -1910,7 +2192,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1910
2192
|
mitigateCopyModeUnderlineArtifacts(sessionName);
|
|
1911
2193
|
}
|
|
1912
2194
|
catch (err) {
|
|
1913
|
-
|
|
2195
|
+
logCliOperationFailure(err);
|
|
1914
2196
|
}
|
|
1915
2197
|
continue;
|
|
1916
2198
|
}
|
|
@@ -1919,7 +2201,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1919
2201
|
execTmuxFileSync(finalizeStep.args, { stdio });
|
|
1920
2202
|
}
|
|
1921
2203
|
catch (err) {
|
|
1922
|
-
|
|
2204
|
+
logCliOperationFailure(err);
|
|
1923
2205
|
if (finalizeStep.name === "attach-session")
|
|
1924
2206
|
throw new Error("failed to attach detached tmux session");
|
|
1925
2207
|
continue;
|
|
@@ -1939,7 +2221,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1939
2221
|
}
|
|
1940
2222
|
}
|
|
1941
2223
|
catch (err) {
|
|
1942
|
-
|
|
2224
|
+
logCliOperationFailure(err);
|
|
1943
2225
|
if (createdDetachedSession) {
|
|
1944
2226
|
const rollbackSteps = buildDetachedSessionRollbackSteps(sessionName, registeredHookTarget, registeredHookName, registeredClientAttachedHookName);
|
|
1945
2227
|
for (const rollbackStep of rollbackSteps) {
|
|
@@ -1947,7 +2229,7 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, n
|
|
|
1947
2229
|
execTmuxFileSync(rollbackStep.args, { stdio: "ignore" });
|
|
1948
2230
|
}
|
|
1949
2231
|
catch (err) {
|
|
1950
|
-
|
|
2232
|
+
logCliOperationFailure(err);
|
|
1951
2233
|
// best-effort rollback only
|
|
1952
2234
|
}
|
|
1953
2235
|
}
|
|
@@ -1962,7 +2244,7 @@ function listHudWatchPaneIdsInCurrentWindow(currentPaneId) {
|
|
|
1962
2244
|
return listCurrentWindowHudPaneIds(currentPaneId);
|
|
1963
2245
|
}
|
|
1964
2246
|
catch (err) {
|
|
1965
|
-
|
|
2247
|
+
logCliOperationFailure(err);
|
|
1966
2248
|
return [];
|
|
1967
2249
|
}
|
|
1968
2250
|
}
|
|
@@ -1976,7 +2258,7 @@ function killTmuxPane(paneId) {
|
|
|
1976
2258
|
killSharedTmuxPane(paneId);
|
|
1977
2259
|
}
|
|
1978
2260
|
catch (err) {
|
|
1979
|
-
|
|
2261
|
+
logCliOperationFailure(err);
|
|
1980
2262
|
// Pane may already be gone; ignore.
|
|
1981
2263
|
}
|
|
1982
2264
|
}
|
|
@@ -2055,7 +2337,7 @@ function scheduleDetachedWindowsCodexLaunch(sessionName, commandText) {
|
|
|
2055
2337
|
* postLaunch: Clean up after Codex exits.
|
|
2056
2338
|
* Each step is independently fault-tolerant (try/catch per step).
|
|
2057
2339
|
*/
|
|
2058
|
-
async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority = false) {
|
|
2340
|
+
async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority = false, projectLocalCodexHomeForCleanup) {
|
|
2059
2341
|
// Capture session start time before cleanup (writeSessionEnd deletes session.json)
|
|
2060
2342
|
let sessionStartedAt;
|
|
2061
2343
|
try {
|
|
@@ -2063,7 +2345,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2063
2345
|
sessionStartedAt = sessionState?.started_at;
|
|
2064
2346
|
}
|
|
2065
2347
|
catch (err) {
|
|
2066
|
-
|
|
2348
|
+
logCliOperationFailure(err);
|
|
2067
2349
|
// Non-fatal
|
|
2068
2350
|
}
|
|
2069
2351
|
// 0. Reap MCP orphans left behind by the session that just exited.
|
|
@@ -2073,7 +2355,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2073
2355
|
await flushNotifyFallbackOnce(cwd, { codexHomeOverride, enableAuthority: enableNotifyFallbackAuthority, sessionId });
|
|
2074
2356
|
}
|
|
2075
2357
|
catch (err) {
|
|
2076
|
-
|
|
2358
|
+
logCliOperationFailure(err);
|
|
2077
2359
|
// Non-fatal
|
|
2078
2360
|
}
|
|
2079
2361
|
// 0. Stop notify fallback watcher first.
|
|
@@ -2081,7 +2363,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2081
2363
|
await stopNotifyFallbackWatcher(cwd);
|
|
2082
2364
|
}
|
|
2083
2365
|
catch (err) {
|
|
2084
|
-
|
|
2366
|
+
logCliOperationFailure(err);
|
|
2085
2367
|
// Non-fatal
|
|
2086
2368
|
}
|
|
2087
2369
|
// 0. Flush derived watcher once on shutdown (opt-in, best effort).
|
|
@@ -2089,7 +2371,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2089
2371
|
await flushHookDerivedWatcherOnce(cwd);
|
|
2090
2372
|
}
|
|
2091
2373
|
catch (err) {
|
|
2092
|
-
|
|
2374
|
+
logCliOperationFailure(err);
|
|
2093
2375
|
// Non-fatal
|
|
2094
2376
|
}
|
|
2095
2377
|
// 0.1 Stop derived watcher first (opt-in, best effort).
|
|
@@ -2097,9 +2379,18 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2097
2379
|
await stopHookDerivedWatcher(cwd);
|
|
2098
2380
|
}
|
|
2099
2381
|
catch (err) {
|
|
2100
|
-
|
|
2382
|
+
logCliOperationFailure(err);
|
|
2101
2383
|
// Non-fatal
|
|
2102
2384
|
}
|
|
2385
|
+
// 0.5. Remove Codex transient TUI NUX counters from project-local config only.
|
|
2386
|
+
try {
|
|
2387
|
+
if (projectLocalCodexHomeForCleanup) {
|
|
2388
|
+
await cleanCodexModelAvailabilityNuxIfNeeded(join(projectLocalCodexHomeForCleanup, "config.toml"));
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
catch (err) {
|
|
2392
|
+
console.error(`[omx] postLaunch: project config transient NUX cleanup failed: ${err instanceof Error ? err.message : err}`);
|
|
2393
|
+
}
|
|
2103
2394
|
// 1. Remove session-scoped model instructions file
|
|
2104
2395
|
try {
|
|
2105
2396
|
await removeSessionModelInstructionsFile(cwd, sessionId);
|
|
@@ -2120,7 +2411,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2120
2411
|
onSessionEnd({ cwd, session_id: sessionId });
|
|
2121
2412
|
}
|
|
2122
2413
|
catch (err) {
|
|
2123
|
-
|
|
2414
|
+
logCliOperationFailure(err);
|
|
2124
2415
|
// Non-fatal: wiki capture must never block session cleanup
|
|
2125
2416
|
}
|
|
2126
2417
|
// 3. Cancel any still-active modes
|
|
@@ -2145,7 +2436,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2145
2436
|
});
|
|
2146
2437
|
}
|
|
2147
2438
|
catch (err) {
|
|
2148
|
-
|
|
2439
|
+
logCliOperationFailure(err);
|
|
2149
2440
|
// Non-fatal: notification failures must never block session cleanup
|
|
2150
2441
|
}
|
|
2151
2442
|
// 4.5. Persist team leader attention when an active leader session exits.
|
|
@@ -2154,7 +2445,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2154
2445
|
await markOwnedTeamsLeaderSessionStopped(cwd, sessionId);
|
|
2155
2446
|
}
|
|
2156
2447
|
catch (err) {
|
|
2157
|
-
|
|
2448
|
+
logCliOperationFailure(err);
|
|
2158
2449
|
// Non-fatal
|
|
2159
2450
|
}
|
|
2160
2451
|
// 5. Dispatch native hook event (best effort)
|
|
@@ -2182,7 +2473,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
|
|
|
2182
2473
|
});
|
|
2183
2474
|
}
|
|
2184
2475
|
catch (err) {
|
|
2185
|
-
|
|
2476
|
+
logCliOperationFailure(err);
|
|
2186
2477
|
// Non-fatal
|
|
2187
2478
|
}
|
|
2188
2479
|
}
|
|
@@ -2578,7 +2869,7 @@ async function cancelModes() {
|
|
|
2578
2869
|
parsedState = JSON.parse(content);
|
|
2579
2870
|
}
|
|
2580
2871
|
catch (err) {
|
|
2581
|
-
|
|
2872
|
+
logCliOperationFailure(err);
|
|
2582
2873
|
continue;
|
|
2583
2874
|
}
|
|
2584
2875
|
states.set(ref.mode, {
|
|
@@ -2635,7 +2926,7 @@ async function cancelModes() {
|
|
|
2635
2926
|
}
|
|
2636
2927
|
}
|
|
2637
2928
|
catch (err) {
|
|
2638
|
-
|
|
2929
|
+
logCliOperationFailure(err);
|
|
2639
2930
|
console.log("No active modes to cancel.");
|
|
2640
2931
|
}
|
|
2641
2932
|
}
|