oh-my-codex 0.20.5 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +1 -1
- package/README.md +22 -19
- package/dist/agents/__tests__/definitions.test.js +0 -27
- package/dist/agents/__tests__/definitions.test.js.map +1 -1
- package/dist/agents/__tests__/native-config.test.js +3 -8
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +0 -41
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/policy.d.ts.map +1 -1
- package/dist/agents/policy.js +0 -1
- package/dist/agents/policy.js.map +1 -1
- package/dist/autopilot/__tests__/completion-gate-advisory.test.d.ts +2 -0
- package/dist/autopilot/__tests__/completion-gate-advisory.test.d.ts.map +1 -0
- package/dist/autopilot/__tests__/completion-gate-advisory.test.js +383 -0
- package/dist/autopilot/__tests__/completion-gate-advisory.test.js.map +1 -0
- package/dist/autopilot/completion-gate.d.ts +6 -1
- package/dist/autopilot/completion-gate.d.ts.map +1 -1
- package/dist/autopilot/completion-gate.js +247 -7
- package/dist/autopilot/completion-gate.js.map +1 -1
- package/dist/catalog/__tests__/generator.test.js +15 -10
- package/dist/catalog/__tests__/generator.test.js.map +1 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +13 -7
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -1
- package/dist/catalog/__tests__/schema.test.js +3 -5
- package/dist/catalog/__tests__/schema.test.js.map +1 -1
- package/dist/catalog/schema.js +1 -1
- package/dist/catalog/schema.js.map +1 -1
- package/dist/cli/__tests__/autopilot.test.d.ts +2 -0
- package/dist/cli/__tests__/autopilot.test.d.ts.map +1 -0
- package/dist/cli/__tests__/autopilot.test.js +143 -0
- package/dist/cli/__tests__/autopilot.test.js.map +1 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js +6 -2
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts +2 -0
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts.map +1 -0
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js +592 -0
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js.map +1 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js +270 -33
- package/dist/cli/__tests__/detached-leader-teardown.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-state-root-binding.test.js +69 -2
- package/dist/cli/__tests__/doctor-state-root-binding.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-team.test.js +85 -0
- package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +136 -8
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +543 -2
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts +2 -0
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts.map +1 -0
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.js +17 -0
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.js.map +1 -0
- package/dist/cli/__tests__/launch-fallback.test.js +120 -3
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +25 -8
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts +2 -0
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts.map +1 -0
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.js +76 -0
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.js.map +1 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts +2 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts.map +1 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js +1662 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js.map +1 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts +2 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts.map +1 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js +522 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js.map +1 -0
- package/dist/cli/__tests__/ralph-deslop-contract.test.js +4 -18
- package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +4 -30
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +4 -15
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-advisory.test.d.ts +2 -0
- package/dist/cli/__tests__/ralplan-advisory.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralplan-advisory.test.js +301 -0
- package/dist/cli/__tests__/ralplan-advisory.test.js.map +1 -0
- package/dist/cli/__tests__/ralplan.test.js +88 -4
- package/dist/cli/__tests__/ralplan.test.js.map +1 -1
- package/dist/cli/__tests__/resume.test.js +81 -6
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +458 -4
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/session-search-help.test.js +65 -3
- package/dist/cli/__tests__/session-search-help.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +49 -0
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +34 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js +1 -1
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +133 -23
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js +1 -1
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +12 -6
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +180 -21
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +4 -0
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +115 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +23 -23
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +81 -1
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +30 -4
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
- package/dist/cli/autopilot.d.ts +8 -0
- package/dist/cli/autopilot.d.ts.map +1 -0
- package/dist/cli/autopilot.js +160 -0
- package/dist/cli/autopilot.js.map +1 -0
- package/dist/cli/doctor.d.ts +12 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +216 -27
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +114 -8
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1932 -200
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-parity.d.ts.map +1 -1
- package/dist/cli/mcp-parity.js +7 -3
- package/dist/cli/mcp-parity.js.map +1 -1
- package/dist/cli/native-assets.d.ts +1 -1
- package/dist/cli/native-assets.d.ts.map +1 -1
- package/dist/cli/package-manager-ownership.d.ts +6 -0
- package/dist/cli/package-manager-ownership.d.ts.map +1 -1
- package/dist/cli/package-manager-ownership.js +15 -0
- package/dist/cli/package-manager-ownership.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +90 -4
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +2190 -105
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/ralplan.d.ts +4 -1
- package/dist/cli/ralplan.d.ts.map +1 -1
- package/dist/cli/ralplan.js +199 -1
- package/dist/cli/ralplan.js.map +1 -1
- package/dist/cli/session-search.d.ts.map +1 -1
- package/dist/cli/session-search.js +38 -1
- package/dist/cli/session-search.js.map +1 -1
- package/dist/cli/setup.d.ts +3 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +376 -183
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +9 -10
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/ultragoal.d.ts +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +8 -5
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/update.d.ts +2 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +21 -1
- package/dist/cli/update.js.map +1 -1
- package/dist/compat/__tests__/upgrade-from-0-20.test.d.ts +2 -0
- package/dist/compat/__tests__/upgrade-from-0-20.test.d.ts.map +1 -0
- package/dist/compat/__tests__/upgrade-from-0-20.test.js +109 -0
- package/dist/compat/__tests__/upgrade-from-0-20.test.js.map +1 -0
- package/dist/compat/upgrade-from-0-20.d.ts +64 -0
- package/dist/compat/upgrade-from-0-20.d.ts.map +1 -0
- package/dist/compat/upgrade-from-0-20.js +276 -0
- package/dist/compat/upgrade-from-0-20.js.map +1 -0
- package/dist/config/__tests__/generator-idempotent.test.js +118 -0
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +74 -4
- package/dist/config/generator.js.map +1 -1
- package/dist/hooks/__tests__/analyze-skill-contract.test.js +24 -31
- package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/anti-slop-workflow.test.js +66 -135
- package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +47 -129
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.js +16 -18
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +2 -14
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js +56 -234
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +1 -3
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/design-skill.test.js +18 -16
- package/dist/hooks/__tests__/design-skill.test.js.map +1 -1
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +24 -20
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js +8 -16
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js.map +1 -1
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.d.ts +2 -0
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.js +169 -0
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.js.map +1 -0
- package/dist/hooks/__tests__/keyword-detector.test.js +200 -897
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +4 -4
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +18 -54
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +14 -904
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js +5 -5
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +5 -5
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +7 -7
- 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 +7 -6
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js +19 -21
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js +15 -4
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +23 -28
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts +2 -0
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js +250 -0
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js.map +1 -0
- package/dist/hooks/__tests__/research-workflow-boundaries.test.js +9 -8
- package/dist/hooks/__tests__/research-workflow-boundaries.test.js.map +1 -1
- package/dist/hooks/__tests__/session.test.js +608 -18
- package/dist/hooks/__tests__/session.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.js +13 -22
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-guidance-contract.test.js +3 -13
- package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/sunset-routing-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/sunset-routing-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/sunset-routing-contract.test.js +172 -0
- package/dist/hooks/__tests__/sunset-routing-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +2 -2
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/tmux-hook-engine.test.js +18 -3
- package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.js +20 -17
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-verdict-loop.test.js +17 -18
- package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +10 -51
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +279 -366
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/keyword-registry.d.ts.map +1 -1
- package/dist/hooks/keyword-registry.js +14 -26
- package/dist/hooks/keyword-registry.js.map +1 -1
- package/dist/hooks/native/capability-warnings.d.ts +16 -0
- package/dist/hooks/native/capability-warnings.d.ts.map +1 -0
- package/dist/hooks/native/capability-warnings.js +40 -0
- package/dist/hooks/native/capability-warnings.js.map +1 -0
- package/dist/hooks/native/index.d.ts +17 -0
- package/dist/hooks/native/index.d.ts.map +1 -0
- package/dist/hooks/native/index.js +17 -0
- package/dist/hooks/native/index.js.map +1 -0
- package/dist/hooks/native/pre-tool-use-advisory.d.ts +17 -0
- package/dist/hooks/native/pre-tool-use-advisory.d.ts.map +1 -0
- package/dist/hooks/native/pre-tool-use-advisory.js +112 -0
- package/dist/hooks/native/pre-tool-use-advisory.js.map +1 -0
- package/dist/hooks/native/types.d.ts +30 -0
- package/dist/hooks/native/types.d.ts.map +1 -0
- package/dist/hooks/native/types.js +22 -0
- package/dist/hooks/native/types.js.map +1 -0
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +46 -93
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/session.d.ts +22 -4
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +589 -28
- package/dist/hooks/session.js.map +1 -1
- package/dist/hooks/sunset-stub.d.ts +17 -0
- package/dist/hooks/sunset-stub.d.ts.map +1 -0
- package/dist/hooks/sunset-stub.js +125 -0
- package/dist/hooks/sunset-stub.js.map +1 -0
- package/dist/hud/__tests__/index.test.js +16 -1
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +134 -7
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/session-attached.test.d.ts +2 -0
- package/dist/hud/__tests__/session-attached.test.d.ts.map +1 -0
- package/dist/hud/__tests__/session-attached.test.js +82 -0
- package/dist/hud/__tests__/session-attached.test.js.map +1 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.d.ts +2 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.d.ts.map +1 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.js +279 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.js.map +1 -0
- package/dist/hud/__tests__/tmux.test.js +166 -22
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/__tests__/watch-detached.test.d.ts +2 -0
- package/dist/hud/__tests__/watch-detached.test.d.ts.map +1 -0
- package/dist/hud/__tests__/watch-detached.test.js +383 -0
- package/dist/hud/__tests__/watch-detached.test.js.map +1 -0
- package/dist/hud/__tests__/watch-realtmux.test.d.ts +2 -0
- package/dist/hud/__tests__/watch-realtmux.test.d.ts.map +1 -0
- package/dist/hud/__tests__/watch-realtmux.test.js +322 -0
- package/dist/hud/__tests__/watch-realtmux.test.js.map +1 -0
- package/dist/hud/index.d.ts +3 -0
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +98 -20
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +68 -24
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/session-attached.d.ts +15 -0
- package/dist/hud/session-attached.d.ts.map +1 -0
- package/dist/hud/session-attached.js +47 -0
- package/dist/hud/session-attached.js.map +1 -0
- package/dist/hud/tmux.d.ts +5 -0
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +103 -32
- package/dist/hud/tmux.js.map +1 -1
- package/dist/mcp/__tests__/state-server-ralph-phase.test.js +29 -4
- package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server-schema.test.js +13 -3
- package/dist/mcp/__tests__/state-server-schema.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +11 -1033
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/state-server.d.ts +67 -96
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/state-server.js +116 -67
- package/dist/mcp/state-server.js.map +1 -1
- package/dist/modes/__tests__/base-autopilot-gates.test.js +1 -197
- package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -1
- package/dist/modes/__tests__/base-autoresearch-contract.test.js +1 -85
- package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.js +1 -35
- package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -1
- package/dist/modes/__tests__/base-session-scope.test.js +1 -158
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/base.d.ts +16 -3
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +157 -97
- package/dist/modes/base.js.map +1 -1
- package/dist/native-assets/policy.d.ts +1 -1
- package/dist/native-assets/policy.d.ts.map +1 -1
- package/dist/native-assets/policy.js +1 -1
- package/dist/native-assets/policy.js.map +1 -1
- package/dist/notifications/__tests__/formatter.test.js +8 -0
- package/dist/notifications/__tests__/formatter.test.js.map +1 -1
- package/dist/notifications/__tests__/template-engine.test.js +8 -0
- package/dist/notifications/__tests__/template-engine.test.js.map +1 -1
- package/dist/notifications/formatter.js +1 -1
- package/dist/notifications/formatter.js.map +1 -1
- package/dist/notifications/template-engine.js +1 -1
- package/dist/notifications/template-engine.js.map +1 -1
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js +0 -21
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js.map +1 -1
- package/dist/question/autopilot-wait.d.ts.map +1 -1
- package/dist/question/autopilot-wait.js +3 -3
- package/dist/question/autopilot-wait.js.map +1 -1
- package/dist/question/deep-interview.d.ts +1 -2
- package/dist/question/deep-interview.d.ts.map +1 -1
- package/dist/question/deep-interview.js +5 -5
- package/dist/question/deep-interview.js.map +1 -1
- package/dist/ralplan/__tests__/advisory-activation.test.d.ts +2 -0
- package/dist/ralplan/__tests__/advisory-activation.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/advisory-activation.test.js +700 -0
- package/dist/ralplan/__tests__/advisory-activation.test.js.map +1 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts +2 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.js +88 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.js.map +1 -0
- package/dist/ralplan/__tests__/advisory.test.d.ts +2 -0
- package/dist/ralplan/__tests__/advisory.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/advisory.test.js +1087 -0
- package/dist/ralplan/__tests__/advisory.test.js.map +1 -0
- package/dist/ralplan/__tests__/runtime.test.js +380 -716
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/advisory-activation-verifier.d.ts +19 -0
- package/dist/ralplan/advisory-activation-verifier.d.ts.map +1 -0
- package/dist/ralplan/advisory-activation-verifier.js +77 -0
- package/dist/ralplan/advisory-activation-verifier.js.map +1 -0
- package/dist/ralplan/advisory-activation.d.ts +34 -0
- package/dist/ralplan/advisory-activation.d.ts.map +1 -0
- package/dist/ralplan/advisory-activation.js +205 -0
- package/dist/ralplan/advisory-activation.js.map +1 -0
- package/dist/ralplan/advisory-contract.d.ts +103 -0
- package/dist/ralplan/advisory-contract.d.ts.map +1 -0
- package/dist/ralplan/advisory-contract.js +83 -0
- package/dist/ralplan/advisory-contract.js.map +1 -0
- package/dist/ralplan/advisory-detached-transition.d.ts +11 -0
- package/dist/ralplan/advisory-detached-transition.d.ts.map +1 -0
- package/dist/ralplan/advisory-detached-transition.js +21 -0
- package/dist/ralplan/advisory-detached-transition.js.map +1 -0
- package/dist/ralplan/advisory-evidence.d.ts +91 -0
- package/dist/ralplan/advisory-evidence.d.ts.map +1 -0
- package/dist/ralplan/advisory-evidence.js +393 -0
- package/dist/ralplan/advisory-evidence.js.map +1 -0
- package/dist/ralplan/advisory-lifecycle-validation.d.ts +11 -0
- package/dist/ralplan/advisory-lifecycle-validation.d.ts.map +1 -0
- package/dist/ralplan/advisory-lifecycle-validation.js +72 -0
- package/dist/ralplan/advisory-lifecycle-validation.js.map +1 -0
- package/dist/ralplan/advisory-postconditions.d.ts +3 -0
- package/dist/ralplan/advisory-postconditions.d.ts.map +1 -0
- package/dist/ralplan/advisory-postconditions.js +33 -0
- package/dist/ralplan/advisory-postconditions.js.map +1 -0
- package/dist/ralplan/advisory-recovery-journal.d.ts +56 -0
- package/dist/ralplan/advisory-recovery-journal.d.ts.map +1 -0
- package/dist/ralplan/advisory-recovery-journal.js +136 -0
- package/dist/ralplan/advisory-recovery-journal.js.map +1 -0
- package/dist/ralplan/advisory-storage.d.ts +24 -0
- package/dist/ralplan/advisory-storage.d.ts.map +1 -0
- package/dist/ralplan/advisory-storage.js +106 -0
- package/dist/ralplan/advisory-storage.js.map +1 -0
- package/dist/ralplan/advisory.d.ts +99 -0
- package/dist/ralplan/advisory.d.ts.map +1 -0
- package/dist/ralplan/advisory.js +914 -0
- package/dist/ralplan/advisory.js.map +1 -0
- package/dist/ralplan/documented-leader-preflight.d.ts +8 -0
- package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -1
- package/dist/ralplan/documented-leader-preflight.js +60 -2
- package/dist/ralplan/documented-leader-preflight.js.map +1 -1
- package/dist/ralplan/runtime-advisory-lifecycle.d.ts +74 -0
- package/dist/ralplan/runtime-advisory-lifecycle.d.ts.map +1 -0
- package/dist/ralplan/runtime-advisory-lifecycle.js +352 -0
- package/dist/ralplan/runtime-advisory-lifecycle.js.map +1 -0
- package/dist/ralplan/runtime-contract.d.ts +126 -0
- package/dist/ralplan/runtime-contract.d.ts.map +1 -0
- package/dist/ralplan/runtime-contract.js +2 -0
- package/dist/ralplan/runtime-contract.js.map +1 -0
- package/dist/ralplan/runtime.d.ts +6 -109
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +256 -51
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +45 -0
- package/dist/runtime/bridge.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +7361 -19497
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/docs-site-contract.test.js +2 -2
- package/dist/scripts/__tests__/docs-site-contract.test.js.map +1 -1
- package/dist/scripts/__tests__/generated-artifact-drift.test.d.ts +2 -0
- package/dist/scripts/__tests__/generated-artifact-drift.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/generated-artifact-drift.test.js +84 -0
- package/dist/scripts/__tests__/generated-artifact-drift.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js +13 -3
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js.map +1 -1
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js +32 -84
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js.map +1 -1
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js +69 -404
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js.map +1 -1
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js +107 -624
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js.map +1 -1
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js +3 -171
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js.map +1 -1
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.js +63 -0
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.js +65 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.js +189 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.js.map +1 -0
- package/dist/scripts/__tests__/prompt-inventory.test.js +54 -1
- package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -1
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts +2 -0
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.js +299 -0
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.js.map +1 -0
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js +2 -2
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js.map +1 -1
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js +46 -77
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js.map +1 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +121 -18
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts +21 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +412 -993
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +8 -20
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.d.ts +2 -48
- package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.js +1 -0
- package/dist/scripts/notify-hook/auto-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +8 -5
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +3 -2
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/notify-hook.d.ts.map +1 -1
- package/dist/scripts/notify-hook.js +2 -51
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/prompt-inventory.d.ts +39 -0
- package/dist/scripts/prompt-inventory.d.ts.map +1 -1
- package/dist/scripts/prompt-inventory.js +108 -3
- package/dist/scripts/prompt-inventory.js.map +1 -1
- package/dist/scripts/run-compiled-ci.js +2 -0
- package/dist/scripts/run-compiled-ci.js.map +1 -1
- package/dist/scripts/run-test-files.js +1 -0
- package/dist/scripts/run-test-files.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +21 -5
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +158 -64
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-prompt-guidance-fragments.js +62 -20
- package/dist/scripts/sync-prompt-guidance-fragments.js.map +1 -1
- package/dist/scripts/tmux-hook-engine.d.ts +1 -1
- package/dist/scripts/tmux-hook-engine.d.ts.map +1 -1
- package/dist/scripts/tmux-hook-engine.js +3 -3
- package/dist/scripts/tmux-hook-engine.js.map +1 -1
- package/dist/scripts/verify-capabilities-lock.d.ts +3 -0
- package/dist/scripts/verify-capabilities-lock.d.ts.map +1 -0
- package/dist/scripts/verify-capabilities-lock.js +22 -0
- package/dist/scripts/verify-capabilities-lock.js.map +1 -0
- package/dist/state/__tests__/authority-decreasing.test.d.ts +2 -0
- package/dist/state/__tests__/authority-decreasing.test.d.ts.map +1 -0
- package/dist/state/__tests__/authority-decreasing.test.js +78 -0
- package/dist/state/__tests__/authority-decreasing.test.js.map +1 -0
- package/dist/state/__tests__/handoff-carrier.test.d.ts +2 -0
- package/dist/state/__tests__/handoff-carrier.test.d.ts.map +1 -0
- package/dist/state/__tests__/handoff-carrier.test.js +96 -0
- package/dist/state/__tests__/handoff-carrier.test.js.map +1 -0
- package/dist/state/__tests__/mode-binding-lease.test.d.ts +2 -0
- package/dist/state/__tests__/mode-binding-lease.test.d.ts.map +1 -0
- package/dist/state/__tests__/mode-binding-lease.test.js +498 -0
- package/dist/state/__tests__/mode-binding-lease.test.js.map +1 -0
- package/dist/state/__tests__/operations.test.js +340 -1596
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/pinned-atomic-file.test.d.ts +2 -0
- package/dist/state/__tests__/pinned-atomic-file.test.d.ts.map +1 -0
- package/dist/state/__tests__/pinned-atomic-file.test.js +438 -0
- package/dist/state/__tests__/pinned-atomic-file.test.js.map +1 -0
- package/dist/state/__tests__/single-writer-invariant.test.d.ts +2 -0
- package/dist/state/__tests__/single-writer-invariant.test.d.ts.map +1 -0
- package/dist/state/__tests__/single-writer-invariant.test.js +342 -0
- package/dist/state/__tests__/single-writer-invariant.test.js.map +1 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts +2 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts.map +1 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.js +179 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.js.map +1 -0
- package/dist/state/__tests__/skill-active.test.js +29 -1
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/__tests__/stale-state-neutralization.test.d.ts +2 -0
- package/dist/state/__tests__/stale-state-neutralization.test.d.ts.map +1 -0
- package/dist/state/__tests__/stale-state-neutralization.test.js +84 -0
- package/dist/state/__tests__/stale-state-neutralization.test.js.map +1 -0
- package/dist/state/__tests__/workflow-transition.test.js +20 -33
- package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
- package/dist/state/handoff-carrier.d.ts +46 -0
- package/dist/state/handoff-carrier.d.ts.map +1 -0
- package/dist/state/handoff-carrier.js +85 -0
- package/dist/state/handoff-carrier.js.map +1 -0
- package/dist/state/mode-binding-lease-helper.d.ts +2 -0
- package/dist/state/mode-binding-lease-helper.d.ts.map +1 -0
- package/dist/state/mode-binding-lease-helper.js +623 -0
- package/dist/state/mode-binding-lease-helper.js.map +1 -0
- package/dist/state/mode-binding-lease.d.ts +25 -0
- package/dist/state/mode-binding-lease.d.ts.map +1 -0
- package/dist/state/mode-binding-lease.js +380 -0
- package/dist/state/mode-binding-lease.js.map +1 -0
- package/dist/state/namespace-owners.d.ts +34 -0
- package/dist/state/namespace-owners.d.ts.map +1 -0
- package/dist/state/namespace-owners.js +127 -0
- package/dist/state/namespace-owners.js.map +1 -0
- package/dist/state/operations.d.ts +34 -4
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +274 -338
- package/dist/state/operations.js.map +1 -1
- package/dist/state/pinned-atomic-file-darwin-client.d.ts +34 -0
- package/dist/state/pinned-atomic-file-darwin-client.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-client.js +174 -0
- package/dist/state/pinned-atomic-file-darwin-client.js.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-helper.d.ts +2 -0
- package/dist/state/pinned-atomic-file-darwin-helper.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-helper.js +275 -0
- package/dist/state/pinned-atomic-file-darwin-helper.js.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.d.ts +2 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.js +272 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.js.map +1 -0
- package/dist/state/pinned-atomic-file.d.ts +29 -0
- package/dist/state/pinned-atomic-file.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file.js +536 -0
- package/dist/state/pinned-atomic-file.js.map +1 -0
- package/dist/state/process-identity.d.ts +30 -0
- package/dist/state/process-identity.d.ts.map +1 -0
- package/dist/state/process-identity.js +99 -0
- package/dist/state/process-identity.js.map +1 -0
- package/dist/state/skill-active.d.ts +18 -1
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +83 -13
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +5 -31
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/state/workflow-transition.d.ts +1 -27
- package/dist/state/workflow-transition.d.ts.map +1 -1
- package/dist/state/workflow-transition.js +6 -789
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/team/__tests__/api-interop.test.js +1 -0
- package/dist/team/__tests__/api-interop.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +47 -8
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/team-ops-contract.test.js +1 -0
- package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +321 -15
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js +11 -1
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +11 -13
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/__tests__/worker-provenance.test.d.ts +2 -0
- package/dist/team/__tests__/worker-provenance.test.d.ts.map +1 -0
- package/dist/team/__tests__/worker-provenance.test.js +251 -0
- package/dist/team/__tests__/worker-provenance.test.js.map +1 -0
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +14 -8
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/mcp-comm.d.ts.map +1 -1
- package/dist/team/mcp-comm.js +3 -8
- package/dist/team/mcp-comm.js.map +1 -1
- package/dist/team/scaling.js +1 -1
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state.d.ts +1 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +11 -1
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-ops.d.ts +1 -0
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +1 -0
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +2 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +73 -35
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/ultragoal-context.d.ts +1 -0
- package/dist/team/ultragoal-context.d.ts.map +1 -1
- package/dist/team/ultragoal-context.js +2 -0
- package/dist/team/ultragoal-context.js.map +1 -1
- package/dist/team/worker-provenance.d.ts +35 -0
- package/dist/team/worker-provenance.d.ts.map +1 -0
- package/dist/team/worker-provenance.js +213 -0
- package/dist/team/worker-provenance.js.map +1 -0
- package/dist/ultragoal/__tests__/artifacts.test.js +103 -0
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +88 -59
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +1 -0
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +35 -5
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/url-reader/__tests__/url-reader.test.js +14 -0
- package/dist/url-reader/__tests__/url-reader.test.js.map +1 -1
- package/dist/url-reader/index.js +5 -3
- package/dist/url-reader/index.js.map +1 -1
- package/dist/utils/__tests__/file-durability.test.js +20 -0
- package/dist/utils/__tests__/file-durability.test.js.map +1 -1
- package/dist/utils/__tests__/version.test.js +17 -0
- package/dist/utils/__tests__/version.test.js.map +1 -1
- package/dist/utils/file-durability.d.ts +1 -1
- package/dist/utils/file-durability.d.ts.map +1 -1
- package/dist/utils/file-durability.js.map +1 -1
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +2 -1
- package/dist/utils/version.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +12 -4
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/dist/verification/__tests__/ci-trusted-publish.test.d.ts +2 -0
- package/dist/verification/__tests__/ci-trusted-publish.test.d.ts.map +1 -0
- package/dist/verification/__tests__/ci-trusted-publish.test.js +205 -0
- package/dist/verification/__tests__/ci-trusted-publish.test.js.map +1 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js +10 -5
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -1
- package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts +2 -0
- package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts.map +1 -0
- package/dist/verification/__tests__/publish-npm-manual-retired.test.js +22 -0
- package/dist/verification/__tests__/publish-npm-manual-retired.test.js.map +1 -0
- package/package.json +6 -3
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +60 -135
- package/plugins/oh-my-codex/skills/analyze/SKILL.md +35 -111
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +69 -168
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +33 -337
- package/plugins/oh-my-codex/skills/code-review/SKILL.md +66 -256
- package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +30 -216
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +11 -10
- package/plugins/oh-my-codex/skills/design/SKILL.md +32 -132
- package/plugins/oh-my-codex/skills/doctor/SKILL.md +56 -177
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +35 -116
- package/plugins/oh-my-codex/skills/plan/SKILL.md +45 -228
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +26 -17
- package/plugins/oh-my-codex/skills/skill/SKILL.md +82 -807
- package/plugins/oh-my-codex/skills/team/SKILL.md +34 -520
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +47 -151
- package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +75 -252
- package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +33 -111
- package/plugins/oh-my-codex/skills/worker/SKILL.md +40 -113
- package/prompts/analyst.md +27 -107
- package/prompts/api-reviewer.md +17 -84
- package/prompts/architect.md +31 -70
- package/prompts/code-reviewer.md +18 -107
- package/prompts/code-simplifier.md +32 -110
- package/prompts/critic.md +32 -54
- package/prompts/dependency-expert.md +37 -107
- package/prompts/designer.md +40 -107
- package/prompts/executor.md +26 -75
- package/prompts/information-architect.md +51 -200
- package/prompts/performance-reviewer.md +17 -81
- package/prompts/planner.md +33 -76
- package/prompts/product-analyst.md +65 -280
- package/prompts/product-manager.md +48 -216
- package/prompts/qa-tester.md +33 -104
- package/prompts/quality-reviewer.md +17 -93
- package/prompts/quality-strategist.md +31 -255
- package/prompts/researcher.md +32 -89
- package/prompts/security-reviewer.md +12 -98
- package/prompts/test-engineer.md +29 -110
- package/prompts/ux-researcher.md +46 -300
- package/prompts/verifier.md +23 -51
- package/skills/ai-slop-cleaner/SKILL.md +60 -135
- package/skills/analyze/SKILL.md +35 -111
- package/skills/autopilot/SKILL.md +69 -168
- package/skills/autoresearch-goal/SKILL.md +6 -31
- package/skills/cancel/SKILL.md +33 -337
- package/skills/code-review/SKILL.md +66 -256
- package/skills/configure-notifications/SKILL.md +30 -216
- package/skills/deep-interview/SKILL.md +11 -10
- package/skills/design/SKILL.md +32 -132
- package/skills/doctor/SKILL.md +56 -177
- package/skills/omx-setup/SKILL.md +35 -116
- package/skills/pipeline/SKILL.md +6 -89
- package/skills/plan/SKILL.md +45 -228
- package/skills/ralph/SKILL.md +6 -290
- package/skills/ralplan/SKILL.md +26 -17
- package/skills/skill/SKILL.md +82 -807
- package/skills/team/SKILL.md +34 -520
- package/skills/ultragoal/SKILL.md +47 -151
- package/skills/ultraqa/SKILL.md +75 -252
- package/skills/ultrawork/SKILL.md +6 -182
- package/skills/visual-ralph/SKILL.md +33 -111
- package/skills/worker/SKILL.md +40 -113
- package/src/scripts/__tests__/codex-native-hook.test.ts +17518 -32980
- package/src/scripts/__tests__/docs-site-contract.test.ts +2 -2
- package/src/scripts/__tests__/generated-artifact-drift.test.ts +97 -0
- package/src/scripts/__tests__/issue-3293-callsite-parity.test.ts +12 -2
- package/src/scripts/__tests__/issue-3293-hook-owned-cancel.test.ts +32 -33
- package/src/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.ts +67 -481
- package/src/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.ts +115 -615
- package/src/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.ts +0 -168
- package/src/scripts/__tests__/issue-3481-conductor-deadlock.test.ts +77 -0
- package/src/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.ts +95 -0
- package/src/scripts/__tests__/issue-3536-external-team-state-root.test.ts +216 -0
- package/src/scripts/__tests__/prompt-inventory.test.ts +62 -1
- package/src/scripts/__tests__/ralplan-advisory-hook.test.ts +320 -0
- package/src/scripts/__tests__/reasoning-artifact-contract.test.ts +1 -2
- package/src/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.ts +49 -78
- package/src/scripts/__tests__/smoke-packed-install.test.ts +141 -19
- package/src/scripts/codex-native-hook.ts +436 -1154
- package/src/scripts/codex-native-pre-post.ts +17 -22
- package/src/scripts/notify-hook/auto-nudge.ts +1 -0
- package/src/scripts/notify-hook/team-dispatch.ts +8 -5
- package/src/scripts/notify-hook/team-tmux-guard.ts +3 -1
- package/src/scripts/notify-hook.ts +2 -51
- package/src/scripts/prompt-inventory.ts +142 -3
- package/src/scripts/run-compiled-ci.ts +2 -0
- package/src/scripts/run-test-files.ts +1 -0
- package/src/scripts/smoke-packed-install.ts +176 -77
- package/src/scripts/sync-prompt-guidance-fragments.ts +59 -22
- package/src/scripts/tmux-hook-engine.ts +3 -3
- package/src/scripts/verify-capabilities-lock.ts +23 -0
- package/templates/AGENTS.md +45 -10
- package/templates/catalog-manifest.json +6 -146
- package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts +0 -2
- package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts.map +0 -1
- package/dist/autopilot/__tests__/deep-interview-gate.test.js +0 -215
- package/dist/autopilot/__tests__/deep-interview-gate.test.js.map +0 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.d.ts +0 -2
- package/dist/autopilot/__tests__/ralplan-gate.test.d.ts.map +0 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.js +0 -114
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +0 -1
- package/dist/autopilot/deep-interview-gate.d.ts +0 -18
- package/dist/autopilot/deep-interview-gate.d.ts.map +0 -1
- package/dist/autopilot/deep-interview-gate.js +0 -396
- package/dist/autopilot/deep-interview-gate.js.map +0 -1
- package/dist/autopilot/ralplan-gate.d.ts +0 -18
- package/dist/autopilot/ralplan-gate.d.ts.map +0 -1
- package/dist/autopilot/ralplan-gate.js +0 -149
- package/dist/autopilot/ralplan-gate.js.map +0 -1
- package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prometheus-strict-contract.test.js +0 -320
- package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +0 -1
- package/dist/pipeline/__tests__/orchestrator.test.d.ts +0 -2
- package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +0 -1
- package/dist/pipeline/__tests__/orchestrator.test.js +0 -892
- package/dist/pipeline/__tests__/orchestrator.test.js.map +0 -1
- package/dist/pipeline/__tests__/stages.test.d.ts +0 -2
- package/dist/pipeline/__tests__/stages.test.d.ts.map +0 -1
- package/dist/pipeline/__tests__/stages.test.js +0 -1695
- package/dist/pipeline/__tests__/stages.test.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -25
- package/dist/pipeline/index.d.ts.map +0 -1
- package/dist/pipeline/index.js +0 -17
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/orchestrator.d.ts +0 -52
- package/dist/pipeline/orchestrator.d.ts.map +0 -1
- package/dist/pipeline/orchestrator.js +0 -505
- package/dist/pipeline/orchestrator.js.map +0 -1
- package/dist/pipeline/review-verdict.d.ts +0 -3
- package/dist/pipeline/review-verdict.d.ts.map +0 -1
- package/dist/pipeline/review-verdict.js +0 -14
- package/dist/pipeline/review-verdict.js.map +0 -1
- package/dist/pipeline/stages/code-review.d.ts +0 -35
- package/dist/pipeline/stages/code-review.d.ts.map +0 -1
- package/dist/pipeline/stages/code-review.js +0 -55
- package/dist/pipeline/stages/code-review.js.map +0 -1
- package/dist/pipeline/stages/deep-interview.d.ts +0 -15
- package/dist/pipeline/stages/deep-interview.d.ts.map +0 -1
- package/dist/pipeline/stages/deep-interview.js +0 -32
- package/dist/pipeline/stages/deep-interview.js.map +0 -1
- package/dist/pipeline/stages/ralph-verify.d.ts +0 -53
- package/dist/pipeline/stages/ralph-verify.d.ts.map +0 -1
- package/dist/pipeline/stages/ralph-verify.js +0 -89
- package/dist/pipeline/stages/ralph-verify.js.map +0 -1
- package/dist/pipeline/stages/ralplan.d.ts +0 -27
- package/dist/pipeline/stages/ralplan.d.ts.map +0 -1
- package/dist/pipeline/stages/ralplan.js +0 -180
- package/dist/pipeline/stages/ralplan.js.map +0 -1
- package/dist/pipeline/stages/team-exec.d.ts +0 -52
- package/dist/pipeline/stages/team-exec.d.ts.map +0 -1
- package/dist/pipeline/stages/team-exec.js +0 -266
- package/dist/pipeline/stages/team-exec.js.map +0 -1
- package/dist/pipeline/stages/ultragoal.d.ts +0 -23
- package/dist/pipeline/stages/ultragoal.d.ts.map +0 -1
- package/dist/pipeline/stages/ultragoal.js +0 -53
- package/dist/pipeline/stages/ultragoal.js.map +0 -1
- package/dist/pipeline/stages/ultraqa.d.ts +0 -33
- package/dist/pipeline/stages/ultraqa.d.ts.map +0 -1
- package/dist/pipeline/stages/ultraqa.js +0 -49
- package/dist/pipeline/stages/ultraqa.js.map +0 -1
- package/dist/pipeline/types.d.ts +0 -124
- package/dist/pipeline/types.d.ts.map +0 -1
- package/dist/pipeline/types.js +0 -8
- package/dist/pipeline/types.js.map +0 -1
- package/dist/ralplan/__tests__/consensus-gate.test.d.ts +0 -2
- package/dist/ralplan/__tests__/consensus-gate.test.d.ts.map +0 -1
- package/dist/ralplan/__tests__/consensus-gate.test.js +0 -88
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +0 -1
- package/dist/ralplan/consensus-gate.d.ts +0 -70
- package/dist/ralplan/consensus-gate.d.ts.map +0 -1
- package/dist/ralplan/consensus-gate.js +0 -496
- package/dist/ralplan/consensus-gate.js.map +0 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts +0 -25
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +0 -1
- package/dist/scripts/notify-hook/ralph-session-resume.js +0 -377
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +0 -1
- package/dist/state/__tests__/planning-gate.test.d.ts +0 -2
- package/dist/state/__tests__/planning-gate.test.d.ts.map +0 -1
- package/dist/state/__tests__/planning-gate.test.js +0 -629
- package/dist/state/__tests__/planning-gate.test.js.map +0 -1
- package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +0 -39
- package/plugins/oh-my-codex/skills/pipeline/SKILL.md +0 -97
- package/plugins/oh-my-codex/skills/prometheus-strict/README.md +0 -35
- package/plugins/oh-my-codex/skills/prometheus-strict/SKILL.md +0 -219
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +0 -298
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +0 -190
- package/plugins/oh-my-codex/skills/ultrawork/references/agent-tiers.md +0 -62
- package/prompts/prometheus-strict-metis.md +0 -274
- package/prompts/prometheus-strict-momus.md +0 -82
- package/prompts/prometheus-strict-oracle.md +0 -107
- package/prompts/scholastic.md +0 -11
- package/prompts/sisyphus-lite.md +0 -111
- package/skills/ask-claude/SKILL.md +0 -12
- package/skills/ask-gemini/SKILL.md +0 -12
- package/skills/build-fix/SKILL.md +0 -10
- package/skills/deepsearch/SKILL.md +0 -10
- package/skills/ecomode/SKILL.md +0 -114
- package/skills/ecomode/references/agent-tiers.md +0 -61
- package/skills/frontend-ui-ux/SKILL.md +0 -16
- package/skills/help/SKILL.md +0 -10
- package/skills/note/SKILL.md +0 -10
- package/skills/prometheus-strict/README.md +0 -35
- package/skills/prometheus-strict/SKILL.md +0 -219
- package/skills/ralph-init/SKILL.md +0 -10
- package/skills/review/SKILL.md +0 -10
- package/skills/security-review/SKILL.md +0 -10
- package/skills/swarm/SKILL.md +0 -12
- package/skills/tdd/SKILL.md +0 -104
- package/skills/trace/SKILL.md +0 -10
- package/skills/visual-verdict/SKILL.md +0 -10
- package/skills/web-clone/SKILL.md +0 -357
- package/src/scripts/notify-hook/ralph-session-resume.ts +0 -466
package/dist/cli/setup.js
CHANGED
|
@@ -13,14 +13,14 @@ import { createHash } from "crypto";
|
|
|
13
13
|
import { clearNativeHookClaimJournal as clearNativeHookClaimJournalWithDurability, createNativeHookClaimJournalDurability, persistNativeHookClaimJournal as persistNativeHookClaimJournalWithDurability, recoverNativeHookClaimJournal, syncNativeHookClaimParent as syncNativeHookClaimParentWithDurability, restoreNativeHookClaimNoClobber as restoreNativeHookClaimNoClobberWithDurability, wrapNativeHookClaimJournalDurability, } from "./native-hook-claim-journal.js";
|
|
14
14
|
import { codexHome, codexConfigPath, codexPromptsDir, codexAgentsDir, userSkillsDir, omxStateDir, detectLegacySkillRootOverlap, omxPlansDir, omxLogsDir, } from "../utils/paths.js";
|
|
15
15
|
import { emitDegradedDurabilityWarning, recordRegularFileSyncOutcome, syncRegularFile, } from "../utils/file-durability.js";
|
|
16
|
-
import { buildMergedConfig, getRootModelName, getRootTomlArray, hasLegacyOmxTeamRunTable, isOmxManagedNotifyCommand, sanitizePreviousNotifyCommand, stripExistingOmxBlocks, stripExistingSharedMcpRegistryBlock, mergeSharedMcpRegistryBlock, stripOmxEnvSettings, stripOmxFeatureFlags, stripOmxSeededBehavioralDefaults, upsertPluginModeRuntimeFeatureFlags, upsertManagedCodexHookTrustState, stripManagedCodexHookTrustState, OMX_DEVELOPER_INSTRUCTIONS, OMX_PLUGIN_DEVELOPER_INSTRUCTIONS, hasFirstPartyOmxMcpRegistrations, extractFirstPartyOmxMcpSections, stripFirstPartyOmxMcpSections, } from "../config/generator.js";
|
|
16
|
+
import { buildMergedConfig, formatTomlStringArray, getRootModelName, getRootTomlArray, hasLegacyOmxTeamRunTable, isOmxManagedNotifyCommand, sanitizePreviousNotifyCommand, stripExistingOmxBlocks, stripExistingSharedMcpRegistryBlock, mergeSharedMcpRegistryBlock, stripOmxEnvSettings, stripOmxFeatureFlags, stripOmxSeededBehavioralDefaults, upsertPluginModeRuntimeFeatureFlags, upsertManagedCodexHookTrustState, stripManagedCodexHookTrustState, OMX_DEVELOPER_INSTRUCTIONS, OMX_PLUGIN_DEVELOPER_INSTRUCTIONS, hasFirstPartyOmxMcpRegistrations, extractFirstPartyOmxMcpSections, stripFirstPartyOmxMcpSections, } from "../config/generator.js";
|
|
17
17
|
import { buildManagedCodexNativeHookWindowsShimContent, buildManagedCodexNativeHookWindowsShimPath, planManagedCodexHooksMerge, planManagedCodexHooksRemoval, classifyManagedCodexNativeHookWindowsShimOwnership, ManagedCodexHooksPlanError, validateCodexHooksConfigStrict, } from "../config/codex-hooks.js";
|
|
18
18
|
import { getLegacyUnifiedMcpRegistryCandidate, getUnifiedMcpRegistryCandidates, loadUnifiedMcpRegistry, planClaudeCodeMcpSettingsSync, } from "../config/mcp-registry.js";
|
|
19
19
|
import { generateAgentToml } from "../agents/native-config.js";
|
|
20
20
|
import { AGENT_DEFINITIONS } from "../agents/definitions.js";
|
|
21
21
|
import { getCatalogAgentStatusByName, getInstallableNativeAgentNames, isNativeAgentInstallableStatus, isSetupPromptAssetName, } from "../agents/policy.js";
|
|
22
22
|
import { getPackageRoot } from "../utils/package.js";
|
|
23
|
-
import { readSessionState,
|
|
23
|
+
import { readSessionState, classifySessionStateLiveness } from "../hooks/session.js";
|
|
24
24
|
import { getCatalogHeadlineCounts } from "./catalog-contract.js";
|
|
25
25
|
import { tryReadCatalogManifest } from "../catalog/reader.js";
|
|
26
26
|
import { DEFAULT_FRONTIER_MODEL } from "../config/models.js";
|
|
@@ -28,7 +28,7 @@ import { teamModeEnabled, } from "../config/team-mode.js";
|
|
|
28
28
|
import { addGeneratedAgentsMarker, hasOmxAgentsContract, hasOmxManagedAgentsSections, isOmxGeneratedAgentsMd, preserveUserOmxPolicyBlocks, upsertManagedAgentsBlock, } from "../utils/agents-md.js";
|
|
29
29
|
import { DEFAULT_HUD_CONFIG } from "../hud/types.js";
|
|
30
30
|
import { SETUP_INSTALL_MODES, SETUP_MCP_MODES, SETUP_SCOPES, getSetupScopeFilePath, readPersistedSetupPreferences, resolvePersistedSetupMergeAgents, writePersistedSetupPreferences, } from "./setup-preferences.js";
|
|
31
|
-
import { OMX_LOCAL_MARKETPLACE_NAME, OMX_PLUGIN_NAME, materializePackagedOmxPluginCache, resolvePackagedOmxMarketplace, upsertLocalOmxMarketplaceRegistration, upsertLocalOmxPluginEnablement, upsertLocalOmxPluginMcpServerEnablement, hasLocalOmxPluginMcpServerRegistrations,
|
|
31
|
+
import { OMX_LOCAL_MARKETPLACE_NAME, OMX_LOCAL_PLUGIN_CONFIG_KEY, OMX_PLUGIN_NAME, discoverOmxPluginCacheDirs, materializePackagedOmxPluginCache, resolvePackagedOmxMarketplace, upsertLocalOmxMarketplaceRegistration, upsertLocalOmxPluginEnablement, upsertLocalOmxPluginMcpServerEnablement, hasLocalOmxPluginMcpServerRegistrations, } from "./plugin-marketplace.js";
|
|
32
32
|
import { resolveCodexHookFeatureSupportForCli } from "./codex-feature-probe.js";
|
|
33
33
|
async function resolveStatusLinePresetForSetup(projectRoot, options) {
|
|
34
34
|
if (options.force) {
|
|
@@ -54,6 +54,8 @@ export { SETUP_INSTALL_MODES, SETUP_MCP_MODES, SETUP_SCOPES };
|
|
|
54
54
|
export { SETUP_TEAM_MODES } from "../config/team-mode.js";
|
|
55
55
|
const PROJECT_GITIGNORE_ENTRIES = [
|
|
56
56
|
".omx/",
|
|
57
|
+
".omx-state-locks/",
|
|
58
|
+
".omx-state-locks.identity.json",
|
|
57
59
|
".codex/*",
|
|
58
60
|
"!.codex/agents/",
|
|
59
61
|
"!.codex/agents/**",
|
|
@@ -67,7 +69,6 @@ const LEGACY_PROJECT_GITIGNORE_ENTRIES = [".codex/"];
|
|
|
67
69
|
const SETUP_ONLY_INSTALLABLE_SKILLS = new Set(["wiki"]);
|
|
68
70
|
const DEFAULT_SETUP_MCP_MODE = "none";
|
|
69
71
|
const SKIP_NATIVE_AGENT_REFRESH_ENV = "OMX_SKIP_NATIVE_AGENT_REFRESH";
|
|
70
|
-
const HARD_DEPRECATED_SKILL_NAMES = new Set(["web-clone"]);
|
|
71
72
|
const TEAM_MODE_SKILL_NAMES = new Set(["team", "worker"]);
|
|
72
73
|
const TEAM_MODE_PROMPT_NAMES = new Set(["team-executor"]);
|
|
73
74
|
const TEAM_MODE_NATIVE_AGENT_NAMES = new Set(["team-executor"]);
|
|
@@ -1337,9 +1338,134 @@ export async function validateSkillFile(skillMdPath) {
|
|
|
1337
1338
|
const content = await readFile(skillMdPath, "utf-8");
|
|
1338
1339
|
parseSkillFrontmatter(content, skillMdPath);
|
|
1339
1340
|
}
|
|
1341
|
+
const INSTALLED_SKILL_BADGE_PREFIX = "[OMX] ";
|
|
1342
|
+
function installedSkillReceiptPath(scope, projectRoot) {
|
|
1343
|
+
const authorityRoot = scope === "project" ? projectRoot : homedir();
|
|
1344
|
+
return join(authorityRoot, ".omx", "state", "setup", "installed-skills.json");
|
|
1345
|
+
}
|
|
1346
|
+
async function readInstalledSkillReceipt(receiptPath) {
|
|
1347
|
+
try {
|
|
1348
|
+
const parsed = JSON.parse(await readFile(receiptPath, "utf-8"));
|
|
1349
|
+
if (parsed?.version === 1 && parsed.skills && typeof parsed.skills === "object") {
|
|
1350
|
+
// Re-key through a prototype-less record so a `__proto__` entry in a persisted receipt is a
|
|
1351
|
+
// real own property on both sides of the comparison.
|
|
1352
|
+
const skills = Object.create(null);
|
|
1353
|
+
for (const [name, entry] of Object.entries(parsed.skills)) {
|
|
1354
|
+
const files = Object.create(null);
|
|
1355
|
+
for (const [file, digest] of Object.entries(entry?.files ?? {}))
|
|
1356
|
+
files[file] = String(digest);
|
|
1357
|
+
skills[name] = { files };
|
|
1358
|
+
}
|
|
1359
|
+
return { version: 1, skills };
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
catch {
|
|
1363
|
+
// A missing or unreadable receipt means "no proof of ownership", which retains conservatively.
|
|
1364
|
+
}
|
|
1365
|
+
return { version: 1, skills: Object.create(null) };
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Digest the CURRENT contents of a skill directory, used to compare against a receipt.
|
|
1369
|
+
*
|
|
1370
|
+
* Non-regular entries (symlinks, sockets) are recorded as a sentinel rather than skipped, so a
|
|
1371
|
+
* directory containing one can never compare equal to a receipt of regular files and is therefore
|
|
1372
|
+
* retained instead of deleted.
|
|
1373
|
+
*/
|
|
1374
|
+
async function digestSkillDirectory(skillDir) {
|
|
1375
|
+
// Prototype-less: a file literally named `__proto__` assigned into a normal object literal is not an
|
|
1376
|
+
// own enumerable property, so it would vanish from Object.keys() and let a user entry be deleted
|
|
1377
|
+
// while the comparison still reported equality.
|
|
1378
|
+
const files = Object.create(null);
|
|
1379
|
+
const walk = async (dir, prefix) => {
|
|
1380
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
1381
|
+
const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
1382
|
+
const full = join(dir, entry.name);
|
|
1383
|
+
if (entry.isDirectory()) {
|
|
1384
|
+
await walk(full, relPath);
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
if (!entry.isFile()) {
|
|
1388
|
+
files[relPath] = "non-regular-entry";
|
|
1389
|
+
continue;
|
|
1390
|
+
}
|
|
1391
|
+
files[relPath] = createHash("sha256").update(await readFile(full)).digest("hex");
|
|
1392
|
+
}
|
|
1393
|
+
};
|
|
1394
|
+
await walk(skillDir, "");
|
|
1395
|
+
return files;
|
|
1396
|
+
}
|
|
1397
|
+
/** True only when every current file matches the digest OMX recorded at install time. */
|
|
1398
|
+
async function isUnmodifiedRecordedInstall(receiptPath, skillName, skillDir) {
|
|
1399
|
+
const receipt = await readInstalledSkillReceipt(receiptPath);
|
|
1400
|
+
const recorded = receipt.skills[skillName]?.files;
|
|
1401
|
+
if (!recorded || Object.keys(recorded).length === 0)
|
|
1402
|
+
return false;
|
|
1403
|
+
let current;
|
|
1404
|
+
try {
|
|
1405
|
+
current = await digestSkillDirectory(skillDir);
|
|
1406
|
+
}
|
|
1407
|
+
catch {
|
|
1408
|
+
return false;
|
|
1409
|
+
}
|
|
1410
|
+
const recordedNames = Object.keys(recorded).sort();
|
|
1411
|
+
const currentNames = Object.keys(current).sort();
|
|
1412
|
+
if (recordedNames.length !== currentNames.length)
|
|
1413
|
+
return false;
|
|
1414
|
+
return recordedNames.every((name, index) => currentNames[index] === name && current[name] === recorded[name]);
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Record digests for EXACTLY the files OMX wrote, keyed by skill.
|
|
1418
|
+
*
|
|
1419
|
+
* Digesting the destination tree instead would poison the receipt: a note a user drops into an active
|
|
1420
|
+
* skill directory would be recorded as OMX-owned and then deleted when that skill is later retired.
|
|
1421
|
+
* The receipt therefore describes the installer's own output, and any extra entry present at
|
|
1422
|
+
* retirement time makes the comparison fail, which retains the directory.
|
|
1423
|
+
*/
|
|
1424
|
+
async function writeInstalledSkillReceipt(receiptPath, skillsDir, writtenFilesBySkill, options) {
|
|
1425
|
+
if (options.dryRun)
|
|
1426
|
+
return;
|
|
1427
|
+
const receipt = await readInstalledSkillReceipt(receiptPath);
|
|
1428
|
+
for (const [name, relativePaths] of writtenFilesBySkill) {
|
|
1429
|
+
const files = Object.create(null);
|
|
1430
|
+
let complete = true;
|
|
1431
|
+
for (const relPath of relativePaths) {
|
|
1432
|
+
const full = join(skillsDir, name, relPath);
|
|
1433
|
+
try {
|
|
1434
|
+
files[relPath] = createHash("sha256").update(await readFile(full)).digest("hex");
|
|
1435
|
+
}
|
|
1436
|
+
catch {
|
|
1437
|
+
complete = false;
|
|
1438
|
+
break;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
if (complete && Object.keys(files).length > 0)
|
|
1442
|
+
receipt.skills[name] = { files };
|
|
1443
|
+
else
|
|
1444
|
+
delete receipt.skills[name];
|
|
1445
|
+
}
|
|
1446
|
+
try {
|
|
1447
|
+
await mkdir(dirname(receiptPath), { recursive: true });
|
|
1448
|
+
await writeFile(receiptPath, `${JSON.stringify(receipt, null, 2)}\n`);
|
|
1449
|
+
}
|
|
1450
|
+
catch {
|
|
1451
|
+
// A receipt we cannot persist simply means the next refresh retains conservatively.
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
async function isOmxManagedInstalledSkillDir(skillDir) {
|
|
1455
|
+
const skillMdPath = join(skillDir, "SKILL.md");
|
|
1456
|
+
if (!existsSync(skillMdPath))
|
|
1457
|
+
return false;
|
|
1458
|
+
try {
|
|
1459
|
+
const metadata = parseSkillFrontmatter(await readFile(skillMdPath, "utf-8"), skillMdPath);
|
|
1460
|
+
return metadata.description.startsWith(INSTALLED_SKILL_BADGE_PREFIX);
|
|
1461
|
+
}
|
|
1462
|
+
catch {
|
|
1463
|
+
return false;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1340
1466
|
function rewriteInstalledSkillDescriptionBadge(content, filePath = "SKILL.md") {
|
|
1341
1467
|
const metadata = parseSkillFrontmatter(content, filePath);
|
|
1342
|
-
const badgePrefix =
|
|
1468
|
+
const badgePrefix = INSTALLED_SKILL_BADGE_PREFIX;
|
|
1343
1469
|
const displayDescription = metadata.description.startsWith(badgePrefix)
|
|
1344
1470
|
? metadata.description
|
|
1345
1471
|
: `${badgePrefix}${metadata.description}`;
|
|
@@ -1724,155 +1850,8 @@ async function resolveSetupScope(projectRoot, requestedScope, persistedReviewDec
|
|
|
1724
1850
|
}
|
|
1725
1851
|
return { scope: DEFAULT_SETUP_SCOPE, source: "default" };
|
|
1726
1852
|
}
|
|
1727
|
-
async function
|
|
1728
|
-
|
|
1729
|
-
const parsed = JSON.parse(await readFile(manifestPath, "utf-8"));
|
|
1730
|
-
return typeof parsed === "object" &&
|
|
1731
|
-
parsed !== null &&
|
|
1732
|
-
"name" in parsed &&
|
|
1733
|
-
typeof parsed.name === "string"
|
|
1734
|
-
? parsed.name
|
|
1735
|
-
: null;
|
|
1736
|
-
}
|
|
1737
|
-
catch {
|
|
1738
|
-
return null;
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
async function readPluginManifestSummary(manifestPath) {
|
|
1742
|
-
try {
|
|
1743
|
-
const parsed = JSON.parse(await readFile(manifestPath, "utf-8"));
|
|
1744
|
-
if (typeof parsed !== "object" || parsed === null)
|
|
1745
|
-
return null;
|
|
1746
|
-
const manifest = parsed;
|
|
1747
|
-
return {
|
|
1748
|
-
name: typeof manifest.name === "string" ? manifest.name : null,
|
|
1749
|
-
version: typeof manifest.version === "string" ? manifest.version : null,
|
|
1750
|
-
skills: typeof manifest.skills === "string" ? manifest.skills : null,
|
|
1751
|
-
hooks: typeof manifest.hooks === "string" ? manifest.hooks : null,
|
|
1752
|
-
};
|
|
1753
|
-
}
|
|
1754
|
-
catch {
|
|
1755
|
-
return null;
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
|
-
async function listChildDirectoryNames(dir) {
|
|
1759
|
-
try {
|
|
1760
|
-
const entries = await readdir(dir, { withFileTypes: true });
|
|
1761
|
-
return entries
|
|
1762
|
-
.filter((entry) => entry.isDirectory())
|
|
1763
|
-
.map((entry) => entry.name)
|
|
1764
|
-
.sort();
|
|
1765
|
-
}
|
|
1766
|
-
catch {
|
|
1767
|
-
return null;
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
async function discoverOmxPluginCacheDirs(cacheRoot = join(codexHome(), "plugins", "cache")) {
|
|
1771
|
-
if (!existsSync(cacheRoot))
|
|
1772
|
-
return [];
|
|
1773
|
-
const queue = [
|
|
1774
|
-
{ path: cacheRoot, depth: 0 },
|
|
1775
|
-
];
|
|
1776
|
-
const maxDepth = 5;
|
|
1777
|
-
const matches = [];
|
|
1778
|
-
while (queue.length > 0) {
|
|
1779
|
-
const current = queue.shift();
|
|
1780
|
-
if (!current)
|
|
1781
|
-
break;
|
|
1782
|
-
const manifestPath = join(current.path, ".codex-plugin", "plugin.json");
|
|
1783
|
-
if (existsSync(manifestPath)) {
|
|
1784
|
-
const name = await readPluginManifestName(manifestPath);
|
|
1785
|
-
if (name === "oh-my-codex") {
|
|
1786
|
-
matches.push(current.path);
|
|
1787
|
-
continue;
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
if (current.depth >= maxDepth)
|
|
1791
|
-
continue;
|
|
1792
|
-
let entries;
|
|
1793
|
-
try {
|
|
1794
|
-
entries = await readdir(current.path, { withFileTypes: true });
|
|
1795
|
-
}
|
|
1796
|
-
catch {
|
|
1797
|
-
continue;
|
|
1798
|
-
}
|
|
1799
|
-
for (const entry of entries) {
|
|
1800
|
-
if (!entry.isDirectory())
|
|
1801
|
-
continue;
|
|
1802
|
-
if (entry.name === ".git" || entry.name === "node_modules")
|
|
1803
|
-
continue;
|
|
1804
|
-
queue.push({
|
|
1805
|
-
path: join(current.path, entry.name),
|
|
1806
|
-
depth: current.depth + 1,
|
|
1807
|
-
});
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
return matches.sort();
|
|
1811
|
-
}
|
|
1812
|
-
async function discoverOmxPluginCacheDir(cacheRoot = join(codexHome(), "plugins", "cache")) {
|
|
1813
|
-
return (await discoverOmxPluginCacheDirs(cacheRoot))[0] ?? null;
|
|
1814
|
-
}
|
|
1815
|
-
async function refreshOmxPluginDiscoveryCache(pkgRoot, options, codexHomeDir = codexHome()) {
|
|
1816
|
-
const packagedMarketplace = await resolvePackagedOmxMarketplace(pkgRoot);
|
|
1817
|
-
if (!packagedMarketplace) {
|
|
1818
|
-
return { status: "unavailable", staleDirs: [] };
|
|
1819
|
-
}
|
|
1820
|
-
const [pkg, expectedSkillNames, cachedDirs] = await Promise.all([
|
|
1821
|
-
readFile(join(pkgRoot, "package.json"), "utf-8").then((raw) => JSON.parse(raw)),
|
|
1822
|
-
listChildDirectoryNames(join(packagedMarketplace.pluginRoot, "skills")),
|
|
1823
|
-
discoverOmxPluginCacheDirs(join(codexHomeDir, "plugins", "cache")),
|
|
1824
|
-
]);
|
|
1825
|
-
const expectedVersion = typeof pkg.version === "string" ? pkg.version : null;
|
|
1826
|
-
const staleDirs = [];
|
|
1827
|
-
for (const cacheDir of cachedDirs) {
|
|
1828
|
-
const manifest = await readPluginManifestSummary(join(cacheDir, ".codex-plugin", "plugin.json"));
|
|
1829
|
-
if (manifest?.name !== "oh-my-codex")
|
|
1830
|
-
continue;
|
|
1831
|
-
const cachedSkillNames = await listChildDirectoryNames(join(cacheDir, "skills"));
|
|
1832
|
-
const versionChanged = expectedVersion !== null && manifest.version !== expectedVersion;
|
|
1833
|
-
const skillsPointerChanged = manifest.skills !== "./skills/";
|
|
1834
|
-
const hooksPointerChanged = manifest.hooks !== "./hooks/hooks.json";
|
|
1835
|
-
const hookFilesMissing = !existsSync(join(cacheDir, "hooks", "hooks.json"))
|
|
1836
|
-
|| !existsSync(join(cacheDir, "hooks", "codex-native-hook.mjs"))
|
|
1837
|
-
|| !existsSync(join(cacheDir, "hooks", "omx-command.json"));
|
|
1838
|
-
const hookFilesChanged = !hookFilesMissing
|
|
1839
|
-
&& !(await pluginHookCacheMatchesPackaged(cacheDir, packagedMarketplace));
|
|
1840
|
-
const skillListChanged = expectedSkillNames !== null &&
|
|
1841
|
-
cachedSkillNames !== null &&
|
|
1842
|
-
JSON.stringify(cachedSkillNames) !== JSON.stringify(expectedSkillNames);
|
|
1843
|
-
if (!versionChanged &&
|
|
1844
|
-
!skillsPointerChanged &&
|
|
1845
|
-
!hooksPointerChanged &&
|
|
1846
|
-
!hookFilesMissing &&
|
|
1847
|
-
!hookFilesChanged &&
|
|
1848
|
-
!skillListChanged)
|
|
1849
|
-
continue;
|
|
1850
|
-
staleDirs.push(cacheDir);
|
|
1851
|
-
if (!options.dryRun) {
|
|
1852
|
-
await rm(cacheDir, { recursive: true, force: true });
|
|
1853
|
-
}
|
|
1854
|
-
if (options.verbose) {
|
|
1855
|
-
const reasons = [
|
|
1856
|
-
versionChanged
|
|
1857
|
-
? `version ${manifest.version ?? "unknown"} -> ${expectedVersion}`
|
|
1858
|
-
: null,
|
|
1859
|
-
skillsPointerChanged
|
|
1860
|
-
? `skills pointer ${manifest.skills ?? "missing"} -> ./skills/`
|
|
1861
|
-
: null,
|
|
1862
|
-
hooksPointerChanged
|
|
1863
|
-
? `hooks pointer ${manifest.hooks ?? "missing"} -> ./hooks/hooks.json`
|
|
1864
|
-
: null,
|
|
1865
|
-
hookFilesMissing ? "plugin hook files missing" : null,
|
|
1866
|
-
hookFilesChanged ? "plugin hook files changed" : null,
|
|
1867
|
-
skillListChanged ? "skill directory list changed" : null,
|
|
1868
|
-
].filter(Boolean);
|
|
1869
|
-
console.log(` ${options.dryRun ? "would invalidate" : "invalidated"} Codex plugin discovery cache ${cacheDir} (${reasons.join(", ")})`);
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
return {
|
|
1873
|
-
status: staleDirs.length > 0 ? "refreshed" : "unchanged",
|
|
1874
|
-
staleDirs,
|
|
1875
|
-
};
|
|
1853
|
+
async function discoverOmxPluginCacheDir(codexHomeDir = codexHome()) {
|
|
1854
|
+
return (await discoverOmxPluginCacheDirs(codexHomeDir))[0] ?? null;
|
|
1876
1855
|
}
|
|
1877
1856
|
function resolveSetupMcpMode(scope, requestedMcpMode, persistedReviewDecision, persistedPreferences) {
|
|
1878
1857
|
if (requestedMcpMode) {
|
|
@@ -2234,6 +2213,122 @@ function buildPluginModeLegacyConfig(original, options) {
|
|
|
2234
2213
|
config = config.trim();
|
|
2235
2214
|
return config.length > 0 ? `${config}\n` : "";
|
|
2236
2215
|
}
|
|
2216
|
+
function stripLocalOmxPluginEnablementForDisable(config) {
|
|
2217
|
+
const lines = config.split(/\r?\n/);
|
|
2218
|
+
const header = '[plugins."oh-my-codex@oh-my-codex-local"]';
|
|
2219
|
+
const start = lines.findIndex((line) => line.trim() === header);
|
|
2220
|
+
if (start >= 0) {
|
|
2221
|
+
let end = lines.length;
|
|
2222
|
+
for (let index = start + 1; index < lines.length; index += 1) {
|
|
2223
|
+
if (/^\s*\[/.test(lines[index])) {
|
|
2224
|
+
end = index;
|
|
2225
|
+
break;
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
for (let index = end - 1; index > start; index -= 1) {
|
|
2229
|
+
if (/^\s*enabled\s*=\s*true\s*(?:#.*)?$/.test(lines[index])) {
|
|
2230
|
+
lines[index] = lines[index].replace("true", "false");
|
|
2231
|
+
break;
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
const pluginsStart = lines.findIndex((line) => /^\s*\[plugins\]\s*$/.test(line));
|
|
2236
|
+
if (pluginsStart >= 0) {
|
|
2237
|
+
for (let index = pluginsStart + 1; index < lines.length && !/^\s*\[/.test(lines[index]); index += 1) {
|
|
2238
|
+
if (/^\s*"oh-my-codex@oh-my-codex-local"\s*=\s*true\s*(?:#.*)?$/.test(lines[index])) {
|
|
2239
|
+
lines[index] = lines[index].replace("true", "false");
|
|
2240
|
+
break;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
return lines.join("\n").replace(/\n{3,}/g, "\n\n");
|
|
2245
|
+
}
|
|
2246
|
+
function stripHookFeatureFlagsForDisable(config, preserveNativeHooks) {
|
|
2247
|
+
const lines = config.split(/\r?\n/);
|
|
2248
|
+
const featuresStart = lines.findIndex((line) => /^\s*\[features\]\s*$/.test(line));
|
|
2249
|
+
if (featuresStart < 0)
|
|
2250
|
+
return config;
|
|
2251
|
+
let sectionEnd = lines.length;
|
|
2252
|
+
for (let index = featuresStart + 1; index < lines.length; index += 1) {
|
|
2253
|
+
if (/^\s*\[\[?[^\]]+\]?\]\s*$/.test(lines[index])) {
|
|
2254
|
+
sectionEnd = index;
|
|
2255
|
+
break;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
const removable = new Set(preserveNativeHooks
|
|
2259
|
+
? ["plugin_hooks"]
|
|
2260
|
+
: ["hooks", "codex_hooks", "plugin_hooks"]);
|
|
2261
|
+
for (let index = sectionEnd - 1; index > featuresStart; index -= 1) {
|
|
2262
|
+
const match = /^\s*([A-Za-z0-9_-]+)\s*=\s*true\s*(?:#.*)?$/.exec(lines[index]);
|
|
2263
|
+
if (match && removable.has(match[1]))
|
|
2264
|
+
lines[index] = lines[index].replace("true", "false");
|
|
2265
|
+
}
|
|
2266
|
+
const nextFeaturesStart = lines.findIndex((line) => /^\s*\[features\]\s*$/.test(line));
|
|
2267
|
+
if (nextFeaturesStart >= 0) {
|
|
2268
|
+
let nextSectionEnd = lines.length;
|
|
2269
|
+
for (let index = nextFeaturesStart + 1; index < lines.length; index += 1) {
|
|
2270
|
+
if (/^\s*\[\[?[^\]]+\]?\]\s*$/.test(lines[index])) {
|
|
2271
|
+
nextSectionEnd = index;
|
|
2272
|
+
break;
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
if (lines.slice(nextFeaturesStart + 1, nextSectionEnd).every((line) => line.trim() === "")) {
|
|
2276
|
+
lines.splice(nextFeaturesStart, nextSectionEnd - nextFeaturesStart);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
return lines.join("\n");
|
|
2280
|
+
}
|
|
2281
|
+
function parseDisableHooksNotifyMetadata(snapshot, metadataPath, currentNotify) {
|
|
2282
|
+
if (!snapshot.bytes) {
|
|
2283
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} is missing.`);
|
|
2284
|
+
}
|
|
2285
|
+
let parsed;
|
|
2286
|
+
try {
|
|
2287
|
+
parsed = JSON.parse(decodeNativeHookTransactionUtf8(snapshot.bytes, `notification metadata ${metadataPath}`));
|
|
2288
|
+
}
|
|
2289
|
+
catch (error) {
|
|
2290
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} is invalid JSON (${error instanceof Error ? error.message : String(error)}).`);
|
|
2291
|
+
}
|
|
2292
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
2293
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} must be an object.`);
|
|
2294
|
+
}
|
|
2295
|
+
const metadata = parsed;
|
|
2296
|
+
const dispatcherNotify = metadata.dispatcherNotify;
|
|
2297
|
+
if (metadata.managedBy !== "oh-my-codex" || metadata.version !== 1 ||
|
|
2298
|
+
!Array.isArray(dispatcherNotify) ||
|
|
2299
|
+
dispatcherNotify.length !== currentNotify.length ||
|
|
2300
|
+
dispatcherNotify.some((part, index) => part !== currentNotify[index])) {
|
|
2301
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} does not prove OMX ownership.`);
|
|
2302
|
+
}
|
|
2303
|
+
const previousNotify = metadata.previousNotify;
|
|
2304
|
+
if (previousNotify !== null && (!Array.isArray(previousNotify) || !previousNotify.every((part) => typeof part === "string"))) {
|
|
2305
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} has invalid previousNotify.`);
|
|
2306
|
+
}
|
|
2307
|
+
return sanitizePreviousNotifyCommand(previousNotify, getPackageRoot());
|
|
2308
|
+
}
|
|
2309
|
+
async function planDisableHooksConfig(existingConfig, pkgRoot, managedHooksPlan, codexHomeDir, notifyMetadataSnapshot) {
|
|
2310
|
+
const priorManagedHookTrustState = managedHooksPlan?.priorTrustState ?? {};
|
|
2311
|
+
let finalConfig = stripManagedCodexHookTrustState(existingConfig, {
|
|
2312
|
+
priorManagedHookTrustState,
|
|
2313
|
+
managedTrustState: {},
|
|
2314
|
+
});
|
|
2315
|
+
finalConfig = stripHookFeatureFlagsForDisable(finalConfig, managedHooksPlan?.hasForeignHooks === true);
|
|
2316
|
+
finalConfig = stripLocalOmxPluginEnablementForDisable(finalConfig);
|
|
2317
|
+
const notify = getRootTomlArray(finalConfig, "notify");
|
|
2318
|
+
if (!notify || !isOmxManagedNotifyCommand(notify, pkgRoot)) {
|
|
2319
|
+
return { finalConfig, metadataAfter: null };
|
|
2320
|
+
}
|
|
2321
|
+
const metadataPath = getNotifyMetadataPath(codexHomeDir);
|
|
2322
|
+
if (isOmxDispatcherNotifyCommand(notify, pkgRoot)) {
|
|
2323
|
+
const previousNotify = parseDisableHooksNotifyMetadata(notifyMetadataSnapshot ?? { bytes: null, topology: { kind: "absent" } }, metadataPath, notify);
|
|
2324
|
+
finalConfig = removeRootTomlKey(finalConfig, "notify");
|
|
2325
|
+
if (previousNotify) {
|
|
2326
|
+
finalConfig = insertRootTomlKey(finalConfig, `notify = ${formatTomlStringArray(previousNotify)}`);
|
|
2327
|
+
}
|
|
2328
|
+
return { finalConfig, metadataPath, metadataAfter: null };
|
|
2329
|
+
}
|
|
2330
|
+
return { finalConfig: removeRootTomlKey(finalConfig, "notify"), metadataAfter: null };
|
|
2331
|
+
}
|
|
2237
2332
|
async function planNativeHookSetupTransaction(options) {
|
|
2238
2333
|
const existingConfigSnapshot = options.configSnapshot;
|
|
2239
2334
|
const existingHooksSnapshot = await captureNativeHookTransactionArtifact(options.hooksPath, `native hooks ${options.hooksPath}`);
|
|
@@ -2254,7 +2349,29 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2254
2349
|
let notifyMetadataPrecondition = null;
|
|
2255
2350
|
let modelUpgrade;
|
|
2256
2351
|
let repairedLegacyTeamRunTable = false;
|
|
2257
|
-
if (options.
|
|
2352
|
+
if (options.disableHooks) {
|
|
2353
|
+
let managedHooksPlan = null;
|
|
2354
|
+
if (existingHooksContent !== null) {
|
|
2355
|
+
const removal = planManagedCodexHooksRemoval(existingHooksContent, options.hooksPath, {
|
|
2356
|
+
platform: options.platform,
|
|
2357
|
+
codexHomeDir: options.codexHomeDir,
|
|
2358
|
+
});
|
|
2359
|
+
if (!removal.ok)
|
|
2360
|
+
throw removal.error;
|
|
2361
|
+
managedHooksPlan = removal;
|
|
2362
|
+
finalHooksContent = removal.finalContent;
|
|
2363
|
+
hooksRemovedCount = removal.removedCount;
|
|
2364
|
+
diagnostics = removal.diagnostics;
|
|
2365
|
+
}
|
|
2366
|
+
const notifyPlan = await planDisableHooksConfig(existingConfig, options.pkgRoot, managedHooksPlan, options.codexHomeDir, options.notifyMetadataSnapshot);
|
|
2367
|
+
finalConfig = notifyPlan.finalConfig;
|
|
2368
|
+
if (notifyPlan.metadataPath) {
|
|
2369
|
+
const metadataBefore = options.notifyMetadataSnapshot ?? { bytes: null, topology: { kind: "absent" } };
|
|
2370
|
+
notifyMetadataPrecondition = nativeHookTransactionPrecondition("metadata", notifyPlan.metadataPath, `notification metadata ${notifyPlan.metadataPath}`, metadataBefore);
|
|
2371
|
+
notifyMetadataArtifact = nativeHookTransactionArtifact("metadata", notifyPlan.metadataPath, `notification metadata ${notifyPlan.metadataPath}`, metadataBefore, notifyPlan.metadataAfter);
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
if (!options.disableHooks && options.isPluginInstallMode) {
|
|
2258
2375
|
const pluginPlan = buildPluginModeHooksConfigPlan(existingConfig, existingHooksContent, options.pkgRoot, options.hooksPath, options.codexHomeDir, {
|
|
2259
2376
|
codexHookFeatureFlag: options.codexHookFeatureFlag,
|
|
2260
2377
|
pluginScopedHooks: options.pluginScopedHooks,
|
|
@@ -2280,7 +2397,7 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2280
2397
|
finalConfig = developerInstructionsPlan.finalConfig;
|
|
2281
2398
|
pluginDeveloperInstructionsResult = developerInstructionsPlan.result;
|
|
2282
2399
|
}
|
|
2283
|
-
else {
|
|
2400
|
+
else if (!options.disableHooks) {
|
|
2284
2401
|
const managedHooksPlan = planManagedCodexHooksMerge(existingHooksContent, options.pkgRoot, options.hooksPath, {
|
|
2285
2402
|
platform: options.platform,
|
|
2286
2403
|
codexHomeDir: options.codexHomeDir,
|
|
@@ -2331,7 +2448,7 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2331
2448
|
}
|
|
2332
2449
|
}
|
|
2333
2450
|
}
|
|
2334
|
-
if (options.isPluginInstallMode && options.sharedMcpRegistry.servers.length > 0) {
|
|
2451
|
+
if (!options.disableHooks && options.isPluginInstallMode && options.sharedMcpRegistry.servers.length > 0) {
|
|
2335
2452
|
finalConfig = mergeSharedMcpRegistryBlock(finalConfig, options.sharedMcpRegistry.servers, options.sharedMcpRegistry.sourcePath);
|
|
2336
2453
|
}
|
|
2337
2454
|
try {
|
|
@@ -2350,8 +2467,9 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2350
2467
|
const shimAfter = Buffer.from(buildManagedCodexNativeHookWindowsShimContent(options.pkgRoot), "utf-8");
|
|
2351
2468
|
assertWindowsNativeHookShimOwnership(shimPath, shimSnapshot.bytes, shimAfter);
|
|
2352
2469
|
const shimReference = decideWindowsNativeHookShimReference(finalHooksContent, shimPath);
|
|
2353
|
-
|
|
2354
|
-
|
|
2470
|
+
const shouldDeleteShim = shimReference === "not_referenced" &&
|
|
2471
|
+
(options.disableHooks || (options.isPluginInstallMode && options.pluginScopedHooks));
|
|
2472
|
+
shimArtifact = nativeHookTransactionArtifact("shim", shimPath, `native hook Windows shim ${shimPath}`, shimSnapshot, shouldDeleteShim
|
|
2355
2473
|
? null
|
|
2356
2474
|
: shimAfter);
|
|
2357
2475
|
shimPrecondition = nativeHookTransactionPrecondition("shim", shimPath, `native hook Windows shim ${shimPath}`, shimSnapshot);
|
|
@@ -2394,7 +2512,7 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2394
2512
|
};
|
|
2395
2513
|
}
|
|
2396
2514
|
export async function setup(options = {}) {
|
|
2397
|
-
const { force = false, dryRun = false, installMode: requestedInstallMode, mcpMode: requestedMcpMode, teamMode: requestedTeamMode, scope: requestedScope, verbose = false, skipNativeAgentRefresh: requestedSkipNativeAgentRefresh = false, setupScopePrompt, persistedSetupReviewPrompt, installModePrompt, modelUpgradePrompt, pluginAgentsMdPrompt, pluginDeveloperInstructionsPrompt, firstPartyMcpRemovalPrompt, } = options;
|
|
2515
|
+
const { disableHooks = false, force = false, dryRun = false, installMode: requestedInstallMode, mcpMode: requestedMcpMode, teamMode: requestedTeamMode, scope: requestedScope, verbose = false, skipNativeAgentRefresh: requestedSkipNativeAgentRefresh = false, setupScopePrompt, persistedSetupReviewPrompt, installModePrompt, modelUpgradePrompt, pluginAgentsMdPrompt, pluginDeveloperInstructionsPrompt, firstPartyMcpRemovalPrompt, } = options;
|
|
2398
2516
|
const pkgRoot = getPackageRoot();
|
|
2399
2517
|
const projectRoot = process.cwd();
|
|
2400
2518
|
const persistedPreferences = await readPersistedSetupPreferences(projectRoot, { warnOnLegacyScope: true });
|
|
@@ -2481,6 +2599,9 @@ export async function setup(options = {}) {
|
|
|
2481
2599
|
const notifyMetadataSnapshot = configRequiresNotificationMetadataSnapshot(existingConfigForMcpMigration, pkgRoot, resolvedScope.scope)
|
|
2482
2600
|
? await captureNativeHookTransactionArtifact(getNotifyMetadataPath(scopeDirs.codexHomeDir), `notification metadata ${getNotifyMetadataPath(scopeDirs.codexHomeDir)}`)
|
|
2483
2601
|
: undefined;
|
|
2602
|
+
if (disableHooks && !notifyMetadataSnapshot && isOmxDispatcherNotifyCommand(getRootTomlArray(existingConfigForMcpMigration, "notify"), pkgRoot)) {
|
|
2603
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to disable OMX hooks: managed notification metadata is unavailable for ${getNotifyMetadataPath(scopeDirs.codexHomeDir)}.`);
|
|
2604
|
+
}
|
|
2484
2605
|
const firstPartyMcpRegistrationKinds = [
|
|
2485
2606
|
hasFirstPartyOmxMcpRegistrations(existingConfigForMcpMigration)
|
|
2486
2607
|
? "config.toml [mcp_servers.omx_*]"
|
|
@@ -2503,6 +2624,7 @@ export async function setup(options = {}) {
|
|
|
2503
2624
|
}
|
|
2504
2625
|
const scopeSourceMessage = resolvedScope.source === "persisted" ? " (from .omx/setup-scope.json)" : "";
|
|
2505
2626
|
const backupContext = getBackupContext(resolvedScope.scope, projectRoot);
|
|
2627
|
+
const skillReceiptPath = installedSkillReceiptPath(resolvedScope.scope, projectRoot);
|
|
2506
2628
|
const isPluginInstallMode = resolvedInstallMode?.installMode === "plugin";
|
|
2507
2629
|
const pluginAgentsMdDst = resolvedScope.scope === "project"
|
|
2508
2630
|
? join(projectRoot, "AGENTS.md")
|
|
@@ -2576,6 +2698,7 @@ export async function setup(options = {}) {
|
|
|
2576
2698
|
forceStatusLinePreset: force,
|
|
2577
2699
|
configSnapshot: existingConfigForMcpMigrationSnapshot,
|
|
2578
2700
|
notifyMetadataSnapshot,
|
|
2701
|
+
disableHooks,
|
|
2579
2702
|
});
|
|
2580
2703
|
const summary = createEmptyRunSummary();
|
|
2581
2704
|
for (const precondition of nativeHookSetupTransaction.preconditions) {
|
|
@@ -2583,6 +2706,14 @@ export async function setup(options = {}) {
|
|
|
2583
2706
|
await assertNativeHookTransactionPrecondition(precondition);
|
|
2584
2707
|
}
|
|
2585
2708
|
await assertNativeHookTransactionAncestorPrecondition(nativeHookTransactionAncestorPrecondition);
|
|
2709
|
+
if (disableHooks) {
|
|
2710
|
+
const disableSummary = createEmptyRunSummary();
|
|
2711
|
+
const durabilityTracker = { degraded: false };
|
|
2712
|
+
await commitNativeHookTransaction(nativeHookSetupTransaction.artifacts, nativeHookSetupTransaction.preconditions, nativeHookTransactionAncestorPrecondition, backupContext, durabilityTracker, disableSummary.config, { dryRun, verbose });
|
|
2713
|
+
emitDegradedDurabilityWarning("native-hook setup", durabilityTracker);
|
|
2714
|
+
console.log(`${dryRun ? "Would disable" : "Disabled"} OMX hook registrations; non-OMX hooks and .omx artifacts were preserved.`);
|
|
2715
|
+
return;
|
|
2716
|
+
}
|
|
2586
2717
|
console.log("oh-my-codex setup");
|
|
2587
2718
|
console.log("=================\n");
|
|
2588
2719
|
console.log(`Using setup scope: ${resolvedScope.scope}${scopeSourceMessage}\n`);
|
|
@@ -2696,7 +2827,7 @@ export async function setup(options = {}) {
|
|
|
2696
2827
|
const skillsDst = scopeDirs.skillsDir;
|
|
2697
2828
|
if (isPluginInstallMode) {
|
|
2698
2829
|
summary.skills = createEmptyCategorySummary();
|
|
2699
|
-
const cleanup = await cleanupLegacyManagedSkills(skillsSrc, skillsDst, backupContext, { dryRun, verbose });
|
|
2830
|
+
const cleanup = await cleanupLegacyManagedSkills(skillsSrc, skillsDst, backupContext, { dryRun, verbose, skillReceiptPath });
|
|
2700
2831
|
summary.skills.backedUp += cleanup.backedUp;
|
|
2701
2832
|
summary.skills.removed += cleanup.removedSkillNames.length;
|
|
2702
2833
|
summary.skills.skipped += cleanup.skippedSkillNames.length;
|
|
@@ -2715,6 +2846,7 @@ export async function setup(options = {}) {
|
|
|
2715
2846
|
force,
|
|
2716
2847
|
dryRun,
|
|
2717
2848
|
verbose,
|
|
2849
|
+
skillReceiptPath,
|
|
2718
2850
|
teamMode: resolvedTeamMode,
|
|
2719
2851
|
});
|
|
2720
2852
|
}
|
|
@@ -2741,7 +2873,7 @@ export async function setup(options = {}) {
|
|
|
2741
2873
|
});
|
|
2742
2874
|
console.log(` Native agent role refresh complete (${scopeDirs.nativeAgentsDir}); plugin mode still installs role TOML so agent_type routing works.\n`);
|
|
2743
2875
|
}
|
|
2744
|
-
else {
|
|
2876
|
+
else if (!options.disableHooks) {
|
|
2745
2877
|
summary.nativeAgents = await refreshNativeAgentConfigs(pkgRoot, scopeDirs.nativeAgentsDir, backupContext, {
|
|
2746
2878
|
force,
|
|
2747
2879
|
dryRun,
|
|
@@ -2816,18 +2948,6 @@ export async function setup(options = {}) {
|
|
|
2816
2948
|
else {
|
|
2817
2949
|
console.log(` Local Codex plugin marketplace ${OMX_LOCAL_MARKETPLACE_NAME} already registered (${pkgRoot}).`);
|
|
2818
2950
|
}
|
|
2819
|
-
const pluginCacheRefresh = await refreshOmxPluginDiscoveryCache(pkgRoot, {
|
|
2820
|
-
dryRun,
|
|
2821
|
-
verbose,
|
|
2822
|
-
}, scopeDirs.codexHomeDir);
|
|
2823
|
-
if (pluginCacheRefresh.status === "refreshed") {
|
|
2824
|
-
if (pluginCacheRefresh.staleDirs.length > 0) {
|
|
2825
|
-
console.log(` ${dryRun ? "Would invalidate" : "Invalidated"} ${pluginCacheRefresh.staleDirs.length} stale Codex plugin discovery cache entr${pluginCacheRefresh.staleDirs.length === 1 ? "y" : "ies"} so plugin skills refresh from the packaged manifest.`);
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
else if (pluginCacheRefresh.status === "unchanged") {
|
|
2829
|
-
console.log(" Codex plugin discovery cache already matches packaged plugin metadata.");
|
|
2830
|
-
}
|
|
2831
2951
|
const pluginCacheMaterialize = await materializePackagedOmxPluginCache(scopeDirs.codexHomeDir, preflightMarketplace, { dryRun, teamMode: resolvedTeamMode });
|
|
2832
2952
|
if (pluginCacheMaterialize.status === "materialized") {
|
|
2833
2953
|
console.log(` ${dryRun ? "Would install" : "Installed"} local Codex plugin cache for ${OMX_LOCAL_MARKETPLACE_NAME}/${OMX_PLUGIN_NAME} at ${pluginCacheMaterialize.cacheDir}.`);
|
|
@@ -2835,6 +2955,10 @@ export async function setup(options = {}) {
|
|
|
2835
2955
|
else if (pluginCacheMaterialize.status === "unchanged") {
|
|
2836
2956
|
console.log(" Local Codex plugin cache already exposes packaged OMX skills.");
|
|
2837
2957
|
}
|
|
2958
|
+
else if (pluginCacheMaterialize.status === "stale-launcher") {
|
|
2959
|
+
console.log(` warning: local Codex plugin cache at ${pluginCacheMaterialize.cacheDir} has incompatible launcher provenance (${pluginCacheMaterialize.reason}); not reporting as current.`);
|
|
2960
|
+
console.log(` Run \`codex plugin remove ${OMX_LOCAL_PLUGIN_CONFIG_KEY} --json\` then rerun \`omx setup --plugin\` to rebuild the snapshot for ${preflightMarketplace?.packageRoot ?? pkgRoot}.`);
|
|
2961
|
+
}
|
|
2838
2962
|
if (pluginCacheMaterialize.status === "materialized" ||
|
|
2839
2963
|
pluginCacheMaterialize.status === "unchanged") {
|
|
2840
2964
|
console.log(" Start a new Codex session if /skills still shows stale OMX plugin skill metadata; the current session may keep its in-memory plugin registry until restart.");
|
|
@@ -2888,7 +3012,11 @@ export async function setup(options = {}) {
|
|
|
2888
3012
|
const activeSession = resolvedScope.scope === "project"
|
|
2889
3013
|
? await readSessionState(projectRoot)
|
|
2890
3014
|
: null;
|
|
2891
|
-
|
|
3015
|
+
// Only a definitely dead session releases the overlay. macOS records no process-birth evidence, so
|
|
3016
|
+
// a live session classifies as identity-indeterminate; treating that as stale would let setup
|
|
3017
|
+
// overwrite the AGENTS.md overlay of a running session.
|
|
3018
|
+
const sessionIsActive = activeSession !== null &&
|
|
3019
|
+
classifySessionStateLiveness(activeSession) !== "stale-dead";
|
|
2892
3020
|
if (isPluginInstallMode) {
|
|
2893
3021
|
const agentsMdSrc = join(pkgRoot, "templates", "AGENTS.md");
|
|
2894
3022
|
const pluginAgentsMdExists = pluginAgentsMdPathExists;
|
|
@@ -3662,7 +3790,14 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3662
3790
|
: null;
|
|
3663
3791
|
const isSetupInstallableSkill = (skillName, status) => isCatalogInstallableStatus(status) || installableSkillNames.has(skillName);
|
|
3664
3792
|
const entries = await readdir(srcDir, { withFileTypes: true });
|
|
3665
|
-
const
|
|
3793
|
+
const catalogKnownSkillNames = new Set(manifest?.skills.map((skill) => skill.name) ?? []);
|
|
3794
|
+
const staleCandidateSkillNames = new Set(catalogKnownSkillNames);
|
|
3795
|
+
if (existsSync(dstDir)) {
|
|
3796
|
+
for (const installed of await readdir(dstDir, { withFileTypes: true })) {
|
|
3797
|
+
if (installed.isDirectory())
|
|
3798
|
+
staleCandidateSkillNames.add(installed.name);
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3666
3801
|
for (const entry of entries) {
|
|
3667
3802
|
if (!entry.isDirectory())
|
|
3668
3803
|
continue;
|
|
@@ -3697,6 +3832,7 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3697
3832
|
for (const skill of installableSkills) {
|
|
3698
3833
|
await validateSkillFile(join(skill.sourceDir, "SKILL.md"));
|
|
3699
3834
|
}
|
|
3835
|
+
const writtenFilesBySkill = new Map();
|
|
3700
3836
|
for (const skill of installableSkills) {
|
|
3701
3837
|
const skillName = skill.name;
|
|
3702
3838
|
const skillSrc = skill.sourceDir;
|
|
@@ -3705,18 +3841,27 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3705
3841
|
await mkdir(skillDst, { recursive: true });
|
|
3706
3842
|
}
|
|
3707
3843
|
const skillFiles = await readdir(skillSrc);
|
|
3844
|
+
const writtenForSkill = [];
|
|
3708
3845
|
for (const sf of skillFiles) {
|
|
3709
3846
|
const sfPath = join(skillSrc, sf);
|
|
3710
3847
|
const sfStat = await stat(sfPath);
|
|
3711
3848
|
if (!sfStat.isFile())
|
|
3712
3849
|
continue;
|
|
3713
3850
|
const dstPath = join(skillDst, sf);
|
|
3851
|
+
writtenForSkill.push(sf);
|
|
3714
3852
|
if (sf === "SKILL.md") {
|
|
3715
3853
|
await syncManagedContent(rewriteInstalledSkillDescriptionBadge(await readFile(sfPath, "utf-8"), sfPath), dstPath, summary, backupContext, options, `skill ${skillName}/${sf}`);
|
|
3716
3854
|
continue;
|
|
3717
3855
|
}
|
|
3718
3856
|
await syncManagedFileFromDisk(sfPath, dstPath, summary, backupContext, options, `skill ${skillName}/${sf}`);
|
|
3719
3857
|
}
|
|
3858
|
+
writtenFilesBySkill.set(skillName, writtenForSkill);
|
|
3859
|
+
}
|
|
3860
|
+
// Record what we just wrote so a later refresh can prove an unmodified install before retiring it.
|
|
3861
|
+
// Without an authority path, refuse to create a receipt rather than placing deletion authority
|
|
3862
|
+
// in the user-writable skills directory.
|
|
3863
|
+
if (options.skillReceiptPath) {
|
|
3864
|
+
await writeInstalledSkillReceipt(options.skillReceiptPath, dstDir, writtenFilesBySkill, options);
|
|
3720
3865
|
}
|
|
3721
3866
|
if (manifest && existsSync(dstDir)) {
|
|
3722
3867
|
for (const staleSkill of staleCandidateSkillNames) {
|
|
@@ -3724,14 +3869,32 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3724
3869
|
const disabledTeamSkill = !teamModeEnabled(options.teamMode) && TEAM_MODE_SKILL_NAMES.has(staleSkill);
|
|
3725
3870
|
if (isSetupInstallableSkill(staleSkill, status) && !disabledTeamSkill)
|
|
3726
3871
|
continue;
|
|
3727
|
-
const hardDeprecated = HARD_DEPRECATED_SKILL_NAMES.has(staleSkill);
|
|
3728
|
-
if (!options.force && !hardDeprecated && !disabledTeamSkill)
|
|
3729
|
-
continue;
|
|
3730
3872
|
const staleSkillDir = join(dstDir, staleSkill);
|
|
3731
3873
|
if (!existsSync(staleSkillDir))
|
|
3732
3874
|
continue;
|
|
3733
|
-
|
|
3734
|
-
|
|
3875
|
+
// A directory the catalog no longer ships is ours to retire on any refresh - which is what
|
|
3876
|
+
// makes `omx update` drop deprecated skills without an extra flag - but only when we can
|
|
3877
|
+
// prove it is an UNMODIFIED install we wrote. The badge alone is not proof: a user who
|
|
3878
|
+
// edits the body keeps it, and archiving their edit is not preserving it.
|
|
3879
|
+
const unmodifiedInstall = Boolean(options.skillReceiptPath)
|
|
3880
|
+
&& await isUnmodifiedRecordedInstall(options.skillReceiptPath, staleSkill, staleSkillDir);
|
|
3881
|
+
const omxManaged = await isOmxManagedInstalledSkillDir(staleSkillDir) && unmodifiedInstall;
|
|
3882
|
+
const forcedCatalogSkill = options.force && catalogKnownSkillNames.has(staleSkill);
|
|
3883
|
+
// Disabling Team mode is a configuration change, not a destructive opt-in, so it must not
|
|
3884
|
+
// delete a directory we cannot prove we wrote. --force remains the explicit destructive path.
|
|
3885
|
+
const removableDisabledTeamSkill = disabledTeamSkill && unmodifiedInstall;
|
|
3886
|
+
if (!omxManaged && !forcedCatalogSkill && !removableDisabledTeamSkill) {
|
|
3887
|
+
summary.skipped += 1;
|
|
3888
|
+
if (options.verbose) {
|
|
3889
|
+
const why = await isOmxManagedInstalledSkillDir(staleSkillDir)
|
|
3890
|
+
? "modified since install, or installed before receipts existed"
|
|
3891
|
+
: "not an OMX-managed skill install";
|
|
3892
|
+
console.log(` kept ${staleSkill}/ (${why})`);
|
|
3893
|
+
}
|
|
3894
|
+
continue;
|
|
3895
|
+
}
|
|
3896
|
+
if (await removeDirectoryCopyAware(staleSkillDir, backupContext, options)) {
|
|
3897
|
+
summary.backedUp += 1;
|
|
3735
3898
|
}
|
|
3736
3899
|
summary.removed += 1;
|
|
3737
3900
|
if (options.verbose) {
|
|
@@ -3739,9 +3902,9 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3739
3902
|
? "would remove stale skill"
|
|
3740
3903
|
: "removed stale skill";
|
|
3741
3904
|
const label = status ?? "unlisted";
|
|
3742
|
-
const reason =
|
|
3905
|
+
const reason = removableDisabledTeamSkill
|
|
3743
3906
|
? ", Team mode disabled"
|
|
3744
|
-
:
|
|
3907
|
+
: omxManaged ? ", retired from the catalog" : "";
|
|
3745
3908
|
console.log(` ${prefix} ${staleSkill}/ (status: ${label}${reason})`);
|
|
3746
3909
|
}
|
|
3747
3910
|
}
|
|
@@ -3799,12 +3962,42 @@ async function cleanupLegacyManagedSkills(srcDir, dstDir, backupContext, options
|
|
|
3799
3962
|
result.warnings.push(warning);
|
|
3800
3963
|
continue;
|
|
3801
3964
|
}
|
|
3965
|
+
// A matching SKILL.md does not prove the whole directory is ours: a user file sitting beside it
|
|
3966
|
+
// would be deleted with the directory. Require the same unmodified-install proof the ordinary
|
|
3967
|
+
// retirement sweep uses.
|
|
3968
|
+
if (!options.skillReceiptPath || !(await isUnmodifiedRecordedInstall(options.skillReceiptPath, skillName, installedSkillDir))) {
|
|
3969
|
+
const warning = `Skipping legacy skill cleanup for ${skillName}: directory contents are not a receipted unmodified OMX install.`;
|
|
3970
|
+
result.skippedSkillNames.push(skillName);
|
|
3971
|
+
result.warnings.push(warning);
|
|
3972
|
+
continue;
|
|
3973
|
+
}
|
|
3802
3974
|
const removed = await removeDirectoryCopyAware(installedSkillDir, backupContext, options);
|
|
3803
3975
|
if (removed) {
|
|
3804
3976
|
result.backedUp += 1;
|
|
3805
3977
|
result.removedSkillNames.push(skillName);
|
|
3806
3978
|
}
|
|
3807
3979
|
}
|
|
3980
|
+
// Plugin mode never reinstalls into the legacy directory, so a skill the catalog has retired
|
|
3981
|
+
// would otherwise survive there forever. Retire OMX-badged orphans on every refresh.
|
|
3982
|
+
for (const entry of await readdir(dstDir, { withFileTypes: true })) {
|
|
3983
|
+
if (!entry.isDirectory())
|
|
3984
|
+
continue;
|
|
3985
|
+
if (installableSkillNames.has(entry.name))
|
|
3986
|
+
continue;
|
|
3987
|
+
const installedSkillDir = join(dstDir, entry.name);
|
|
3988
|
+
if (!(await isOmxManagedInstalledSkillDir(installedSkillDir)))
|
|
3989
|
+
continue;
|
|
3990
|
+
// The badge alone is not proof of ownership for deletion; a user-edited body keeps it.
|
|
3991
|
+
if (!options.skillReceiptPath || !(await isUnmodifiedRecordedInstall(options.skillReceiptPath, entry.name, installedSkillDir))) {
|
|
3992
|
+
result.skippedSkillNames.push(entry.name);
|
|
3993
|
+
result.warnings.push(`Skipping retired skill ${entry.name}: modified since install, or installed before receipts existed.`);
|
|
3994
|
+
continue;
|
|
3995
|
+
}
|
|
3996
|
+
if (await removeDirectoryCopyAware(installedSkillDir, backupContext, options)) {
|
|
3997
|
+
result.backedUp += 1;
|
|
3998
|
+
result.removedSkillNames.push(entry.name);
|
|
3999
|
+
}
|
|
4000
|
+
}
|
|
3808
4001
|
return result;
|
|
3809
4002
|
}
|
|
3810
4003
|
function getNotifyMetadataPath(codexHomeDir) {
|