oh-my-codex 0.20.3 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +35 -18
- package/Cargo.toml +1 -1
- package/README.md +22 -19
- package/crates/omx-runtime/Cargo.toml +3 -0
- package/crates/omx-runtime/src/main.rs +390 -0
- package/crates/omx-runtime/tests/execution.rs +264 -0
- package/dist/adapt/__tests__/herdr-target.test.d.ts +2 -0
- package/dist/adapt/__tests__/herdr-target.test.d.ts.map +1 -0
- package/dist/adapt/__tests__/herdr-target.test.js +72 -0
- package/dist/adapt/__tests__/herdr-target.test.js.map +1 -0
- package/dist/adapt/contracts.d.ts +1 -1
- package/dist/adapt/contracts.d.ts.map +1 -1
- package/dist/adapt/contracts.js +1 -1
- package/dist/adapt/contracts.js.map +1 -1
- package/dist/adapt/herdr/__tests__/authority.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/authority.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/authority.test.js +49 -0
- package/dist/adapt/herdr/__tests__/authority.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/bridge.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/bridge.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/bridge.test.js +176 -0
- package/dist/adapt/herdr/__tests__/bridge.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.js +45 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/semantic.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/semantic.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/semantic.test.js +130 -0
- package/dist/adapt/herdr/__tests__/semantic.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.js +54 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.js +104 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/team-map.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/team-map.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/team-map.test.js +46 -0
- package/dist/adapt/herdr/__tests__/team-map.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/transport.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/transport.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/transport.test.js +160 -0
- package/dist/adapt/herdr/__tests__/transport.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/wiring.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/wiring.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/wiring.test.js +118 -0
- package/dist/adapt/herdr/__tests__/wiring.test.js.map +1 -0
- package/dist/adapt/herdr/authority.d.ts +34 -0
- package/dist/adapt/herdr/authority.d.ts.map +1 -0
- package/dist/adapt/herdr/authority.js +71 -0
- package/dist/adapt/herdr/authority.js.map +1 -0
- package/dist/adapt/herdr/bridge.d.ts +84 -0
- package/dist/adapt/herdr/bridge.d.ts.map +1 -0
- package/dist/adapt/herdr/bridge.js +222 -0
- package/dist/adapt/herdr/bridge.js.map +1 -0
- package/dist/adapt/herdr/sanitize.d.ts +20 -0
- package/dist/adapt/herdr/sanitize.d.ts.map +1 -0
- package/dist/adapt/herdr/sanitize.js +70 -0
- package/dist/adapt/herdr/sanitize.js.map +1 -0
- package/dist/adapt/herdr/semantic.d.ts +67 -0
- package/dist/adapt/herdr/semantic.d.ts.map +1 -0
- package/dist/adapt/herdr/semantic.js +170 -0
- package/dist/adapt/herdr/semantic.js.map +1 -0
- package/dist/adapt/herdr/seq-store.d.ts +32 -0
- package/dist/adapt/herdr/seq-store.d.ts.map +1 -0
- package/dist/adapt/herdr/seq-store.js +126 -0
- package/dist/adapt/herdr/seq-store.js.map +1 -0
- package/dist/adapt/herdr/team-map.d.ts +30 -0
- package/dist/adapt/herdr/team-map.d.ts.map +1 -0
- package/dist/adapt/herdr/team-map.js +37 -0
- package/dist/adapt/herdr/team-map.js.map +1 -0
- package/dist/adapt/herdr/transport.d.ts +115 -0
- package/dist/adapt/herdr/transport.d.ts.map +1 -0
- package/dist/adapt/herdr/transport.js +260 -0
- package/dist/adapt/herdr/transport.js.map +1 -0
- package/dist/adapt/herdr/wiring.d.ts +24 -0
- package/dist/adapt/herdr/wiring.d.ts.map +1 -0
- package/dist/adapt/herdr/wiring.js +62 -0
- package/dist/adapt/herdr/wiring.js.map +1 -0
- package/dist/adapt/herdr.d.ts +19 -0
- package/dist/adapt/herdr.d.ts.map +1 -0
- package/dist/adapt/herdr.js +115 -0
- package/dist/adapt/herdr.js.map +1 -0
- package/dist/adapt/index.d.ts +4 -0
- package/dist/adapt/index.d.ts.map +1 -1
- package/dist/adapt/index.js +48 -0
- package/dist/adapt/index.js.map +1 -1
- package/dist/adapt/registry.d.ts.map +1 -1
- package/dist/adapt/registry.js +11 -0
- package/dist/adapt/registry.js.map +1 -1
- 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/auth/__tests__/hotswap.test.js +60 -1
- package/dist/auth/__tests__/hotswap.test.js.map +1 -1
- package/dist/auth/__tests__/storage.test.js +33 -1
- package/dist/auth/__tests__/storage.test.js.map +1 -1
- package/dist/auth/hotswap.d.ts +16 -2
- package/dist/auth/hotswap.d.ts.map +1 -1
- package/dist/auth/hotswap.js +22 -7
- package/dist/auth/hotswap.js.map +1 -1
- package/dist/auth/storage.js +1 -1
- package/dist/auth/storage.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__/agents-init.test.js +4 -23
- package/dist/cli/__tests__/agents-init.test.js.map +1 -1
- package/dist/cli/__tests__/api.test.js +61 -24
- package/dist/cli/__tests__/api.test.js.map +1 -1
- package/dist/cli/__tests__/auth.test.js +3 -1
- package/dist/cli/__tests__/auth.test.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-feature-probe.test.js +66 -1
- package/dist/cli/__tests__/codex-feature-probe.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +76 -4
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/detached-leader-teardown.test.d.ts +2 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.d.ts.map +1 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js +473 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js +103 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.js +206 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.js.map +1 -0
- 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 +38 -6
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +75 -0
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +621 -460
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +1125 -143
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-parity.test.js +4 -3
- package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
- package/dist/cli/__tests__/native-assets.test.js +398 -16
- package/dist/cli/__tests__/native-assets.test.js.map +1 -1
- package/dist/cli/__tests__/native-hook-claim-journal.test.js +53 -5
- package/dist/cli/__tests__/native-hook-claim-journal.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +5 -8
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- 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__/ralph.test.js +2 -2
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js +57 -57
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.d.ts +2 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.js +56 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.js.map +1 -0
- package/dist/cli/__tests__/ralplan.test.js +131 -14
- package/dist/cli/__tests__/ralplan.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +1153 -43
- 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 +57 -55
- 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 +258 -26
- 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 +3 -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 +93 -41
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +45 -1
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +161 -2
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +73 -28
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +749 -177
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +32 -2
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
- package/dist/cli/api.d.ts.map +1 -1
- package/dist/cli/api.js +9 -10
- package/dist/cli/api.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/codex-feature-probe.d.ts +16 -0
- package/dist/cli/codex-feature-probe.d.ts.map +1 -1
- package/dist/cli/codex-feature-probe.js +44 -0
- package/dist/cli/codex-feature-probe.js.map +1 -1
- package/dist/cli/codex-home.d.ts.map +1 -1
- package/dist/cli/codex-home.js +7 -4
- package/dist/cli/codex-home.js.map +1 -1
- package/dist/cli/doctor.d.ts +29 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +433 -19
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +231 -12
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2354 -724
- 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 +26 -1
- package/dist/cli/native-assets.d.ts.map +1 -1
- package/dist/cli/native-assets.js +448 -51
- package/dist/cli/native-assets.js.map +1 -1
- package/dist/cli/native-hook-claim-journal.d.ts +8 -4
- package/dist/cli/native-hook-claim-journal.d.ts.map +1 -1
- package/dist/cli/native-hook-claim-journal.js +30 -8
- package/dist/cli/native-hook-claim-journal.js.map +1 -1
- package/dist/cli/package-manager-ownership.d.ts +69 -0
- package/dist/cli/package-manager-ownership.d.ts.map +1 -0
- package/dist/cli/package-manager-ownership.js +338 -0
- package/dist/cli/package-manager-ownership.js.map +1 -0
- package/dist/cli/plugin-marketplace.d.ts +1 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +123 -55
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/ralph.js +2 -2
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/ralplan.d.ts +6 -2
- package/dist/cli/ralplan.d.ts.map +1 -1
- package/dist/cli/ralplan.js +134 -34
- 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-preferences.d.ts +15 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -1
- package/dist/cli/setup-preferences.js +27 -1
- package/dist/cli/setup-preferences.js.map +1 -1
- package/dist/cli/setup.d.ts +6 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +425 -215
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +52 -9
- 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 +10 -7
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +27 -28
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update-worker.d.ts +2 -0
- package/dist/cli/update-worker.d.ts.map +1 -0
- package/dist/cli/update-worker.js +142 -0
- package/dist/cli/update-worker.js.map +1 -0
- package/dist/cli/update.d.ts +16 -23
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +212 -241
- 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 +173 -29
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +3 -1
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/generator.d.ts +25 -3
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +113 -35
- package/dist/config/generator.js.map +1 -1
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +25 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +2 -0
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/hooks/__tests__/agents-overlay.test.js +3 -1
- package/dist/hooks/__tests__/agents-overlay.test.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 -106
- 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.d.ts +2 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js +164 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js.map +1 -0
- 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 +226 -858
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +176 -14
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +1 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +33 -21
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +27 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +10 -118
- package/dist/hooks/__tests__/notify-hook-managed-tmux.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-regression-205.test.js +7 -0
- package/dist/hooks/__tests__/notify-hook-regression-205.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 +7 -7
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +11 -8
- 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__/notify-hook-team-worker-fail-closed.test.js +2 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +1 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.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 +23 -3
- 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__/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 +3656 -656
- 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/agents-overlay.js +1 -1
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js +108 -2
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.js +151 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.js.map +1 -1
- package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
- package/dist/hooks/extensibility/dispatcher.js +20 -3
- package/dist/hooks/extensibility/dispatcher.js.map +1 -1
- package/dist/hooks/extensibility/plugin-runner.js +1 -0
- package/dist/hooks/extensibility/plugin-runner.js.map +1 -1
- package/dist/hooks/extensibility/runtime.d.ts.map +1 -1
- package/dist/hooks/extensibility/runtime.js.map +1 -1
- package/dist/hooks/extensibility/sdk/paths.d.ts +1 -1
- package/dist/hooks/extensibility/sdk/paths.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk/paths.js +2 -2
- package/dist/hooks/extensibility/sdk/paths.js.map +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.js +55 -15
- package/dist/hooks/extensibility/sdk/runtime-state.js.map +1 -1
- package/dist/hooks/extensibility/sdk.d.ts +1 -0
- package/dist/hooks/extensibility/sdk.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk.js +1 -1
- package/dist/hooks/extensibility/sdk.js.map +1 -1
- package/dist/hooks/extensibility/types.d.ts +7 -0
- package/dist/hooks/extensibility/types.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +6 -47
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +156 -268
- 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 +197 -18
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +1939 -271
- 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__/hud-tmux-injection.test.js +6 -6
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +26 -16
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +83 -78
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +36 -31
- package/dist/hud/__tests__/state.test.js.map +1 -1
- 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 +112 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.js.map +1 -0
- package/dist/hud/__tests__/tmux.test.js +217 -198
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/tmux.d.ts +43 -4
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +1025 -139
- package/dist/hud/tmux.js.map +1 -1
- package/dist/leader/__tests__/contract.test.js +71 -34
- package/dist/leader/__tests__/contract.test.js.map +1 -1
- package/dist/leader/contract.d.ts +1 -6
- package/dist/leader/contract.d.ts.map +1 -1
- package/dist/leader/contract.js +25 -24
- package/dist/leader/contract.js.map +1 -1
- package/dist/mcp/__tests__/hermes-bridge.test.js +17 -0
- package/dist/mcp/__tests__/hermes-bridge.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +4 -4
- package/dist/mcp/__tests__/state-paths.test.js +735 -4
- package/dist/mcp/__tests__/state-paths.test.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/__tests__/trace-server.test.js +2 -2
- package/dist/mcp/__tests__/trace-server.test.js.map +1 -1
- package/dist/mcp/hermes-bridge.d.ts.map +1 -1
- package/dist/mcp/hermes-bridge.js +2 -2
- package/dist/mcp/hermes-bridge.js.map +1 -1
- package/dist/mcp/state-paths.d.ts +78 -4
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +543 -40
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/mcp/state-server.d.ts +68 -97
- 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 -168
- 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 +10 -158
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/base.d.ts +6 -6
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +116 -90
- package/dist/modes/base.js.map +1 -1
- package/dist/native-assets/archive.d.ts +17 -0
- package/dist/native-assets/archive.d.ts.map +1 -0
- package/dist/native-assets/archive.js +238 -0
- package/dist/native-assets/archive.js.map +1 -0
- package/dist/native-assets/policy.d.ts +42 -0
- package/dist/native-assets/policy.d.ts.map +1 -0
- package/dist/native-assets/policy.js +155 -0
- package/dist/native-assets/policy.js.map +1 -0
- 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 +2 -2
- 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 +4 -4
- package/dist/question/deep-interview.js.map +1 -1
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js +328 -39
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js.map +1 -1
- package/dist/ralplan/__tests__/runtime.test.js +56 -821
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/documented-leader-preflight.d.ts +15 -8
- package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -1
- package/dist/ralplan/documented-leader-preflight.js +356 -54
- package/dist/ralplan/documented-leader-preflight.js.map +1 -1
- package/dist/ralplan/runtime.d.ts +2 -2
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +145 -163
- 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/runtime/run-state.d.ts +5 -1
- package/dist/runtime/run-state.d.ts.map +1 -1
- package/dist/runtime/run-state.js +15 -8
- package/dist/runtime/run-state.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +12490 -19414
- 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.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js +235 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.js +188 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js +207 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js +156 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js +191 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js +40 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js.map +1 -0
- 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__/notify-state-io.test.js +26 -0
- package/dist/scripts/__tests__/notify-state-io.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-tmux-injection.test.js +23 -1
- package/dist/scripts/__tests__/notify-tmux-injection.test.js.map +1 -1
- package/dist/scripts/__tests__/postinstall.test.js +19 -1
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
- 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__/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 -60
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js.map +1 -1
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js +60 -25
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js.map +1 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +168 -20
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-release-assets.test.d.ts +2 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.js +235 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts +51 -2
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +3648 -1332
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts +9 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +33 -22
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/generate-native-release-manifest.js +80 -51
- package/dist/scripts/generate-native-release-manifest.js.map +1 -1
- package/dist/scripts/notify-fallback-watcher.js +28 -39
- package/dist/scripts/notify-fallback-watcher.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/state-io.d.ts.map +1 -1
- package/dist/scripts/notify-hook/state-io.js +5 -0
- package/dist/scripts/notify-hook/state-io.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-leader-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.js +32 -3
- package/dist/scripts/notify-hook/team-leader-nudge.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/team-worker-stop.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.js +23 -3
- package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +45 -5
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.d.ts +1 -0
- package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js +4 -1
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
- package/dist/scripts/notify-hook.d.ts.map +1 -1
- package/dist/scripts/notify-hook.js +71 -124
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/postinstall-advisory.d.ts +14 -0
- package/dist/scripts/postinstall-advisory.d.ts.map +1 -0
- package/dist/scripts/postinstall-advisory.js +49 -0
- package/dist/scripts/postinstall-advisory.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +1 -1
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +1 -1
- package/dist/scripts/postinstall.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 +32 -1
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +407 -60
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +16 -1
- package/dist/scripts/sync-plugin-mirror.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/scripts/verify-native-release-assets.js +37 -23
- package/dist/scripts/verify-native-release-assets.js.map +1 -1
- 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-state-context.test.js +12 -5
- package/dist/state/__tests__/mode-state-context.test.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +870 -2517
- package/dist/state/__tests__/operations.test.js.map +1 -1
- 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.test.js +400 -2
- 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-state-context.d.ts +3 -0
- package/dist/state/mode-state-context.d.ts.map +1 -1
- package/dist/state/mode-state-context.js +27 -13
- package/dist/state/mode-state-context.js.map +1 -1
- 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 +9 -4
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +194 -235
- package/dist/state/operations.js.map +1 -1
- 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 +421 -31
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts +3 -0
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +11 -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 +9 -790
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js +27 -0
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js.map +1 -1
- package/dist/subagents/__tests__/tracker.test.js +837 -1048
- package/dist/subagents/__tests__/tracker.test.js.map +1 -1
- package/dist/subagents/tracker.d.ts +64 -60
- package/dist/subagents/tracker.d.ts.map +1 -1
- package/dist/subagents/tracker.js +809 -358
- package/dist/subagents/tracker.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__/delivery-e2e-smoke.test.js +6 -7
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -1
- package/dist/team/__tests__/mcp-comm.test.js +104 -3
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -1
- package/dist/team/__tests__/notice-ledger.test.d.ts +2 -0
- package/dist/team/__tests__/notice-ledger.test.d.ts.map +1 -0
- package/dist/team/__tests__/notice-ledger.test.js +131 -0
- package/dist/team/__tests__/notice-ledger.test.js.map +1 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.d.ts +2 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.d.ts.map +1 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.js +410 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.js.map +1 -0
- package/dist/team/__tests__/phase-controller.test.js +20 -0
- package/dist/team/__tests__/phase-controller.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +725 -59
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +269 -245
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js +117 -2
- package/dist/team/__tests__/state-root.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 +1093 -101
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js +159 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js.map +1 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts +69 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.js +242 -15
- package/dist/team/__tests__/tmux-test-fixture.js.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.test.js +177 -1
- package/dist/team/__tests__/tmux-test-fixture.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/__tests__/worker-runtime-identity.test.js +45 -72
- package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -1
- 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/notice-ledger.d.ts +54 -0
- package/dist/team/notice-ledger.d.ts.map +1 -0
- package/dist/team/notice-ledger.js +259 -0
- package/dist/team/notice-ledger.js.map +1 -0
- package/dist/team/phase-controller.d.ts.map +1 -1
- package/dist/team/phase-controller.js +2 -0
- package/dist/team/phase-controller.js.map +1 -1
- package/dist/team/runtime.d.ts +3 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +314 -142
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +161 -91
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/monitor.d.ts +10 -0
- package/dist/team/state/monitor.d.ts.map +1 -1
- package/dist/team/state/monitor.js +13 -0
- package/dist/team/state/monitor.js.map +1 -1
- package/dist/team/state/types.d.ts +15 -0
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state-root.d.ts +12 -0
- package/dist/team/state-root.d.ts.map +1 -1
- package/dist/team/state-root.js +177 -0
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts +19 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +47 -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 +42 -4
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +572 -196
- 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 +1053 -2
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +89 -59
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +36 -1
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +267 -51
- 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 +58 -1
- package/dist/utils/__tests__/file-durability.test.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +21 -1
- package/dist/utils/__tests__/paths.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 +10 -0
- package/dist/utils/file-durability.d.ts.map +1 -1
- package/dist/utils/file-durability.js +34 -4
- package/dist/utils/file-durability.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +14 -6
- package/dist/utils/paths.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 +49 -4
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js +60 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -1
- package/dist/verification/__tests__/native-release-manifest.test.js +157 -4
- package/dist/verification/__tests__/native-release-manifest.test.js.map +1 -1
- package/package.json +17 -6
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +81 -17
- 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 +72 -163
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +33 -392
- 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 +20 -22
- package/plugins/oh-my-codex/skills/skill/SKILL.md +82 -807
- package/plugins/oh-my-codex/skills/team/SKILL.md +32 -520
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +47 -150
- 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 +72 -163
- package/skills/autoresearch-goal/SKILL.md +6 -31
- package/skills/cancel/SKILL.md +33 -392
- 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 +20 -22
- package/skills/skill/SKILL.md +82 -807
- package/skills/team/SKILL.md +32 -520
- package/skills/ultragoal/SKILL.md +47 -150
- 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 +18888 -28799
- 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 +197 -0
- package/src/scripts/__tests__/issue-3293-cancel-transaction.test.ts +189 -0
- package/src/scripts/__tests__/issue-3293-hook-owned-cancel.test.ts +186 -0
- package/src/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.ts +177 -0
- package/src/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.ts +201 -0
- package/src/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.ts +43 -0
- 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__/notify-state-io.test.ts +29 -0
- package/src/scripts/__tests__/notify-tmux-injection.test.ts +26 -1
- package/src/scripts/__tests__/postinstall.test.ts +23 -1
- package/src/scripts/__tests__/prompt-inventory.test.ts +62 -1
- package/src/scripts/__tests__/reasoning-artifact-contract.test.ts +1 -2
- package/src/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.ts +49 -59
- package/src/scripts/__tests__/role-intent-durable-recovery-3181.test.ts +61 -27
- package/src/scripts/__tests__/smoke-packed-install.test.ts +223 -23
- package/src/scripts/__tests__/verify-native-release-assets.test.ts +240 -0
- package/src/scripts/codex-native-hook.ts +3618 -1383
- package/src/scripts/codex-native-pre-post.ts +50 -24
- package/src/scripts/generate-native-release-manifest.ts +83 -79
- package/src/scripts/notify-fallback-watcher.ts +38 -38
- package/src/scripts/notify-hook/auto-nudge.ts +1 -0
- package/src/scripts/notify-hook/state-io.ts +11 -0
- package/src/scripts/notify-hook/team-dispatch.ts +8 -5
- package/src/scripts/notify-hook/team-leader-nudge.ts +32 -4
- package/src/scripts/notify-hook/team-tmux-guard.ts +3 -1
- package/src/scripts/notify-hook/team-worker-stop.ts +23 -4
- package/src/scripts/notify-hook/team-worker.ts +43 -5
- package/src/scripts/notify-hook/tmux-injection.ts +5 -1
- package/src/scripts/notify-hook.ts +76 -124
- package/src/scripts/postinstall-advisory.ts +67 -0
- package/src/scripts/postinstall.ts +1 -1
- 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 +440 -59
- package/src/scripts/sync-plugin-mirror.ts +17 -1
- 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/src/scripts/verify-native-release-assets.ts +39 -31
- package/templates/AGENTS.md +45 -9
- 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 -1361
- 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 -148
- 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 -770
- 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 -1778
- 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 -399
- 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 -152
- 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 -1455
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +0 -1
- package/dist/ralplan/consensus-gate.d.ts +0 -62
- package/dist/ralplan/consensus-gate.d.ts.map +0 -1
- package/dist/ralplan/consensus-gate.js +0 -760
- 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
|
@@ -10,17 +10,17 @@ import { createInterface } from "readline/promises";
|
|
|
10
10
|
import { homedir } from "os";
|
|
11
11
|
import TOML from "@iarna/toml";
|
|
12
12
|
import { createHash } from "crypto";
|
|
13
|
-
import { clearNativeHookClaimJournal as clearNativeHookClaimJournalWithDurability, createNativeHookClaimJournalDurability, persistNativeHookClaimJournal as persistNativeHookClaimJournalWithDurability, recoverNativeHookClaimJournal, syncNativeHookClaimParent as syncNativeHookClaimParentWithDurability, restoreNativeHookClaimNoClobber as restoreNativeHookClaimNoClobberWithDurability, } from "./native-hook-claim-journal.js";
|
|
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_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) {
|
|
@@ -67,7 +67,6 @@ const LEGACY_PROJECT_GITIGNORE_ENTRIES = [".codex/"];
|
|
|
67
67
|
const SETUP_ONLY_INSTALLABLE_SKILLS = new Set(["wiki"]);
|
|
68
68
|
const DEFAULT_SETUP_MCP_MODE = "none";
|
|
69
69
|
const SKIP_NATIVE_AGENT_REFRESH_ENV = "OMX_SKIP_NATIVE_AGENT_REFRESH";
|
|
70
|
-
const HARD_DEPRECATED_SKILL_NAMES = new Set(["web-clone"]);
|
|
71
70
|
const TEAM_MODE_SKILL_NAMES = new Set(["team", "worker"]);
|
|
72
71
|
const TEAM_MODE_PROMPT_NAMES = new Set(["team-executor"]);
|
|
73
72
|
const TEAM_MODE_NATIVE_AGENT_NAMES = new Set(["team-executor"]);
|
|
@@ -211,6 +210,7 @@ let nativeHookTransactionTemporaryPathOverride;
|
|
|
211
210
|
let setupLatePhaseFailureInjector;
|
|
212
211
|
let nativeHookTransactionRegularFileSyncOverride;
|
|
213
212
|
let nativeHookClaimJournalDurabilityOverride;
|
|
213
|
+
let nativeHookTransactionArtifactLstatOverride;
|
|
214
214
|
/** @internal Test seam for deterministic atomic-write and rollback coverage. */
|
|
215
215
|
export function setNativeHookTransactionFailureInjectorForTest(injector) {
|
|
216
216
|
const previous = nativeHookTransactionFailureInjector;
|
|
@@ -251,6 +251,14 @@ export function setNativeHookTransactionRegularFileSyncForTest(sync) {
|
|
|
251
251
|
nativeHookTransactionRegularFileSyncOverride = previous;
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
+
/** @internal Test seam for deterministic artifact read-back coverage. */
|
|
255
|
+
export function setNativeHookTransactionArtifactLstatForTest(artifactLstat) {
|
|
256
|
+
const previous = nativeHookTransactionArtifactLstatOverride;
|
|
257
|
+
nativeHookTransactionArtifactLstatOverride = artifactLstat;
|
|
258
|
+
return () => {
|
|
259
|
+
nativeHookTransactionArtifactLstatOverride = previous;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
254
262
|
/** @internal Test seam for deterministic claim-journal durability coverage. */
|
|
255
263
|
export function setNativeHookClaimJournalDurabilityForTest(durability) {
|
|
256
264
|
const previous = nativeHookClaimJournalDurabilityOverride;
|
|
@@ -262,21 +270,21 @@ export function setNativeHookClaimJournalDurabilityForTest(durability) {
|
|
|
262
270
|
function nativeHookPlatform() {
|
|
263
271
|
return nativeHookTransactionPlatformOverride ?? process.platform;
|
|
264
272
|
}
|
|
265
|
-
function nativeHookClaimJournalDurability() {
|
|
266
|
-
return nativeHookClaimJournalDurabilityOverride
|
|
267
|
-
?? createNativeHookClaimJournalDurability(nativeHookPlatform());
|
|
273
|
+
function nativeHookClaimJournalDurability(tracker) {
|
|
274
|
+
return wrapNativeHookClaimJournalDurability(nativeHookClaimJournalDurabilityOverride
|
|
275
|
+
?? createNativeHookClaimJournalDurability(nativeHookPlatform()), tracker);
|
|
268
276
|
}
|
|
269
|
-
async function clearNativeHookClaimJournal(root) {
|
|
270
|
-
return clearNativeHookClaimJournalWithDurability(root, nativeHookClaimJournalDurability());
|
|
277
|
+
async function clearNativeHookClaimJournal(root, tracker) {
|
|
278
|
+
return clearNativeHookClaimJournalWithDurability(root, nativeHookClaimJournalDurability(tracker));
|
|
271
279
|
}
|
|
272
|
-
async function persistNativeHookClaimJournal(root, entry) {
|
|
273
|
-
return persistNativeHookClaimJournalWithDurability(root, entry, nativeHookClaimJournalDurability());
|
|
280
|
+
async function persistNativeHookClaimJournal(root, entry, tracker) {
|
|
281
|
+
return persistNativeHookClaimJournalWithDurability(root, entry, nativeHookClaimJournalDurability(tracker));
|
|
274
282
|
}
|
|
275
|
-
async function restoreNativeHookClaimNoClobber(claimPath, destinationPath) {
|
|
276
|
-
return restoreNativeHookClaimNoClobberWithDurability(claimPath, destinationPath, nativeHookClaimJournalDurability());
|
|
283
|
+
async function restoreNativeHookClaimNoClobber(claimPath, destinationPath, tracker) {
|
|
284
|
+
return restoreNativeHookClaimNoClobberWithDurability(claimPath, destinationPath, nativeHookClaimJournalDurability(tracker));
|
|
277
285
|
}
|
|
278
|
-
async function syncNativeHookClaimParent(path) {
|
|
279
|
-
return syncNativeHookClaimParentWithDurability(path, nativeHookClaimJournalDurability());
|
|
286
|
+
async function syncNativeHookClaimParent(path, tracker) {
|
|
287
|
+
return syncNativeHookClaimParentWithDurability(path, nativeHookClaimJournalDurability(tracker));
|
|
280
288
|
}
|
|
281
289
|
async function syncNativeHookRegularFile(handle) {
|
|
282
290
|
const platform = nativeHookPlatform();
|
|
@@ -293,6 +301,20 @@ function nativeHookTransactionTopologyEqual(left, right) {
|
|
|
293
301
|
? left.kind === right.kind
|
|
294
302
|
: left.mode === right.mode;
|
|
295
303
|
}
|
|
304
|
+
function nativeHookTransactionTopologyMatchesDuringReadback(left, right) {
|
|
305
|
+
if (nativeHookPlatform() === "win32" &&
|
|
306
|
+
left.kind === "regular_file" &&
|
|
307
|
+
right.kind === "regular_file" &&
|
|
308
|
+
left.mode === 0o600 &&
|
|
309
|
+
right.mode === 0o666) {
|
|
310
|
+
// Windows can synthesize a requested new-file mode of 0o600 as 0o666
|
|
311
|
+
// when the same file is reopened for read-back. Accept only that one-way
|
|
312
|
+
// transition inside a single identity-checked snapshot; later snapshots
|
|
313
|
+
// remain mode-strict so real permission drift still fails closed.
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
return nativeHookTransactionTopologyEqual(left, right);
|
|
317
|
+
}
|
|
296
318
|
function isMissingPathError(error) {
|
|
297
319
|
return (typeof error === "object" &&
|
|
298
320
|
error !== null &&
|
|
@@ -405,7 +427,7 @@ function decodeNativeHookTransactionUtf8(bytes, label) {
|
|
|
405
427
|
async function captureNativeHookTransactionArtifact(path, label) {
|
|
406
428
|
let before;
|
|
407
429
|
try {
|
|
408
|
-
before = await lstat(path);
|
|
430
|
+
before = await (nativeHookTransactionArtifactLstatOverride?.(path) ?? lstat(path));
|
|
409
431
|
}
|
|
410
432
|
catch (error) {
|
|
411
433
|
if (isMissingPathError(error)) {
|
|
@@ -417,7 +439,7 @@ async function captureNativeHookTransactionArtifact(path, label) {
|
|
|
417
439
|
throw new Error(`Refusing native hook transaction for ${label}: expected a single-link regular file or absence.`);
|
|
418
440
|
}
|
|
419
441
|
const bytes = await readFile(path);
|
|
420
|
-
const after = await lstat(path);
|
|
442
|
+
const after = await (nativeHookTransactionArtifactLstatOverride?.(path) ?? lstat(path));
|
|
421
443
|
const beforeTopology = {
|
|
422
444
|
kind: "regular_file",
|
|
423
445
|
mode: before.mode & 0o7777,
|
|
@@ -428,7 +450,7 @@ async function captureNativeHookTransactionArtifact(path, label) {
|
|
|
428
450
|
};
|
|
429
451
|
if (!after.isFile() ||
|
|
430
452
|
after.nlink !== 1 ||
|
|
431
|
-
!
|
|
453
|
+
!nativeHookTransactionTopologyMatchesDuringReadback(beforeTopology, afterTopology) ||
|
|
432
454
|
before.dev !== after.dev ||
|
|
433
455
|
before.ino !== after.ino ||
|
|
434
456
|
before.nlink !== after.nlink) {
|
|
@@ -436,7 +458,7 @@ async function captureNativeHookTransactionArtifact(path, label) {
|
|
|
436
458
|
}
|
|
437
459
|
return {
|
|
438
460
|
bytes,
|
|
439
|
-
topology:
|
|
461
|
+
topology: afterTopology,
|
|
440
462
|
device: before.dev,
|
|
441
463
|
inode: before.ino,
|
|
442
464
|
links: before.nlink,
|
|
@@ -451,7 +473,7 @@ function nativeHookTransactionSnapshotsEqual(left, right) {
|
|
|
451
473
|
}
|
|
452
474
|
function nativeHookTransactionSnapshotMatchesExpected(snapshot, expected) {
|
|
453
475
|
return (hookTransactionBytesEqual(snapshot.bytes, expected.bytes) &&
|
|
454
|
-
|
|
476
|
+
nativeHookTransactionTopologyMatchesDuringReadback(expected.topology, snapshot.topology));
|
|
455
477
|
}
|
|
456
478
|
function nativeHookTransactionOutputTopology(before, after) {
|
|
457
479
|
if (after === null)
|
|
@@ -622,7 +644,7 @@ function nativeHookTransactionClaimPath(path) {
|
|
|
622
644
|
return join(dirname(path), `.${basename(path)}.omx-claim-${process.pid}-${nativeHookTransactionSequence}.tmp`);
|
|
623
645
|
}
|
|
624
646
|
async function restoreNativeHookClaim(claimPath, destinationPath, tracker) {
|
|
625
|
-
recordRegularFileSyncOutcome(tracker, await restoreNativeHookClaimNoClobber(claimPath, destinationPath));
|
|
647
|
+
recordRegularFileSyncOutcome(tracker, await restoreNativeHookClaimNoClobber(claimPath, destinationPath, tracker));
|
|
626
648
|
}
|
|
627
649
|
async function atomicWriteNativeHookTransactionArtifact(artifact, content, stage, expectedCurrent, ancestorPrecondition, tracker, onWriteApplied, onWriteStabilized, assertApplied) {
|
|
628
650
|
const temporaryPath = nativeHookTransactionTemporaryPath(artifact.path, "write");
|
|
@@ -688,14 +710,14 @@ async function atomicWriteNativeHookTransactionArtifact(artifact, content, stage
|
|
|
688
710
|
claimPath,
|
|
689
711
|
before: expectedCurrent.bytes,
|
|
690
712
|
after: content,
|
|
691
|
-
}));
|
|
713
|
+
}, tracker));
|
|
692
714
|
await refreshNativeHookTransactionAncestorPrecondition(ancestorPrecondition, join(ancestorPrecondition.controlledRoot, ".omx", "native-hook-claim-journal.json"));
|
|
693
715
|
journaledClaim = true;
|
|
694
716
|
}
|
|
695
717
|
await rename(artifact.path, claimPath);
|
|
696
718
|
claimCreated = true;
|
|
697
719
|
if (journaledClaim)
|
|
698
|
-
await syncNativeHookClaimParent(claimPath);
|
|
720
|
+
await syncNativeHookClaimParent(claimPath, tracker);
|
|
699
721
|
await assertNativeHookTransactionArtifactSnapshot(claimPath, `${artifact.label} replacement claim`, expectedCurrent, stage === "write" ? "precondition" : "rollback");
|
|
700
722
|
}
|
|
701
723
|
await copyFile(temporaryPath, artifact.path, constants.COPYFILE_EXCL);
|
|
@@ -709,15 +731,15 @@ async function atomicWriteNativeHookTransactionArtifact(artifact, content, stage
|
|
|
709
731
|
finally {
|
|
710
732
|
await installedHandle.close();
|
|
711
733
|
}
|
|
712
|
-
await syncNativeHookClaimParent(artifact.path);
|
|
734
|
+
await syncNativeHookClaimParent(artifact.path, tracker);
|
|
713
735
|
const installedSnapshot = await assertNativeHookTransactionArtifactState(artifact.path, artifact.label, { bytes: content, topology: artifact.afterTopology }, stage === "write" ? "precondition" : "rollback");
|
|
714
736
|
if (claimCreated && claimPath) {
|
|
715
737
|
await rm(claimPath);
|
|
716
|
-
await syncNativeHookClaimParent(claimPath);
|
|
738
|
+
await syncNativeHookClaimParent(claimPath, tracker);
|
|
717
739
|
claimCreated = false;
|
|
718
740
|
}
|
|
719
741
|
if (journaledClaim) {
|
|
720
|
-
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot);
|
|
742
|
+
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot, tracker);
|
|
721
743
|
journaledClaim = false;
|
|
722
744
|
}
|
|
723
745
|
await rm(temporaryPath);
|
|
@@ -733,10 +755,10 @@ async function atomicWriteNativeHookTransactionArtifact(artifact, content, stage
|
|
|
733
755
|
if (claimCreated && claimPath) {
|
|
734
756
|
try {
|
|
735
757
|
await restoreNativeHookClaim(claimPath, artifact.path, tracker);
|
|
736
|
-
await syncNativeHookClaimParent(artifact.path);
|
|
758
|
+
await syncNativeHookClaimParent(artifact.path, tracker);
|
|
737
759
|
claimCreated = false;
|
|
738
760
|
if (journaledClaim) {
|
|
739
|
-
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot);
|
|
761
|
+
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot, tracker);
|
|
740
762
|
journaledClaim = false;
|
|
741
763
|
}
|
|
742
764
|
}
|
|
@@ -872,11 +894,11 @@ async function applyNativeHookTransactionArtifact(artifact, ancestorPrecondition
|
|
|
872
894
|
claimPath,
|
|
873
895
|
before: artifact.before.bytes,
|
|
874
896
|
after: null,
|
|
875
|
-
}));
|
|
897
|
+
}, tracker));
|
|
876
898
|
}
|
|
877
899
|
await rename(artifact.path, claimPath);
|
|
878
900
|
if (journaledClaim)
|
|
879
|
-
await syncNativeHookClaimParent(claimPath);
|
|
901
|
+
await syncNativeHookClaimParent(claimPath, tracker);
|
|
880
902
|
const entry = {
|
|
881
903
|
artifact,
|
|
882
904
|
appliedSnapshot: { bytes: null, topology: { kind: "absent" } },
|
|
@@ -893,9 +915,9 @@ async function applyNativeHookTransactionArtifact(artifact, ancestorPrecondition
|
|
|
893
915
|
const claimed = await captureNativeHookTransactionArtifact(claimPath, `${artifact.label} removal claim`);
|
|
894
916
|
await restoreNativeHookClaim(claimPath, artifact.path, tracker);
|
|
895
917
|
if (journaledClaim)
|
|
896
|
-
await syncNativeHookClaimParent(artifact.path);
|
|
918
|
+
await syncNativeHookClaimParent(artifact.path, tracker);
|
|
897
919
|
if (journaledClaim) {
|
|
898
|
-
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot);
|
|
920
|
+
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot, tracker);
|
|
899
921
|
}
|
|
900
922
|
await assertNativeHookTransactionArtifactSnapshot(artifact.path, artifact.label, claimed, "precondition");
|
|
901
923
|
const entryIndex = applied.indexOf(entry);
|
|
@@ -909,9 +931,9 @@ async function applyNativeHookTransactionArtifact(artifact, ancestorPrecondition
|
|
|
909
931
|
}
|
|
910
932
|
await rm(claimPath);
|
|
911
933
|
if (journaledClaim)
|
|
912
|
-
await syncNativeHookClaimParent(claimPath);
|
|
934
|
+
await syncNativeHookClaimParent(claimPath, tracker);
|
|
913
935
|
if (journaledClaim) {
|
|
914
|
-
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot);
|
|
936
|
+
await clearNativeHookClaimJournal(ancestorPrecondition.controlledRoot, tracker);
|
|
915
937
|
}
|
|
916
938
|
originalRemoved = true;
|
|
917
939
|
injectNativeHookTransactionFailure("after_remove", artifact);
|
|
@@ -1314,9 +1336,134 @@ export async function validateSkillFile(skillMdPath) {
|
|
|
1314
1336
|
const content = await readFile(skillMdPath, "utf-8");
|
|
1315
1337
|
parseSkillFrontmatter(content, skillMdPath);
|
|
1316
1338
|
}
|
|
1339
|
+
const INSTALLED_SKILL_BADGE_PREFIX = "[OMX] ";
|
|
1340
|
+
function installedSkillReceiptPath(scope, projectRoot) {
|
|
1341
|
+
const authorityRoot = scope === "project" ? projectRoot : homedir();
|
|
1342
|
+
return join(authorityRoot, ".omx", "state", "setup", "installed-skills.json");
|
|
1343
|
+
}
|
|
1344
|
+
async function readInstalledSkillReceipt(receiptPath) {
|
|
1345
|
+
try {
|
|
1346
|
+
const parsed = JSON.parse(await readFile(receiptPath, "utf-8"));
|
|
1347
|
+
if (parsed?.version === 1 && parsed.skills && typeof parsed.skills === "object") {
|
|
1348
|
+
// Re-key through a prototype-less record so a `__proto__` entry in a persisted receipt is a
|
|
1349
|
+
// real own property on both sides of the comparison.
|
|
1350
|
+
const skills = Object.create(null);
|
|
1351
|
+
for (const [name, entry] of Object.entries(parsed.skills)) {
|
|
1352
|
+
const files = Object.create(null);
|
|
1353
|
+
for (const [file, digest] of Object.entries(entry?.files ?? {}))
|
|
1354
|
+
files[file] = String(digest);
|
|
1355
|
+
skills[name] = { files };
|
|
1356
|
+
}
|
|
1357
|
+
return { version: 1, skills };
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
catch {
|
|
1361
|
+
// A missing or unreadable receipt means "no proof of ownership", which retains conservatively.
|
|
1362
|
+
}
|
|
1363
|
+
return { version: 1, skills: Object.create(null) };
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Digest the CURRENT contents of a skill directory, used to compare against a receipt.
|
|
1367
|
+
*
|
|
1368
|
+
* Non-regular entries (symlinks, sockets) are recorded as a sentinel rather than skipped, so a
|
|
1369
|
+
* directory containing one can never compare equal to a receipt of regular files and is therefore
|
|
1370
|
+
* retained instead of deleted.
|
|
1371
|
+
*/
|
|
1372
|
+
async function digestSkillDirectory(skillDir) {
|
|
1373
|
+
// Prototype-less: a file literally named `__proto__` assigned into a normal object literal is not an
|
|
1374
|
+
// own enumerable property, so it would vanish from Object.keys() and let a user entry be deleted
|
|
1375
|
+
// while the comparison still reported equality.
|
|
1376
|
+
const files = Object.create(null);
|
|
1377
|
+
const walk = async (dir, prefix) => {
|
|
1378
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
1379
|
+
const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
1380
|
+
const full = join(dir, entry.name);
|
|
1381
|
+
if (entry.isDirectory()) {
|
|
1382
|
+
await walk(full, relPath);
|
|
1383
|
+
continue;
|
|
1384
|
+
}
|
|
1385
|
+
if (!entry.isFile()) {
|
|
1386
|
+
files[relPath] = "non-regular-entry";
|
|
1387
|
+
continue;
|
|
1388
|
+
}
|
|
1389
|
+
files[relPath] = createHash("sha256").update(await readFile(full)).digest("hex");
|
|
1390
|
+
}
|
|
1391
|
+
};
|
|
1392
|
+
await walk(skillDir, "");
|
|
1393
|
+
return files;
|
|
1394
|
+
}
|
|
1395
|
+
/** True only when every current file matches the digest OMX recorded at install time. */
|
|
1396
|
+
async function isUnmodifiedRecordedInstall(receiptPath, skillName, skillDir) {
|
|
1397
|
+
const receipt = await readInstalledSkillReceipt(receiptPath);
|
|
1398
|
+
const recorded = receipt.skills[skillName]?.files;
|
|
1399
|
+
if (!recorded || Object.keys(recorded).length === 0)
|
|
1400
|
+
return false;
|
|
1401
|
+
let current;
|
|
1402
|
+
try {
|
|
1403
|
+
current = await digestSkillDirectory(skillDir);
|
|
1404
|
+
}
|
|
1405
|
+
catch {
|
|
1406
|
+
return false;
|
|
1407
|
+
}
|
|
1408
|
+
const recordedNames = Object.keys(recorded).sort();
|
|
1409
|
+
const currentNames = Object.keys(current).sort();
|
|
1410
|
+
if (recordedNames.length !== currentNames.length)
|
|
1411
|
+
return false;
|
|
1412
|
+
return recordedNames.every((name, index) => currentNames[index] === name && current[name] === recorded[name]);
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Record digests for EXACTLY the files OMX wrote, keyed by skill.
|
|
1416
|
+
*
|
|
1417
|
+
* Digesting the destination tree instead would poison the receipt: a note a user drops into an active
|
|
1418
|
+
* skill directory would be recorded as OMX-owned and then deleted when that skill is later retired.
|
|
1419
|
+
* The receipt therefore describes the installer's own output, and any extra entry present at
|
|
1420
|
+
* retirement time makes the comparison fail, which retains the directory.
|
|
1421
|
+
*/
|
|
1422
|
+
async function writeInstalledSkillReceipt(receiptPath, skillsDir, writtenFilesBySkill, options) {
|
|
1423
|
+
if (options.dryRun)
|
|
1424
|
+
return;
|
|
1425
|
+
const receipt = await readInstalledSkillReceipt(receiptPath);
|
|
1426
|
+
for (const [name, relativePaths] of writtenFilesBySkill) {
|
|
1427
|
+
const files = Object.create(null);
|
|
1428
|
+
let complete = true;
|
|
1429
|
+
for (const relPath of relativePaths) {
|
|
1430
|
+
const full = join(skillsDir, name, relPath);
|
|
1431
|
+
try {
|
|
1432
|
+
files[relPath] = createHash("sha256").update(await readFile(full)).digest("hex");
|
|
1433
|
+
}
|
|
1434
|
+
catch {
|
|
1435
|
+
complete = false;
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
if (complete && Object.keys(files).length > 0)
|
|
1440
|
+
receipt.skills[name] = { files };
|
|
1441
|
+
else
|
|
1442
|
+
delete receipt.skills[name];
|
|
1443
|
+
}
|
|
1444
|
+
try {
|
|
1445
|
+
await mkdir(dirname(receiptPath), { recursive: true });
|
|
1446
|
+
await writeFile(receiptPath, `${JSON.stringify(receipt, null, 2)}\n`);
|
|
1447
|
+
}
|
|
1448
|
+
catch {
|
|
1449
|
+
// A receipt we cannot persist simply means the next refresh retains conservatively.
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
async function isOmxManagedInstalledSkillDir(skillDir) {
|
|
1453
|
+
const skillMdPath = join(skillDir, "SKILL.md");
|
|
1454
|
+
if (!existsSync(skillMdPath))
|
|
1455
|
+
return false;
|
|
1456
|
+
try {
|
|
1457
|
+
const metadata = parseSkillFrontmatter(await readFile(skillMdPath, "utf-8"), skillMdPath);
|
|
1458
|
+
return metadata.description.startsWith(INSTALLED_SKILL_BADGE_PREFIX);
|
|
1459
|
+
}
|
|
1460
|
+
catch {
|
|
1461
|
+
return false;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1317
1464
|
function rewriteInstalledSkillDescriptionBadge(content, filePath = "SKILL.md") {
|
|
1318
1465
|
const metadata = parseSkillFrontmatter(content, filePath);
|
|
1319
|
-
const badgePrefix =
|
|
1466
|
+
const badgePrefix = INSTALLED_SKILL_BADGE_PREFIX;
|
|
1320
1467
|
const displayDescription = metadata.description.startsWith(badgePrefix)
|
|
1321
1468
|
? metadata.description
|
|
1322
1469
|
: `${badgePrefix}${metadata.description}`;
|
|
@@ -1701,155 +1848,8 @@ async function resolveSetupScope(projectRoot, requestedScope, persistedReviewDec
|
|
|
1701
1848
|
}
|
|
1702
1849
|
return { scope: DEFAULT_SETUP_SCOPE, source: "default" };
|
|
1703
1850
|
}
|
|
1704
|
-
async function
|
|
1705
|
-
|
|
1706
|
-
const parsed = JSON.parse(await readFile(manifestPath, "utf-8"));
|
|
1707
|
-
return typeof parsed === "object" &&
|
|
1708
|
-
parsed !== null &&
|
|
1709
|
-
"name" in parsed &&
|
|
1710
|
-
typeof parsed.name === "string"
|
|
1711
|
-
? parsed.name
|
|
1712
|
-
: null;
|
|
1713
|
-
}
|
|
1714
|
-
catch {
|
|
1715
|
-
return null;
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
async function readPluginManifestSummary(manifestPath) {
|
|
1719
|
-
try {
|
|
1720
|
-
const parsed = JSON.parse(await readFile(manifestPath, "utf-8"));
|
|
1721
|
-
if (typeof parsed !== "object" || parsed === null)
|
|
1722
|
-
return null;
|
|
1723
|
-
const manifest = parsed;
|
|
1724
|
-
return {
|
|
1725
|
-
name: typeof manifest.name === "string" ? manifest.name : null,
|
|
1726
|
-
version: typeof manifest.version === "string" ? manifest.version : null,
|
|
1727
|
-
skills: typeof manifest.skills === "string" ? manifest.skills : null,
|
|
1728
|
-
hooks: typeof manifest.hooks === "string" ? manifest.hooks : null,
|
|
1729
|
-
};
|
|
1730
|
-
}
|
|
1731
|
-
catch {
|
|
1732
|
-
return null;
|
|
1733
|
-
}
|
|
1734
|
-
}
|
|
1735
|
-
async function listChildDirectoryNames(dir) {
|
|
1736
|
-
try {
|
|
1737
|
-
const entries = await readdir(dir, { withFileTypes: true });
|
|
1738
|
-
return entries
|
|
1739
|
-
.filter((entry) => entry.isDirectory())
|
|
1740
|
-
.map((entry) => entry.name)
|
|
1741
|
-
.sort();
|
|
1742
|
-
}
|
|
1743
|
-
catch {
|
|
1744
|
-
return null;
|
|
1745
|
-
}
|
|
1746
|
-
}
|
|
1747
|
-
async function discoverOmxPluginCacheDirs(cacheRoot = join(codexHome(), "plugins", "cache")) {
|
|
1748
|
-
if (!existsSync(cacheRoot))
|
|
1749
|
-
return [];
|
|
1750
|
-
const queue = [
|
|
1751
|
-
{ path: cacheRoot, depth: 0 },
|
|
1752
|
-
];
|
|
1753
|
-
const maxDepth = 5;
|
|
1754
|
-
const matches = [];
|
|
1755
|
-
while (queue.length > 0) {
|
|
1756
|
-
const current = queue.shift();
|
|
1757
|
-
if (!current)
|
|
1758
|
-
break;
|
|
1759
|
-
const manifestPath = join(current.path, ".codex-plugin", "plugin.json");
|
|
1760
|
-
if (existsSync(manifestPath)) {
|
|
1761
|
-
const name = await readPluginManifestName(manifestPath);
|
|
1762
|
-
if (name === "oh-my-codex") {
|
|
1763
|
-
matches.push(current.path);
|
|
1764
|
-
continue;
|
|
1765
|
-
}
|
|
1766
|
-
}
|
|
1767
|
-
if (current.depth >= maxDepth)
|
|
1768
|
-
continue;
|
|
1769
|
-
let entries;
|
|
1770
|
-
try {
|
|
1771
|
-
entries = await readdir(current.path, { withFileTypes: true });
|
|
1772
|
-
}
|
|
1773
|
-
catch {
|
|
1774
|
-
continue;
|
|
1775
|
-
}
|
|
1776
|
-
for (const entry of entries) {
|
|
1777
|
-
if (!entry.isDirectory())
|
|
1778
|
-
continue;
|
|
1779
|
-
if (entry.name === ".git" || entry.name === "node_modules")
|
|
1780
|
-
continue;
|
|
1781
|
-
queue.push({
|
|
1782
|
-
path: join(current.path, entry.name),
|
|
1783
|
-
depth: current.depth + 1,
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
|
-
return matches.sort();
|
|
1788
|
-
}
|
|
1789
|
-
async function discoverOmxPluginCacheDir(cacheRoot = join(codexHome(), "plugins", "cache")) {
|
|
1790
|
-
return (await discoverOmxPluginCacheDirs(cacheRoot))[0] ?? null;
|
|
1791
|
-
}
|
|
1792
|
-
async function refreshOmxPluginDiscoveryCache(pkgRoot, options, codexHomeDir = codexHome()) {
|
|
1793
|
-
const packagedMarketplace = await resolvePackagedOmxMarketplace(pkgRoot);
|
|
1794
|
-
if (!packagedMarketplace) {
|
|
1795
|
-
return { status: "unavailable", staleDirs: [] };
|
|
1796
|
-
}
|
|
1797
|
-
const [pkg, expectedSkillNames, cachedDirs] = await Promise.all([
|
|
1798
|
-
readFile(join(pkgRoot, "package.json"), "utf-8").then((raw) => JSON.parse(raw)),
|
|
1799
|
-
listChildDirectoryNames(join(packagedMarketplace.pluginRoot, "skills")),
|
|
1800
|
-
discoverOmxPluginCacheDirs(join(codexHomeDir, "plugins", "cache")),
|
|
1801
|
-
]);
|
|
1802
|
-
const expectedVersion = typeof pkg.version === "string" ? pkg.version : null;
|
|
1803
|
-
const staleDirs = [];
|
|
1804
|
-
for (const cacheDir of cachedDirs) {
|
|
1805
|
-
const manifest = await readPluginManifestSummary(join(cacheDir, ".codex-plugin", "plugin.json"));
|
|
1806
|
-
if (manifest?.name !== "oh-my-codex")
|
|
1807
|
-
continue;
|
|
1808
|
-
const cachedSkillNames = await listChildDirectoryNames(join(cacheDir, "skills"));
|
|
1809
|
-
const versionChanged = expectedVersion !== null && manifest.version !== expectedVersion;
|
|
1810
|
-
const skillsPointerChanged = manifest.skills !== "./skills/";
|
|
1811
|
-
const hooksPointerChanged = manifest.hooks !== "./hooks/hooks.json";
|
|
1812
|
-
const hookFilesMissing = !existsSync(join(cacheDir, "hooks", "hooks.json"))
|
|
1813
|
-
|| !existsSync(join(cacheDir, "hooks", "codex-native-hook.mjs"))
|
|
1814
|
-
|| !existsSync(join(cacheDir, "hooks", "omx-command.json"));
|
|
1815
|
-
const hookFilesChanged = !hookFilesMissing
|
|
1816
|
-
&& !(await pluginHookCacheMatchesPackaged(cacheDir, packagedMarketplace));
|
|
1817
|
-
const skillListChanged = expectedSkillNames !== null &&
|
|
1818
|
-
cachedSkillNames !== null &&
|
|
1819
|
-
JSON.stringify(cachedSkillNames) !== JSON.stringify(expectedSkillNames);
|
|
1820
|
-
if (!versionChanged &&
|
|
1821
|
-
!skillsPointerChanged &&
|
|
1822
|
-
!hooksPointerChanged &&
|
|
1823
|
-
!hookFilesMissing &&
|
|
1824
|
-
!hookFilesChanged &&
|
|
1825
|
-
!skillListChanged)
|
|
1826
|
-
continue;
|
|
1827
|
-
staleDirs.push(cacheDir);
|
|
1828
|
-
if (!options.dryRun) {
|
|
1829
|
-
await rm(cacheDir, { recursive: true, force: true });
|
|
1830
|
-
}
|
|
1831
|
-
if (options.verbose) {
|
|
1832
|
-
const reasons = [
|
|
1833
|
-
versionChanged
|
|
1834
|
-
? `version ${manifest.version ?? "unknown"} -> ${expectedVersion}`
|
|
1835
|
-
: null,
|
|
1836
|
-
skillsPointerChanged
|
|
1837
|
-
? `skills pointer ${manifest.skills ?? "missing"} -> ./skills/`
|
|
1838
|
-
: null,
|
|
1839
|
-
hooksPointerChanged
|
|
1840
|
-
? `hooks pointer ${manifest.hooks ?? "missing"} -> ./hooks/hooks.json`
|
|
1841
|
-
: null,
|
|
1842
|
-
hookFilesMissing ? "plugin hook files missing" : null,
|
|
1843
|
-
hookFilesChanged ? "plugin hook files changed" : null,
|
|
1844
|
-
skillListChanged ? "skill directory list changed" : null,
|
|
1845
|
-
].filter(Boolean);
|
|
1846
|
-
console.log(` ${options.dryRun ? "would invalidate" : "invalidated"} Codex plugin discovery cache ${cacheDir} (${reasons.join(", ")})`);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
return {
|
|
1850
|
-
status: staleDirs.length > 0 ? "refreshed" : "unchanged",
|
|
1851
|
-
staleDirs,
|
|
1852
|
-
};
|
|
1851
|
+
async function discoverOmxPluginCacheDir(codexHomeDir = codexHome()) {
|
|
1852
|
+
return (await discoverOmxPluginCacheDirs(codexHomeDir))[0] ?? null;
|
|
1853
1853
|
}
|
|
1854
1854
|
function resolveSetupMcpMode(scope, requestedMcpMode, persistedReviewDecision, persistedPreferences) {
|
|
1855
1855
|
if (requestedMcpMode) {
|
|
@@ -2211,6 +2211,122 @@ function buildPluginModeLegacyConfig(original, options) {
|
|
|
2211
2211
|
config = config.trim();
|
|
2212
2212
|
return config.length > 0 ? `${config}\n` : "";
|
|
2213
2213
|
}
|
|
2214
|
+
function stripLocalOmxPluginEnablementForDisable(config) {
|
|
2215
|
+
const lines = config.split(/\r?\n/);
|
|
2216
|
+
const header = '[plugins."oh-my-codex@oh-my-codex-local"]';
|
|
2217
|
+
const start = lines.findIndex((line) => line.trim() === header);
|
|
2218
|
+
if (start >= 0) {
|
|
2219
|
+
let end = lines.length;
|
|
2220
|
+
for (let index = start + 1; index < lines.length; index += 1) {
|
|
2221
|
+
if (/^\s*\[/.test(lines[index])) {
|
|
2222
|
+
end = index;
|
|
2223
|
+
break;
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
for (let index = end - 1; index > start; index -= 1) {
|
|
2227
|
+
if (/^\s*enabled\s*=\s*true\s*(?:#.*)?$/.test(lines[index])) {
|
|
2228
|
+
lines[index] = lines[index].replace("true", "false");
|
|
2229
|
+
break;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
const pluginsStart = lines.findIndex((line) => /^\s*\[plugins\]\s*$/.test(line));
|
|
2234
|
+
if (pluginsStart >= 0) {
|
|
2235
|
+
for (let index = pluginsStart + 1; index < lines.length && !/^\s*\[/.test(lines[index]); index += 1) {
|
|
2236
|
+
if (/^\s*"oh-my-codex@oh-my-codex-local"\s*=\s*true\s*(?:#.*)?$/.test(lines[index])) {
|
|
2237
|
+
lines[index] = lines[index].replace("true", "false");
|
|
2238
|
+
break;
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
return lines.join("\n").replace(/\n{3,}/g, "\n\n");
|
|
2243
|
+
}
|
|
2244
|
+
function stripHookFeatureFlagsForDisable(config, preserveNativeHooks) {
|
|
2245
|
+
const lines = config.split(/\r?\n/);
|
|
2246
|
+
const featuresStart = lines.findIndex((line) => /^\s*\[features\]\s*$/.test(line));
|
|
2247
|
+
if (featuresStart < 0)
|
|
2248
|
+
return config;
|
|
2249
|
+
let sectionEnd = lines.length;
|
|
2250
|
+
for (let index = featuresStart + 1; index < lines.length; index += 1) {
|
|
2251
|
+
if (/^\s*\[\[?[^\]]+\]?\]\s*$/.test(lines[index])) {
|
|
2252
|
+
sectionEnd = index;
|
|
2253
|
+
break;
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
const removable = new Set(preserveNativeHooks
|
|
2257
|
+
? ["plugin_hooks"]
|
|
2258
|
+
: ["hooks", "codex_hooks", "plugin_hooks"]);
|
|
2259
|
+
for (let index = sectionEnd - 1; index > featuresStart; index -= 1) {
|
|
2260
|
+
const match = /^\s*([A-Za-z0-9_-]+)\s*=\s*true\s*(?:#.*)?$/.exec(lines[index]);
|
|
2261
|
+
if (match && removable.has(match[1]))
|
|
2262
|
+
lines[index] = lines[index].replace("true", "false");
|
|
2263
|
+
}
|
|
2264
|
+
const nextFeaturesStart = lines.findIndex((line) => /^\s*\[features\]\s*$/.test(line));
|
|
2265
|
+
if (nextFeaturesStart >= 0) {
|
|
2266
|
+
let nextSectionEnd = lines.length;
|
|
2267
|
+
for (let index = nextFeaturesStart + 1; index < lines.length; index += 1) {
|
|
2268
|
+
if (/^\s*\[\[?[^\]]+\]?\]\s*$/.test(lines[index])) {
|
|
2269
|
+
nextSectionEnd = index;
|
|
2270
|
+
break;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
if (lines.slice(nextFeaturesStart + 1, nextSectionEnd).every((line) => line.trim() === "")) {
|
|
2274
|
+
lines.splice(nextFeaturesStart, nextSectionEnd - nextFeaturesStart);
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
return lines.join("\n");
|
|
2278
|
+
}
|
|
2279
|
+
function parseDisableHooksNotifyMetadata(snapshot, metadataPath, currentNotify) {
|
|
2280
|
+
if (!snapshot.bytes) {
|
|
2281
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} is missing.`);
|
|
2282
|
+
}
|
|
2283
|
+
let parsed;
|
|
2284
|
+
try {
|
|
2285
|
+
parsed = JSON.parse(decodeNativeHookTransactionUtf8(snapshot.bytes, `notification metadata ${metadataPath}`));
|
|
2286
|
+
}
|
|
2287
|
+
catch (error) {
|
|
2288
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} is invalid JSON (${error instanceof Error ? error.message : String(error)}).`);
|
|
2289
|
+
}
|
|
2290
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
2291
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} must be an object.`);
|
|
2292
|
+
}
|
|
2293
|
+
const metadata = parsed;
|
|
2294
|
+
const dispatcherNotify = metadata.dispatcherNotify;
|
|
2295
|
+
if (metadata.managedBy !== "oh-my-codex" || metadata.version !== 1 ||
|
|
2296
|
+
!Array.isArray(dispatcherNotify) ||
|
|
2297
|
+
dispatcherNotify.length !== currentNotify.length ||
|
|
2298
|
+
dispatcherNotify.some((part, index) => part !== currentNotify[index])) {
|
|
2299
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} does not prove OMX ownership.`);
|
|
2300
|
+
}
|
|
2301
|
+
const previousNotify = metadata.previousNotify;
|
|
2302
|
+
if (previousNotify !== null && (!Array.isArray(previousNotify) || !previousNotify.every((part) => typeof part === "string"))) {
|
|
2303
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} has invalid previousNotify.`);
|
|
2304
|
+
}
|
|
2305
|
+
return sanitizePreviousNotifyCommand(previousNotify, getPackageRoot());
|
|
2306
|
+
}
|
|
2307
|
+
async function planDisableHooksConfig(existingConfig, pkgRoot, managedHooksPlan, codexHomeDir, notifyMetadataSnapshot) {
|
|
2308
|
+
const priorManagedHookTrustState = managedHooksPlan?.priorTrustState ?? {};
|
|
2309
|
+
let finalConfig = stripManagedCodexHookTrustState(existingConfig, {
|
|
2310
|
+
priorManagedHookTrustState,
|
|
2311
|
+
managedTrustState: {},
|
|
2312
|
+
});
|
|
2313
|
+
finalConfig = stripHookFeatureFlagsForDisable(finalConfig, managedHooksPlan?.hasForeignHooks === true);
|
|
2314
|
+
finalConfig = stripLocalOmxPluginEnablementForDisable(finalConfig);
|
|
2315
|
+
const notify = getRootTomlArray(finalConfig, "notify");
|
|
2316
|
+
if (!notify || !isOmxManagedNotifyCommand(notify, pkgRoot)) {
|
|
2317
|
+
return { finalConfig, metadataAfter: null };
|
|
2318
|
+
}
|
|
2319
|
+
const metadataPath = getNotifyMetadataPath(codexHomeDir);
|
|
2320
|
+
if (isOmxDispatcherNotifyCommand(notify, pkgRoot)) {
|
|
2321
|
+
const previousNotify = parseDisableHooksNotifyMetadata(notifyMetadataSnapshot ?? { bytes: null, topology: { kind: "absent" } }, metadataPath, notify);
|
|
2322
|
+
finalConfig = removeRootTomlKey(finalConfig, "notify");
|
|
2323
|
+
if (previousNotify) {
|
|
2324
|
+
finalConfig = insertRootTomlKey(finalConfig, `notify = ${formatTomlStringArray(previousNotify)}`);
|
|
2325
|
+
}
|
|
2326
|
+
return { finalConfig, metadataPath, metadataAfter: null };
|
|
2327
|
+
}
|
|
2328
|
+
return { finalConfig: removeRootTomlKey(finalConfig, "notify"), metadataAfter: null };
|
|
2329
|
+
}
|
|
2214
2330
|
async function planNativeHookSetupTransaction(options) {
|
|
2215
2331
|
const existingConfigSnapshot = options.configSnapshot;
|
|
2216
2332
|
const existingHooksSnapshot = await captureNativeHookTransactionArtifact(options.hooksPath, `native hooks ${options.hooksPath}`);
|
|
@@ -2231,7 +2347,29 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2231
2347
|
let notifyMetadataPrecondition = null;
|
|
2232
2348
|
let modelUpgrade;
|
|
2233
2349
|
let repairedLegacyTeamRunTable = false;
|
|
2234
|
-
if (options.
|
|
2350
|
+
if (options.disableHooks) {
|
|
2351
|
+
let managedHooksPlan = null;
|
|
2352
|
+
if (existingHooksContent !== null) {
|
|
2353
|
+
const removal = planManagedCodexHooksRemoval(existingHooksContent, options.hooksPath, {
|
|
2354
|
+
platform: options.platform,
|
|
2355
|
+
codexHomeDir: options.codexHomeDir,
|
|
2356
|
+
});
|
|
2357
|
+
if (!removal.ok)
|
|
2358
|
+
throw removal.error;
|
|
2359
|
+
managedHooksPlan = removal;
|
|
2360
|
+
finalHooksContent = removal.finalContent;
|
|
2361
|
+
hooksRemovedCount = removal.removedCount;
|
|
2362
|
+
diagnostics = removal.diagnostics;
|
|
2363
|
+
}
|
|
2364
|
+
const notifyPlan = await planDisableHooksConfig(existingConfig, options.pkgRoot, managedHooksPlan, options.codexHomeDir, options.notifyMetadataSnapshot);
|
|
2365
|
+
finalConfig = notifyPlan.finalConfig;
|
|
2366
|
+
if (notifyPlan.metadataPath) {
|
|
2367
|
+
const metadataBefore = options.notifyMetadataSnapshot ?? { bytes: null, topology: { kind: "absent" } };
|
|
2368
|
+
notifyMetadataPrecondition = nativeHookTransactionPrecondition("metadata", notifyPlan.metadataPath, `notification metadata ${notifyPlan.metadataPath}`, metadataBefore);
|
|
2369
|
+
notifyMetadataArtifact = nativeHookTransactionArtifact("metadata", notifyPlan.metadataPath, `notification metadata ${notifyPlan.metadataPath}`, metadataBefore, notifyPlan.metadataAfter);
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
if (!options.disableHooks && options.isPluginInstallMode) {
|
|
2235
2373
|
const pluginPlan = buildPluginModeHooksConfigPlan(existingConfig, existingHooksContent, options.pkgRoot, options.hooksPath, options.codexHomeDir, {
|
|
2236
2374
|
codexHookFeatureFlag: options.codexHookFeatureFlag,
|
|
2237
2375
|
pluginScopedHooks: options.pluginScopedHooks,
|
|
@@ -2257,7 +2395,7 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2257
2395
|
finalConfig = developerInstructionsPlan.finalConfig;
|
|
2258
2396
|
pluginDeveloperInstructionsResult = developerInstructionsPlan.result;
|
|
2259
2397
|
}
|
|
2260
|
-
else {
|
|
2398
|
+
else if (!options.disableHooks) {
|
|
2261
2399
|
const managedHooksPlan = planManagedCodexHooksMerge(existingHooksContent, options.pkgRoot, options.hooksPath, {
|
|
2262
2400
|
platform: options.platform,
|
|
2263
2401
|
codexHomeDir: options.codexHomeDir,
|
|
@@ -2308,7 +2446,7 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2308
2446
|
}
|
|
2309
2447
|
}
|
|
2310
2448
|
}
|
|
2311
|
-
if (options.isPluginInstallMode && options.sharedMcpRegistry.servers.length > 0) {
|
|
2449
|
+
if (!options.disableHooks && options.isPluginInstallMode && options.sharedMcpRegistry.servers.length > 0) {
|
|
2312
2450
|
finalConfig = mergeSharedMcpRegistryBlock(finalConfig, options.sharedMcpRegistry.servers, options.sharedMcpRegistry.sourcePath);
|
|
2313
2451
|
}
|
|
2314
2452
|
try {
|
|
@@ -2327,8 +2465,9 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2327
2465
|
const shimAfter = Buffer.from(buildManagedCodexNativeHookWindowsShimContent(options.pkgRoot), "utf-8");
|
|
2328
2466
|
assertWindowsNativeHookShimOwnership(shimPath, shimSnapshot.bytes, shimAfter);
|
|
2329
2467
|
const shimReference = decideWindowsNativeHookShimReference(finalHooksContent, shimPath);
|
|
2330
|
-
|
|
2331
|
-
|
|
2468
|
+
const shouldDeleteShim = shimReference === "not_referenced" &&
|
|
2469
|
+
(options.disableHooks || (options.isPluginInstallMode && options.pluginScopedHooks));
|
|
2470
|
+
shimArtifact = nativeHookTransactionArtifact("shim", shimPath, `native hook Windows shim ${shimPath}`, shimSnapshot, shouldDeleteShim
|
|
2332
2471
|
? null
|
|
2333
2472
|
: shimAfter);
|
|
2334
2473
|
shimPrecondition = nativeHookTransactionPrecondition("shim", shimPath, `native hook Windows shim ${shimPath}`, shimSnapshot);
|
|
@@ -2371,7 +2510,7 @@ async function planNativeHookSetupTransaction(options) {
|
|
|
2371
2510
|
};
|
|
2372
2511
|
}
|
|
2373
2512
|
export async function setup(options = {}) {
|
|
2374
|
-
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;
|
|
2513
|
+
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;
|
|
2375
2514
|
const pkgRoot = getPackageRoot();
|
|
2376
2515
|
const projectRoot = process.cwd();
|
|
2377
2516
|
const persistedPreferences = await readPersistedSetupPreferences(projectRoot, { warnOnLegacyScope: true });
|
|
@@ -2434,7 +2573,7 @@ export async function setup(options = {}) {
|
|
|
2434
2573
|
const scopeDirs = resolveScopeDirectories(resolvedScope.scope, projectRoot);
|
|
2435
2574
|
if (!dryRun) {
|
|
2436
2575
|
const recoveryTracker = { degraded: false };
|
|
2437
|
-
const recovery = await recoverNativeHookClaimJournal(scopeDirs.codexHomeDir, nativeHookClaimJournalDurability());
|
|
2576
|
+
const recovery = await recoverNativeHookClaimJournal(scopeDirs.codexHomeDir, nativeHookClaimJournalDurability(recoveryTracker));
|
|
2438
2577
|
recordRegularFileSyncOutcome(recoveryTracker, recovery.outcome);
|
|
2439
2578
|
if (recovery.recovered) {
|
|
2440
2579
|
emitDegradedDurabilityWarning("native-hook claim-journal recovery", recoveryTracker);
|
|
@@ -2458,6 +2597,9 @@ export async function setup(options = {}) {
|
|
|
2458
2597
|
const notifyMetadataSnapshot = configRequiresNotificationMetadataSnapshot(existingConfigForMcpMigration, pkgRoot, resolvedScope.scope)
|
|
2459
2598
|
? await captureNativeHookTransactionArtifact(getNotifyMetadataPath(scopeDirs.codexHomeDir), `notification metadata ${getNotifyMetadataPath(scopeDirs.codexHomeDir)}`)
|
|
2460
2599
|
: undefined;
|
|
2600
|
+
if (disableHooks && !notifyMetadataSnapshot && isOmxDispatcherNotifyCommand(getRootTomlArray(existingConfigForMcpMigration, "notify"), pkgRoot)) {
|
|
2601
|
+
throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to disable OMX hooks: managed notification metadata is unavailable for ${getNotifyMetadataPath(scopeDirs.codexHomeDir)}.`);
|
|
2602
|
+
}
|
|
2461
2603
|
const firstPartyMcpRegistrationKinds = [
|
|
2462
2604
|
hasFirstPartyOmxMcpRegistrations(existingConfigForMcpMigration)
|
|
2463
2605
|
? "config.toml [mcp_servers.omx_*]"
|
|
@@ -2480,6 +2622,7 @@ export async function setup(options = {}) {
|
|
|
2480
2622
|
}
|
|
2481
2623
|
const scopeSourceMessage = resolvedScope.source === "persisted" ? " (from .omx/setup-scope.json)" : "";
|
|
2482
2624
|
const backupContext = getBackupContext(resolvedScope.scope, projectRoot);
|
|
2625
|
+
const skillReceiptPath = installedSkillReceiptPath(resolvedScope.scope, projectRoot);
|
|
2483
2626
|
const isPluginInstallMode = resolvedInstallMode?.installMode === "plugin";
|
|
2484
2627
|
const pluginAgentsMdDst = resolvedScope.scope === "project"
|
|
2485
2628
|
? join(projectRoot, "AGENTS.md")
|
|
@@ -2553,6 +2696,7 @@ export async function setup(options = {}) {
|
|
|
2553
2696
|
forceStatusLinePreset: force,
|
|
2554
2697
|
configSnapshot: existingConfigForMcpMigrationSnapshot,
|
|
2555
2698
|
notifyMetadataSnapshot,
|
|
2699
|
+
disableHooks,
|
|
2556
2700
|
});
|
|
2557
2701
|
const summary = createEmptyRunSummary();
|
|
2558
2702
|
for (const precondition of nativeHookSetupTransaction.preconditions) {
|
|
@@ -2560,6 +2704,14 @@ export async function setup(options = {}) {
|
|
|
2560
2704
|
await assertNativeHookTransactionPrecondition(precondition);
|
|
2561
2705
|
}
|
|
2562
2706
|
await assertNativeHookTransactionAncestorPrecondition(nativeHookTransactionAncestorPrecondition);
|
|
2707
|
+
if (disableHooks) {
|
|
2708
|
+
const disableSummary = createEmptyRunSummary();
|
|
2709
|
+
const durabilityTracker = { degraded: false };
|
|
2710
|
+
await commitNativeHookTransaction(nativeHookSetupTransaction.artifacts, nativeHookSetupTransaction.preconditions, nativeHookTransactionAncestorPrecondition, backupContext, durabilityTracker, disableSummary.config, { dryRun, verbose });
|
|
2711
|
+
emitDegradedDurabilityWarning("native-hook setup", durabilityTracker);
|
|
2712
|
+
console.log(`${dryRun ? "Would disable" : "Disabled"} OMX hook registrations; non-OMX hooks and .omx artifacts were preserved.`);
|
|
2713
|
+
return;
|
|
2714
|
+
}
|
|
2563
2715
|
console.log("oh-my-codex setup");
|
|
2564
2716
|
console.log("=================\n");
|
|
2565
2717
|
console.log(`Using setup scope: ${resolvedScope.scope}${scopeSourceMessage}\n`);
|
|
@@ -2673,7 +2825,7 @@ export async function setup(options = {}) {
|
|
|
2673
2825
|
const skillsDst = scopeDirs.skillsDir;
|
|
2674
2826
|
if (isPluginInstallMode) {
|
|
2675
2827
|
summary.skills = createEmptyCategorySummary();
|
|
2676
|
-
const cleanup = await cleanupLegacyManagedSkills(skillsSrc, skillsDst, backupContext, { dryRun, verbose });
|
|
2828
|
+
const cleanup = await cleanupLegacyManagedSkills(skillsSrc, skillsDst, backupContext, { dryRun, verbose, skillReceiptPath });
|
|
2677
2829
|
summary.skills.backedUp += cleanup.backedUp;
|
|
2678
2830
|
summary.skills.removed += cleanup.removedSkillNames.length;
|
|
2679
2831
|
summary.skills.skipped += cleanup.skippedSkillNames.length;
|
|
@@ -2692,6 +2844,7 @@ export async function setup(options = {}) {
|
|
|
2692
2844
|
force,
|
|
2693
2845
|
dryRun,
|
|
2694
2846
|
verbose,
|
|
2847
|
+
skillReceiptPath,
|
|
2695
2848
|
teamMode: resolvedTeamMode,
|
|
2696
2849
|
});
|
|
2697
2850
|
}
|
|
@@ -2718,7 +2871,7 @@ export async function setup(options = {}) {
|
|
|
2718
2871
|
});
|
|
2719
2872
|
console.log(` Native agent role refresh complete (${scopeDirs.nativeAgentsDir}); plugin mode still installs role TOML so agent_type routing works.\n`);
|
|
2720
2873
|
}
|
|
2721
|
-
else {
|
|
2874
|
+
else if (!options.disableHooks) {
|
|
2722
2875
|
summary.nativeAgents = await refreshNativeAgentConfigs(pkgRoot, scopeDirs.nativeAgentsDir, backupContext, {
|
|
2723
2876
|
force,
|
|
2724
2877
|
dryRun,
|
|
@@ -2793,18 +2946,6 @@ export async function setup(options = {}) {
|
|
|
2793
2946
|
else {
|
|
2794
2947
|
console.log(` Local Codex plugin marketplace ${OMX_LOCAL_MARKETPLACE_NAME} already registered (${pkgRoot}).`);
|
|
2795
2948
|
}
|
|
2796
|
-
const pluginCacheRefresh = await refreshOmxPluginDiscoveryCache(pkgRoot, {
|
|
2797
|
-
dryRun,
|
|
2798
|
-
verbose,
|
|
2799
|
-
}, scopeDirs.codexHomeDir);
|
|
2800
|
-
if (pluginCacheRefresh.status === "refreshed") {
|
|
2801
|
-
if (pluginCacheRefresh.staleDirs.length > 0) {
|
|
2802
|
-
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.`);
|
|
2803
|
-
}
|
|
2804
|
-
}
|
|
2805
|
-
else if (pluginCacheRefresh.status === "unchanged") {
|
|
2806
|
-
console.log(" Codex plugin discovery cache already matches packaged plugin metadata.");
|
|
2807
|
-
}
|
|
2808
2949
|
const pluginCacheMaterialize = await materializePackagedOmxPluginCache(scopeDirs.codexHomeDir, preflightMarketplace, { dryRun, teamMode: resolvedTeamMode });
|
|
2809
2950
|
if (pluginCacheMaterialize.status === "materialized") {
|
|
2810
2951
|
console.log(` ${dryRun ? "Would install" : "Installed"} local Codex plugin cache for ${OMX_LOCAL_MARKETPLACE_NAME}/${OMX_PLUGIN_NAME} at ${pluginCacheMaterialize.cacheDir}.`);
|
|
@@ -2865,7 +3006,11 @@ export async function setup(options = {}) {
|
|
|
2865
3006
|
const activeSession = resolvedScope.scope === "project"
|
|
2866
3007
|
? await readSessionState(projectRoot)
|
|
2867
3008
|
: null;
|
|
2868
|
-
|
|
3009
|
+
// Only a definitely dead session releases the overlay. macOS records no process-birth evidence, so
|
|
3010
|
+
// a live session classifies as identity-indeterminate; treating that as stale would let setup
|
|
3011
|
+
// overwrite the AGENTS.md overlay of a running session.
|
|
3012
|
+
const sessionIsActive = activeSession !== null &&
|
|
3013
|
+
classifySessionStateLiveness(activeSession) !== "stale-dead";
|
|
2869
3014
|
if (isPluginInstallMode) {
|
|
2870
3015
|
const agentsMdSrc = join(pkgRoot, "templates", "AGENTS.md");
|
|
2871
3016
|
const pluginAgentsMdExists = pluginAgentsMdPathExists;
|
|
@@ -3639,7 +3784,14 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3639
3784
|
: null;
|
|
3640
3785
|
const isSetupInstallableSkill = (skillName, status) => isCatalogInstallableStatus(status) || installableSkillNames.has(skillName);
|
|
3641
3786
|
const entries = await readdir(srcDir, { withFileTypes: true });
|
|
3642
|
-
const
|
|
3787
|
+
const catalogKnownSkillNames = new Set(manifest?.skills.map((skill) => skill.name) ?? []);
|
|
3788
|
+
const staleCandidateSkillNames = new Set(catalogKnownSkillNames);
|
|
3789
|
+
if (existsSync(dstDir)) {
|
|
3790
|
+
for (const installed of await readdir(dstDir, { withFileTypes: true })) {
|
|
3791
|
+
if (installed.isDirectory())
|
|
3792
|
+
staleCandidateSkillNames.add(installed.name);
|
|
3793
|
+
}
|
|
3794
|
+
}
|
|
3643
3795
|
for (const entry of entries) {
|
|
3644
3796
|
if (!entry.isDirectory())
|
|
3645
3797
|
continue;
|
|
@@ -3674,6 +3826,7 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3674
3826
|
for (const skill of installableSkills) {
|
|
3675
3827
|
await validateSkillFile(join(skill.sourceDir, "SKILL.md"));
|
|
3676
3828
|
}
|
|
3829
|
+
const writtenFilesBySkill = new Map();
|
|
3677
3830
|
for (const skill of installableSkills) {
|
|
3678
3831
|
const skillName = skill.name;
|
|
3679
3832
|
const skillSrc = skill.sourceDir;
|
|
@@ -3682,18 +3835,27 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3682
3835
|
await mkdir(skillDst, { recursive: true });
|
|
3683
3836
|
}
|
|
3684
3837
|
const skillFiles = await readdir(skillSrc);
|
|
3838
|
+
const writtenForSkill = [];
|
|
3685
3839
|
for (const sf of skillFiles) {
|
|
3686
3840
|
const sfPath = join(skillSrc, sf);
|
|
3687
3841
|
const sfStat = await stat(sfPath);
|
|
3688
3842
|
if (!sfStat.isFile())
|
|
3689
3843
|
continue;
|
|
3690
3844
|
const dstPath = join(skillDst, sf);
|
|
3845
|
+
writtenForSkill.push(sf);
|
|
3691
3846
|
if (sf === "SKILL.md") {
|
|
3692
3847
|
await syncManagedContent(rewriteInstalledSkillDescriptionBadge(await readFile(sfPath, "utf-8"), sfPath), dstPath, summary, backupContext, options, `skill ${skillName}/${sf}`);
|
|
3693
3848
|
continue;
|
|
3694
3849
|
}
|
|
3695
3850
|
await syncManagedFileFromDisk(sfPath, dstPath, summary, backupContext, options, `skill ${skillName}/${sf}`);
|
|
3696
3851
|
}
|
|
3852
|
+
writtenFilesBySkill.set(skillName, writtenForSkill);
|
|
3853
|
+
}
|
|
3854
|
+
// Record what we just wrote so a later refresh can prove an unmodified install before retiring it.
|
|
3855
|
+
// Without an authority path, refuse to create a receipt rather than placing deletion authority
|
|
3856
|
+
// in the user-writable skills directory.
|
|
3857
|
+
if (options.skillReceiptPath) {
|
|
3858
|
+
await writeInstalledSkillReceipt(options.skillReceiptPath, dstDir, writtenFilesBySkill, options);
|
|
3697
3859
|
}
|
|
3698
3860
|
if (manifest && existsSync(dstDir)) {
|
|
3699
3861
|
for (const staleSkill of staleCandidateSkillNames) {
|
|
@@ -3701,14 +3863,32 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3701
3863
|
const disabledTeamSkill = !teamModeEnabled(options.teamMode) && TEAM_MODE_SKILL_NAMES.has(staleSkill);
|
|
3702
3864
|
if (isSetupInstallableSkill(staleSkill, status) && !disabledTeamSkill)
|
|
3703
3865
|
continue;
|
|
3704
|
-
const hardDeprecated = HARD_DEPRECATED_SKILL_NAMES.has(staleSkill);
|
|
3705
|
-
if (!options.force && !hardDeprecated && !disabledTeamSkill)
|
|
3706
|
-
continue;
|
|
3707
3866
|
const staleSkillDir = join(dstDir, staleSkill);
|
|
3708
3867
|
if (!existsSync(staleSkillDir))
|
|
3709
3868
|
continue;
|
|
3710
|
-
|
|
3711
|
-
|
|
3869
|
+
// A directory the catalog no longer ships is ours to retire on any refresh - which is what
|
|
3870
|
+
// makes `omx update` drop deprecated skills without an extra flag - but only when we can
|
|
3871
|
+
// prove it is an UNMODIFIED install we wrote. The badge alone is not proof: a user who
|
|
3872
|
+
// edits the body keeps it, and archiving their edit is not preserving it.
|
|
3873
|
+
const unmodifiedInstall = Boolean(options.skillReceiptPath)
|
|
3874
|
+
&& await isUnmodifiedRecordedInstall(options.skillReceiptPath, staleSkill, staleSkillDir);
|
|
3875
|
+
const omxManaged = await isOmxManagedInstalledSkillDir(staleSkillDir) && unmodifiedInstall;
|
|
3876
|
+
const forcedCatalogSkill = options.force && catalogKnownSkillNames.has(staleSkill);
|
|
3877
|
+
// Disabling Team mode is a configuration change, not a destructive opt-in, so it must not
|
|
3878
|
+
// delete a directory we cannot prove we wrote. --force remains the explicit destructive path.
|
|
3879
|
+
const removableDisabledTeamSkill = disabledTeamSkill && unmodifiedInstall;
|
|
3880
|
+
if (!omxManaged && !forcedCatalogSkill && !removableDisabledTeamSkill) {
|
|
3881
|
+
summary.skipped += 1;
|
|
3882
|
+
if (options.verbose) {
|
|
3883
|
+
const why = await isOmxManagedInstalledSkillDir(staleSkillDir)
|
|
3884
|
+
? "modified since install, or installed before receipts existed"
|
|
3885
|
+
: "not an OMX-managed skill install";
|
|
3886
|
+
console.log(` kept ${staleSkill}/ (${why})`);
|
|
3887
|
+
}
|
|
3888
|
+
continue;
|
|
3889
|
+
}
|
|
3890
|
+
if (await removeDirectoryCopyAware(staleSkillDir, backupContext, options)) {
|
|
3891
|
+
summary.backedUp += 1;
|
|
3712
3892
|
}
|
|
3713
3893
|
summary.removed += 1;
|
|
3714
3894
|
if (options.verbose) {
|
|
@@ -3716,9 +3896,9 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
|
|
|
3716
3896
|
? "would remove stale skill"
|
|
3717
3897
|
: "removed stale skill";
|
|
3718
3898
|
const label = status ?? "unlisted";
|
|
3719
|
-
const reason =
|
|
3899
|
+
const reason = removableDisabledTeamSkill
|
|
3720
3900
|
? ", Team mode disabled"
|
|
3721
|
-
:
|
|
3901
|
+
: omxManaged ? ", retired from the catalog" : "";
|
|
3722
3902
|
console.log(` ${prefix} ${staleSkill}/ (status: ${label}${reason})`);
|
|
3723
3903
|
}
|
|
3724
3904
|
}
|
|
@@ -3776,12 +3956,42 @@ async function cleanupLegacyManagedSkills(srcDir, dstDir, backupContext, options
|
|
|
3776
3956
|
result.warnings.push(warning);
|
|
3777
3957
|
continue;
|
|
3778
3958
|
}
|
|
3959
|
+
// A matching SKILL.md does not prove the whole directory is ours: a user file sitting beside it
|
|
3960
|
+
// would be deleted with the directory. Require the same unmodified-install proof the ordinary
|
|
3961
|
+
// retirement sweep uses.
|
|
3962
|
+
if (!options.skillReceiptPath || !(await isUnmodifiedRecordedInstall(options.skillReceiptPath, skillName, installedSkillDir))) {
|
|
3963
|
+
const warning = `Skipping legacy skill cleanup for ${skillName}: directory contents are not a receipted unmodified OMX install.`;
|
|
3964
|
+
result.skippedSkillNames.push(skillName);
|
|
3965
|
+
result.warnings.push(warning);
|
|
3966
|
+
continue;
|
|
3967
|
+
}
|
|
3779
3968
|
const removed = await removeDirectoryCopyAware(installedSkillDir, backupContext, options);
|
|
3780
3969
|
if (removed) {
|
|
3781
3970
|
result.backedUp += 1;
|
|
3782
3971
|
result.removedSkillNames.push(skillName);
|
|
3783
3972
|
}
|
|
3784
3973
|
}
|
|
3974
|
+
// Plugin mode never reinstalls into the legacy directory, so a skill the catalog has retired
|
|
3975
|
+
// would otherwise survive there forever. Retire OMX-badged orphans on every refresh.
|
|
3976
|
+
for (const entry of await readdir(dstDir, { withFileTypes: true })) {
|
|
3977
|
+
if (!entry.isDirectory())
|
|
3978
|
+
continue;
|
|
3979
|
+
if (installableSkillNames.has(entry.name))
|
|
3980
|
+
continue;
|
|
3981
|
+
const installedSkillDir = join(dstDir, entry.name);
|
|
3982
|
+
if (!(await isOmxManagedInstalledSkillDir(installedSkillDir)))
|
|
3983
|
+
continue;
|
|
3984
|
+
// The badge alone is not proof of ownership for deletion; a user-edited body keeps it.
|
|
3985
|
+
if (!options.skillReceiptPath || !(await isUnmodifiedRecordedInstall(options.skillReceiptPath, entry.name, installedSkillDir))) {
|
|
3986
|
+
result.skippedSkillNames.push(entry.name);
|
|
3987
|
+
result.warnings.push(`Skipping retired skill ${entry.name}: modified since install, or installed before receipts existed.`);
|
|
3988
|
+
continue;
|
|
3989
|
+
}
|
|
3990
|
+
if (await removeDirectoryCopyAware(installedSkillDir, backupContext, options)) {
|
|
3991
|
+
result.backedUp += 1;
|
|
3992
|
+
result.removedSkillNames.push(entry.name);
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3785
3995
|
return result;
|
|
3786
3996
|
}
|
|
3787
3997
|
function getNotifyMetadataPath(codexHomeDir) {
|