oh-my-codex 0.14.4 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/Cargo.lock +6 -6
- package/Cargo.toml +2 -1
- package/README.md +40 -7
- package/crates/omx-explore/Cargo.toml +1 -0
- package/crates/omx-explore/src/main.rs +246 -24
- package/crates/omx-mux/Cargo.toml +1 -0
- package/crates/omx-runtime/Cargo.toml +1 -0
- package/crates/omx-runtime-core/Cargo.toml +1 -0
- package/crates/omx-runtime-core/src/dispatch.rs +2 -1
- package/crates/omx-runtime-core/src/engine.rs +2 -2
- package/crates/omx-runtime-core/src/mailbox.rs +2 -1
- package/crates/omx-sparkshell/Cargo.toml +1 -0
- package/crates/omx-sparkshell/src/codex_bridge.rs +1 -0
- package/crates/omx-sparkshell/src/prompt.rs +1 -0
- package/crates/omx-sparkshell/src/threshold.rs +1 -0
- package/dist/agents/__tests__/native-config.test.js +98 -4
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/native-config.d.ts +4 -0
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js +19 -3
- package/dist/agents/native-config.js.map +1 -1
- package/dist/agents/policy.d.ts +10 -0
- package/dist/agents/policy.d.ts.map +1 -0
- package/dist/agents/policy.js +61 -0
- package/dist/agents/policy.js.map +1 -0
- package/dist/catalog/__tests__/generator.test.js +2 -0
- package/dist/catalog/__tests__/generator.test.js.map +1 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +2 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +1 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +72 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -0
- package/dist/catalog/installable.d.ts +5 -0
- package/dist/catalog/installable.d.ts.map +1 -0
- package/dist/catalog/installable.js +13 -0
- package/dist/catalog/installable.js.map +1 -0
- package/dist/catalog/skill-mirror.d.ts +20 -0
- package/dist/catalog/skill-mirror.d.ts.map +1 -0
- package/dist/catalog/skill-mirror.js +104 -0
- package/dist/catalog/skill-mirror.js.map +1 -0
- package/dist/cli/__tests__/ask.test.js +4 -1
- package/dist/cli/__tests__/ask.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +2 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +1 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js +210 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-team.test.js +46 -1
- package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +225 -111
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +96 -1
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/explore.test.js +26 -9
- package/dist/cli/__tests__/explore.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +301 -7
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +358 -4
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/list.test.d.ts +2 -0
- package/dist/cli/__tests__/list.test.d.ts.map +1 -0
- package/dist/cli/__tests__/list.test.js +38 -0
- package/dist/cli/__tests__/list.test.js.map +1 -0
- package/dist/cli/__tests__/mcp-parity.test.js +86 -0
- package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-serve.test.d.ts +2 -0
- package/dist/cli/__tests__/mcp-serve.test.d.ts.map +1 -0
- package/dist/cli/__tests__/mcp-serve.test.js +38 -0
- package/dist/cli/__tests__/mcp-serve.test.js.map +1 -0
- package/dist/cli/__tests__/nested-help-routing.test.js +1 -0
- package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +58 -3
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +209 -5
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +146 -3
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-install-mode.test.js +873 -0
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -0
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js +83 -22
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +120 -2
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +32 -13
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
- package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sidecar.test.js +24 -0
- package/dist/cli/__tests__/sidecar.test.js.map +1 -0
- package/dist/cli/__tests__/team.test.js +90 -42
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/version-sync-contract.test.js +11 -0
- package/dist/cli/__tests__/version-sync-contract.test.js.map +1 -1
- package/dist/cli/codex-home.d.ts +4 -5
- package/dist/cli/codex-home.d.ts.map +1 -1
- package/dist/cli/codex-home.js +9 -37
- package/dist/cli/codex-home.js.map +1 -1
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +509 -278
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +13 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +351 -60
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/list.d.ts +2 -0
- package/dist/cli/list.d.ts.map +1 -0
- package/dist/cli/list.js +40 -0
- package/dist/cli/list.js.map +1 -0
- package/dist/cli/mcp-serve.d.ts +12 -0
- package/dist/cli/mcp-serve.d.ts.map +1 -0
- package/dist/cli/mcp-serve.js +63 -0
- package/dist/cli/mcp-serve.js.map +1 -0
- package/dist/cli/plugin-marketplace.d.ts +13 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -0
- package/dist/cli/plugin-marketplace.js +77 -0
- package/dist/cli/plugin-marketplace.js.map +1 -0
- package/dist/cli/question.d.ts.map +1 -1
- package/dist/cli/question.js +27 -2
- package/dist/cli/question.js.map +1 -1
- package/dist/cli/setup-preferences.d.ts +20 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -0
- package/dist/cli/setup-preferences.js +71 -0
- package/dist/cli/setup-preferences.js.map +1 -0
- package/dist/cli/setup.d.ts +12 -3
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +1080 -254
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts +1 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +22 -3
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +2 -8
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +100 -3
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +6 -5
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
- package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
- package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
- package/dist/config/__tests__/models.test.js +35 -2
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/codex-hooks.d.ts.map +1 -1
- package/dist/config/codex-hooks.js +2 -7
- package/dist/config/codex-hooks.js.map +1 -1
- package/dist/config/generator.d.ts +10 -0
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +259 -76
- package/dist/config/generator.js.map +1 -1
- package/dist/config/models.d.ts +13 -3
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +25 -5
- package/dist/config/models.js.map +1 -1
- package/dist/config/omx-first-party-mcp.d.ts +18 -0
- package/dist/config/omx-first-party-mcp.d.ts.map +1 -0
- package/dist/config/omx-first-party-mcp.js +76 -0
- package/dist/config/omx-first-party-mcp.js.map +1 -0
- package/dist/document-refresh/__tests__/enforcer.test.d.ts +2 -0
- package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +1 -0
- package/dist/document-refresh/__tests__/enforcer.test.js +128 -0
- package/dist/document-refresh/__tests__/enforcer.test.js.map +1 -0
- package/dist/document-refresh/config.d.ts +9 -0
- package/dist/document-refresh/config.d.ts.map +1 -0
- package/dist/document-refresh/config.js +70 -0
- package/dist/document-refresh/config.js.map +1 -0
- package/dist/document-refresh/enforcer.d.ts +43 -0
- package/dist/document-refresh/enforcer.d.ts.map +1 -0
- package/dist/document-refresh/enforcer.js +329 -0
- package/dist/document-refresh/enforcer.js.map +1 -0
- package/dist/exec/followup.d.ts +44 -0
- package/dist/exec/followup.d.ts.map +1 -0
- package/dist/exec/followup.js +349 -0
- package/dist/exec/followup.js.map +1 -0
- package/dist/hooks/__tests__/codebase-map.test.js +63 -1
- package/dist/hooks/__tests__/codebase-map.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +10 -7
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +89 -0
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +84 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +23 -2
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +43 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +17 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +53 -0
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js +4 -4
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +103 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +27 -13
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +70 -3
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js +5 -0
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +3 -2
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +28 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/triage-heuristic.test.js +59 -4
- package/dist/hooks/__tests__/triage-heuristic.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +2 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.js +44 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -0
- package/dist/hooks/codebase-map.d.ts.map +1 -1
- package/dist/hooks/codebase-map.js +83 -6
- package/dist/hooks/codebase-map.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +19 -14
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/prompt-guidance-contract.d.ts +6 -0
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +89 -0
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/session.d.ts +2 -0
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +6 -0
- package/dist/hooks/session.js.map +1 -1
- package/dist/hooks/triage-heuristic.d.ts +2 -2
- package/dist/hooks/triage-heuristic.d.ts.map +1 -1
- package/dist/hooks/triage-heuristic.js +97 -20
- package/dist/hooks/triage-heuristic.js.map +1 -1
- package/dist/hooks/triage-state.d.ts +1 -1
- package/dist/hooks/triage-state.d.ts.map +1 -1
- package/dist/hooks/triage-state.js +2 -1
- package/dist/hooks/triage-state.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +4 -4
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +4 -0
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/types.test.js +27 -0
- package/dist/hud/__tests__/types.test.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +8 -0
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +9 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +3 -0
- package/dist/hud/types.js.map +1 -1
- package/dist/mcp/__tests__/bootstrap.test.js +45 -5
- package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +50 -7
- package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +67 -9
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/bootstrap.d.ts +12 -1
- package/dist/mcp/bootstrap.d.ts.map +1 -1
- package/dist/mcp/bootstrap.js +87 -29
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/state-server.d.ts +5 -11
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/state-server.js +16 -432
- package/dist/mcp/state-server.js.map +1 -1
- package/dist/planning/__tests__/artifacts.test.js +152 -1
- package/dist/planning/__tests__/artifacts.test.js.map +1 -1
- package/dist/planning/artifacts.d.ts +9 -0
- package/dist/planning/artifacts.d.ts.map +1 -1
- package/dist/planning/artifacts.js +60 -1
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/question/__tests__/deep-interview.test.js +1 -1
- package/dist/question/__tests__/deep-interview.test.js.map +1 -1
- package/dist/question/__tests__/renderer.test.js +70 -0
- package/dist/question/__tests__/renderer.test.js.map +1 -1
- package/dist/question/__tests__/ui.test.js +49 -0
- package/dist/question/__tests__/ui.test.js.map +1 -1
- package/dist/question/renderer.d.ts +14 -1
- package/dist/question/renderer.d.ts.map +1 -1
- package/dist/question/renderer.js +109 -10
- package/dist/question/renderer.js.map +1 -1
- package/dist/question/state.d.ts +2 -0
- package/dist/question/state.d.ts.map +1 -1
- package/dist/question/state.js +4 -0
- package/dist/question/state.js.map +1 -1
- package/dist/question/types.d.ts +2 -1
- package/dist/question/types.d.ts.map +1 -1
- package/dist/question/types.js.map +1 -1
- package/dist/question/ui.d.ts.map +1 -1
- package/dist/question/ui.js +28 -8
- package/dist/question/ui.js.map +1 -1
- package/dist/runtime/__tests__/bridge.test.js +143 -1
- package/dist/runtime/__tests__/bridge.test.js.map +1 -1
- package/dist/runtime/bridge.d.ts +21 -0
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +54 -4
- package/dist/runtime/bridge.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +1904 -230
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/generate-release-body.test.js +90 -1
- package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -1
- package/dist/scripts/__tests__/hook-derived-watcher.test.js +110 -2
- package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -1
- package/dist/scripts/__tests__/postinstall.test.js +7 -93
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
- package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.d.ts +2 -0
- package/dist/scripts/__tests__/run-test-files.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.js +62 -0
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -0
- package/dist/scripts/__tests__/smoke-packed-install.test.js +13 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts +2 -0
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/verify-native-agents.test.js +166 -0
- package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -0
- package/dist/scripts/codex-execution-surface.d.ts +16 -0
- package/dist/scripts/codex-execution-surface.d.ts.map +1 -0
- package/dist/scripts/codex-execution-surface.js +42 -0
- package/dist/scripts/codex-execution-surface.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +418 -76
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts +8 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +133 -19
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/generate-release-body.d.ts +1 -0
- package/dist/scripts/generate-release-body.d.ts.map +1 -1
- package/dist/scripts/generate-release-body.js +32 -3
- package/dist/scripts/generate-release-body.js.map +1 -1
- package/dist/scripts/hook-derived-watcher.js +46 -7
- package/dist/scripts/hook-derived-watcher.js.map +1 -1
- package/dist/scripts/notify-fallback-watcher.js +59 -9
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
- package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
- package/dist/scripts/notify-hook/managed-tmux.js +18 -1
- package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
- package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
- package/dist/scripts/notify-hook/process-runner.js +7 -3
- package/dist/scripts/notify-hook/process-runner.js.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +96 -11
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +3 -3
- package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
- package/dist/scripts/notify-hook/team-worker.d.ts +1 -1
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +3 -43
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook.js +36 -5
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/postinstall.d.ts +1 -5
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +3 -42
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/scripts/prompt-inventory.d.ts +29 -0
- package/dist/scripts/prompt-inventory.d.ts.map +1 -0
- package/dist/scripts/prompt-inventory.js +178 -0
- package/dist/scripts/prompt-inventory.js.map +1 -0
- package/dist/scripts/run-test-files.js +32 -2
- package/dist/scripts/run-test-files.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +3 -0
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +9 -1
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts +13 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -0
- package/dist/scripts/sync-plugin-mirror.js +242 -0
- package/dist/scripts/sync-plugin-mirror.js.map +1 -0
- package/dist/scripts/verify-native-agents.d.ts +16 -0
- package/dist/scripts/verify-native-agents.d.ts.map +1 -0
- package/dist/scripts/verify-native-agents.js +188 -0
- package/dist/scripts/verify-native-agents.js.map +1 -0
- package/dist/session-history/search.d.ts.map +1 -1
- package/dist/session-history/search.js +7 -2
- package/dist/session-history/search.js.map +1 -1
- package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
- package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/boundary.test.js +48 -0
- package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
- package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
- package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/collector.test.js +162 -0
- package/dist/sidecar/__tests__/collector.test.js.map +1 -0
- package/dist/sidecar/__tests__/render.test.d.ts +2 -0
- package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/render.test.js +67 -0
- package/dist/sidecar/__tests__/render.test.js.map +1 -0
- package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
- package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/tmux.test.js +30 -0
- package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
- package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
- package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/watch.test.js +42 -0
- package/dist/sidecar/__tests__/watch.test.js.map +1 -0
- package/dist/sidecar/collector.d.ts +4 -0
- package/dist/sidecar/collector.d.ts.map +1 -0
- package/dist/sidecar/collector.js +377 -0
- package/dist/sidecar/collector.js.map +1 -0
- package/dist/sidecar/index.d.ts +25 -0
- package/dist/sidecar/index.d.ts.map +1 -0
- package/dist/sidecar/index.js +165 -0
- package/dist/sidecar/index.js.map +1 -0
- package/dist/sidecar/render.d.ts +3 -0
- package/dist/sidecar/render.d.ts.map +1 -0
- package/dist/sidecar/render.js +72 -0
- package/dist/sidecar/render.js.map +1 -0
- package/dist/sidecar/tmux.d.ts +13 -0
- package/dist/sidecar/tmux.d.ts.map +1 -0
- package/dist/sidecar/tmux.js +44 -0
- package/dist/sidecar/tmux.js.map +1 -0
- package/dist/sidecar/types.d.ts +125 -0
- package/dist/sidecar/types.d.ts.map +1 -0
- package/dist/sidecar/types.js +2 -0
- package/dist/sidecar/types.js.map +1 -0
- package/dist/state/__tests__/operations.test.js +50 -22
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/operations.d.ts +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +19 -7
- package/dist/state/operations.js.map +1 -1
- package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
- package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
- package/dist/team/__tests__/commit-hygiene.test.js +93 -0
- package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
- package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
- package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
- package/dist/team/__tests__/delegation-policy.test.js +69 -0
- package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
- package/dist/team/__tests__/events.test.js +54 -4
- package/dist/team/__tests__/events.test.js.map +1 -1
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +18 -2
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.js +95 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -0
- package/dist/team/__tests__/runtime.test.js +677 -17
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js +177 -1
- package/dist/team/__tests__/state-root.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +110 -0
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +301 -2
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +94 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/commit-hygiene.d.ts +22 -3
- package/dist/team/commit-hygiene.d.ts.map +1 -1
- package/dist/team/commit-hygiene.js +134 -2
- package/dist/team/commit-hygiene.js.map +1 -1
- package/dist/team/contracts.d.ts +1 -1
- package/dist/team/contracts.d.ts.map +1 -1
- package/dist/team/contracts.js +2 -0
- package/dist/team/contracts.js.map +1 -1
- package/dist/team/dag-schema.d.ts +38 -0
- package/dist/team/dag-schema.d.ts.map +1 -0
- package/dist/team/dag-schema.js +221 -0
- package/dist/team/dag-schema.js.map +1 -0
- package/dist/team/delegation-policy.d.ts +3 -0
- package/dist/team/delegation-policy.d.ts.map +1 -0
- package/dist/team/delegation-policy.js +82 -0
- package/dist/team/delegation-policy.js.map +1 -0
- package/dist/team/model-contract.d.ts +3 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +44 -5
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/repo-aware-decomposition.d.ts +60 -0
- package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
- package/dist/team/repo-aware-decomposition.js +229 -0
- package/dist/team/repo-aware-decomposition.js.map +1 -0
- package/dist/team/runtime.d.ts +34 -0
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +191 -50
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +33 -0
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/state/types.d.ts +23 -1
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state-root.d.ts +35 -0
- package/dist/team/state-root.d.ts.map +1 -1
- package/dist/team/state-root.js +281 -1
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts +27 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +6 -0
- package/dist/team/state.js.map +1 -1
- package/dist/team/tmux-session.d.ts +1 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +83 -6
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +3 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +77 -4
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/utils/__tests__/agents-model-table.test.js +8 -0
- package/dist/utils/__tests__/agents-model-table.test.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +42 -9
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/agents-md.d.ts +3 -0
- package/dist/utils/agents-md.d.ts.map +1 -1
- package/dist/utils/agents-md.js +25 -0
- package/dist/utils/agents-md.js.map +1 -1
- package/dist/utils/agents-model-table.d.ts.map +1 -1
- package/dist/utils/agents-model-table.js +2 -3
- package/dist/utils/agents-model-table.js.map +1 -1
- package/package.json +14 -7
- package/plugins/oh-my-codex/.app.json +3 -0
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +30 -0
- package/plugins/oh-my-codex/.mcp.json +44 -0
- package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +114 -0
- package/plugins/oh-my-codex/skills/analyze/SKILL.md +148 -0
- package/plugins/oh-my-codex/skills/ask-claude/SKILL.md +61 -0
- package/plugins/oh-my-codex/skills/ask-gemini/SKILL.md +61 -0
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +231 -0
- package/plugins/oh-my-codex/skills/autoresearch/SKILL.md +68 -0
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +399 -0
- package/plugins/oh-my-codex/skills/code-review/SKILL.md +290 -0
- package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +287 -0
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +464 -0
- package/plugins/oh-my-codex/skills/doctor/SKILL.md +239 -0
- package/plugins/oh-my-codex/skills/help/SKILL.md +202 -0
- package/plugins/oh-my-codex/skills/hud/SKILL.md +98 -0
- package/plugins/oh-my-codex/skills/note/SKILL.md +62 -0
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +135 -0
- package/plugins/oh-my-codex/skills/pipeline/SKILL.md +86 -0
- package/plugins/oh-my-codex/skills/plan/SKILL.md +276 -0
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +269 -0
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +162 -0
- package/plugins/oh-my-codex/skills/security-review/SKILL.md +300 -0
- package/plugins/oh-my-codex/skills/skill/SKILL.md +835 -0
- package/plugins/oh-my-codex/skills/team/SKILL.md +510 -0
- package/plugins/oh-my-codex/skills/trace/SKILL.md +33 -0
- package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +143 -0
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +175 -0
- package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +153 -0
- package/plugins/oh-my-codex/skills/visual-verdict/SKILL.md +76 -0
- package/plugins/oh-my-codex/skills/wiki/SKILL.md +57 -0
- package/plugins/oh-my-codex/skills/worker/SKILL.md +106 -0
- package/prompts/critic.md +35 -83
- package/prompts/executor.md +32 -109
- package/prompts/explore-harness.md +1 -1
- package/prompts/explore.md +37 -90
- package/prompts/planner.md +28 -58
- package/prompts/researcher.md +46 -78
- package/prompts/verifier.md +23 -31
- package/skills/autopilot/SKILL.md +1 -4
- package/skills/deep-interview/SKILL.md +8 -5
- package/skills/doctor/SKILL.md +45 -17
- package/skills/help/SKILL.md +2 -2
- package/skills/omx-setup/SKILL.md +52 -9
- package/skills/plan/SKILL.md +1 -4
- package/skills/ralph/SKILL.md +3 -5
- package/skills/ralplan/SKILL.md +2 -6
- package/skills/team/SKILL.md +2 -5
- package/skills/ultraqa/SKILL.md +1 -4
- package/skills/ultrawork/SKILL.md +2 -3
- package/skills/visual-ralph/SKILL.md +153 -0
- package/skills/web-clone/SKILL.md +12 -354
- package/src/scripts/__tests__/codex-native-hook.test.ts +2306 -224
- package/src/scripts/__tests__/generate-release-body.test.ts +109 -0
- package/src/scripts/__tests__/hook-derived-watcher.test.ts +132 -2
- package/src/scripts/__tests__/postinstall.test.ts +7 -104
- package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
- package/src/scripts/__tests__/run-test-files.test.ts +72 -0
- package/src/scripts/__tests__/smoke-packed-install.test.ts +15 -0
- package/src/scripts/__tests__/verify-native-agents.test.ts +204 -0
- package/src/scripts/codex-execution-surface.ts +73 -0
- package/src/scripts/codex-native-hook.ts +579 -82
- package/src/scripts/codex-native-pre-post.ts +157 -19
- package/src/scripts/generate-release-body.ts +34 -2
- package/src/scripts/hook-derived-watcher.ts +51 -8
- package/src/scripts/notify-fallback-watcher.ts +65 -9
- package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
- package/src/scripts/notify-hook/managed-tmux.ts +22 -4
- package/src/scripts/notify-hook/process-runner.ts +7 -3
- package/src/scripts/notify-hook/team-dispatch.ts +103 -11
- package/src/scripts/notify-hook/team-tmux-guard.ts +3 -3
- package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
- package/src/scripts/notify-hook/team-worker.ts +4 -48
- package/src/scripts/notify-hook.ts +36 -5
- package/src/scripts/postinstall.ts +4 -58
- package/src/scripts/prompt-inventory.ts +218 -0
- package/src/scripts/run-test-files.ts +41 -2
- package/src/scripts/smoke-packed-install.ts +10 -1
- package/src/scripts/sync-plugin-mirror.ts +360 -0
- package/src/scripts/verify-native-agents.ts +245 -0
- package/templates/AGENTS.md +26 -91
- package/templates/catalog-manifest.json +16 -1
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { cp, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
import {
|
|
7
|
+
getSetupInstallableSkillNames,
|
|
8
|
+
isCatalogInstallableStatus,
|
|
9
|
+
} from "../catalog/installable.js";
|
|
10
|
+
import { readCatalogManifest } from "../catalog/reader.js";
|
|
11
|
+
import {
|
|
12
|
+
assertSkillMirror,
|
|
13
|
+
compareSkillMirror,
|
|
14
|
+
} from "../catalog/skill-mirror.js";
|
|
15
|
+
import { buildOmxPluginMcpManifest } from "../config/omx-first-party-mcp.js";
|
|
16
|
+
|
|
17
|
+
export interface SyncPluginMirrorOptions {
|
|
18
|
+
root?: string;
|
|
19
|
+
check?: boolean;
|
|
20
|
+
verbose?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SyncPluginMirrorResult {
|
|
24
|
+
checked: boolean;
|
|
25
|
+
mirroredSkillNames: string[];
|
|
26
|
+
changed: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type JsonValue =
|
|
30
|
+
| null
|
|
31
|
+
| boolean
|
|
32
|
+
| number
|
|
33
|
+
| string
|
|
34
|
+
| JsonValue[]
|
|
35
|
+
| { [key: string]: JsonValue };
|
|
36
|
+
|
|
37
|
+
type PluginManifest = {
|
|
38
|
+
name?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
skills?: string;
|
|
41
|
+
mcpServers?: string;
|
|
42
|
+
apps?: string;
|
|
43
|
+
agents?: string;
|
|
44
|
+
prompts?: string;
|
|
45
|
+
hooks?: string;
|
|
46
|
+
[key: string]: JsonValue | undefined;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type PackageJson = {
|
|
50
|
+
version?: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const PLUGIN_NAME = "oh-my-codex";
|
|
54
|
+
const SETUP_OWNED_PLUGIN_MANIFEST_FIELDS = [
|
|
55
|
+
"agents",
|
|
56
|
+
"prompts",
|
|
57
|
+
"hooks",
|
|
58
|
+
] as const;
|
|
59
|
+
|
|
60
|
+
async function readJsonFile<T>(path: string): Promise<T> {
|
|
61
|
+
return JSON.parse(await readFile(path, "utf-8")) as T;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function stringifyJson(value: unknown): string {
|
|
65
|
+
return `${JSON.stringify(value, null, 2)}\n`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function assertDeepJsonEqual(
|
|
69
|
+
actual: unknown,
|
|
70
|
+
expected: unknown,
|
|
71
|
+
label: string,
|
|
72
|
+
): void {
|
|
73
|
+
const actualJson = stringifyJson(actual);
|
|
74
|
+
const expectedJson = stringifyJson(expected);
|
|
75
|
+
if (actualJson !== expectedJson) {
|
|
76
|
+
throw new Error(
|
|
77
|
+
[
|
|
78
|
+
"plugin_bundle_metadata_out_of_sync",
|
|
79
|
+
`kind=${label}`,
|
|
80
|
+
`expected=${expectedJson.trim()}`,
|
|
81
|
+
`actual=${actualJson.trim()}`,
|
|
82
|
+
].join("\n"),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getPluginPaths(root: string): {
|
|
88
|
+
pluginRoot: string;
|
|
89
|
+
pluginSkillsDir: string;
|
|
90
|
+
pluginMcpPath: string;
|
|
91
|
+
pluginAppsPath: string;
|
|
92
|
+
pluginManifestPath: string;
|
|
93
|
+
} {
|
|
94
|
+
const pluginRoot = join(root, "plugins", PLUGIN_NAME);
|
|
95
|
+
return {
|
|
96
|
+
pluginRoot,
|
|
97
|
+
pluginSkillsDir: join(pluginRoot, "skills"),
|
|
98
|
+
pluginMcpPath: join(pluginRoot, ".mcp.json"),
|
|
99
|
+
pluginAppsPath: join(pluginRoot, ".app.json"),
|
|
100
|
+
pluginManifestPath: join(pluginRoot, ".codex-plugin", "plugin.json"),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function assertRootSkillCatalogConsistency(
|
|
105
|
+
root: string,
|
|
106
|
+
skillNames: readonly string[],
|
|
107
|
+
): Promise<void> {
|
|
108
|
+
const manifest = readCatalogManifest(root);
|
|
109
|
+
const rootSkillsDir = join(root, "skills");
|
|
110
|
+
const manifestByName = new Map(
|
|
111
|
+
manifest.skills.map((skill) => [skill.name, skill]),
|
|
112
|
+
);
|
|
113
|
+
const expectedSkillNames = new Set(skillNames);
|
|
114
|
+
|
|
115
|
+
for (const skillName of skillNames) {
|
|
116
|
+
const skillMd = join(rootSkillsDir, skillName, "SKILL.md");
|
|
117
|
+
if (!existsSync(skillMd)) {
|
|
118
|
+
throw new Error(`canonical_skill_missing: skills/${skillName}/SKILL.md`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const rootEntries = await readdir(rootSkillsDir, { withFileTypes: true });
|
|
123
|
+
const unlistedSkillDirs = rootEntries
|
|
124
|
+
.filter((entry) => entry.isDirectory())
|
|
125
|
+
.map((entry) => entry.name)
|
|
126
|
+
.filter(
|
|
127
|
+
(skillName) =>
|
|
128
|
+
!manifestByName.has(skillName) && !expectedSkillNames.has(skillName),
|
|
129
|
+
)
|
|
130
|
+
.sort();
|
|
131
|
+
if (unlistedSkillDirs.length > 0) {
|
|
132
|
+
throw new Error(
|
|
133
|
+
[
|
|
134
|
+
"canonical_skill_catalog_out_of_sync",
|
|
135
|
+
"message=root skill directories must be listed in the catalog or explicitly included by setup policy",
|
|
136
|
+
`skills=${JSON.stringify(unlistedSkillDirs)}`,
|
|
137
|
+
].join("\n"),
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const nonInstallableRootSkillDirs = rootEntries
|
|
142
|
+
.filter((entry) => entry.isDirectory())
|
|
143
|
+
.map((entry) => entry.name)
|
|
144
|
+
.filter((skillName) => {
|
|
145
|
+
if (expectedSkillNames.has(skillName)) return false;
|
|
146
|
+
const status = manifestByName.get(skillName)?.status;
|
|
147
|
+
return status !== "alias" && status !== "merged";
|
|
148
|
+
})
|
|
149
|
+
.sort();
|
|
150
|
+
if (nonInstallableRootSkillDirs.length > 0) {
|
|
151
|
+
throw new Error(
|
|
152
|
+
[
|
|
153
|
+
"canonical_skill_catalog_out_of_sync",
|
|
154
|
+
"message=root skill directories excluded from plugin must be alias or merged catalog entries",
|
|
155
|
+
`skills=${JSON.stringify(nonInstallableRootSkillDirs)}`,
|
|
156
|
+
].join("\n"),
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const installableMissingFromSetup = manifest.skills
|
|
161
|
+
.filter((skill) => isCatalogInstallableStatus(skill.status))
|
|
162
|
+
.map((skill) => skill.name)
|
|
163
|
+
.filter((skillName) => !expectedSkillNames.has(skillName))
|
|
164
|
+
.sort();
|
|
165
|
+
if (installableMissingFromSetup.length > 0) {
|
|
166
|
+
throw new Error(
|
|
167
|
+
[
|
|
168
|
+
"canonical_skill_catalog_out_of_sync",
|
|
169
|
+
"message=installable catalog skills must be included in plugin/setup installable skill set",
|
|
170
|
+
`skills=${JSON.stringify(installableMissingFromSetup)}`,
|
|
171
|
+
].join("\n"),
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async function buildExpectedPluginManifest(
|
|
177
|
+
root: string,
|
|
178
|
+
): Promise<PluginManifest> {
|
|
179
|
+
const { pluginManifestPath } = getPluginPaths(root);
|
|
180
|
+
const [manifest, pkg] = await Promise.all([
|
|
181
|
+
readJsonFile<PluginManifest>(pluginManifestPath),
|
|
182
|
+
readJsonFile<PackageJson>(join(root, "package.json")),
|
|
183
|
+
]);
|
|
184
|
+
return {
|
|
185
|
+
...manifest,
|
|
186
|
+
name: PLUGIN_NAME,
|
|
187
|
+
version: pkg.version,
|
|
188
|
+
skills: "./skills/",
|
|
189
|
+
mcpServers: "./.mcp.json",
|
|
190
|
+
apps: "./.app.json",
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
async function assertPluginManifestPolicy(
|
|
195
|
+
root: string,
|
|
196
|
+
manifest: PluginManifest,
|
|
197
|
+
): Promise<void> {
|
|
198
|
+
const pkg = await readJsonFile<PackageJson>(join(root, "package.json"));
|
|
199
|
+
const expectedFields: Pick<
|
|
200
|
+
PluginManifest,
|
|
201
|
+
"name" | "version" | "skills" | "mcpServers" | "apps"
|
|
202
|
+
> = {
|
|
203
|
+
name: PLUGIN_NAME,
|
|
204
|
+
version: pkg.version,
|
|
205
|
+
skills: "./skills/",
|
|
206
|
+
mcpServers: "./.mcp.json",
|
|
207
|
+
apps: "./.app.json",
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
for (const [field, expectedValue] of Object.entries(expectedFields)) {
|
|
211
|
+
if (manifest[field] !== expectedValue) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
[
|
|
214
|
+
"plugin_bundle_metadata_out_of_sync",
|
|
215
|
+
"kind=plugin-manifest",
|
|
216
|
+
`field=${field}`,
|
|
217
|
+
`expected=${JSON.stringify(expectedValue)}`,
|
|
218
|
+
`actual=${JSON.stringify(manifest[field])}`,
|
|
219
|
+
].join("\n"),
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
for (const field of SETUP_OWNED_PLUGIN_MANIFEST_FIELDS) {
|
|
225
|
+
if (manifest[field] !== undefined) {
|
|
226
|
+
throw new Error(
|
|
227
|
+
[
|
|
228
|
+
"plugin_bundle_metadata_out_of_sync",
|
|
229
|
+
"kind=plugin-manifest",
|
|
230
|
+
`field=${field}`,
|
|
231
|
+
"message=setup-owned agents/prompts/hooks must not be plugin-scoped",
|
|
232
|
+
].join("\n"),
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
async function assertPluginMetadata(root: string): Promise<void> {
|
|
239
|
+
const { pluginMcpPath, pluginAppsPath, pluginManifestPath } =
|
|
240
|
+
getPluginPaths(root);
|
|
241
|
+
const [actualMcp, actualApps, actualManifest] = await Promise.all([
|
|
242
|
+
readJsonFile<unknown>(pluginMcpPath),
|
|
243
|
+
readJsonFile<unknown>(pluginAppsPath),
|
|
244
|
+
readJsonFile<PluginManifest>(pluginManifestPath),
|
|
245
|
+
]);
|
|
246
|
+
|
|
247
|
+
assertDeepJsonEqual(actualMcp, buildOmxPluginMcpManifest(), "mcp-manifest");
|
|
248
|
+
assertDeepJsonEqual(actualApps, { apps: {} }, "apps-manifest");
|
|
249
|
+
await assertPluginManifestPolicy(root, actualManifest);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async function writePluginMetadata(
|
|
253
|
+
root: string,
|
|
254
|
+
verbose = false,
|
|
255
|
+
): Promise<boolean> {
|
|
256
|
+
const { pluginMcpPath, pluginAppsPath, pluginManifestPath } =
|
|
257
|
+
getPluginPaths(root);
|
|
258
|
+
const expectedMcp = buildOmxPluginMcpManifest();
|
|
259
|
+
const expectedApps = { apps: {} };
|
|
260
|
+
const expectedManifest = await buildExpectedPluginManifest(root);
|
|
261
|
+
const writes = [
|
|
262
|
+
{
|
|
263
|
+
path: pluginMcpPath,
|
|
264
|
+
content: stringifyJson(expectedMcp),
|
|
265
|
+
label: "plugin MCP manifest",
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
path: pluginAppsPath,
|
|
269
|
+
content: stringifyJson(expectedApps),
|
|
270
|
+
label: "plugin apps manifest",
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
path: pluginManifestPath,
|
|
274
|
+
content: stringifyJson(expectedManifest),
|
|
275
|
+
label: "plugin manifest",
|
|
276
|
+
},
|
|
277
|
+
];
|
|
278
|
+
let changed = false;
|
|
279
|
+
|
|
280
|
+
for (const write of writes) {
|
|
281
|
+
const existing = existsSync(write.path)
|
|
282
|
+
? await readFile(write.path, "utf-8")
|
|
283
|
+
: null;
|
|
284
|
+
if (existing !== write.content) {
|
|
285
|
+
await mkdir(dirname(write.path), { recursive: true });
|
|
286
|
+
await writeFile(write.path, write.content);
|
|
287
|
+
changed = true;
|
|
288
|
+
if (verbose) console.log(`synced ${write.label}`);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return changed;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export async function syncPluginMirror(
|
|
296
|
+
options: SyncPluginMirrorOptions = {},
|
|
297
|
+
): Promise<SyncPluginMirrorResult> {
|
|
298
|
+
const root = options.root ?? process.cwd();
|
|
299
|
+
const manifest = readCatalogManifest(root);
|
|
300
|
+
const skillNames = [...getSetupInstallableSkillNames(manifest)].sort();
|
|
301
|
+
const rootSkillsDir = join(root, "skills");
|
|
302
|
+
const { pluginSkillsDir } = getPluginPaths(root);
|
|
303
|
+
|
|
304
|
+
await assertRootSkillCatalogConsistency(root, skillNames);
|
|
305
|
+
|
|
306
|
+
if (options.check) {
|
|
307
|
+
await assertSkillMirror(rootSkillsDir, pluginSkillsDir, skillNames);
|
|
308
|
+
await assertPluginMetadata(root);
|
|
309
|
+
return { checked: true, mirroredSkillNames: skillNames, changed: false };
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const beforeSkillsMatch =
|
|
313
|
+
(await compareSkillMirror(rootSkillsDir, pluginSkillsDir, skillNames)) ===
|
|
314
|
+
null;
|
|
315
|
+
|
|
316
|
+
await rm(pluginSkillsDir, { recursive: true, force: true });
|
|
317
|
+
await mkdir(pluginSkillsDir, { recursive: true });
|
|
318
|
+
|
|
319
|
+
for (const skillName of skillNames) {
|
|
320
|
+
await cp(join(rootSkillsDir, skillName), join(pluginSkillsDir, skillName), {
|
|
321
|
+
recursive: true,
|
|
322
|
+
});
|
|
323
|
+
if (options.verbose) {
|
|
324
|
+
console.log(
|
|
325
|
+
`mirrored skills/${skillName} -> plugins/${PLUGIN_NAME}/skills/${skillName}`,
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const metadataChanged = await writePluginMetadata(root, options.verbose);
|
|
331
|
+
|
|
332
|
+
await assertSkillMirror(rootSkillsDir, pluginSkillsDir, skillNames);
|
|
333
|
+
await assertPluginMetadata(root);
|
|
334
|
+
return {
|
|
335
|
+
checked: false,
|
|
336
|
+
mirroredSkillNames: skillNames,
|
|
337
|
+
changed: !beforeSkillsMatch || metadataChanged,
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function parseArgs(argv: string[]): SyncPluginMirrorOptions {
|
|
342
|
+
return {
|
|
343
|
+
check: argv.includes("--check"),
|
|
344
|
+
verbose: argv.includes("--verbose"),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
349
|
+
syncPluginMirror(parseArgs(process.argv.slice(2)))
|
|
350
|
+
.then((result) => {
|
|
351
|
+
const action = result.checked ? "verified" : "synced";
|
|
352
|
+
console.log(
|
|
353
|
+
`[sync-plugin-mirror] ${action} ${result.mirroredSkillNames.length} canonical skill director${result.mirroredSkillNames.length === 1 ? "y" : "ies"} and plugin metadata`,
|
|
354
|
+
);
|
|
355
|
+
})
|
|
356
|
+
.catch((error: unknown) => {
|
|
357
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
358
|
+
process.exitCode = 1;
|
|
359
|
+
});
|
|
360
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
import TOML from "@iarna/toml";
|
|
7
|
+
import { AGENT_DEFINITIONS, type AgentDefinition } from "../agents/definitions.js";
|
|
8
|
+
import { generateAgentToml } from "../agents/native-config.js";
|
|
9
|
+
import {
|
|
10
|
+
NON_NATIVE_AGENT_PROMPT_ASSETS,
|
|
11
|
+
assertNativeAgentCanonicalTargets,
|
|
12
|
+
getCatalogAgentByName,
|
|
13
|
+
getInstallableNativeAgentNames,
|
|
14
|
+
isNativeAgentInstallableStatus,
|
|
15
|
+
} from "../agents/policy.js";
|
|
16
|
+
import { readCatalogManifest } from "../catalog/reader.js";
|
|
17
|
+
import type { CatalogManifest } from "../catalog/schema.js";
|
|
18
|
+
|
|
19
|
+
export interface VerifyNativeAgentsOptions {
|
|
20
|
+
root?: string;
|
|
21
|
+
manifest?: CatalogManifest;
|
|
22
|
+
definitions?: Record<string, AgentDefinition>;
|
|
23
|
+
promptNames?: Set<string>;
|
|
24
|
+
pluginManifest?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface VerifyNativeAgentsResult {
|
|
28
|
+
installableAgentNames: string[];
|
|
29
|
+
promptAssetNames: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function errorBlock(code: string, fields: Record<string, unknown>): Error {
|
|
33
|
+
return new Error(
|
|
34
|
+
[
|
|
35
|
+
code,
|
|
36
|
+
...Object.entries(fields).map(
|
|
37
|
+
([key, value]) => `${key}=${JSON.stringify(value)}`,
|
|
38
|
+
),
|
|
39
|
+
].join("\n"),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function readPromptNames(root: string): Promise<Set<string>> {
|
|
44
|
+
const promptsDir = join(root, "prompts");
|
|
45
|
+
const entries = await readdir(promptsDir, { withFileTypes: true });
|
|
46
|
+
return new Set(
|
|
47
|
+
entries
|
|
48
|
+
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
|
|
49
|
+
.map((entry) => entry.name.slice(0, -3)),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function readPluginManifest(
|
|
54
|
+
root: string,
|
|
55
|
+
): Promise<Record<string, unknown> | null> {
|
|
56
|
+
const pluginManifestPath = join(
|
|
57
|
+
root,
|
|
58
|
+
"plugins",
|
|
59
|
+
"oh-my-codex",
|
|
60
|
+
".codex-plugin",
|
|
61
|
+
"plugin.json",
|
|
62
|
+
);
|
|
63
|
+
if (!existsSync(pluginManifestPath)) return null;
|
|
64
|
+
return JSON.parse(await readFile(pluginManifestPath, "utf-8")) as Record<
|
|
65
|
+
string,
|
|
66
|
+
unknown
|
|
67
|
+
>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function assertTomlStructure(
|
|
71
|
+
agentName: string,
|
|
72
|
+
agent: AgentDefinition,
|
|
73
|
+
toml: string,
|
|
74
|
+
): void {
|
|
75
|
+
let parsed: Record<string, unknown>;
|
|
76
|
+
try {
|
|
77
|
+
parsed = TOML.parse(toml) as Record<string, unknown>;
|
|
78
|
+
} catch (cause) {
|
|
79
|
+
throw errorBlock("native_agent_toml_invalid", {
|
|
80
|
+
agent: agentName,
|
|
81
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (parsed.name !== agentName) {
|
|
86
|
+
throw errorBlock("native_agent_toml_invalid", {
|
|
87
|
+
agent: agentName,
|
|
88
|
+
field: "name",
|
|
89
|
+
expected: agentName,
|
|
90
|
+
actual: parsed.name,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (parsed.description !== agent.description) {
|
|
94
|
+
throw errorBlock("native_agent_toml_invalid", {
|
|
95
|
+
agent: agentName,
|
|
96
|
+
field: "description",
|
|
97
|
+
expected: agent.description,
|
|
98
|
+
actual: parsed.description,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (parsed.model_reasoning_effort !== agent.reasoningEffort) {
|
|
102
|
+
throw errorBlock("native_agent_toml_invalid", {
|
|
103
|
+
agent: agentName,
|
|
104
|
+
field: "model_reasoning_effort",
|
|
105
|
+
expected: agent.reasoningEffort,
|
|
106
|
+
actual: parsed.model_reasoning_effort,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const instructions = parsed.developer_instructions;
|
|
111
|
+
if (typeof instructions !== "string" || instructions.trim() === "") {
|
|
112
|
+
throw errorBlock("native_agent_toml_invalid", {
|
|
113
|
+
agent: agentName,
|
|
114
|
+
field: "developer_instructions",
|
|
115
|
+
message: "developer instructions must be non-empty",
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
for (const expected of [
|
|
120
|
+
`- role: ${agentName}`,
|
|
121
|
+
`- posture: ${agent.posture}`,
|
|
122
|
+
`- model_class: ${agent.modelClass}`,
|
|
123
|
+
`- routing_role: ${agent.routingRole}`,
|
|
124
|
+
]) {
|
|
125
|
+
if (!instructions.includes(expected)) {
|
|
126
|
+
throw errorBlock("native_agent_toml_invalid", {
|
|
127
|
+
agent: agentName,
|
|
128
|
+
field: "developer_instructions",
|
|
129
|
+
missing: expected,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export async function verifyNativeAgents(
|
|
136
|
+
options: VerifyNativeAgentsOptions = {},
|
|
137
|
+
): Promise<VerifyNativeAgentsResult> {
|
|
138
|
+
const root = resolve(options.root ?? process.cwd());
|
|
139
|
+
const manifest = options.manifest ?? readCatalogManifest(root);
|
|
140
|
+
const definitions = options.definitions ?? AGENT_DEFINITIONS;
|
|
141
|
+
const promptNames = options.promptNames ?? (await readPromptNames(root));
|
|
142
|
+
const catalogByName = getCatalogAgentByName(manifest);
|
|
143
|
+
const installableAgentNames = [...getInstallableNativeAgentNames(manifest)].sort();
|
|
144
|
+
|
|
145
|
+
assertNativeAgentCanonicalTargets(manifest);
|
|
146
|
+
|
|
147
|
+
for (const agent of manifest.agents) {
|
|
148
|
+
if (!isNativeAgentInstallableStatus(agent.status)) continue;
|
|
149
|
+
if (!definitions[agent.name]) {
|
|
150
|
+
throw errorBlock("native_agent_definition_missing", {
|
|
151
|
+
agent: agent.name,
|
|
152
|
+
status: agent.status,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (!promptNames.has(agent.name)) {
|
|
156
|
+
throw errorBlock("native_agent_prompt_missing", {
|
|
157
|
+
agent: agent.name,
|
|
158
|
+
status: agent.status,
|
|
159
|
+
path: `prompts/${agent.name}.md`,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
for (const name of Object.keys(definitions).sort()) {
|
|
165
|
+
if (!catalogByName.has(name)) {
|
|
166
|
+
throw errorBlock("native_agent_catalog_out_of_sync", {
|
|
167
|
+
agent: name,
|
|
168
|
+
message: "agent definition must be listed in catalog agents",
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
for (const name of [...promptNames].sort()) {
|
|
174
|
+
if (catalogByName.has(name)) continue;
|
|
175
|
+
if (NON_NATIVE_AGENT_PROMPT_ASSETS.has(name)) continue;
|
|
176
|
+
throw errorBlock("native_agent_prompt_unclassified", {
|
|
177
|
+
prompt: name,
|
|
178
|
+
path: `prompts/${name}.md`,
|
|
179
|
+
message:
|
|
180
|
+
"prompt files must be cataloged native agents or explicit non-native prompt assets",
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
for (const name of installableAgentNames) {
|
|
185
|
+
const agent = definitions[name];
|
|
186
|
+
if (!agent) continue;
|
|
187
|
+
const promptPath = join(root, "prompts", `${name}.md`);
|
|
188
|
+
const promptContent = options.promptNames
|
|
189
|
+
? `${name} prompt fixture`
|
|
190
|
+
: await readFile(promptPath, "utf-8");
|
|
191
|
+
const toml = generateAgentToml(agent, promptContent);
|
|
192
|
+
assertTomlStructure(name, agent, toml);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const pluginManifest =
|
|
196
|
+
options.pluginManifest === undefined
|
|
197
|
+
? await readPluginManifest(root)
|
|
198
|
+
: options.pluginManifest;
|
|
199
|
+
if (pluginManifest) {
|
|
200
|
+
for (const field of ["agents", "prompts", "hooks"]) {
|
|
201
|
+
if (pluginManifest[field] !== undefined) {
|
|
202
|
+
throw errorBlock("native_agent_plugin_boundary_violation", {
|
|
203
|
+
field,
|
|
204
|
+
message: "native agents/prompts/hooks are setup-owned, not plugin-scoped",
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return {
|
|
211
|
+
installableAgentNames,
|
|
212
|
+
promptAssetNames: [...promptNames].sort(),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function parseArgs(argv: string[]): { root: string } {
|
|
217
|
+
let root = process.cwd();
|
|
218
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
219
|
+
const arg = argv[i];
|
|
220
|
+
if (arg === "--root") {
|
|
221
|
+
const value = argv[i + 1];
|
|
222
|
+
if (!value) throw new Error("missing --root value");
|
|
223
|
+
root = value;
|
|
224
|
+
i += 1;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
throw new Error(`unknown argument: ${arg}`);
|
|
228
|
+
}
|
|
229
|
+
return { root };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
async function main(): Promise<void> {
|
|
233
|
+
const { root } = parseArgs(process.argv.slice(2));
|
|
234
|
+
const result = await verifyNativeAgents({ root });
|
|
235
|
+
console.log(
|
|
236
|
+
`verified ${result.installableAgentNames.length} installable native agents and ${result.promptAssetNames.length} setup prompt assets`,
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (process.argv[1]?.endsWith("verify-native-agents.js")) {
|
|
241
|
+
main().catch((error) => {
|
|
242
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
243
|
+
process.exitCode = 1;
|
|
244
|
+
});
|
|
245
|
+
}
|