oh-my-codex 0.20.1 → 0.20.3
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 +7 -6
- package/Cargo.toml +1 -1
- package/README.md +36 -1
- package/crates/omx-runtime/Cargo.toml +1 -0
- package/crates/omx-runtime/src/main.rs +25 -2
- package/crates/omx-runtime/tests/execution.rs +219 -0
- package/crates/omx-runtime-core/src/dispatch.rs +96 -10
- package/crates/omx-runtime-core/src/engine.rs +839 -29
- package/crates/omx-runtime-core/src/lib.rs +8 -0
- package/dist/adapt/__tests__/hermes.test.js.map +1 -1
- package/dist/adapt/contracts.d.ts.map +1 -1
- package/dist/agents/__tests__/definitions.test.js +81 -0
- package/dist/agents/__tests__/definitions.test.js.map +1 -1
- package/dist/agents/__tests__/native-config.test.js +25 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/native-config.d.ts +2 -1
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js.map +1 -1
- package/dist/auth/__tests__/hotswap.test.d.ts +2 -0
- package/dist/auth/__tests__/hotswap.test.d.ts.map +1 -0
- package/dist/auth/__tests__/hotswap.test.js +183 -0
- package/dist/auth/__tests__/hotswap.test.js.map +1 -0
- package/dist/auth/hotswap.d.ts +6 -0
- package/dist/auth/hotswap.d.ts.map +1 -1
- package/dist/auth/hotswap.js +102 -19
- package/dist/auth/hotswap.js.map +1 -1
- package/dist/auth/paths.js.map +1 -1
- package/dist/auth/storage.js.map +1 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.js +5 -5
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -1
- package/dist/autopilot/completion-gate.js.map +1 -1
- package/dist/autopilot/fsm.d.ts +1 -1
- package/dist/autopilot/fsm.d.ts.map +1 -1
- package/dist/autoresearch/goal.js.map +1 -1
- package/dist/autoresearch/runtime.js.map +1 -1
- package/dist/capabilities/lockfile.js.map +1 -1
- package/dist/catalog/reader.js.map +1 -1
- package/dist/catalog/skill-mirror.js.map +1 -1
- package/dist/cli/__tests__/adapt-help.test.js.map +1 -1
- package/dist/cli/__tests__/agents-init.test.js.map +1 -1
- package/dist/cli/__tests__/agents.test.js.map +1 -1
- package/dist/cli/__tests__/api.test.js.map +1 -1
- package/dist/cli/__tests__/ask.test.js.map +1 -1
- package/dist/cli/__tests__/auth.test.js +60 -6
- package/dist/cli/__tests__/auth.test.js.map +1 -1
- package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -1
- package/dist/cli/__tests__/autoresearch.test.js.map +1 -1
- package/dist/cli/__tests__/capabilities.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +80 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-invalid-config.test.js +47 -4
- package/dist/cli/__tests__/doctor-invalid-config.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +752 -15
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +136 -0
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/imagegen-continuation.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +473 -14
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +336 -4
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-parity.test.js +87 -12
- package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
- package/dist/cli/__tests__/native-hook-claim-journal.test.d.ts +2 -0
- package/dist/cli/__tests__/native-hook-claim-journal.test.d.ts.map +1 -0
- package/dist/cli/__tests__/native-hook-claim-journal.test.js +206 -0
- package/dist/cli/__tests__/native-hook-claim-journal.test.js.map +1 -0
- package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +6 -0
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-prd-smoke.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +8 -3
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.d.ts +2 -0
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js +72 -0
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js.map +1 -0
- package/dist/cli/__tests__/ralplan.test.d.ts +2 -0
- package/dist/cli/__tests__/ralplan.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralplan.test.js +55 -0
- package/dist/cli/__tests__/ralplan.test.js.map +1 -0
- package/dist/cli/__tests__/resume.test.js +17 -11
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +25 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/session-search-help.test.js +25 -1
- package/dist/cli/__tests__/session-search-help.test.js.map +1 -1
- package/dist/cli/__tests__/session-search.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +79 -0
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-gh-star.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +77 -3
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js +285 -0
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js.map +1 -0
- package/dist/cli/__tests__/setup-install-mode.test.js +2579 -294
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-preferences.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-preferences.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-preferences.test.js +79 -0
- package/dist/cli/__tests__/setup-preferences.test.js.map +1 -0
- package/dist/cli/__tests__/setup-refresh.test.js +33 -2
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-scope.test.js +46 -3
- package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/state.test.js +37 -0
- package/dist/cli/__tests__/state.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +105 -7
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +61 -1
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +1817 -24
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +58 -0
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/__tests__/url.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +2 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
- package/dist/cli/adapt.js.map +1 -1
- package/dist/cli/agents-init.js.map +1 -1
- package/dist/cli/agents.js.map +1 -1
- package/dist/cli/api.js.map +1 -1
- package/dist/cli/ask.d.ts +1 -1
- package/dist/cli/ask.d.ts.map +1 -1
- package/dist/cli/ask.js.map +1 -1
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/autoresearch-guided.js.map +1 -1
- package/dist/cli/autoresearch-intake.js.map +1 -1
- package/dist/cli/capabilities.js.map +1 -1
- package/dist/cli/cleanup.js.map +1 -1
- package/dist/cli/codex-feature-probe.js.map +1 -1
- package/dist/cli/codex-home.js.map +1 -1
- package/dist/cli/doctor.d.ts +21 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +607 -130
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/explore.js.map +1 -1
- package/dist/cli/index.d.ts +14 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +245 -57
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-parity.js +2 -2
- package/dist/cli/mcp-parity.js.map +1 -1
- package/dist/cli/mcp-serve.js.map +1 -1
- package/dist/cli/mission.js.map +1 -1
- package/dist/cli/native-assets.js.map +1 -1
- package/dist/cli/native-hook-claim-journal.d.ts +29 -0
- package/dist/cli/native-hook-claim-journal.d.ts.map +1 -0
- package/dist/cli/native-hook-claim-journal.js +252 -0
- package/dist/cli/native-hook-claim-journal.js.map +1 -0
- package/dist/cli/omx.js.map +1 -1
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/project-runtime-codex-homes.js.map +1 -1
- package/dist/cli/question.js.map +1 -1
- package/dist/cli/ralph.d.ts.map +1 -1
- package/dist/cli/ralph.js +3 -2
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/ralplan.d.ts +10 -0
- package/dist/cli/ralplan.d.ts.map +1 -0
- package/dist/cli/ralplan.js +110 -0
- package/dist/cli/ralplan.js.map +1 -0
- package/dist/cli/session-search.d.ts +5 -0
- package/dist/cli/session-search.d.ts.map +1 -1
- package/dist/cli/session-search.js +87 -0
- package/dist/cli/session-search.js.map +1 -1
- package/dist/cli/setup-preferences.d.ts +11 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -1
- package/dist/cli/setup-preferences.js +32 -0
- package/dist/cli/setup-preferences.js.map +1 -1
- package/dist/cli/setup.d.ts +58 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +1450 -398
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/star-prompt.js.map +1 -1
- package/dist/cli/state.d.ts.map +1 -1
- package/dist/cli/state.js +2 -1
- package/dist/cli/state.js.map +1 -1
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/ultragoal.d.ts +5 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +34 -2
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/uninstall.d.ts +17 -0
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +986 -95
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +8 -1
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/url.js.map +1 -1
- package/dist/compat/__tests__/doctor-contract.test.js +5 -1
- package/dist/compat/__tests__/doctor-contract.test.js.map +1 -1
- package/dist/compat/__tests__/rust-runtime-compat.test.js +1 -1
- package/dist/compat/__tests__/rust-runtime-compat.test.js.map +1 -1
- package/dist/config/__tests__/codex-hooks.test.js +1287 -11
- package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +1179 -32
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +6 -1
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/__tests__/models.test.js +67 -3
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/codex-feature-flags.d.ts.map +1 -1
- package/dist/config/codex-feature-flags.js.map +1 -1
- package/dist/config/codex-hooks.d.ts +124 -1
- package/dist/config/codex-hooks.d.ts.map +1 -1
- package/dist/config/codex-hooks.js +2142 -265
- package/dist/config/codex-hooks.js.map +1 -1
- package/dist/config/commit-lore-guard.js.map +1 -1
- package/dist/config/generator.d.ts +23 -34
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +1480 -246
- package/dist/config/generator.js.map +1 -1
- package/dist/config/mcp-registry.js.map +1 -1
- package/dist/config/models.d.ts +14 -4
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +15 -1
- package/dist/config/models.js.map +1 -1
- package/dist/config/omx-first-party-mcp.js.map +1 -1
- package/dist/config/team-mode.d.ts.map +1 -1
- package/dist/document-refresh/__tests__/enforcer.test.js.map +1 -1
- package/dist/document-refresh/enforcer.js.map +1 -1
- package/dist/exec/followup.js.map +1 -1
- package/dist/goal-workflows/artifacts.js.map +1 -1
- package/dist/hooks/__tests__/agents-overlay.test.js +7 -4
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
- package/dist/hooks/__tests__/analyze-routing-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +9 -3
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/design-skill.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +1376 -6
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +252 -543
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +38 -4
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +765 -10
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +2 -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 +142 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-modules.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js +48 -2
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +61 -44
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js +3 -2
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js +243 -4
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +531 -12
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +163 -24
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +482 -32
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +68 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +7 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +43 -4
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/openclaw-setup-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
- package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -1
- package/dist/hooks/__tests__/prompt-session-provenance.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-session-provenance.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-session-provenance.test.js +82 -0
- package/dist/hooks/__tests__/prompt-session-provenance.test.js.map +1 -0
- package/dist/hooks/__tests__/session.test.js +878 -11
- package/dist/hooks/__tests__/session.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.js.map +1 -1
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +1 -1
- package/dist/hooks/agents-overlay.js +5 -5
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/code-simplifier/index.js.map +1 -1
- package/dist/hooks/explore-routing.js.map +1 -1
- package/dist/hooks/extensibility/dispatcher.js.map +1 -1
- package/dist/hooks/extensibility/events.js.map +1 -1
- package/dist/hooks/extensibility/loader.js.map +1 -1
- package/dist/hooks/extensibility/plugin-runner-stdin.js.map +1 -1
- package/dist/hooks/extensibility/sdk/logging.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +33 -7
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +2228 -119
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/keyword-registry.d.ts +12 -0
- package/dist/hooks/keyword-registry.d.ts.map +1 -1
- package/dist/hooks/keyword-registry.js +41 -0
- package/dist/hooks/keyword-registry.js.map +1 -1
- package/dist/hooks/prompt-session-provenance.d.ts +87 -0
- package/dist/hooks/prompt-session-provenance.d.ts.map +1 -0
- package/dist/hooks/prompt-session-provenance.js +180 -0
- package/dist/hooks/prompt-session-provenance.js.map +1 -0
- package/dist/hooks/session.d.ts +163 -34
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +1395 -317
- package/dist/hooks/session.js.map +1 -1
- package/dist/hooks/task-size-detector.js.map +1 -1
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/authority.js.map +1 -1
- package/dist/hud/constants.js.map +1 -1
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/tmux.js.map +1 -1
- package/dist/leader/__tests__/contract.test.js +153 -1
- package/dist/leader/__tests__/contract.test.js.map +1 -1
- package/dist/leader/contract.d.ts +42 -5
- package/dist/leader/contract.d.ts.map +1 -1
- package/dist/leader/contract.js +184 -3
- package/dist/leader/contract.js.map +1 -1
- package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
- package/dist/mcp/__tests__/code-intel-server.test.js +31 -3
- package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +15 -2
- package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
- package/dist/mcp/__tests__/state-paths.test.js +98 -1
- package/dist/mcp/__tests__/state-paths.test.js.map +1 -1
- package/dist/mcp/__tests__/wiki-server.test.js +18 -0
- package/dist/mcp/__tests__/wiki-server.test.js.map +1 -1
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/code-intel-server.d.ts +58 -58
- package/dist/mcp/code-intel-server.d.ts.map +1 -1
- package/dist/mcp/code-intel-server.js +13 -3
- package/dist/mcp/code-intel-server.js.map +1 -1
- package/dist/mcp/hermes-bridge.js.map +1 -1
- package/dist/mcp/hermes-server.d.ts +70 -70
- package/dist/mcp/hermes-server.d.ts.map +1 -1
- package/dist/mcp/lifecycle-telemetry.js.map +1 -1
- package/dist/mcp/memory-server.d.ts +34 -34
- package/dist/mcp/memory-server.d.ts.map +1 -1
- package/dist/mcp/memory-server.js.map +1 -1
- package/dist/mcp/state-paths.d.ts +14 -0
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +96 -20
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/mcp/state-server.d.ts +47 -47
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/trace-server.d.ts +4 -4
- package/dist/mcp/trace-server.d.ts.map +1 -1
- package/dist/mcp/trace-server.js.map +1 -1
- package/dist/mcp/wiki-server.d.ts +34 -23
- package/dist/mcp/wiki-server.d.ts.map +1 -1
- package/dist/mcp/wiki-server.js +9 -2
- package/dist/mcp/wiki-server.js.map +1 -1
- package/dist/modes/__tests__/base-session-scope.test.js +53 -1
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/__tests__/base-tmux-pane.test.js +4 -4
- package/dist/modes/__tests__/base-tmux-pane.test.js.map +1 -1
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +5 -5
- package/dist/modes/base.js.map +1 -1
- package/dist/notifications/__tests__/lifecycle-dedupe.test.js.map +1 -1
- package/dist/notifications/__tests__/reply-listener.test.js.map +1 -1
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js +177 -85
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js.map +1 -1
- package/dist/notifications/__tests__/session-registry.test.js.map +1 -1
- package/dist/notifications/__tests__/template-engine.test.js.map +1 -1
- package/dist/notifications/__tests__/verbosity.test.js.map +1 -1
- package/dist/notifications/http-client.js.map +1 -1
- package/dist/notifications/index.d.ts +4 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +3 -9
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/lifecycle-dedupe.js.map +1 -1
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/session-registry.js.map +1 -1
- package/dist/notifications/session-status.js.map +1 -1
- package/dist/notifications/temp-contract.d.ts.map +1 -1
- package/dist/notifications/temp-contract.js +4 -0
- package/dist/notifications/temp-contract.js.map +1 -1
- package/dist/notifications/tmux-detector.js.map +1 -1
- package/dist/notifications/tmux.js.map +1 -1
- package/dist/openclaw/config.js.map +1 -1
- package/dist/openclaw/dispatcher.js.map +1 -1
- package/dist/pipeline/__tests__/orchestrator.test.js +4 -4
- package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
- package/dist/pipeline/__tests__/stages.test.js +16 -13
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/stages/code-review.js.map +1 -1
- package/dist/pipeline/stages/ralph-verify.js.map +1 -1
- package/dist/pipeline/stages/ralplan.js.map +1 -1
- package/dist/pipeline/stages/team-exec.js.map +1 -1
- package/dist/pipeline/stages/ultragoal.js.map +1 -1
- package/dist/pipeline/stages/ultraqa.js.map +1 -1
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js.map +1 -1
- package/dist/planning/artifact-names.js.map +1 -1
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/question/__tests__/state.test.js.map +1 -1
- package/dist/question/__tests__/ui.test.js.map +1 -1
- package/dist/question/autopilot-wait.js.map +1 -1
- package/dist/question/client.d.ts.map +1 -1
- package/dist/question/client.js.map +1 -1
- package/dist/question/deep-interview.js.map +1 -1
- package/dist/question/events.js.map +1 -1
- package/dist/question/renderer.js.map +1 -1
- package/dist/question/state.d.ts.map +1 -1
- package/dist/question/state.js.map +1 -1
- package/dist/question/ui.js.map +1 -1
- package/dist/ralph/contract.d.ts +1 -1
- package/dist/ralph/contract.d.ts.map +1 -1
- package/dist/ralplan/__tests__/consensus-gate.test.js +527 -8
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +1 -1
- package/dist/ralplan/__tests__/documented-leader-preflight.test.d.ts +2 -0
- package/dist/ralplan/__tests__/documented-leader-preflight.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js +46 -0
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js.map +1 -0
- package/dist/ralplan/__tests__/runtime.test.js +116 -14
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/consensus-gate.d.ts +3 -3
- package/dist/ralplan/consensus-gate.d.ts.map +1 -1
- package/dist/ralplan/consensus-gate.js +173 -70
- package/dist/ralplan/consensus-gate.js.map +1 -1
- package/dist/ralplan/documented-leader-preflight.d.ts +34 -0
- package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -0
- package/dist/ralplan/documented-leader-preflight.js +58 -0
- package/dist/ralplan/documented-leader-preflight.js.map +1 -0
- package/dist/ralplan/runtime.d.ts +3 -2
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +12 -9
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/runtime/__tests__/bridge.test.js +42 -1
- package/dist/runtime/__tests__/bridge.test.js.map +1 -1
- package/dist/runtime/bridge.d.ts +12 -0
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +52 -1
- package/dist/runtime/bridge.js.map +1 -1
- package/dist/runtime/process-tree.js.map +1 -1
- package/dist/runtime/run-loop.js.map +1 -1
- package/dist/runtime/run-outcome.d.ts +3 -3
- package/dist/runtime/run-outcome.d.ts.map +1 -1
- package/dist/runtime/run-outcome.js.map +1 -1
- package/dist/runtime/run-state.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +6657 -995
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/fixtures/issue-3138-installed-smoke.d.ts +2 -0
- package/dist/scripts/__tests__/fixtures/issue-3138-installed-smoke.d.ts.map +1 -0
- package/dist/scripts/__tests__/fixtures/issue-3138-installed-smoke.js +634 -0
- package/dist/scripts/__tests__/fixtures/issue-3138-installed-smoke.js.map +1 -0
- package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -1
- package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-dispatcher.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-fallback-delivery.test.d.ts +2 -0
- package/dist/scripts/__tests__/notify-fallback-delivery.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/notify-fallback-delivery.test.js +174 -0
- package/dist/scripts/__tests__/notify-fallback-delivery.test.js.map +1 -0
- package/dist/scripts/__tests__/notify-state-io.test.js +57 -1
- package/dist/scripts/__tests__/notify-state-io.test.js.map +1 -1
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.d.ts +2 -0
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js +108 -0
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js.map +1 -0
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.d.ts +2 -0
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js +78 -0
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js.map +1 -0
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.d.ts +2 -0
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js +55 -0
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +1100 -4
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/test-reply-listener-live.test.js.map +1 -1
- package/dist/scripts/build-api.js.map +1 -1
- package/dist/scripts/build-explore-harness.js.map +1 -1
- package/dist/scripts/build-sparkshell.js.map +1 -1
- package/dist/scripts/cleanup-explore-harness.js.map +1 -1
- package/dist/scripts/codex-execution-surface.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts +4 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +11577 -1184
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/generate-native-release-manifest.js.map +1 -1
- package/dist/scripts/generate-release-body.js.map +1 -1
- package/dist/scripts/hook-payload-guard.d.ts.map +1 -1
- package/dist/scripts/hook-payload-guard.js.map +1 -1
- package/dist/scripts/notify-fallback-delivery.d.ts +48 -0
- package/dist/scripts/notify-fallback-delivery.d.ts.map +1 -0
- package/dist/scripts/notify-fallback-delivery.js +419 -0
- package/dist/scripts/notify-fallback-delivery.js.map +1 -0
- package/dist/scripts/notify-fallback-watcher.js +218 -138
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.d.ts +18 -9
- package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.js +112 -15
- package/dist/scripts/notify-hook/auto-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/managed-tmux.d.ts +23 -0
- package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
- package/dist/scripts/notify-hook/managed-tmux.js +122 -12
- package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
- package/dist/scripts/notify-hook/orchestration-intent.d.ts +7 -7
- package/dist/scripts/notify-hook/orchestration-intent.d.ts.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts +5 -2
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.js +33 -37
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -1
- package/dist/scripts/notify-hook/state-io.d.ts +17 -0
- package/dist/scripts/notify-hook/state-io.d.ts.map +1 -1
- package/dist/scripts/notify-hook/state-io.js +73 -11
- package/dist/scripts/notify-hook/state-io.js.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts +10 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +234 -79
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts +2 -2
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.js +39 -13
- package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts +16 -8
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +365 -44
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.d.ts +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.js +19 -18
- package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker.d.ts +5 -2
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +37 -28
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.d.ts +8 -1
- package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js +53 -18
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
- package/dist/scripts/notify-hook/visual-verdict.d.ts +1 -1
- package/dist/scripts/notify-hook/visual-verdict.d.ts.map +1 -1
- package/dist/scripts/notify-hook/visual-verdict.js +15 -13
- package/dist/scripts/notify-hook/visual-verdict.js.map +1 -1
- package/dist/scripts/notify-hook.d.ts +24 -1
- package/dist/scripts/notify-hook.d.ts.map +1 -1
- package/dist/scripts/notify-hook.js +267 -90
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/scripts/prompt-inventory.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +927 -5
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +4317 -13
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/scripts/test-reply-listener-live.js.map +1 -1
- package/dist/scripts/test-sparkshell.js.map +1 -1
- package/dist/scripts/verify-native-agents.js.map +1 -1
- package/dist/session-history/friction.js.map +1 -1
- package/dist/session-history/search.js.map +1 -1
- package/dist/sidecar/__tests__/boundary.test.js.map +1 -1
- package/dist/sidecar/collector.js.map +1 -1
- package/dist/sidecar/index.js.map +1 -1
- package/dist/sidecar/render.js.map +1 -1
- package/dist/sidecar/tmux.js.map +1 -1
- package/dist/state/__tests__/mode-state-context.test.js +54 -0
- package/dist/state/__tests__/mode-state-context.test.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +66 -15
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/skill-active.test.js +19 -1
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/__tests__/workflow-transition.test.js +61 -0
- package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
- package/dist/state/mode-state-context.d.ts +5 -0
- package/dist/state/mode-state-context.d.ts.map +1 -1
- package/dist/state/mode-state-context.js +59 -0
- package/dist/state/mode-state-context.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 +49 -55
- package/dist/state/operations.js.map +1 -1
- package/dist/state/paths.d.ts +1 -1
- package/dist/state/paths.d.ts.map +1 -1
- package/dist/state/paths.js +1 -1
- package/dist/state/paths.js.map +1 -1
- package/dist/state/skill-active.d.ts +13 -1
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +43 -4
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/terminal-normalization.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +20 -4
- package/dist/state/workflow-transition-reconcile.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.map +1 -1
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.d.ts +2 -0
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.d.ts.map +1 -0
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js +52 -0
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js.map +1 -0
- package/dist/subagents/__tests__/tracker.test.js +1550 -10
- package/dist/subagents/__tests__/tracker.test.js.map +1 -1
- package/dist/subagents/role-routing-marker.d.ts +10 -0
- package/dist/subagents/role-routing-marker.d.ts.map +1 -0
- package/dist/subagents/role-routing-marker.js +136 -0
- package/dist/subagents/role-routing-marker.js.map +1 -0
- package/dist/subagents/tracker.d.ts +91 -0
- package/dist/subagents/tracker.d.ts.map +1 -1
- package/dist/subagents/tracker.js +806 -62
- package/dist/subagents/tracker.js.map +1 -1
- package/dist/team/__tests__/api-interop.test.js +91 -1
- package/dist/team/__tests__/api-interop.test.js.map +1 -1
- package/dist/team/__tests__/approved-execution.test.js.map +1 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +52 -10
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -1
- package/dist/team/__tests__/idle-nudge.test.js +45 -15
- package/dist/team/__tests__/idle-nudge.test.js.map +1 -1
- package/dist/team/__tests__/mcp-comm.test.js +93 -27
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +341 -4
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/role-router.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.js +9 -0
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +3624 -355
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +2516 -118
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +804 -36
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/team-ops-contract.test.js +6 -0
- package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +3664 -969
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.js.map +1 -1
- package/dist/team/__tests__/worker-runtime-identity.test.js +38 -2
- package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -1
- package/dist/team/__tests__/worktree.test.js +6 -0
- package/dist/team/__tests__/worktree.test.js.map +1 -1
- package/dist/team/api-interop.d.ts +2 -2
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +15 -9
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/commit-hygiene.js.map +1 -1
- package/dist/team/contracts.d.ts +5 -5
- package/dist/team/contracts.d.ts.map +1 -1
- package/dist/team/delivery-log.js.map +1 -1
- package/dist/team/exact-pane.d.ts +23 -0
- package/dist/team/exact-pane.d.ts.map +1 -0
- package/dist/team/exact-pane.js +133 -0
- package/dist/team/exact-pane.js.map +1 -0
- package/dist/team/followup-planner.js.map +1 -1
- package/dist/team/goal-workflow.js.map +1 -1
- package/dist/team/idle-nudge.d.ts +12 -1
- package/dist/team/idle-nudge.d.ts.map +1 -1
- package/dist/team/idle-nudge.js +41 -14
- package/dist/team/idle-nudge.js.map +1 -1
- package/dist/team/model-contract.d.ts +18 -2
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +314 -35
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/orchestrator.js.map +1 -1
- package/dist/team/pane-status.js.map +1 -1
- package/dist/team/phase-controller.js.map +1 -1
- package/dist/team/reminder-intents.d.ts +1 -1
- package/dist/team/reminder-intents.d.ts.map +1 -1
- package/dist/team/reminder-intents.js.map +1 -1
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime.d.ts +1 -0
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +1326 -231
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts +22 -8
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +1463 -376
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/dispatch-lock.js.map +1 -1
- package/dist/team/state/dispatch.d.ts.map +1 -1
- package/dist/team/state/dispatch.js +26 -8
- package/dist/team/state/dispatch.js.map +1 -1
- package/dist/team/state/events.js.map +1 -1
- package/dist/team/state/locks.d.ts.map +1 -1
- package/dist/team/state/locks.js +61 -13
- package/dist/team/state/locks.js.map +1 -1
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +4 -3
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts +67 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +636 -129
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-identity.d.ts.map +1 -1
- package/dist/team/team-identity.js.map +1 -1
- package/dist/team/team-ops.d.ts +5 -0
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +4 -0
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +125 -23
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +1340 -333
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/team/worktree.d.ts.map +1 -1
- package/dist/team/worktree.js +4 -0
- package/dist/team/worktree.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +4 -1
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/url-reader/index.js.map +1 -1
- package/dist/utils/__tests__/file-durability.test.d.ts +2 -0
- package/dist/utils/__tests__/file-durability.test.d.ts.map +1 -0
- package/dist/utils/__tests__/file-durability.test.js +57 -0
- package/dist/utils/__tests__/file-durability.test.js.map +1 -0
- package/dist/utils/agents-model-table.js.map +1 -1
- package/dist/utils/file-durability.d.ts +15 -0
- package/dist/utils/file-durability.d.ts.map +1 -0
- package/dist/utils/file-durability.js +37 -0
- package/dist/utils/file-durability.js.map +1 -0
- package/dist/utils/package.js.map +1 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/platform-command.js.map +1 -1
- package/dist/utils/repo-deps.js.map +1 -1
- package/dist/utils/version.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +1 -1
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +3 -0
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +1 -1
- package/dist/verification/verifier.js.map +1 -1
- package/dist/visual/constants.d.ts +1 -1
- package/dist/visual/constants.d.ts.map +1 -1
- package/dist/vscode/__tests__/index.test.js.map +1 -1
- package/dist/vscode/index.js.map +1 -1
- package/dist/wiki/__tests__/cjk-tokenize.test.js.map +1 -1
- package/dist/wiki/__tests__/lint.test.js.map +1 -1
- package/dist/wiki/__tests__/query.test.js.map +1 -1
- package/dist/wiki/__tests__/storage.test.js.map +1 -1
- package/dist/wiki/__tests__/test-helpers.d.ts.map +1 -1
- package/dist/wiki/lint.d.ts +4 -1
- package/dist/wiki/lint.d.ts.map +1 -1
- package/dist/wiki/lint.js +3 -2
- package/dist/wiki/lint.js.map +1 -1
- package/dist/wiki/query.js.map +1 -1
- package/dist/wiki/storage.js.map +1 -1
- package/package.json +2 -2
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +24 -0
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +10 -5
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +6 -2
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +6 -2
- package/plugins/oh-my-codex/skills/team/SKILL.md +13 -9
- package/skills/omx-setup/SKILL.md +10 -5
- package/skills/ralph/SKILL.md +6 -2
- package/skills/ralplan/SKILL.md +6 -2
- package/skills/team/SKILL.md +13 -9
- package/src/scripts/__tests__/codex-native-hook.test.ts +20048 -10827
- package/src/scripts/__tests__/fixtures/issue-3138-installed-smoke.ts +734 -0
- package/src/scripts/__tests__/notify-fallback-delivery.test.ts +177 -0
- package/src/scripts/__tests__/notify-state-io.test.ts +73 -0
- package/src/scripts/__tests__/reasoning-artifact-contract.test.ts +129 -0
- package/src/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.ts +78 -0
- package/src/scripts/__tests__/role-intent-durable-recovery-3181.test.ts +60 -0
- package/src/scripts/__tests__/smoke-packed-install.test.ts +1309 -4
- package/src/scripts/codex-native-hook.ts +11429 -1163
- package/src/scripts/notify-fallback-delivery.ts +416 -0
- package/src/scripts/notify-fallback-watcher.ts +216 -155
- package/src/scripts/notify-hook/auto-nudge.ts +113 -14
- package/src/scripts/notify-hook/managed-tmux.ts +149 -12
- package/src/scripts/notify-hook/ralph-session-resume.ts +37 -36
- package/src/scripts/notify-hook/state-io.ts +100 -13
- package/src/scripts/notify-hook/team-dispatch.ts +242 -75
- package/src/scripts/notify-hook/team-leader-nudge.ts +40 -18
- package/src/scripts/notify-hook/team-tmux-guard.ts +366 -39
- package/src/scripts/notify-hook/team-worker-stop.ts +20 -16
- package/src/scripts/notify-hook/team-worker.ts +39 -26
- package/src/scripts/notify-hook/tmux-injection.ts +66 -23
- package/src/scripts/notify-hook/visual-verdict.ts +22 -12
- package/src/scripts/notify-hook.ts +336 -90
- package/src/scripts/smoke-packed-install.ts +5154 -149
package/dist/cli/doctor.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* omx doctor - Validate oh-my-codex installation
|
|
3
3
|
*/
|
|
4
|
+
import { createNativeHookClaimJournalDurability, recoverNativeHookClaimJournal, } from "./native-hook-claim-journal.js";
|
|
5
|
+
import { emitDegradedDurabilityWarning, recordRegularFileSyncOutcome, } from "../utils/file-durability.js";
|
|
4
6
|
import { constants, existsSync, readFileSync } from "fs";
|
|
5
|
-
import { access, chown, lstat, mkdtemp, readdir, readFile, rm } from "fs/promises";
|
|
7
|
+
import { access, chown, lstat, mkdtemp, readdir, readFile, rmdir, rm } from "fs/promises";
|
|
6
8
|
import { spawnSync } from "child_process";
|
|
7
|
-
import { basename, join, relative } from "path";
|
|
9
|
+
import { basename, dirname, join, relative } from "path";
|
|
8
10
|
import { tmpdir } from "os";
|
|
9
11
|
import { codexHome, codexConfigPath, codexPromptsDir, userSkillsDir, projectSkillsDir, omxStateDir, detectLegacySkillRootOverlap, codexAgentsDir, } from "../utils/paths.js";
|
|
10
12
|
import { classifySpawnError, spawnPlatformCommandSync, } from "../utils/platform-command.js";
|
|
@@ -13,7 +15,7 @@ import { parse as parseToml } from "@iarna/toml";
|
|
|
13
15
|
import { getBuiltinExploreHarnessUnsupportedReason, resolvePackagedExploreHarnessCommand, EXPLORE_BIN_ENV, } from "./explore.js";
|
|
14
16
|
import { getPackageRoot } from "../utils/package.js";
|
|
15
17
|
import { analyzeLegacyMultiAgentConfig, hasExactOmxSeededBehavioralDefaultsPair, hasLegacyOmxTeamRunTable, } from "../config/generator.js";
|
|
16
|
-
import { MANAGED_HOOK_EVENTS, buildManagedCodexNativeHookCommand, discoverCodexHookConfigPaths,
|
|
18
|
+
import { MANAGED_HOOK_EVENTS, buildManagedCodexNativeHookCommand, buildManagedCodexNativeHookWindowsShimContent, classifyManagedCodexNativeHookWindowsShimOwnership, discoverCodexHookConfigPaths, isManagedCodexHookCommand, parseManagedCodexNativeHookWindowsShimCommand, planManagedCodexHooksRemoval, resolveWindowsPowerShellPath, validateCodexHooksConfigStrict, } from "../config/codex-hooks.js";
|
|
17
19
|
import { OMX_FIRST_PARTY_MCP_SERVER_NAMES } from "../config/omx-first-party-mcp.js";
|
|
18
20
|
import { getDefaultBridge, isBridgeEnabled } from "../runtime/bridge.js";
|
|
19
21
|
import { OMX_EXPLORE_CMD_ENV, isExploreCommandRoutingEnabled, } from "../hooks/explore-routing.js";
|
|
@@ -28,6 +30,15 @@ import { OMX_DEFAULT_SPARK_MODEL_ENV, OMX_SPARK_MODEL_ENV, getAgentModelOverride
|
|
|
28
30
|
import { AGENT_DEFINITIONS } from "../agents/definitions.js";
|
|
29
31
|
import { getInstallableNativeAgentNames } from "../agents/policy.js";
|
|
30
32
|
import { readCatalogManifest } from "../catalog/reader.js";
|
|
33
|
+
let doctorClaimJournalDurabilityOverride;
|
|
34
|
+
/** @internal Test seam for deterministic claim-journal durability coverage. */
|
|
35
|
+
export function setDoctorClaimJournalDurabilityForTest(durability) {
|
|
36
|
+
const previous = doctorClaimJournalDurabilityOverride;
|
|
37
|
+
doctorClaimJournalDurabilityOverride = durability;
|
|
38
|
+
return () => {
|
|
39
|
+
doctorClaimJournalDurabilityOverride = previous;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
31
42
|
const REPO_ARTIFACT_DIRS = [".omx", ".beads"];
|
|
32
43
|
async function resolveDoctorScope(cwd) {
|
|
33
44
|
const persisted = await readPersistedSetupPreferences(cwd);
|
|
@@ -124,6 +135,10 @@ export async function doctor(options = {}) {
|
|
|
124
135
|
const cwd = process.cwd();
|
|
125
136
|
const scopeResolution = await resolveDoctorScope(cwd);
|
|
126
137
|
const paths = resolveDoctorPaths(cwd, scopeResolution.scope);
|
|
138
|
+
const recoveryTracker = { degraded: false };
|
|
139
|
+
const recovery = await recoverNativeHookClaimJournal(paths.codexHomeDir, doctorClaimJournalDurabilityOverride ?? createNativeHookClaimJournalDurability());
|
|
140
|
+
recordRegularFileSyncOutcome(recoveryTracker, recovery.outcome);
|
|
141
|
+
emitDegradedDurabilityWarning("native-hook claim-journal recovery", recoveryTracker);
|
|
127
142
|
const scopeSourceMessage = scopeResolution.source === "persisted"
|
|
128
143
|
? " (from .omx/setup-scope.json)"
|
|
129
144
|
: scopeResolution.source === "config"
|
|
@@ -182,13 +197,14 @@ export async function doctor(options = {}) {
|
|
|
182
197
|
checks.push(seededContextDefaultsCheck);
|
|
183
198
|
}
|
|
184
199
|
// Check 4.25: Native hooks coverage
|
|
185
|
-
|
|
200
|
+
const nativeHooksCheck = await checkNativeHooks(paths.hooksPath, paths.configPath, {
|
|
186
201
|
codexHomeDir: paths.codexHomeDir,
|
|
187
202
|
installMode: scopeResolution.installMode,
|
|
188
|
-
})
|
|
203
|
+
});
|
|
204
|
+
checks.push(nativeHooksCheck);
|
|
189
205
|
checks.push(await checkNativeHookDistSmoke());
|
|
190
206
|
if (options.verbose) {
|
|
191
|
-
const postCompactRuntimeCheck = await checkNativePostCompactHookRuntime(paths.hooksPath, cwd, paths.codexHomeDir);
|
|
207
|
+
const postCompactRuntimeCheck = await checkNativePostCompactHookRuntime(paths.hooksPath, cwd, paths.codexHomeDir, { nativeHooksCheck });
|
|
192
208
|
if (postCompactRuntimeCheck)
|
|
193
209
|
checks.push(postCompactRuntimeCheck);
|
|
194
210
|
}
|
|
@@ -249,10 +265,10 @@ export async function doctor(options = {}) {
|
|
|
249
265
|
}
|
|
250
266
|
console.log(`\nResults: ${passCount} passed, ${warnCount} warnings, ${failCount} failed`);
|
|
251
267
|
if (failCount > 0) {
|
|
252
|
-
console.log('\
|
|
268
|
+
console.log('\nReview failed checks above. Follow the check-specific recovery guidance; inspect invalid or ambiguous hook documents manually because doctor will not modify them.');
|
|
253
269
|
}
|
|
254
270
|
else if (warnCount > 0) {
|
|
255
|
-
console.log('\nReview warnings above.
|
|
271
|
+
console.log('\nReview warnings above. Follow the check-specific recovery guidance; for AGENTS.md preservation prefer "omx setup --merge-agents".');
|
|
256
272
|
}
|
|
257
273
|
else {
|
|
258
274
|
console.log("\nAll checks passed! oh-my-codex is ready.");
|
|
@@ -1229,6 +1245,183 @@ function configEnablesPluginScopedHooks(configContent) {
|
|
|
1229
1245
|
return /^\s*plugin_hooks\s*=\s*(?:true|1|"true"|"1"|"yes"|"on")\s*$/m.test(configContent);
|
|
1230
1246
|
}
|
|
1231
1247
|
}
|
|
1248
|
+
function trimNativeHookDetailTerminalPeriod(detail) {
|
|
1249
|
+
return detail.endsWith(".") ? detail.slice(0, -1) : detail;
|
|
1250
|
+
}
|
|
1251
|
+
function formatNativeHookDiagnostics(diagnostics) {
|
|
1252
|
+
return diagnostics
|
|
1253
|
+
.map((diagnostic) => {
|
|
1254
|
+
const coordinate = `${diagnostic.eventName}[${diagnostic.groupIndex}]${diagnostic.handlerIndex === undefined
|
|
1255
|
+
? ""
|
|
1256
|
+
: `.${diagnostic.handlerIndex}`}`;
|
|
1257
|
+
return `${coordinate}: ${trimNativeHookDetailTerminalPeriod(diagnostic.message)}`;
|
|
1258
|
+
})
|
|
1259
|
+
.join("; ");
|
|
1260
|
+
}
|
|
1261
|
+
function isJsonRecord(value) {
|
|
1262
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1263
|
+
}
|
|
1264
|
+
const WINDOWS_SHIM_SCAN_EVENTS = [
|
|
1265
|
+
"PreToolUse",
|
|
1266
|
+
"PermissionRequest",
|
|
1267
|
+
"PostToolUse",
|
|
1268
|
+
"PreCompact",
|
|
1269
|
+
"PostCompact",
|
|
1270
|
+
"SessionStart",
|
|
1271
|
+
"UserPromptSubmit",
|
|
1272
|
+
"SubagentStart",
|
|
1273
|
+
"SubagentStop",
|
|
1274
|
+
"Stop",
|
|
1275
|
+
];
|
|
1276
|
+
function effectiveWindowsHookCommand(handler) {
|
|
1277
|
+
const commandWindows = handler.commandWindows;
|
|
1278
|
+
if (typeof commandWindows === "string")
|
|
1279
|
+
return commandWindows;
|
|
1280
|
+
const commandWindowsSnakeCase = handler.command_windows;
|
|
1281
|
+
if (typeof commandWindowsSnakeCase === "string")
|
|
1282
|
+
return commandWindowsSnakeCase;
|
|
1283
|
+
return typeof handler.command === "string" ? handler.command : null;
|
|
1284
|
+
}
|
|
1285
|
+
function referencedWindowsNativeHookShimPaths(root, diagnostics, codexHomeDir) {
|
|
1286
|
+
if (!isJsonRecord(root.hooks))
|
|
1287
|
+
return [];
|
|
1288
|
+
const skippedGroups = new Set(diagnostics
|
|
1289
|
+
.filter((diagnostic) => diagnostic.code === "invalid_matcher")
|
|
1290
|
+
.map((diagnostic) => `${diagnostic.eventName}:${diagnostic.groupIndex}`));
|
|
1291
|
+
const skippedHandlers = new Set(diagnostics
|
|
1292
|
+
.filter((diagnostic) => diagnostic.code === "async_command" || diagnostic.code === "empty_command")
|
|
1293
|
+
.map((diagnostic) => `${diagnostic.eventName}:${diagnostic.groupIndex}:${diagnostic.handlerIndex}`));
|
|
1294
|
+
const shimPaths = new Set();
|
|
1295
|
+
for (const eventName of WINDOWS_SHIM_SCAN_EVENTS) {
|
|
1296
|
+
const eventGroups = root.hooks[eventName];
|
|
1297
|
+
if (!Array.isArray(eventGroups))
|
|
1298
|
+
continue;
|
|
1299
|
+
for (const [groupIndex, group] of eventGroups.entries()) {
|
|
1300
|
+
if (skippedGroups.has(`${eventName}:${groupIndex}`) || !isJsonRecord(group) || !Array.isArray(group.hooks))
|
|
1301
|
+
continue;
|
|
1302
|
+
for (const [handlerIndex, handler] of group.hooks.entries()) {
|
|
1303
|
+
if (skippedHandlers.has(`${eventName}:${groupIndex}:${handlerIndex}`) ||
|
|
1304
|
+
!isJsonRecord(handler) ||
|
|
1305
|
+
handler.type !== "command")
|
|
1306
|
+
continue;
|
|
1307
|
+
const command = effectiveWindowsHookCommand(handler);
|
|
1308
|
+
if (!command)
|
|
1309
|
+
continue;
|
|
1310
|
+
const shimPath = parseManagedCodexNativeHookWindowsShimCommand(command, {
|
|
1311
|
+
platform: "win32",
|
|
1312
|
+
codexHomeDir,
|
|
1313
|
+
});
|
|
1314
|
+
if (shimPath)
|
|
1315
|
+
shimPaths.add(shimPath);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
return [...shimPaths];
|
|
1320
|
+
}
|
|
1321
|
+
async function checkWindowsNativeHookShimParentTopology(shimPath, codexHomeDir) {
|
|
1322
|
+
let ancestorPath = dirname(shimPath);
|
|
1323
|
+
for (;;) {
|
|
1324
|
+
try {
|
|
1325
|
+
const ancestorStat = await lstat(ancestorPath);
|
|
1326
|
+
if (ancestorStat.isSymbolicLink() || !ancestorStat.isDirectory()) {
|
|
1327
|
+
return {
|
|
1328
|
+
name: "Native hooks",
|
|
1329
|
+
status: "fail",
|
|
1330
|
+
message: `referenced Windows native hook shim at ${shimPath} has an unsafe parent topology at ${ancestorPath}; doctor will not follow or modify it`,
|
|
1331
|
+
};
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
catch {
|
|
1335
|
+
return {
|
|
1336
|
+
name: "Native hooks",
|
|
1337
|
+
status: "fail",
|
|
1338
|
+
message: `referenced Windows native hook shim at ${shimPath} has a parent topology that cannot be safely validated; doctor will not follow or modify it`,
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
if (ancestorPath === codexHomeDir)
|
|
1342
|
+
return null;
|
|
1343
|
+
const parentPath = dirname(ancestorPath);
|
|
1344
|
+
if (parentPath === ancestorPath) {
|
|
1345
|
+
return {
|
|
1346
|
+
name: "Native hooks",
|
|
1347
|
+
status: "fail",
|
|
1348
|
+
message: `referenced Windows native hook shim at ${shimPath} is outside the controlled Codex home topology; doctor will not follow or modify it`,
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
ancestorPath = parentPath;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
async function checkWindowsNativeHookShims(root, diagnostics, codexHomeDir, requireCurrent = false) {
|
|
1355
|
+
const expected = Buffer.from(buildManagedCodexNativeHookWindowsShimContent(getPackageRoot()), "utf-8");
|
|
1356
|
+
for (const shimPath of referencedWindowsNativeHookShimPaths(root, diagnostics, codexHomeDir)) {
|
|
1357
|
+
let shimContent;
|
|
1358
|
+
try {
|
|
1359
|
+
const shimStat = await lstat(shimPath);
|
|
1360
|
+
if (shimStat.isSymbolicLink() || !shimStat.isFile()) {
|
|
1361
|
+
return {
|
|
1362
|
+
name: "Native hooks",
|
|
1363
|
+
status: "fail",
|
|
1364
|
+
message: `referenced Windows native hook shim at ${shimPath} is not a regular file; doctor will not follow or modify it`,
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
if (shimStat.nlink !== 1) {
|
|
1368
|
+
return {
|
|
1369
|
+
name: "Native hooks",
|
|
1370
|
+
status: "fail",
|
|
1371
|
+
message: `referenced Windows native hook shim at ${shimPath} is hard-linked; doctor will not execute or modify it`,
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
shimContent = await readFile(shimPath);
|
|
1375
|
+
const topologyCheck = await checkWindowsNativeHookShimParentTopology(shimPath, codexHomeDir);
|
|
1376
|
+
if (topologyCheck)
|
|
1377
|
+
return topologyCheck;
|
|
1378
|
+
}
|
|
1379
|
+
catch (error) {
|
|
1380
|
+
const code = typeof error === "object" && error !== null && "code" in error
|
|
1381
|
+
? String(error.code)
|
|
1382
|
+
: undefined;
|
|
1383
|
+
return {
|
|
1384
|
+
name: "Native hooks",
|
|
1385
|
+
status: "fail",
|
|
1386
|
+
message: code === "ENOENT"
|
|
1387
|
+
? `referenced Windows native hook shim is missing at ${shimPath}; manually reinstall the matching oh-my-codex version because doctor will not create or modify shims`
|
|
1388
|
+
: `cannot read referenced Windows native hook shim at ${shimPath}; inspect it and manually reinstall the matching oh-my-codex version because doctor will not modify shims`,
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
1391
|
+
const ownership = classifyManagedCodexNativeHookWindowsShimOwnership(shimContent, expected);
|
|
1392
|
+
if (ownership === "modified") {
|
|
1393
|
+
return {
|
|
1394
|
+
name: "Native hooks",
|
|
1395
|
+
status: "fail",
|
|
1396
|
+
message: `referenced Windows native hook shim at ${shimPath} is not an exact current or complete historical generated shim; it may be modified, truncated, have extra content, or use ambiguous encoding. Manually reinstall the matching oh-my-codex version because doctor will not overwrite it`,
|
|
1397
|
+
};
|
|
1398
|
+
}
|
|
1399
|
+
if (requireCurrent && ownership !== "current") {
|
|
1400
|
+
return {
|
|
1401
|
+
name: "Native hooks",
|
|
1402
|
+
status: "warn",
|
|
1403
|
+
message: `referenced Windows native hook shim at ${shimPath} is a complete historical generated shim, but verbose execution requires exact current shim bytes; run "omx setup" to migrate it before retrying`,
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
return null;
|
|
1408
|
+
}
|
|
1409
|
+
const MANAGED_HOOK_TRUST_KEY_LABELS = {
|
|
1410
|
+
SessionStart: "session_start",
|
|
1411
|
+
PreToolUse: "pre_tool_use",
|
|
1412
|
+
PostToolUse: "post_tool_use",
|
|
1413
|
+
UserPromptSubmit: "user_prompt_submit",
|
|
1414
|
+
PreCompact: "pre_compact",
|
|
1415
|
+
PostCompact: "post_compact",
|
|
1416
|
+
Stop: "stop",
|
|
1417
|
+
};
|
|
1418
|
+
function getMissingManagedHookEventsFromPlan(plan) {
|
|
1419
|
+
return MANAGED_HOOK_EVENTS.filter((eventName) => {
|
|
1420
|
+
const label = MANAGED_HOOK_TRUST_KEY_LABELS[eventName];
|
|
1421
|
+
const keyPattern = new RegExp(`:${label}:\\d+:\\d+$`);
|
|
1422
|
+
return !Object.keys(plan.priorTrustState).some((key) => keyPattern.test(key));
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1232
1425
|
function pluginHooksJsonHasNativeCoverage(content) {
|
|
1233
1426
|
try {
|
|
1234
1427
|
const parsed = JSON.parse(content);
|
|
@@ -1260,7 +1453,7 @@ function pluginHooksJsonHasNativeCoverage(content) {
|
|
|
1260
1453
|
}
|
|
1261
1454
|
async function checkPluginScopedNativeHooks(codexHomeDir, setupHooksPath) {
|
|
1262
1455
|
const setupHooksPathDescription = existsSync(setupHooksPath)
|
|
1263
|
-
? `existing hooks.json at ${setupHooksPath} is
|
|
1456
|
+
? `existing hooks.json at ${setupHooksPath} is retained read-only and validated separately because plugin-scoped hooks are enabled`
|
|
1264
1457
|
: `setup-owned hooks.json is intentionally absent at ${setupHooksPath}`;
|
|
1265
1458
|
const packagedMarketplace = await resolvePackagedOmxMarketplace(getPackageRoot());
|
|
1266
1459
|
if (!packagedMarketplace) {
|
|
@@ -1282,14 +1475,14 @@ async function checkPluginScopedNativeHooks(codexHomeDir, setupHooksPath) {
|
|
|
1282
1475
|
return {
|
|
1283
1476
|
name: "Native hooks",
|
|
1284
1477
|
status: "warn",
|
|
1285
|
-
message: `plugin-scoped hooks are enabled, but the expected Codex plugin cache manifest is missing at ${join(expectedCacheDir, ".codex-plugin", "plugin.json")}; ${setupHooksPathDescription}; run "omx setup --plugin
|
|
1478
|
+
message: `plugin-scoped hooks are enabled, but the expected Codex plugin cache manifest is missing at ${join(expectedCacheDir, ".codex-plugin", "plugin.json")}; ${setupHooksPathDescription}; run "omx setup --plugin" to refresh the plugin cache`,
|
|
1286
1479
|
};
|
|
1287
1480
|
}
|
|
1288
1481
|
if (state.hooksPointer !== "./hooks/hooks.json") {
|
|
1289
1482
|
return {
|
|
1290
1483
|
name: "Native hooks",
|
|
1291
1484
|
status: "warn",
|
|
1292
|
-
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
|
|
1485
|
+
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" to refresh the plugin cache`,
|
|
1293
1486
|
};
|
|
1294
1487
|
}
|
|
1295
1488
|
for (const expectedPath of [expectedHooksPath, expectedHookLauncherPath, expectedPinnedLauncherPath]) {
|
|
@@ -1297,7 +1490,7 @@ async function checkPluginScopedNativeHooks(codexHomeDir, setupHooksPath) {
|
|
|
1297
1490
|
return {
|
|
1298
1491
|
name: "Native hooks",
|
|
1299
1492
|
status: "warn",
|
|
1300
|
-
message: `plugin-scoped hooks are enabled, but expected plugin hook file is missing at ${expectedPath}; ${setupHooksPathDescription}; run "omx setup --plugin
|
|
1493
|
+
message: `plugin-scoped hooks are enabled, but expected plugin hook file is missing at ${expectedPath}; ${setupHooksPathDescription}; run "omx setup --plugin" to refresh the plugin cache`,
|
|
1301
1494
|
};
|
|
1302
1495
|
}
|
|
1303
1496
|
}
|
|
@@ -1305,7 +1498,7 @@ async function checkPluginScopedNativeHooks(codexHomeDir, setupHooksPath) {
|
|
|
1305
1498
|
return {
|
|
1306
1499
|
name: "Native hooks",
|
|
1307
1500
|
status: "warn",
|
|
1308
|
-
message: `plugin-scoped hooks are enabled, but cached plugin hook files or pinned hook launcher in ${expectedCacheDir} do not match the packaged plugin; ${setupHooksPathDescription}; run "omx setup --plugin
|
|
1501
|
+
message: `plugin-scoped hooks are enabled, but cached plugin hook files or pinned hook launcher in ${expectedCacheDir} do not match the packaged plugin; ${setupHooksPathDescription}; run "omx setup --plugin" to refresh the plugin cache`,
|
|
1309
1502
|
};
|
|
1310
1503
|
}
|
|
1311
1504
|
let hookContent;
|
|
@@ -1331,7 +1524,7 @@ async function checkPluginScopedNativeHooks(codexHomeDir, setupHooksPath) {
|
|
|
1331
1524
|
return {
|
|
1332
1525
|
name: "Native hooks",
|
|
1333
1526
|
status: "warn",
|
|
1334
|
-
message: `plugin-scoped hooks.json at ${expectedHooksPath} is missing OMX native coverage for one or more events; run "omx setup --plugin
|
|
1527
|
+
message: `plugin-scoped hooks.json at ${expectedHooksPath} is missing OMX native coverage for one or more events; run "omx setup --plugin" to refresh the plugin cache`,
|
|
1335
1528
|
};
|
|
1336
1529
|
}
|
|
1337
1530
|
const smokeCwd = await mkdtemp(join(tmpdir(), "omx-doctor-plugin-hook-"));
|
|
@@ -1384,12 +1577,145 @@ async function checkPluginScopedNativeHooks(codexHomeDir, setupHooksPath) {
|
|
|
1384
1577
|
message: `plugin-scoped hooks are enabled; ${setupHooksPathDescription}, and plugin cache native hook coverage smoke passed via ${expectedHooksPath}`,
|
|
1385
1578
|
};
|
|
1386
1579
|
}
|
|
1387
|
-
|
|
1580
|
+
function decodeStrictUtf8(bytes) {
|
|
1581
|
+
try {
|
|
1582
|
+
const content = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
|
|
1583
|
+
return Buffer.from(content, "utf-8").equals(bytes) ? content : null;
|
|
1584
|
+
}
|
|
1585
|
+
catch {
|
|
1586
|
+
return null;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
function combinePluginAndGlobalNativeHookChecks(plugin, global) {
|
|
1590
|
+
if (!global)
|
|
1591
|
+
return plugin;
|
|
1592
|
+
const status = plugin.status === "fail" || global.status === "fail"
|
|
1593
|
+
? "fail"
|
|
1594
|
+
: plugin.status === "warn" || global.status === "warn"
|
|
1595
|
+
? "warn"
|
|
1596
|
+
: "pass";
|
|
1597
|
+
return {
|
|
1598
|
+
name: "Native hooks",
|
|
1599
|
+
status,
|
|
1600
|
+
message: `${plugin.message}; existing global hooks.json: ${global.message}`,
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
function combineNativeHookIntegrityAndRemovalChecks(integrityCheck, removalCheck) {
|
|
1604
|
+
if (!integrityCheck)
|
|
1605
|
+
return removalCheck;
|
|
1606
|
+
return {
|
|
1607
|
+
name: "Native hooks",
|
|
1608
|
+
status: integrityCheck.status === "fail" || removalCheck.status === "fail"
|
|
1609
|
+
? "fail"
|
|
1610
|
+
: "warn",
|
|
1611
|
+
message: `${integrityCheck.message}; ${removalCheck.message}`,
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1614
|
+
async function checkExistingNativeHooks(hooksPath, context) {
|
|
1615
|
+
const platform = context.platform ?? process.platform;
|
|
1616
|
+
try {
|
|
1617
|
+
const hooksStat = await lstat(hooksPath);
|
|
1618
|
+
if (hooksStat.isSymbolicLink() || !hooksStat.isFile()) {
|
|
1619
|
+
return {
|
|
1620
|
+
name: "Native hooks",
|
|
1621
|
+
status: "fail",
|
|
1622
|
+
message: `hooks.json at ${hooksPath} is not a regular file; doctor will not follow or modify it`,
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
const content = decodeStrictUtf8(await readFile(hooksPath));
|
|
1626
|
+
if (content === null) {
|
|
1627
|
+
return {
|
|
1628
|
+
name: "Native hooks",
|
|
1629
|
+
status: "fail",
|
|
1630
|
+
message: `hooks.json at ${hooksPath} is not valid UTF-8; inspect the file manually because doctor will not modify it`,
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
const validation = validateCodexHooksConfigStrict(content, {
|
|
1634
|
+
platform,
|
|
1635
|
+
codexHomeDir: context.codexHomeDir,
|
|
1636
|
+
});
|
|
1637
|
+
if (!validation.ok) {
|
|
1638
|
+
return {
|
|
1639
|
+
name: "Native hooks",
|
|
1640
|
+
status: "fail",
|
|
1641
|
+
message: `hooks.json failed strict load validation (${validation.error.code}): ${trimNativeHookDetailTerminalPeriod(validation.error.message)}; inspect the file manually because doctor will not modify it`,
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
const removalPlan = planManagedCodexHooksRemoval(content, hooksPath, {
|
|
1645
|
+
platform,
|
|
1646
|
+
codexHomeDir: context.codexHomeDir,
|
|
1647
|
+
});
|
|
1648
|
+
const windowsShimCheck = platform === "win32"
|
|
1649
|
+
? await checkWindowsNativeHookShims(validation.root, validation.diagnostics, context.codexHomeDir)
|
|
1650
|
+
: null;
|
|
1651
|
+
if (!removalPlan.ok) {
|
|
1652
|
+
const removalIsCoordinateOnly = removalPlan.error.code === "unsafe_managed_removal";
|
|
1653
|
+
const removalCheck = {
|
|
1654
|
+
name: "Native hooks",
|
|
1655
|
+
status: removalIsCoordinateOnly ? "warn" : "fail",
|
|
1656
|
+
message: removalIsCoordinateOnly
|
|
1657
|
+
? `hooks.json has OMX entries that cannot be safely removed (${removalPlan.error.code}): ${trimNativeHookDetailTerminalPeriod(removalPlan.error.message)}; manual cleanup is required because doctor will not overwrite or remove it`
|
|
1658
|
+
: `hooks.json has ambiguous or untrusted OMX ownership (${removalPlan.error.code}): ${trimNativeHookDetailTerminalPeriod(removalPlan.error.message)}; inspect the file manually because doctor will not overwrite or remove it`,
|
|
1659
|
+
};
|
|
1660
|
+
return combineNativeHookIntegrityAndRemovalChecks(windowsShimCheck, removalCheck);
|
|
1661
|
+
}
|
|
1662
|
+
if (windowsShimCheck)
|
|
1663
|
+
return windowsShimCheck;
|
|
1664
|
+
const legacyTrustStateEntries = Object.keys(removalPlan.legacyTrustState).length;
|
|
1665
|
+
if (legacyTrustStateEntries > 0) {
|
|
1666
|
+
return {
|
|
1667
|
+
name: "Native hooks",
|
|
1668
|
+
status: "warn",
|
|
1669
|
+
message: `hooks.json contains ${legacyTrustStateEntries} exact historical OMX hook trust-state ${legacyTrustStateEntries === 1 ? "entry that requires" : "entries that require"} migration; run "omx setup" to migrate ${legacyTrustStateEntries === 1 ? "it" : "them"} after reviewing the configuration`,
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
if (validation.diagnostics.length > 0) {
|
|
1673
|
+
return {
|
|
1674
|
+
name: "Native hooks",
|
|
1675
|
+
status: "warn",
|
|
1676
|
+
message: `hooks.json discovery warnings: ${formatNativeHookDiagnostics(validation.diagnostics)}; Codex may ignore the listed entries, and doctor will not modify them`,
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
const missingEvents = getMissingManagedHookEventsFromPlan(removalPlan);
|
|
1680
|
+
if (removalPlan.hasForeignHooks &&
|
|
1681
|
+
removalPlan.removedCount === 0 &&
|
|
1682
|
+
missingEvents.length === MANAGED_HOOK_EVENTS.length) {
|
|
1683
|
+
return {
|
|
1684
|
+
name: "Native hooks",
|
|
1685
|
+
status: "pass",
|
|
1686
|
+
message: "hooks.json contains valid foreign hook entries and no OMX-managed wrappers; doctor will preserve the user-owned configuration",
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
if (missingEvents.length > 0) {
|
|
1690
|
+
return {
|
|
1691
|
+
name: "Native hooks",
|
|
1692
|
+
status: "warn",
|
|
1693
|
+
message: `hooks.json is missing OMX-managed coverage for ${missingEvents.join(", ")}; run "omx setup" to restore native hooks${removalPlan.hasForeignHooks ? "; valid foreign hooks will be preserved" : ""}`,
|
|
1694
|
+
};
|
|
1695
|
+
}
|
|
1696
|
+
return {
|
|
1697
|
+
name: "Native hooks",
|
|
1698
|
+
status: "pass",
|
|
1699
|
+
message: `hooks.json includes OMX-managed coverage for all native hook events${removalPlan.hasForeignHooks ? "; valid foreign hooks will be preserved" : ""}`,
|
|
1700
|
+
};
|
|
1701
|
+
}
|
|
1702
|
+
catch {
|
|
1703
|
+
return {
|
|
1704
|
+
name: "Native hooks",
|
|
1705
|
+
status: "fail",
|
|
1706
|
+
message: "cannot read hooks.json",
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
export async function checkNativeHooks(hooksPath, configPath, context) {
|
|
1388
1711
|
if (existsSync(configPath) && context.installMode === "plugin") {
|
|
1389
1712
|
try {
|
|
1390
1713
|
const configContent = await readFile(configPath, "utf-8");
|
|
1391
1714
|
if (configEnablesPluginScopedHooks(configContent)) {
|
|
1392
|
-
|
|
1715
|
+
const globalCheck = existsSync(hooksPath)
|
|
1716
|
+
? await checkExistingNativeHooks(hooksPath, context)
|
|
1717
|
+
: null;
|
|
1718
|
+
return combinePluginAndGlobalNativeHookChecks(await checkPluginScopedNativeHooks(context.codexHomeDir, hooksPath), globalCheck);
|
|
1393
1719
|
}
|
|
1394
1720
|
}
|
|
1395
1721
|
catch {
|
|
@@ -1401,25 +1727,23 @@ async function checkNativeHooks(hooksPath, configPath, context) {
|
|
|
1401
1727
|
if (existsSync(configPath)) {
|
|
1402
1728
|
try {
|
|
1403
1729
|
const configContent = await readFile(configPath, "utf-8");
|
|
1404
|
-
if (context.installMode === "plugin") {
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
};
|
|
1411
|
-
}
|
|
1730
|
+
if (context.installMode === "plugin" && configHasOmxEntries(configContent)) {
|
|
1731
|
+
return {
|
|
1732
|
+
name: "Native hooks",
|
|
1733
|
+
status: "warn",
|
|
1734
|
+
message: `plugin mode is using legacy native hook fallback, but expected setup-owned hooks.json is missing at ${hooksPath}; run "omx setup --plugin" to restore the fallback hook file, or upgrade Codex to plugin_hooks support so setup can use plugin-scoped hooks`,
|
|
1735
|
+
};
|
|
1412
1736
|
}
|
|
1413
1737
|
if (configHasOmxEntries(configContent)) {
|
|
1414
1738
|
return {
|
|
1415
1739
|
name: "Native hooks",
|
|
1416
1740
|
status: "warn",
|
|
1417
|
-
message: `expected setup-owned hooks.json is missing at ${hooksPath} even though config.toml has OMX entries; run "omx setup
|
|
1741
|
+
message: `expected setup-owned hooks.json is missing at ${hooksPath} even though config.toml has OMX entries; run "omx setup" to restore native hook coverage`,
|
|
1418
1742
|
};
|
|
1419
1743
|
}
|
|
1420
1744
|
}
|
|
1421
1745
|
catch {
|
|
1422
|
-
//
|
|
1746
|
+
// Fall through to the neutral first-setup path when config cannot be read here;
|
|
1423
1747
|
// the dedicated config check will report read failures separately.
|
|
1424
1748
|
}
|
|
1425
1749
|
}
|
|
@@ -1429,66 +1753,18 @@ async function checkNativeHooks(hooksPath, configPath, context) {
|
|
|
1429
1753
|
message: "hooks.json not found yet (expected before first setup)",
|
|
1430
1754
|
};
|
|
1431
1755
|
}
|
|
1432
|
-
|
|
1433
|
-
const content = await readFile(hooksPath, "utf-8");
|
|
1434
|
-
const missingEvents = getMissingManagedCodexHookEvents(content);
|
|
1435
|
-
if (missingEvents === null) {
|
|
1436
|
-
return {
|
|
1437
|
-
name: "Native hooks",
|
|
1438
|
-
status: "fail",
|
|
1439
|
-
message: 'invalid hooks.json; Codex may skip OMX hook coverage until "omx setup --force" repairs it',
|
|
1440
|
-
};
|
|
1441
|
-
}
|
|
1442
|
-
const hasTopLevelState = hasCodexHooksJsonTopLevelState(content);
|
|
1443
|
-
if (hasTopLevelState === true) {
|
|
1444
|
-
return {
|
|
1445
|
-
name: "Native hooks",
|
|
1446
|
-
status: "fail",
|
|
1447
|
-
message: 'top-level state in hooks.json is incompatible with Codex 0.140 (unknown field state, expected hooks); run "omx setup --force" to migrate trust state to config.toml and repair hooks.json',
|
|
1448
|
-
};
|
|
1449
|
-
}
|
|
1450
|
-
if (missingEvents.length > 0) {
|
|
1451
|
-
return {
|
|
1452
|
-
name: "Native hooks",
|
|
1453
|
-
status: "warn",
|
|
1454
|
-
message: `hooks.json is missing OMX-managed coverage for ${missingEvents.join(", ")}; run "omx setup --force" to restore native hooks`,
|
|
1455
|
-
};
|
|
1456
|
-
}
|
|
1457
|
-
return {
|
|
1458
|
-
name: "Native hooks",
|
|
1459
|
-
status: "pass",
|
|
1460
|
-
message: "hooks.json includes OMX-managed coverage for all native hook events",
|
|
1461
|
-
};
|
|
1462
|
-
}
|
|
1463
|
-
catch {
|
|
1464
|
-
return {
|
|
1465
|
-
name: "Native hooks",
|
|
1466
|
-
status: "fail",
|
|
1467
|
-
message: "cannot read hooks.json",
|
|
1468
|
-
};
|
|
1469
|
-
}
|
|
1756
|
+
return checkExistingNativeHooks(hooksPath, context);
|
|
1470
1757
|
}
|
|
1471
1758
|
export async function checkNativeHookDistSmoke(options = {}) {
|
|
1472
1759
|
const packageRoot = options.packageRoot ?? getPackageRoot();
|
|
1473
1760
|
const nodePath = options.nodePath ?? process.execPath;
|
|
1474
1761
|
const runner = options.runner ?? spawnSync;
|
|
1475
1762
|
const scriptPath = join(packageRoot, "dist", "scripts", "codex-native-hook.js");
|
|
1476
|
-
const packageJsonPath = join(packageRoot, "package.json");
|
|
1477
|
-
let packageVersion = "current";
|
|
1478
|
-
try {
|
|
1479
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
1480
|
-
if (typeof packageJson.version === "string" && packageJson.version.trim()) {
|
|
1481
|
-
packageVersion = packageJson.version.trim();
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
catch {
|
|
1485
|
-
// Keep the generic recovery copy when package metadata is not readable.
|
|
1486
|
-
}
|
|
1487
1763
|
if (!existsSync(scriptPath)) {
|
|
1488
1764
|
return {
|
|
1489
1765
|
name: "Native hook dist smoke",
|
|
1490
1766
|
status: "fail",
|
|
1491
|
-
message: `installed native hook script is missing at ${scriptPath}; reinstall oh-my-codex and run "omx setup
|
|
1767
|
+
message: `installed native hook script is missing at ${scriptPath}; reinstall oh-my-codex and run "omx setup"`,
|
|
1492
1768
|
};
|
|
1493
1769
|
}
|
|
1494
1770
|
const smokeCwd = await mkdtemp(join(tmpdir(), "omx-doctor-native-hook-dist-"));
|
|
@@ -1518,7 +1794,7 @@ export async function checkNativeHookDistSmoke(options = {}) {
|
|
|
1518
1794
|
return {
|
|
1519
1795
|
name: "Native hook dist smoke",
|
|
1520
1796
|
status: "fail",
|
|
1521
|
-
message: `installed native hook dist smoke failed to run (${result.error.message}); reinstall oh-my-codex and run "omx setup
|
|
1797
|
+
message: `installed native hook dist smoke failed to run (${result.error.message}); reinstall oh-my-codex and run "omx setup"`,
|
|
1522
1798
|
};
|
|
1523
1799
|
}
|
|
1524
1800
|
if (result.status !== 0) {
|
|
@@ -1528,7 +1804,7 @@ export async function checkNativeHookDistSmoke(options = {}) {
|
|
|
1528
1804
|
return {
|
|
1529
1805
|
name: "Native hook dist smoke",
|
|
1530
1806
|
status: "fail",
|
|
1531
|
-
message: `installed native hook dist failed a minimal UserPromptSubmit smoke (${detail}); reinstall
|
|
1807
|
+
message: `installed native hook dist failed a minimal UserPromptSubmit smoke (${detail}); reinstall the matching oh-my-codex version and then run "omx setup"`,
|
|
1532
1808
|
};
|
|
1533
1809
|
}
|
|
1534
1810
|
return {
|
|
@@ -1550,14 +1826,14 @@ export function classifyPostCompactHookStdout(stdout) {
|
|
|
1550
1826
|
return {
|
|
1551
1827
|
name: "Native PostCompact hook",
|
|
1552
1828
|
status: "fail",
|
|
1553
|
-
message: "PostCompact hook emitted JSON stdout, but OMX PostCompact must emit no stdout until Codex defines a supported PostCompact output contract;
|
|
1829
|
+
message: "PostCompact hook emitted JSON stdout, but OMX PostCompact must emit no stdout until Codex defines a supported PostCompact output contract; rerun \"omx setup\" after upgrading",
|
|
1554
1830
|
};
|
|
1555
1831
|
}
|
|
1556
1832
|
catch (error) {
|
|
1557
1833
|
return {
|
|
1558
1834
|
name: "Native PostCompact hook",
|
|
1559
1835
|
status: "fail",
|
|
1560
|
-
message: `PostCompact hook emitted invalid JSON stdout (${error instanceof Error ? error.message : String(error)});
|
|
1836
|
+
message: `PostCompact hook emitted invalid JSON stdout (${error instanceof Error ? error.message : String(error)}); rerun "omx setup" after upgrading`,
|
|
1561
1837
|
};
|
|
1562
1838
|
}
|
|
1563
1839
|
}
|
|
@@ -1582,77 +1858,278 @@ export function buildPostCompactSmokeSpawnInvocation(expectedCommand, options =
|
|
|
1582
1858
|
shell: true,
|
|
1583
1859
|
};
|
|
1584
1860
|
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1861
|
+
function buildInMemoryWindowsShimSmokeInvocation(expectedShimContent, options = {}) {
|
|
1862
|
+
const shimSource = decodeStrictUtf8(expectedShimContent);
|
|
1863
|
+
if (shimSource === null)
|
|
1587
1864
|
return null;
|
|
1588
|
-
|
|
1865
|
+
const encodedShimBytes = expectedShimContent.toString("base64");
|
|
1866
|
+
const command = [
|
|
1867
|
+
"$ErrorActionPreference = 'Stop'",
|
|
1868
|
+
`$omxShimSource = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${encodedShimBytes}'))`,
|
|
1869
|
+
"if ($omxShimSource.Length -gt 0 -and [int][char]$omxShimSource[0] -eq 0xFEFF) { $omxShimSource = $omxShimSource.Substring(1) }",
|
|
1870
|
+
"& ([ScriptBlock]::Create($omxShimSource))",
|
|
1871
|
+
"exit $LASTEXITCODE",
|
|
1872
|
+
].join("; ");
|
|
1873
|
+
return {
|
|
1874
|
+
command: resolveWindowsPowerShellPath(options.env),
|
|
1875
|
+
args: [
|
|
1876
|
+
"-NoProfile",
|
|
1877
|
+
"-ExecutionPolicy",
|
|
1878
|
+
"Bypass",
|
|
1879
|
+
"-EncodedCommand",
|
|
1880
|
+
Buffer.from(command, "utf16le").toString("base64"),
|
|
1881
|
+
],
|
|
1882
|
+
shell: false,
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
function smokeDirectoryIdentity(stat) {
|
|
1886
|
+
if (!stat.isDirectory() ||
|
|
1887
|
+
stat.isSymbolicLink() ||
|
|
1888
|
+
(process.platform !== "win32" && (stat.mode & 0o077) !== 0))
|
|
1889
|
+
return null;
|
|
1890
|
+
return { dev: stat.dev, ino: stat.ino };
|
|
1891
|
+
}
|
|
1892
|
+
async function readSmokeDirectoryIdentity(smokeCwd) {
|
|
1589
1893
|
try {
|
|
1590
|
-
|
|
1894
|
+
return smokeDirectoryIdentity(await lstat(smokeCwd));
|
|
1591
1895
|
}
|
|
1592
1896
|
catch {
|
|
1593
1897
|
return null;
|
|
1594
1898
|
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1899
|
+
}
|
|
1900
|
+
function sameSmokeDirectoryIdentity(expected, actual) {
|
|
1901
|
+
return actual !== null && actual.dev === expected.dev && actual.ino === expected.ino;
|
|
1902
|
+
}
|
|
1903
|
+
function smokeDirectorySafetyCheck(message) {
|
|
1904
|
+
return {
|
|
1905
|
+
name: "Native PostCompact hook",
|
|
1906
|
+
status: "warn",
|
|
1907
|
+
message,
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
async function cleanupSmokeDirectoryIfUnchanged(smokeCwd, identity) {
|
|
1911
|
+
if (!sameSmokeDirectoryIdentity(identity, await readSmokeDirectoryIdentity(smokeCwd))) {
|
|
1912
|
+
return smokeDirectorySafetyCheck("temporary PostCompact smoke directory changed during validation; doctor preserved it for manual recovery and skipped cleanup for safety");
|
|
1913
|
+
}
|
|
1914
|
+
try {
|
|
1915
|
+
// Only remove the empty, identity-checked directory. Never recursively remove
|
|
1916
|
+
// a directory that another process could have replaced or populated.
|
|
1917
|
+
await rmdir(smokeCwd);
|
|
1597
1918
|
return null;
|
|
1598
1919
|
}
|
|
1599
|
-
|
|
1920
|
+
catch {
|
|
1921
|
+
return smokeDirectorySafetyCheck("temporary PostCompact smoke directory could not be removed without recursive deletion; doctor preserved it for manual recovery");
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
function inMemoryWindowsShimSmokeCheck() {
|
|
1925
|
+
return {
|
|
1926
|
+
name: "Native PostCompact hook",
|
|
1927
|
+
status: "warn",
|
|
1928
|
+
message: "doctor could not build an in-memory Windows native hook smoke command from exact validated shim bytes; doctor skipped execution for safety",
|
|
1929
|
+
};
|
|
1930
|
+
}
|
|
1931
|
+
function getManagedPostCompactHookCommands(content, platform, codexHomeDir) {
|
|
1932
|
+
const validation = validateCodexHooksConfigStrict(content, {
|
|
1933
|
+
platform,
|
|
1934
|
+
codexHomeDir,
|
|
1935
|
+
});
|
|
1936
|
+
if (!validation.ok)
|
|
1937
|
+
return null;
|
|
1938
|
+
return validation.discoveredCommands
|
|
1939
|
+
.filter((command) => command.eventName === "PostCompact")
|
|
1940
|
+
.map((command) => command.command)
|
|
1941
|
+
.filter((command) => isManagedCodexHookCommand(command) ||
|
|
1942
|
+
(platform === "win32" && parseManagedCodexNativeHookWindowsShimCommand(command, {
|
|
1943
|
+
platform,
|
|
1944
|
+
codexHomeDir,
|
|
1945
|
+
}) !== null));
|
|
1946
|
+
}
|
|
1947
|
+
function currentPostCompactCommandCheck() {
|
|
1948
|
+
return {
|
|
1949
|
+
name: "Native PostCompact hook",
|
|
1950
|
+
status: "warn",
|
|
1951
|
+
message: "effective PostCompact OMX command does not match this installation's managed hook command; doctor skipped execution for safety, and rerunning \"omx setup\" should refresh stale hooks.json entries",
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
function skippedPostCompactIntegrityCheck(integrityCheck) {
|
|
1955
|
+
return {
|
|
1956
|
+
name: "Native PostCompact hook",
|
|
1957
|
+
status: integrityCheck.status === "fail" ? "fail" : "warn",
|
|
1958
|
+
message: `${integrityCheck.message}; doctor skipped execution because native hook integrity validation did not pass`,
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
export async function checkNativePostCompactHookRuntime(hooksPath, cwd, codexHomeDir, options = {}) {
|
|
1962
|
+
if (!existsSync(hooksPath))
|
|
1963
|
+
return null;
|
|
1964
|
+
if (options.nativeHooksCheck && options.nativeHooksCheck.status !== "pass")
|
|
1965
|
+
return null;
|
|
1966
|
+
const platform = options.platform ?? process.platform;
|
|
1967
|
+
const expectedCommand = options.expectedCommand ?? buildManagedCodexNativeHookCommand(getPackageRoot(), {
|
|
1600
1968
|
codexHomeDir,
|
|
1969
|
+
platform,
|
|
1601
1970
|
});
|
|
1971
|
+
let content;
|
|
1972
|
+
try {
|
|
1973
|
+
content = decodeStrictUtf8(await readFile(hooksPath));
|
|
1974
|
+
}
|
|
1975
|
+
catch {
|
|
1976
|
+
return null;
|
|
1977
|
+
}
|
|
1978
|
+
if (content === null)
|
|
1979
|
+
return null;
|
|
1980
|
+
const postCompactCommands = getManagedPostCompactHookCommands(content, platform, codexHomeDir);
|
|
1981
|
+
if (postCompactCommands === null || postCompactCommands.length === 0)
|
|
1982
|
+
return null;
|
|
1602
1983
|
const uniqueCommands = [...new Set(postCompactCommands)];
|
|
1603
1984
|
if (uniqueCommands.length !== 1 || uniqueCommands[0] !== expectedCommand) {
|
|
1604
|
-
return
|
|
1605
|
-
name: "Native PostCompact hook",
|
|
1606
|
-
status: "warn",
|
|
1607
|
-
message: "effective PostCompact OMX command does not match this installation's managed hook command; doctor skipped execution for safety, and \"omx setup --force\" should refresh stale hooks.json entries",
|
|
1608
|
-
};
|
|
1985
|
+
return currentPostCompactCommandCheck();
|
|
1609
1986
|
}
|
|
1610
1987
|
const smokeCwd = await mkdtemp(join(tmpdir(), "omx-doctor-postcompact-"));
|
|
1988
|
+
const smokeDirectory = await readSmokeDirectoryIdentity(smokeCwd);
|
|
1989
|
+
if (!smokeDirectory) {
|
|
1990
|
+
return smokeDirectorySafetyCheck("temporary PostCompact smoke directory could not be validated; doctor preserved it for manual recovery and skipped execution for safety");
|
|
1991
|
+
}
|
|
1992
|
+
let primaryResult = null;
|
|
1993
|
+
let primaryError = null;
|
|
1611
1994
|
try {
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1995
|
+
primaryResult = await (async () => {
|
|
1996
|
+
const revalidatedIntegrity = await checkExistingNativeHooks(hooksPath, {
|
|
1997
|
+
codexHomeDir,
|
|
1998
|
+
platform,
|
|
1999
|
+
});
|
|
2000
|
+
if (revalidatedIntegrity.status !== "pass") {
|
|
2001
|
+
return skippedPostCompactIntegrityCheck(revalidatedIntegrity);
|
|
2002
|
+
}
|
|
2003
|
+
let revalidatedContent;
|
|
2004
|
+
try {
|
|
2005
|
+
revalidatedContent = decodeStrictUtf8(await readFile(hooksPath));
|
|
2006
|
+
}
|
|
2007
|
+
catch {
|
|
2008
|
+
return {
|
|
2009
|
+
name: "Native PostCompact hook",
|
|
2010
|
+
status: "warn",
|
|
2011
|
+
message: "hooks.json changed during verbose validation; doctor skipped execution for safety",
|
|
2012
|
+
};
|
|
2013
|
+
}
|
|
2014
|
+
if (revalidatedContent === null) {
|
|
2015
|
+
return {
|
|
2016
|
+
name: "Native PostCompact hook",
|
|
2017
|
+
status: "warn",
|
|
2018
|
+
message: "hooks.json changed during verbose validation; doctor skipped execution for safety",
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
const revalidatedCommands = getManagedPostCompactHookCommands(revalidatedContent, platform, codexHomeDir);
|
|
2022
|
+
if (revalidatedCommands === null ||
|
|
2023
|
+
revalidatedCommands.length === 0 ||
|
|
2024
|
+
new Set(revalidatedCommands).size !== 1 ||
|
|
2025
|
+
revalidatedCommands[0] !== expectedCommand) {
|
|
2026
|
+
return currentPostCompactCommandCheck();
|
|
2027
|
+
}
|
|
2028
|
+
if (platform === "win32") {
|
|
2029
|
+
const validation = validateCodexHooksConfigStrict(revalidatedContent, {
|
|
2030
|
+
platform,
|
|
2031
|
+
codexHomeDir,
|
|
2032
|
+
});
|
|
2033
|
+
if (!validation.ok) {
|
|
2034
|
+
return {
|
|
2035
|
+
name: "Native PostCompact hook",
|
|
2036
|
+
status: "warn",
|
|
2037
|
+
message: "hooks.json changed during verbose validation; doctor skipped execution for safety",
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
const currentShimCheck = await checkWindowsNativeHookShims(validation.root, validation.diagnostics, codexHomeDir, true);
|
|
2041
|
+
if (currentShimCheck)
|
|
2042
|
+
return skippedPostCompactIntegrityCheck(currentShimCheck);
|
|
2043
|
+
}
|
|
2044
|
+
let smokeInvocation;
|
|
2045
|
+
if (platform === "win32") {
|
|
2046
|
+
const canonicalShimPath = parseManagedCodexNativeHookWindowsShimCommand(expectedCommand, {
|
|
2047
|
+
platform,
|
|
2048
|
+
codexHomeDir,
|
|
2049
|
+
});
|
|
2050
|
+
if (!canonicalShimPath)
|
|
2051
|
+
return currentPostCompactCommandCheck();
|
|
2052
|
+
const expectedShimContent = Buffer.from(buildManagedCodexNativeHookWindowsShimContent(getPackageRoot()), "utf-8");
|
|
2053
|
+
const inMemoryInvocation = buildInMemoryWindowsShimSmokeInvocation(expectedShimContent);
|
|
2054
|
+
if (!inMemoryInvocation)
|
|
2055
|
+
return inMemoryWindowsShimSmokeCheck();
|
|
2056
|
+
smokeInvocation = inMemoryInvocation;
|
|
2057
|
+
try {
|
|
2058
|
+
await options.beforeWindowsShimSmoke?.({ canonicalShimPath, smokeCwd });
|
|
2059
|
+
}
|
|
2060
|
+
catch {
|
|
2061
|
+
return smokeDirectorySafetyCheck("Windows native hook changed during validation; doctor skipped execution for safety");
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
else {
|
|
2065
|
+
smokeInvocation = buildPostCompactSmokeSpawnInvocation(expectedCommand, { platform });
|
|
2066
|
+
}
|
|
2067
|
+
if (!sameSmokeDirectoryIdentity(smokeDirectory, await readSmokeDirectoryIdentity(smokeCwd))) {
|
|
2068
|
+
return smokeDirectorySafetyCheck("temporary PostCompact smoke directory changed during validation; doctor preserved it for manual recovery and skipped execution for safety");
|
|
2069
|
+
}
|
|
2070
|
+
const payload = JSON.stringify({
|
|
2071
|
+
hook_event_name: "PostCompact",
|
|
2072
|
+
cwd: smokeCwd,
|
|
2073
|
+
session_id: "omx-doctor-postcompact-smoke",
|
|
2074
|
+
});
|
|
2075
|
+
const result = (options.runner ?? spawnSync)(smokeInvocation.command, smokeInvocation.args, {
|
|
2076
|
+
cwd,
|
|
2077
|
+
encoding: "utf-8",
|
|
2078
|
+
env: {
|
|
2079
|
+
...process.env,
|
|
2080
|
+
OMX_NATIVE_HOOK_DOCTOR_SMOKE: "1",
|
|
2081
|
+
OMX_ROOT: smokeCwd,
|
|
2082
|
+
OMX_SESSION_ID: "omx-doctor-postcompact-smoke",
|
|
2083
|
+
OMX_SOURCE_CWD: smokeCwd,
|
|
2084
|
+
OMX_STARTUP_CWD: smokeCwd,
|
|
2085
|
+
},
|
|
2086
|
+
input: payload,
|
|
2087
|
+
shell: smokeInvocation.shell,
|
|
2088
|
+
timeout: 5_000,
|
|
2089
|
+
});
|
|
2090
|
+
if (result.error) {
|
|
2091
|
+
return {
|
|
2092
|
+
name: "Native PostCompact hook",
|
|
2093
|
+
status: "fail",
|
|
2094
|
+
message: `PostCompact hook smoke validation failed to run (${result.error.message})`,
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
if (result.status !== 0) {
|
|
2098
|
+
const stderr = (result.stderr || "").trim();
|
|
2099
|
+
return {
|
|
2100
|
+
name: "Native PostCompact hook",
|
|
2101
|
+
status: "fail",
|
|
2102
|
+
message: `PostCompact hook smoke validation exited ${result.status}${stderr ? `: ${stderr}` : ""}`,
|
|
2103
|
+
};
|
|
2104
|
+
}
|
|
2105
|
+
const stdoutCheck = classifyPostCompactHookStdout(result.stdout || "");
|
|
2106
|
+
if (stdoutCheck)
|
|
2107
|
+
return stdoutCheck;
|
|
1638
2108
|
return {
|
|
1639
2109
|
name: "Native PostCompact hook",
|
|
1640
|
-
status: "
|
|
1641
|
-
message:
|
|
2110
|
+
status: "pass",
|
|
2111
|
+
message: "verbose smoke validation confirmed the effective PostCompact hook exits successfully with no stdout",
|
|
1642
2112
|
};
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
name: "Native PostCompact hook",
|
|
1649
|
-
status: "pass",
|
|
1650
|
-
message: "verbose smoke validation confirmed the effective PostCompact hook exits successfully with no stdout",
|
|
1651
|
-
};
|
|
2113
|
+
})();
|
|
2114
|
+
}
|
|
2115
|
+
catch (error) {
|
|
2116
|
+
primaryError = error instanceof Error ? error : new Error(String(error));
|
|
2117
|
+
throw primaryError;
|
|
1652
2118
|
}
|
|
1653
2119
|
finally {
|
|
1654
|
-
await
|
|
2120
|
+
const cleanupCheck = await cleanupSmokeDirectoryIfUnchanged(smokeCwd, smokeDirectory);
|
|
2121
|
+
if (cleanupCheck) {
|
|
2122
|
+
if (primaryResult) {
|
|
2123
|
+
if (primaryResult.status === "pass")
|
|
2124
|
+
primaryResult.status = cleanupCheck.status;
|
|
2125
|
+
primaryResult.message = `${primaryResult.message}; ${cleanupCheck.message}`;
|
|
2126
|
+
}
|
|
2127
|
+
else if (primaryError) {
|
|
2128
|
+
primaryError.message = `${primaryError.message}; ${cleanupCheck.message}`;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
1655
2131
|
}
|
|
2132
|
+
return primaryResult;
|
|
1656
2133
|
}
|
|
1657
2134
|
async function checkNativeHookRuntimeMirrors(cwd, hooksPath) {
|
|
1658
2135
|
if (!existsSync(hooksPath))
|