oh-my-codex 0.18.0 → 0.18.2
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 +45 -19
- package/crates/omx-api/src/lib.rs +66 -9
- package/crates/omx-sparkshell/src/exec.rs +125 -3
- package/crates/omx-sparkshell/src/main.rs +126 -36
- package/crates/omx-sparkshell/tests/execution.rs +225 -1
- package/dist/agents/__tests__/definitions.test.js +14 -0
- package/dist/agents/__tests__/definitions.test.js.map +1 -1
- package/dist/agents/__tests__/native-config.test.js +19 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +30 -0
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/native-config.d.ts +1 -0
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js +4 -0
- package/dist/agents/native-config.js.map +1 -1
- package/dist/catalog/__tests__/generator.test.js +4 -0
- package/dist/catalog/__tests__/generator.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +15 -7
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +137 -8
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +203 -15
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/install-docs-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/install-docs-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/install-docs-contract.test.js +55 -0
- package/dist/cli/__tests__/install-docs-contract.test.js.map +1 -0
- package/dist/cli/__tests__/launch-fallback.test.js +163 -0
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +29 -43
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +94 -35
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +20 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-packaging.test.js +1 -0
- package/dist/cli/__tests__/sparkshell-packaging.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +227 -4
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +72 -1
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/codex-feature-probe.d.ts +5 -0
- package/dist/cli/codex-feature-probe.d.ts.map +1 -1
- package/dist/cli/codex-feature-probe.js +13 -7
- package/dist/cli/codex-feature-probe.js.map +1 -1
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +297 -17
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +9 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +465 -110
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +2 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +15 -1
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +71 -11
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts +7 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +13 -3
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/ultragoal.d.ts +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +184 -10
- package/dist/cli/ultragoal.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 +14 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/compat/__tests__/doctor-contract.test.js +3 -0
- package/dist/compat/__tests__/doctor-contract.test.js.map +1 -1
- package/dist/config/__tests__/codex-feature-flags.test.js +11 -1
- package/dist/config/__tests__/codex-feature-flags.test.js.map +1 -1
- package/dist/config/__tests__/codex-hooks.test.js +22 -11
- package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
- package/dist/config/__tests__/commit-lore-guard.test.d.ts +2 -0
- package/dist/config/__tests__/commit-lore-guard.test.d.ts.map +1 -0
- package/dist/config/__tests__/commit-lore-guard.test.js +20 -0
- package/dist/config/__tests__/commit-lore-guard.test.js.map +1 -0
- package/dist/config/codex-feature-flags.d.ts +4 -0
- package/dist/config/codex-feature-flags.d.ts.map +1 -1
- package/dist/config/codex-feature-flags.js +4 -0
- package/dist/config/codex-feature-flags.js.map +1 -1
- package/dist/config/codex-hooks.d.ts +1 -0
- package/dist/config/codex-hooks.d.ts.map +1 -1
- package/dist/config/codex-hooks.js +8 -10
- package/dist/config/codex-hooks.js.map +1 -1
- package/dist/config/commit-lore-guard.d.ts +1 -0
- package/dist/config/commit-lore-guard.d.ts.map +1 -1
- package/dist/config/commit-lore-guard.js +29 -3
- package/dist/config/commit-lore-guard.js.map +1 -1
- package/dist/config/generator.d.ts +17 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +124 -11
- package/dist/config/generator.js.map +1 -1
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +21 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +4 -0
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +50 -3
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +27 -6
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js +13 -11
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +4 -3
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +173 -17
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +33 -0
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prometheus-strict-contract.test.js +320 -0
- package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +12 -0
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
- package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts +2 -0
- package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/research-workflow-boundaries.test.js +35 -0
- package/dist/hooks/__tests__/research-workflow-boundaries.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js +26 -3
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -1
- package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
- package/dist/hooks/extensibility/dispatcher.js +29 -14
- package/dist/hooks/extensibility/dispatcher.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +36 -9
- 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 +14 -2
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.js +36 -8
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +122 -11
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/render.test.js +84 -0
- package/dist/hud/__tests__/render.test.js.map +1 -1
- package/dist/hud/__tests__/resource-leak-watch.test.d.ts +2 -0
- package/dist/hud/__tests__/resource-leak-watch.test.d.ts.map +1 -0
- package/dist/hud/__tests__/resource-leak-watch.test.js +28 -0
- package/dist/hud/__tests__/resource-leak-watch.test.js.map +1 -0
- package/dist/hud/__tests__/state.test.js +51 -1
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +69 -23
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/index.d.ts +2 -2
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +17 -6
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +6 -3
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +26 -0
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts +2 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +62 -1
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/tmux.d.ts +10 -3
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +60 -11
- package/dist/hud/tmux.js.map +1 -1
- package/dist/hud/types.d.ts +22 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/notifications/__tests__/http-client-resource.test.d.ts +2 -0
- package/dist/notifications/__tests__/http-client-resource.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/http-client-resource.test.js +41 -0
- package/dist/notifications/__tests__/http-client-resource.test.js.map +1 -0
- package/dist/notifications/__tests__/verbosity.test.js +20 -0
- package/dist/notifications/__tests__/verbosity.test.js.map +1 -1
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +6 -3
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/http-client.d.ts.map +1 -1
- package/dist/notifications/http-client.js +78 -27
- package/dist/notifications/http-client.js.map +1 -1
- package/dist/notifications/types.d.ts +2 -0
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +49 -1
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/openclaw/dispatcher.d.ts +7 -4
- package/dist/openclaw/dispatcher.d.ts.map +1 -1
- package/dist/openclaw/dispatcher.js +32 -69
- package/dist/openclaw/dispatcher.js.map +1 -1
- package/dist/pipeline/__tests__/orchestrator.test.js +128 -4
- package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
- package/dist/pipeline/__tests__/stages.test.js +460 -9
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/index.d.ts +8 -2
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/index.js +5 -2
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/orchestrator.d.ts +5 -4
- package/dist/pipeline/orchestrator.d.ts.map +1 -1
- package/dist/pipeline/orchestrator.js +85 -17
- package/dist/pipeline/orchestrator.js.map +1 -1
- package/dist/pipeline/stages/code-review.d.ts +2 -2
- package/dist/pipeline/stages/code-review.d.ts.map +1 -1
- package/dist/pipeline/stages/code-review.js +5 -3
- package/dist/pipeline/stages/code-review.js.map +1 -1
- package/dist/pipeline/stages/deep-interview.d.ts +15 -0
- package/dist/pipeline/stages/deep-interview.d.ts.map +1 -0
- package/dist/pipeline/stages/deep-interview.js +32 -0
- package/dist/pipeline/stages/deep-interview.js.map +1 -0
- package/dist/pipeline/stages/ralph-verify.d.ts +5 -5
- package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -1
- package/dist/pipeline/stages/ralph-verify.js +2 -2
- package/dist/pipeline/stages/ralph-verify.js.map +1 -1
- package/dist/pipeline/stages/ralplan.d.ts.map +1 -1
- package/dist/pipeline/stages/ralplan.js +41 -6
- package/dist/pipeline/stages/ralplan.js.map +1 -1
- package/dist/pipeline/stages/ultragoal.d.ts +19 -0
- package/dist/pipeline/stages/ultragoal.d.ts.map +1 -0
- package/dist/pipeline/stages/ultragoal.js +38 -0
- package/dist/pipeline/stages/ultragoal.js.map +1 -0
- package/dist/pipeline/stages/ultraqa.d.ts +30 -0
- package/dist/pipeline/stages/ultraqa.d.ts.map +1 -0
- package/dist/pipeline/stages/ultraqa.js +46 -0
- package/dist/pipeline/stages/ultraqa.js.map +1 -0
- package/dist/pipeline/types.d.ts +8 -6
- package/dist/pipeline/types.d.ts.map +1 -1
- package/dist/pipeline/types.js +2 -2
- package/dist/question/__tests__/ui.test.js +43 -10
- package/dist/question/__tests__/ui.test.js.map +1 -1
- package/dist/question/ui.d.ts +12 -0
- package/dist/question/ui.d.ts.map +1 -1
- package/dist/question/ui.js +83 -46
- package/dist/question/ui.js.map +1 -1
- package/dist/ralplan/__tests__/runtime.test.js +200 -10
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/consensus-gate.d.ts +23 -0
- package/dist/ralplan/consensus-gate.d.ts.map +1 -0
- package/dist/ralplan/consensus-gate.js +212 -0
- package/dist/ralplan/consensus-gate.js.map +1 -0
- package/dist/ralplan/runtime.d.ts +25 -0
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +144 -8
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +1358 -79
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/docs-site-contract.test.d.ts +2 -0
- package/dist/scripts/__tests__/docs-site-contract.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/docs-site-contract.test.js +42 -0
- package/dist/scripts/__tests__/docs-site-contract.test.js.map +1 -0
- package/dist/scripts/__tests__/notify-dispatcher.test.js +115 -2
- package/dist/scripts/__tests__/notify-dispatcher.test.js.map +1 -1
- package/dist/scripts/__tests__/run-test-files.test.js +57 -0
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +23 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-agents.test.js +18 -3
- package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -1
- package/dist/scripts/cleanup-explore-harness.js +1 -0
- package/dist/scripts/cleanup-explore-harness.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +372 -44
- 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 +9 -1
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/notify-dispatcher.js +188 -4
- package/dist/scripts/notify-dispatcher.js.map +1 -1
- package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
- package/dist/scripts/notify-hook/process-runner.js +39 -17
- 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 +9 -5
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +7 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/run-test-files.js +13 -0
- 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 +99 -1
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +2 -2
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/scripts/verify-native-agents.js +2 -2
- package/dist/scripts/verify-native-agents.js.map +1 -1
- package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts +2 -0
- package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/resource-leak-watch.test.js +38 -0
- package/dist/sidecar/__tests__/resource-leak-watch.test.js.map +1 -0
- package/dist/sidecar/index.d.ts +1 -1
- package/dist/sidecar/index.d.ts.map +1 -1
- package/dist/sidecar/index.js +29 -12
- package/dist/sidecar/index.js.map +1 -1
- package/dist/state/__tests__/operations-ralph-phase.test.js +88 -1
- package/dist/state/__tests__/operations-ralph-phase.test.js.map +1 -1
- package/dist/state/__tests__/workflow-transition.test.js +6 -0
- 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 +11 -0
- package/dist/state/operations.js.map +1 -1
- package/dist/state/workflow-transition.d.ts +1 -1
- package/dist/state/workflow-transition.d.ts.map +1 -1
- package/dist/state/workflow-transition.js +7 -0
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/subagents/tracker.d.ts.map +1 -1
- package/dist/subagents/tracker.js +4 -3
- package/dist/subagents/tracker.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +36 -44
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +163 -15
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +10 -20
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +51 -21
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +764 -10
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +57 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/__tests__/steering-fixtures.d.ts +68 -0
- package/dist/ultragoal/__tests__/steering-fixtures.d.ts.map +1 -0
- package/dist/ultragoal/__tests__/steering-fixtures.js +259 -0
- package/dist/ultragoal/__tests__/steering-fixtures.js.map +1 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts +2 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts.map +1 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.js +65 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.js.map +1 -0
- package/dist/ultragoal/artifacts.d.ts +97 -2
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +837 -256
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/utils/__tests__/sleep-resource.test.d.ts +2 -0
- package/dist/utils/__tests__/sleep-resource.test.d.ts.map +1 -0
- package/dist/utils/__tests__/sleep-resource.test.js +39 -0
- package/dist/utils/__tests__/sleep-resource.test.js.map +1 -0
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/sleep.js +17 -6
- package/dist/utils/sleep.js.map +1 -1
- package/package.json +2 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +4 -3
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +56 -0
- package/plugins/oh-my-codex/hooks/hooks.json +77 -0
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +92 -50
- package/plugins/oh-my-codex/skills/autoresearch/SKILL.md +4 -0
- package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/best-practice-research/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +8 -8
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/pipeline/SKILL.md +23 -12
- package/plugins/oh-my-codex/skills/plan/SKILL.md +8 -8
- package/plugins/oh-my-codex/skills/prometheus-strict/README.md +35 -0
- package/plugins/oh-my-codex/skills/prometheus-strict/SKILL.md +219 -0
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +7 -0
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +22 -7
- package/plugins/oh-my-codex/skills/team/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +38 -4
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +1 -1
- package/prompts/planner.md +1 -1
- package/prompts/prometheus-strict-metis.md +274 -0
- package/prompts/prometheus-strict-momus.md +82 -0
- package/prompts/prometheus-strict-oracle.md +107 -0
- package/prompts/researcher.md +22 -3
- package/skills/autopilot/SKILL.md +92 -50
- package/skills/autoresearch/SKILL.md +4 -0
- package/skills/autoresearch-goal/SKILL.md +1 -1
- package/skills/best-practice-research/SKILL.md +1 -1
- package/skills/cancel/SKILL.md +2 -2
- package/skills/deep-interview/SKILL.md +8 -8
- package/skills/omx-setup/SKILL.md +1 -1
- package/skills/pipeline/SKILL.md +23 -12
- package/skills/plan/SKILL.md +8 -8
- package/skills/prometheus-strict/README.md +35 -0
- package/skills/prometheus-strict/SKILL.md +219 -0
- package/skills/ralph/SKILL.md +7 -0
- package/skills/ralplan/SKILL.md +22 -7
- package/skills/team/SKILL.md +1 -1
- package/skills/ultragoal/SKILL.md +38 -4
- package/skills/ultrawork/SKILL.md +1 -1
- package/src/scripts/__tests__/codex-native-hook.test.ts +1757 -210
- package/src/scripts/__tests__/docs-site-contract.test.ts +47 -0
- package/src/scripts/__tests__/notify-dispatcher.test.ts +132 -3
- package/src/scripts/__tests__/run-test-files.test.ts +67 -0
- package/src/scripts/__tests__/smoke-packed-install.test.ts +31 -0
- package/src/scripts/__tests__/verify-native-agents.test.ts +23 -3
- package/src/scripts/cleanup-explore-harness.ts +1 -0
- package/src/scripts/codex-native-hook.ts +393 -40
- package/src/scripts/codex-native-pre-post.ts +16 -1
- package/src/scripts/notify-dispatcher.ts +202 -4
- package/src/scripts/notify-hook/process-runner.ts +40 -16
- package/src/scripts/notify-hook/team-dispatch.ts +9 -5
- package/src/scripts/notify-hook/team-tmux-guard.ts +7 -0
- package/src/scripts/run-test-files.ts +13 -0
- package/src/scripts/smoke-packed-install.ts +105 -0
- package/src/scripts/sync-plugin-mirror.ts +3 -3
- package/src/scripts/verify-native-agents.ts +2 -2
- package/templates/catalog-manifest.json +22 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from "child_process";
|
|
2
|
-
import { DEFAULT_CODEX_HOOK_FEATURE_FLAG, resolveCodexHookFeatureFlag, } from "../config/codex-feature-flags.js";
|
|
2
|
+
import { DEFAULT_CODEX_HOOK_FEATURE_FLAG, resolveCodexHookFeatureFlag, supportsCodexPluginScopedHooks, } from "../config/codex-feature-flags.js";
|
|
3
3
|
export function probeInstalledCodexFeatureList() {
|
|
4
4
|
const result = spawnSync("codex", ["features", "list"], {
|
|
5
5
|
encoding: "utf-8",
|
|
@@ -16,13 +16,19 @@ export function probeInstalledCodexVersion() {
|
|
|
16
16
|
return null;
|
|
17
17
|
return [result.stdout, result.stderr].filter(Boolean).join("\n") || null;
|
|
18
18
|
}
|
|
19
|
-
export function
|
|
19
|
+
export function resolveCodexHookFeatureSupportForCli(options = {}) {
|
|
20
20
|
const featuresListOutput = options.codexFeaturesProbe?.() ?? probeInstalledCodexFeatureList();
|
|
21
21
|
const versionOutput = options.codexVersionProbe?.() ?? probeInstalledCodexVersion();
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return {
|
|
23
|
+
hookFeatureFlag: resolveCodexHookFeatureFlag({
|
|
24
|
+
featuresListOutput,
|
|
25
|
+
versionOutput,
|
|
26
|
+
fallback: DEFAULT_CODEX_HOOK_FEATURE_FLAG,
|
|
27
|
+
}),
|
|
28
|
+
pluginScopedHooks: supportsCodexPluginScopedHooks({ featuresListOutput }),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function resolveCodexHookFeatureFlagForCli(options = {}) {
|
|
32
|
+
return resolveCodexHookFeatureSupportForCli(options).hookFeatureFlag;
|
|
27
33
|
}
|
|
28
34
|
//# sourceMappingURL=codex-feature-probe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-feature-probe.js","sourceRoot":"","sources":["../../src/cli/codex-feature-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"codex-feature-probe.js","sourceRoot":"","sources":["../../src/cli/codex-feature-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,GAE/B,MAAM,kCAAkC,CAAC;AAO1C,MAAM,UAAU,8BAA8B;IAC5C,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE;QACtD,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE;QAC/C,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC3E,CAAC;AAOD,MAAM,UAAU,oCAAoC,CAClD,UAAoC,EAAE;IAEtC,MAAM,kBAAkB,GACtB,OAAO,CAAC,kBAAkB,EAAE,EAAE,IAAI,8BAA8B,EAAE,CAAC;IACrE,MAAM,aAAa,GAAG,OAAO,CAAC,iBAAiB,EAAE,EAAE,IAAI,0BAA0B,EAAE,CAAC;IACpF,OAAO;QACL,eAAe,EAAE,2BAA2B,CAAC;YAC3C,kBAAkB;YAClB,aAAa;YACb,QAAQ,EAAE,+BAA+B;SAC1C,CAAC;QACF,iBAAiB,EAAE,8BAA8B,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,UAAoC,EAAE;IAEtC,OAAO,oCAAoC,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC;AACvE,CAAC"}
|
package/dist/cli/doctor.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* omx doctor - Validate oh-my-codex installation
|
|
3
3
|
*/
|
|
4
|
+
import { spawnSync } from "child_process";
|
|
4
5
|
interface DoctorOptions {
|
|
5
6
|
verbose?: boolean;
|
|
6
7
|
force?: boolean;
|
|
@@ -12,8 +13,14 @@ interface Check {
|
|
|
12
13
|
status: "pass" | "warn" | "fail";
|
|
13
14
|
message: string;
|
|
14
15
|
}
|
|
16
|
+
interface NativeHookDistSmokeOptions {
|
|
17
|
+
packageRoot?: string;
|
|
18
|
+
nodePath?: string;
|
|
19
|
+
runner?: typeof spawnSync;
|
|
20
|
+
}
|
|
15
21
|
export declare function doctor(options?: DoctorOptions): Promise<void>;
|
|
16
22
|
export declare function checkExploreHarness(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): Check;
|
|
23
|
+
export declare function checkNativeHookDistSmoke(options?: NativeHookDistSmokeOptions): Promise<Check>;
|
|
17
24
|
export declare function classifyPostCompactHookStdout(stdout: string): Check | null;
|
|
18
25
|
export {};
|
|
19
26
|
//# sourceMappingURL=doctor.d.ts.map
|
package/dist/cli/doctor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAgE1C,UAAU,aAAa;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,UAAU,KAAK;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,0BAA0B;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,SAAS,CAAC;CAC1B;AAyDD,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmJvE;AAuYD,wBAAgB,mBAAmB,CAClC,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,GAAG,GAAE,MAAM,CAAC,UAAwB,GAClC,KAAK,CAoFP;AAwiBD,wBAAsB,wBAAwB,CAC7C,OAAO,GAAE,0BAA+B,GACtC,OAAO,CAAC,KAAK,CAAC,CA2EhB;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAmB1E"}
|
package/dist/cli/doctor.js
CHANGED
|
@@ -13,7 +13,7 @@ import { parse as parseToml } from "@iarna/toml";
|
|
|
13
13
|
import { getBuiltinExploreHarnessUnsupportedReason, resolvePackagedExploreHarnessCommand, EXPLORE_BIN_ENV, } from "./explore.js";
|
|
14
14
|
import { getPackageRoot } from "../utils/package.js";
|
|
15
15
|
import { hasLegacyOmxTeamRunTable, getModelContextRecommendation, } from "../config/generator.js";
|
|
16
|
-
import { buildManagedCodexNativeHookCommand, discoverCodexHookConfigPaths, getManagedCodexHookCommandsForEvent, getMissingManagedCodexHookEvents, } from "../config/codex-hooks.js";
|
|
16
|
+
import { MANAGED_HOOK_EVENTS, buildManagedCodexNativeHookCommand, discoverCodexHookConfigPaths, getManagedCodexHookCommandsForEvent, getMissingManagedCodexHookEvents, } from "../config/codex-hooks.js";
|
|
17
17
|
import { OMX_FIRST_PARTY_MCP_SERVER_NAMES } from "../config/omx-first-party-mcp.js";
|
|
18
18
|
import { getDefaultBridge, isBridgeEnabled } from "../runtime/bridge.js";
|
|
19
19
|
import { OMX_EXPLORE_CMD_ENV, isExploreCommandRoutingEnabled, } from "../hooks/explore-routing.js";
|
|
@@ -94,7 +94,11 @@ export async function doctor(options = {}) {
|
|
|
94
94
|
if (contextRecommendationCheck)
|
|
95
95
|
checks.push(contextRecommendationCheck);
|
|
96
96
|
// Check 4.25: Native hooks coverage
|
|
97
|
-
checks.push(await checkNativeHooks(paths.hooksPath, paths.configPath
|
|
97
|
+
checks.push(await checkNativeHooks(paths.hooksPath, paths.configPath, {
|
|
98
|
+
codexHomeDir: paths.codexHomeDir,
|
|
99
|
+
installMode: scopeResolution.installMode,
|
|
100
|
+
}));
|
|
101
|
+
checks.push(await checkNativeHookDistSmoke());
|
|
98
102
|
if (options.verbose) {
|
|
99
103
|
const postCompactRuntimeCheck = await checkNativePostCompactHookRuntime(paths.hooksPath, cwd, paths.codexHomeDir);
|
|
100
104
|
if (postCompactRuntimeCheck)
|
|
@@ -714,21 +718,40 @@ async function checkExploreRouting(configPath) {
|
|
|
714
718
|
};
|
|
715
719
|
}
|
|
716
720
|
}
|
|
721
|
+
const LORE_COMMIT_GUARD_EXPLICIT_OPT_OUT_VALUES = new Set([
|
|
722
|
+
"0",
|
|
723
|
+
"false",
|
|
724
|
+
"no",
|
|
725
|
+
"off",
|
|
726
|
+
]);
|
|
717
727
|
async function checkLoreCommitGuard(configPath) {
|
|
718
728
|
const envValue = process.env[OMX_LORE_COMMIT_GUARD_ENV];
|
|
719
|
-
if (typeof envValue === "string"
|
|
720
|
-
|
|
729
|
+
if (typeof envValue === "string") {
|
|
730
|
+
if (isLoreCommitGuardEnabled(process.env)) {
|
|
731
|
+
return {
|
|
732
|
+
name: "Lore commit guard",
|
|
733
|
+
status: "pass",
|
|
734
|
+
message: "enabled by environment opt-in",
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
if (!isExplicitLoreCommitGuardOptOut(envValue)) {
|
|
738
|
+
return {
|
|
739
|
+
name: "Lore commit guard",
|
|
740
|
+
status: "warn",
|
|
741
|
+
message: "invalid environment value; Lore commit enforcement is disabled until OMX_LORE_COMMIT_GUARD is set to 1, true, yes, or on",
|
|
742
|
+
};
|
|
743
|
+
}
|
|
721
744
|
return {
|
|
722
745
|
name: "Lore commit guard",
|
|
723
|
-
status: "
|
|
724
|
-
message: "disabled by environment
|
|
746
|
+
status: "pass",
|
|
747
|
+
message: "disabled by environment/default opt-out; enable with OMX_LORE_COMMIT_GUARD=1",
|
|
725
748
|
};
|
|
726
749
|
}
|
|
727
750
|
if (!existsSync(configPath)) {
|
|
728
751
|
return {
|
|
729
752
|
name: "Lore commit guard",
|
|
730
753
|
status: "pass",
|
|
731
|
-
message: "
|
|
754
|
+
message: "disabled by default (config.toml not found yet)",
|
|
732
755
|
};
|
|
733
756
|
}
|
|
734
757
|
try {
|
|
@@ -736,20 +759,33 @@ async function checkLoreCommitGuard(configPath) {
|
|
|
736
759
|
const parsed = parseToml(content);
|
|
737
760
|
const configuredValue = parsed?.shell_environment_policy?.set?.[OMX_LORE_COMMIT_GUARD_ENV] ??
|
|
738
761
|
parsed?.env?.[OMX_LORE_COMMIT_GUARD_ENV];
|
|
739
|
-
if (typeof configuredValue === "string"
|
|
740
|
-
|
|
762
|
+
if (typeof configuredValue === "string") {
|
|
763
|
+
if (isLoreCommitGuardEnabled({
|
|
741
764
|
[OMX_LORE_COMMIT_GUARD_ENV]: configuredValue,
|
|
742
765
|
})) {
|
|
766
|
+
return {
|
|
767
|
+
name: "Lore commit guard",
|
|
768
|
+
status: "pass",
|
|
769
|
+
message: "enabled by config.toml opt-in",
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
if (!isExplicitLoreCommitGuardOptOut(configuredValue)) {
|
|
773
|
+
return {
|
|
774
|
+
name: "Lore commit guard",
|
|
775
|
+
status: "warn",
|
|
776
|
+
message: 'invalid config.toml value; Lore commit enforcement is disabled until OMX_LORE_COMMIT_GUARD = "1" (or true/yes/on) is set under [shell_environment_policy.set]',
|
|
777
|
+
};
|
|
778
|
+
}
|
|
743
779
|
return {
|
|
744
780
|
name: "Lore commit guard",
|
|
745
|
-
status: "
|
|
746
|
-
message: 'disabled in config.toml; set OMX_LORE_COMMIT_GUARD = "1" under [shell_environment_policy.set] to
|
|
781
|
+
status: "pass",
|
|
782
|
+
message: 'disabled in config.toml/default opt-out; set OMX_LORE_COMMIT_GUARD = "1" under [shell_environment_policy.set] to enable Lore commit enforcement',
|
|
747
783
|
};
|
|
748
784
|
}
|
|
749
785
|
return {
|
|
750
786
|
name: "Lore commit guard",
|
|
751
787
|
status: "pass",
|
|
752
|
-
message: "
|
|
788
|
+
message: "disabled by default",
|
|
753
789
|
};
|
|
754
790
|
}
|
|
755
791
|
catch {
|
|
@@ -760,18 +796,189 @@ async function checkLoreCommitGuard(configPath) {
|
|
|
760
796
|
};
|
|
761
797
|
}
|
|
762
798
|
}
|
|
763
|
-
|
|
799
|
+
function isExplicitLoreCommitGuardOptOut(value) {
|
|
800
|
+
return LORE_COMMIT_GUARD_EXPLICIT_OPT_OUT_VALUES.has(value.trim().toLowerCase());
|
|
801
|
+
}
|
|
802
|
+
function isEnabledTomlValue(value) {
|
|
803
|
+
return value === true || (typeof value === "string" && ["1", "true", "yes", "on"].includes(value.trim().toLowerCase()));
|
|
804
|
+
}
|
|
805
|
+
function configHasOmxEntries(configContent) {
|
|
806
|
+
return configContent.includes("omx_") || configContent.includes("oh-my-codex");
|
|
807
|
+
}
|
|
808
|
+
function configEnablesPluginScopedHooks(configContent) {
|
|
809
|
+
try {
|
|
810
|
+
const parsed = parseToml(configContent);
|
|
811
|
+
return isEnabledTomlValue(parsed.plugin_hooks) || isEnabledTomlValue(parsed.features?.plugin_hooks);
|
|
812
|
+
}
|
|
813
|
+
catch {
|
|
814
|
+
return /^\s*plugin_hooks\s*=\s*(?:true|1|"true"|"1"|"yes"|"on")\s*$/m.test(configContent);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
function pluginHooksJsonHasNativeCoverage(content) {
|
|
818
|
+
try {
|
|
819
|
+
const parsed = JSON.parse(content);
|
|
820
|
+
if (!parsed || typeof parsed !== "object" || typeof parsed.hooks !== "object" || parsed.hooks === null) {
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
return MANAGED_HOOK_EVENTS.every((eventName) => {
|
|
824
|
+
const entries = parsed.hooks?.[eventName];
|
|
825
|
+
if (!Array.isArray(entries))
|
|
826
|
+
return false;
|
|
827
|
+
return entries.some((entry) => {
|
|
828
|
+
if (!entry || typeof entry !== "object")
|
|
829
|
+
return false;
|
|
830
|
+
const hooks = entry.hooks;
|
|
831
|
+
if (!Array.isArray(hooks))
|
|
832
|
+
return false;
|
|
833
|
+
return hooks.some((hook) => {
|
|
834
|
+
if (!hook || typeof hook !== "object")
|
|
835
|
+
return false;
|
|
836
|
+
const command = hook.command;
|
|
837
|
+
return typeof command === "string" && command.includes("codex-native-hook.mjs");
|
|
838
|
+
});
|
|
839
|
+
});
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
catch {
|
|
843
|
+
return null;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
async function checkPluginScopedNativeHooks(codexHomeDir, setupHooksPath) {
|
|
847
|
+
const packagedMarketplace = await resolvePackagedOmxMarketplace(getPackageRoot());
|
|
848
|
+
if (!packagedMarketplace) {
|
|
849
|
+
return {
|
|
850
|
+
name: "Native hooks",
|
|
851
|
+
status: "warn",
|
|
852
|
+
message: `plugin-scoped hooks are enabled and setup-owned hooks.json is intentionally absent at ${setupHooksPath}, but packaged ${OMX_LOCAL_MARKETPLACE_NAME} metadata was not found`,
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
const version = await packagedOmxPluginVersion(packagedMarketplace);
|
|
856
|
+
const expectedCacheDir = version
|
|
857
|
+
? join(codexHomeDir, "plugins", "cache", OMX_LOCAL_MARKETPLACE_NAME, "oh-my-codex", version)
|
|
858
|
+
: join(codexHomeDir, "plugins", "cache", OMX_LOCAL_MARKETPLACE_NAME, "oh-my-codex", "<version>");
|
|
859
|
+
const expectedHooksPath = join(expectedCacheDir, "hooks", "hooks.json");
|
|
860
|
+
const expectedHookLauncherPath = join(expectedCacheDir, "hooks", "codex-native-hook.mjs");
|
|
861
|
+
const expectedPinnedLauncherPath = join(expectedCacheDir, "hooks", "omx-command.json");
|
|
862
|
+
const state = await readOmxPluginCacheState(expectedCacheDir);
|
|
863
|
+
if (!state) {
|
|
864
|
+
return {
|
|
865
|
+
name: "Native hooks",
|
|
866
|
+
status: "warn",
|
|
867
|
+
message: `plugin-scoped hooks are enabled, but the expected Codex plugin cache manifest is missing at ${join(expectedCacheDir, ".codex-plugin", "plugin.json")}; setup-owned hooks.json is intentionally absent at ${setupHooksPath}; run "omx setup --plugin --force" to refresh the plugin cache`,
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
if (state.hooksPointer !== "./hooks/hooks.json") {
|
|
871
|
+
return {
|
|
872
|
+
name: "Native hooks",
|
|
873
|
+
status: "warn",
|
|
874
|
+
message: `plugin-scoped hooks are enabled, but the Codex plugin cache manifest points hooks to ${String(state.hooksPointer)} instead of ./hooks/hooks.json at ${expectedHooksPath}; run "omx setup --plugin --force" to refresh the plugin cache`,
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
for (const expectedPath of [expectedHooksPath, expectedHookLauncherPath, expectedPinnedLauncherPath]) {
|
|
878
|
+
if (!existsSync(expectedPath)) {
|
|
879
|
+
return {
|
|
880
|
+
name: "Native hooks",
|
|
881
|
+
status: "warn",
|
|
882
|
+
message: `plugin-scoped hooks are enabled, but expected plugin hook file is missing at ${expectedPath}; setup-owned hooks.json is intentionally absent at ${setupHooksPath}; run "omx setup --plugin --force" to refresh the plugin cache`,
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
let hookContent;
|
|
887
|
+
try {
|
|
888
|
+
hookContent = await readFile(expectedHooksPath, "utf-8");
|
|
889
|
+
}
|
|
890
|
+
catch {
|
|
891
|
+
return {
|
|
892
|
+
name: "Native hooks",
|
|
893
|
+
status: "fail",
|
|
894
|
+
message: `cannot read plugin-scoped hooks.json at ${expectedHooksPath}`,
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
const hasCoverage = pluginHooksJsonHasNativeCoverage(hookContent);
|
|
898
|
+
if (hasCoverage === null) {
|
|
899
|
+
return {
|
|
900
|
+
name: "Native hooks",
|
|
901
|
+
status: "fail",
|
|
902
|
+
message: `invalid plugin-scoped hooks.json at ${expectedHooksPath}`,
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
if (!hasCoverage) {
|
|
906
|
+
return {
|
|
907
|
+
name: "Native hooks",
|
|
908
|
+
status: "warn",
|
|
909
|
+
message: `plugin-scoped hooks.json at ${expectedHooksPath} is missing OMX native coverage for one or more events; run "omx setup --plugin --force" to refresh the plugin cache`,
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
const smokeCwd = await mkdtemp(join(tmpdir(), "omx-doctor-plugin-hook-"));
|
|
913
|
+
try {
|
|
914
|
+
const payload = JSON.stringify({
|
|
915
|
+
hook_event_name: "UserPromptSubmit",
|
|
916
|
+
session_id: "omx-doctor-plugin-hook-smoke",
|
|
917
|
+
transcript_path: join(smokeCwd, "nonexistent-transcript.jsonl"),
|
|
918
|
+
cwd: smokeCwd,
|
|
919
|
+
prompt: "doctor plugin hook smoke test",
|
|
920
|
+
});
|
|
921
|
+
const result = spawnSync(process.execPath, [expectedHookLauncherPath], {
|
|
922
|
+
cwd: smokeCwd,
|
|
923
|
+
encoding: "utf-8",
|
|
924
|
+
env: {
|
|
925
|
+
...process.env,
|
|
926
|
+
OMX_NATIVE_HOOK_DOCTOR_SMOKE: "1",
|
|
927
|
+
OMX_ROOT: join(smokeCwd, ".omx-doctor-root"),
|
|
928
|
+
OMX_SESSION_ID: "omx-doctor-plugin-hook-smoke",
|
|
929
|
+
OMX_SOURCE_CWD: smokeCwd,
|
|
930
|
+
OMX_STARTUP_CWD: smokeCwd,
|
|
931
|
+
},
|
|
932
|
+
input: payload,
|
|
933
|
+
timeout: 5_000,
|
|
934
|
+
});
|
|
935
|
+
if (result.error) {
|
|
936
|
+
return {
|
|
937
|
+
name: "Native hooks",
|
|
938
|
+
status: "fail",
|
|
939
|
+
message: `plugin-scoped native hook smoke failed to run from ${expectedHookLauncherPath} (${result.error.message})`,
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
if (result.status !== 0) {
|
|
943
|
+
const detail = (result.stderr || result.stdout || `exit ${result.status}`).trim();
|
|
944
|
+
return {
|
|
945
|
+
name: "Native hooks",
|
|
946
|
+
status: "fail",
|
|
947
|
+
message: `plugin-scoped native hook smoke failed from ${expectedHookLauncherPath} (${detail})`,
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
finally {
|
|
952
|
+
await rm(smokeCwd, { recursive: true, force: true });
|
|
953
|
+
}
|
|
954
|
+
return {
|
|
955
|
+
name: "Native hooks",
|
|
956
|
+
status: "pass",
|
|
957
|
+
message: `plugin-scoped hooks are enabled; setup-owned hooks.json is intentionally absent at ${setupHooksPath}, and plugin cache native hook coverage smoke passed via ${expectedHooksPath}`,
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
async function checkNativeHooks(hooksPath, configPath, context) {
|
|
764
961
|
if (!existsSync(hooksPath)) {
|
|
765
962
|
if (existsSync(configPath)) {
|
|
766
963
|
try {
|
|
767
964
|
const configContent = await readFile(configPath, "utf-8");
|
|
768
|
-
|
|
769
|
-
configContent
|
|
770
|
-
|
|
965
|
+
if (context.installMode === "plugin") {
|
|
966
|
+
if (configEnablesPluginScopedHooks(configContent)) {
|
|
967
|
+
return checkPluginScopedNativeHooks(context.codexHomeDir, hooksPath);
|
|
968
|
+
}
|
|
969
|
+
if (configHasOmxEntries(configContent)) {
|
|
970
|
+
return {
|
|
971
|
+
name: "Native hooks",
|
|
972
|
+
status: "warn",
|
|
973
|
+
message: `plugin mode is using legacy native hook fallback, but expected setup-owned hooks.json is missing at ${hooksPath}; run "omx setup --plugin --force" to restore the fallback hook file, or upgrade Codex to plugin_hooks support so setup can use plugin-scoped hooks`,
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (configHasOmxEntries(configContent)) {
|
|
771
978
|
return {
|
|
772
979
|
name: "Native hooks",
|
|
773
980
|
status: "warn",
|
|
774
|
-
message:
|
|
981
|
+
message: `expected setup-owned hooks.json is missing at ${hooksPath} even though config.toml has OMX entries; run "omx setup --force" to restore native hook coverage`,
|
|
775
982
|
};
|
|
776
983
|
}
|
|
777
984
|
}
|
|
@@ -817,6 +1024,79 @@ async function checkNativeHooks(hooksPath, configPath) {
|
|
|
817
1024
|
};
|
|
818
1025
|
}
|
|
819
1026
|
}
|
|
1027
|
+
export async function checkNativeHookDistSmoke(options = {}) {
|
|
1028
|
+
const packageRoot = options.packageRoot ?? getPackageRoot();
|
|
1029
|
+
const nodePath = options.nodePath ?? process.execPath;
|
|
1030
|
+
const runner = options.runner ?? spawnSync;
|
|
1031
|
+
const scriptPath = join(packageRoot, "dist", "scripts", "codex-native-hook.js");
|
|
1032
|
+
const packageJsonPath = join(packageRoot, "package.json");
|
|
1033
|
+
let packageVersion = "current";
|
|
1034
|
+
try {
|
|
1035
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
1036
|
+
if (typeof packageJson.version === "string" && packageJson.version.trim()) {
|
|
1037
|
+
packageVersion = packageJson.version.trim();
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
catch {
|
|
1041
|
+
// Keep the generic recovery copy when package metadata is not readable.
|
|
1042
|
+
}
|
|
1043
|
+
if (!existsSync(scriptPath)) {
|
|
1044
|
+
return {
|
|
1045
|
+
name: "Native hook dist smoke",
|
|
1046
|
+
status: "fail",
|
|
1047
|
+
message: `installed native hook script is missing at ${scriptPath}; reinstall oh-my-codex and run "omx setup --force"`,
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
const smokeCwd = await mkdtemp(join(tmpdir(), "omx-doctor-native-hook-dist-"));
|
|
1051
|
+
try {
|
|
1052
|
+
const payload = JSON.stringify({
|
|
1053
|
+
hook_event_name: "UserPromptSubmit",
|
|
1054
|
+
session_id: "omx-doctor-native-hook-dist-smoke",
|
|
1055
|
+
transcript_path: join(smokeCwd, "nonexistent-transcript.jsonl"),
|
|
1056
|
+
cwd: smokeCwd,
|
|
1057
|
+
prompt: "doctor smoke test",
|
|
1058
|
+
});
|
|
1059
|
+
const result = runner(nodePath, [scriptPath], {
|
|
1060
|
+
cwd: smokeCwd,
|
|
1061
|
+
encoding: "utf-8",
|
|
1062
|
+
env: {
|
|
1063
|
+
...process.env,
|
|
1064
|
+
OMX_NATIVE_HOOK_DOCTOR_SMOKE: "1",
|
|
1065
|
+
OMX_ROOT: join(smokeCwd, ".omx-doctor-root"),
|
|
1066
|
+
OMX_SESSION_ID: "omx-doctor-native-hook-dist-smoke",
|
|
1067
|
+
OMX_SOURCE_CWD: smokeCwd,
|
|
1068
|
+
OMX_STARTUP_CWD: smokeCwd,
|
|
1069
|
+
},
|
|
1070
|
+
input: payload,
|
|
1071
|
+
timeout: 5_000,
|
|
1072
|
+
});
|
|
1073
|
+
if (result.error) {
|
|
1074
|
+
return {
|
|
1075
|
+
name: "Native hook dist smoke",
|
|
1076
|
+
status: "fail",
|
|
1077
|
+
message: `installed native hook dist smoke failed to run (${result.error.message}); reinstall oh-my-codex and run "omx setup --force"`,
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
if (result.status !== 0) {
|
|
1081
|
+
const stderr = (result.stderr || "").trim();
|
|
1082
|
+
const stdout = (result.stdout || "").trim();
|
|
1083
|
+
const detail = stderr || stdout || `exit ${result.status}`;
|
|
1084
|
+
return {
|
|
1085
|
+
name: "Native hook dist smoke",
|
|
1086
|
+
status: "fail",
|
|
1087
|
+
message: `installed native hook dist failed a minimal UserPromptSubmit smoke (${detail}); reinstall with "npm install -g oh-my-codex@${packageVersion} --force --min-release-age=0 --before=" and then run "omx setup --force"`,
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
return {
|
|
1091
|
+
name: "Native hook dist smoke",
|
|
1092
|
+
status: "pass",
|
|
1093
|
+
message: "installed dist/scripts/codex-native-hook.js parsed and accepted a minimal UserPromptSubmit payload",
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
finally {
|
|
1097
|
+
await rm(smokeCwd, { recursive: true, force: true });
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
820
1100
|
export function classifyPostCompactHookStdout(stdout) {
|
|
821
1101
|
const trimmed = stdout.trim();
|
|
822
1102
|
if (trimmed === "")
|