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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { join
|
|
2
|
+
import { join } from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import {
|
|
5
5
|
isInstallVersionBump,
|
|
@@ -7,16 +7,13 @@ import {
|
|
|
7
7
|
type UserInstallStamp,
|
|
8
8
|
writeUserInstallStamp,
|
|
9
9
|
} from "../cli/update.js";
|
|
10
|
-
import { setup } from "../cli/setup.js";
|
|
11
10
|
import { getPackageRoot } from "../utils/package.js";
|
|
12
11
|
|
|
13
12
|
type PostinstallStatus =
|
|
14
13
|
| "noop-local"
|
|
15
14
|
| "noop-same-version"
|
|
16
15
|
| "noop-missing-version"
|
|
17
|
-
| "hinted"
|
|
18
|
-
| "setup-ran"
|
|
19
|
-
| "setup-failed";
|
|
16
|
+
| "hinted";
|
|
20
17
|
|
|
21
18
|
export interface PostinstallResult {
|
|
22
19
|
status: PostinstallStatus;
|
|
@@ -26,11 +23,8 @@ export interface PostinstallResult {
|
|
|
26
23
|
interface PostinstallDependencies {
|
|
27
24
|
env: NodeJS.ProcessEnv;
|
|
28
25
|
getCurrentVersion: () => Promise<string | null>;
|
|
29
|
-
isInteractive: () => boolean;
|
|
30
26
|
log: (message: string) => void;
|
|
31
27
|
readStamp: () => Promise<UserInstallStamp | null>;
|
|
32
|
-
runSetup: typeof setup;
|
|
33
|
-
warn: (message: string) => void;
|
|
34
28
|
writeStamp: (stamp: UserInstallStamp) => Promise<void>;
|
|
35
29
|
}
|
|
36
30
|
|
|
@@ -46,29 +40,6 @@ export function isGlobalInstallLifecycle(env: NodeJS.ProcessEnv = process.env):
|
|
|
46
40
|
return isTruthyEnv(env.npm_config_global) || env.npm_config_location === "global";
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
function resolveInstallRoot(env: NodeJS.ProcessEnv): string {
|
|
50
|
-
const installPrefix = env.npm_config_prefix?.trim() || env.npm_config_local_prefix?.trim();
|
|
51
|
-
return installPrefix ? resolve(installPrefix) : process.cwd();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async function runSetupFromInstallRoot(
|
|
55
|
-
runSetup: typeof setup,
|
|
56
|
-
installRoot: string,
|
|
57
|
-
): Promise<void> {
|
|
58
|
-
const previousCwd = process.cwd();
|
|
59
|
-
if (previousCwd === installRoot) {
|
|
60
|
-
await runSetup();
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
process.chdir(installRoot);
|
|
65
|
-
try {
|
|
66
|
-
await runSetup();
|
|
67
|
-
} finally {
|
|
68
|
-
process.chdir(previousCwd);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
43
|
async function getCurrentVersion(): Promise<string | null> {
|
|
73
44
|
try {
|
|
74
45
|
const packageJsonPath = join(getPackageRoot(), "package.json");
|
|
@@ -83,11 +54,8 @@ async function getCurrentVersion(): Promise<string | null> {
|
|
|
83
54
|
const defaultDependencies: PostinstallDependencies = {
|
|
84
55
|
env: process.env,
|
|
85
56
|
getCurrentVersion,
|
|
86
|
-
isInteractive: () => Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
87
57
|
log: (message) => console.log(message),
|
|
88
58
|
readStamp: () => readUserInstallStamp(),
|
|
89
|
-
runSetup: setup,
|
|
90
|
-
warn: (message) => console.warn(message),
|
|
91
59
|
writeStamp: (stamp) => writeUserInstallStamp(stamp),
|
|
92
60
|
};
|
|
93
61
|
|
|
@@ -120,32 +88,10 @@ export async function runPostinstall(
|
|
|
120
88
|
updated_at: new Date().toISOString(),
|
|
121
89
|
});
|
|
122
90
|
|
|
123
|
-
if (!resolved.isInteractive()) {
|
|
124
|
-
resolved.log(
|
|
125
|
-
`[omx] Installed oh-my-codex v${currentStampVersion}. Run \`omx setup\` (interactive) or \`omx update\` when you're ready.`,
|
|
126
|
-
);
|
|
127
|
-
return { status: "hinted", version: currentStampVersion };
|
|
128
|
-
}
|
|
129
|
-
|
|
130
91
|
resolved.log(
|
|
131
|
-
`[omx]
|
|
92
|
+
`[omx] Installed oh-my-codex v${currentStampVersion}. OMX setup is explicit opt-in; run \`omx setup\` or \`omx update\` when you're ready.`,
|
|
132
93
|
);
|
|
133
|
-
|
|
134
|
-
try {
|
|
135
|
-
await runSetupFromInstallRoot(resolved.runSetup, resolveInstallRoot(env));
|
|
136
|
-
await resolved.writeStamp({
|
|
137
|
-
installed_version: currentStampVersion,
|
|
138
|
-
setup_completed_version: currentStampVersion,
|
|
139
|
-
updated_at: new Date().toISOString(),
|
|
140
|
-
});
|
|
141
|
-
resolved.log(`[omx] Setup refresh completed for v${currentStampVersion}.`);
|
|
142
|
-
return { status: "setup-ran", version: currentStampVersion };
|
|
143
|
-
} catch (error) {
|
|
144
|
-
resolved.warn(
|
|
145
|
-
`[omx] Postinstall setup skipped after a non-fatal error: ${error instanceof Error ? error.message : String(error)}`,
|
|
146
|
-
);
|
|
147
|
-
return { status: "setup-failed", version: currentStampVersion };
|
|
148
|
-
}
|
|
94
|
+
return { status: "hinted", version: currentStampVersion };
|
|
149
95
|
}
|
|
150
96
|
|
|
151
97
|
export async function main(): Promise<void> {
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
3
|
+
import { join, relative } from 'node:path';
|
|
4
|
+
|
|
5
|
+
export interface PromptSurfaceInventory {
|
|
6
|
+
path: string;
|
|
7
|
+
lines: number;
|
|
8
|
+
approximateTokens: number;
|
|
9
|
+
absoluteDirectiveCount: number;
|
|
10
|
+
markers: Record<string, number>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface DuplicateFragmentFamily {
|
|
14
|
+
text: string;
|
|
15
|
+
count: number;
|
|
16
|
+
paths: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PromptInventoryReport {
|
|
20
|
+
generatedAt: string;
|
|
21
|
+
root: string;
|
|
22
|
+
totals: {
|
|
23
|
+
files: number;
|
|
24
|
+
lines: number;
|
|
25
|
+
approximateTokens: number;
|
|
26
|
+
absoluteDirectiveCount: number;
|
|
27
|
+
};
|
|
28
|
+
surfaces: PromptSurfaceInventory[];
|
|
29
|
+
duplicateFragmentFamilies: DuplicateFragmentFamily[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const PROMPT_SURFACE_FILES = [
|
|
33
|
+
'AGENTS.md',
|
|
34
|
+
'templates/AGENTS.md',
|
|
35
|
+
'docs/prompt-guidance-contract.md',
|
|
36
|
+
'docs/guidance-schema.md',
|
|
37
|
+
'src/hooks/prompt-guidance-contract.ts',
|
|
38
|
+
'src/config/generator.ts',
|
|
39
|
+
'src/cli/setup.ts',
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const PROMPT_SURFACE_DIRS = [
|
|
43
|
+
'prompts',
|
|
44
|
+
'skills',
|
|
45
|
+
'templates/model-instructions',
|
|
46
|
+
'docs/prompt-guidance-fragments',
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const MARKERS = [
|
|
50
|
+
'<!-- OMX:RUNTIME:START -->',
|
|
51
|
+
'<!-- OMX:RUNTIME:END -->',
|
|
52
|
+
'<!-- OMX:TEAM:WORKER:START -->',
|
|
53
|
+
'<!-- OMX:TEAM:WORKER:END -->',
|
|
54
|
+
'<!-- OMX:MODELS:START -->',
|
|
55
|
+
'<!-- OMX:MODELS:END -->',
|
|
56
|
+
'<!-- omx:generated:agents-md -->',
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
const ABSOLUTE_DIRECTIVE_PATTERN = /\b(MUST(?:\s+NOT)?|DO NOT|DON'T|NEVER|ALWAYS|REQUIRED|REQUIRE|ONLY|STOP|ASK only|AUTO-CONTINUE|KEEP GOING)\b/i;
|
|
60
|
+
|
|
61
|
+
function walkFiles(root: string, dir: string, out: string[]): void {
|
|
62
|
+
const absoluteDir = join(root, dir);
|
|
63
|
+
if (!existsSync(absoluteDir)) return;
|
|
64
|
+
for (const entry of readdirSync(absoluteDir)) {
|
|
65
|
+
const rel = join(dir, entry);
|
|
66
|
+
const absolute = join(root, rel);
|
|
67
|
+
const stats = statSync(absolute);
|
|
68
|
+
if (stats.isDirectory()) {
|
|
69
|
+
walkFiles(root, rel, out);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (stats.isFile() && /\.(md|ts)$/.test(entry)) {
|
|
73
|
+
out.push(rel);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function listPromptSurfacePaths(root = process.cwd()): string[] {
|
|
79
|
+
const paths = new Set<string>();
|
|
80
|
+
for (const file of PROMPT_SURFACE_FILES) {
|
|
81
|
+
if (existsSync(join(root, file))) paths.add(file);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const walked: string[] = [];
|
|
85
|
+
for (const dir of PROMPT_SURFACE_DIRS) walkFiles(root, dir, walked);
|
|
86
|
+
for (const path of walked) paths.add(path);
|
|
87
|
+
|
|
88
|
+
return [...paths].sort();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function countOccurrences(text: string, needle: string): number {
|
|
92
|
+
let count = 0;
|
|
93
|
+
let index = text.indexOf(needle);
|
|
94
|
+
while (index !== -1) {
|
|
95
|
+
count += 1;
|
|
96
|
+
index = text.indexOf(needle, index + needle.length);
|
|
97
|
+
}
|
|
98
|
+
return count;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function approximateTokenCount(text: string): number {
|
|
102
|
+
return text.match(/[\p{L}\p{N}_'-]+|[^\s]/gu)?.length ?? 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function countAbsoluteDirectives(text: string): number {
|
|
106
|
+
return text
|
|
107
|
+
.split(/\r?\n/)
|
|
108
|
+
.filter((line) => ABSOLUTE_DIRECTIVE_PATTERN.test(line))
|
|
109
|
+
.length;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function inventorySurface(root: string, path: string): PromptSurfaceInventory {
|
|
113
|
+
const text = readFileSync(join(root, path), 'utf-8');
|
|
114
|
+
const markers = Object.fromEntries(MARKERS.map((marker) => [marker, countOccurrences(text, marker)]));
|
|
115
|
+
return {
|
|
116
|
+
path,
|
|
117
|
+
lines: text.length === 0 ? 0 : text.split(/\r?\n/).length,
|
|
118
|
+
approximateTokens: approximateTokenCount(text),
|
|
119
|
+
absoluteDirectiveCount: countAbsoluteDirectives(text),
|
|
120
|
+
markers,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function normalizeFragmentLine(line: string): string | null {
|
|
125
|
+
const normalized = line.replace(/\s+/g, ' ').trim();
|
|
126
|
+
if (normalized.length < 60) return null;
|
|
127
|
+
if (/^[-*#>|`]+$/.test(normalized)) return null;
|
|
128
|
+
return normalized;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function duplicateFragmentFamilies(root: string, paths: string[]): DuplicateFragmentFamily[] {
|
|
132
|
+
const occurrences = new Map<string, Set<string>>();
|
|
133
|
+
for (const path of paths) {
|
|
134
|
+
const text = readFileSync(join(root, path), 'utf-8');
|
|
135
|
+
for (const line of text.split(/\r?\n/)) {
|
|
136
|
+
const normalized = normalizeFragmentLine(line);
|
|
137
|
+
if (!normalized) continue;
|
|
138
|
+
const pathsWithLine = occurrences.get(normalized) ?? new Set<string>();
|
|
139
|
+
pathsWithLine.add(path);
|
|
140
|
+
occurrences.set(normalized, pathsWithLine);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return [...occurrences.entries()]
|
|
145
|
+
.map(([text, pathSet]) => ({ text, count: pathSet.size, paths: [...pathSet].sort() }))
|
|
146
|
+
.filter((family) => family.count > 1)
|
|
147
|
+
.sort((a, b) => b.count - a.count || a.text.localeCompare(b.text))
|
|
148
|
+
.slice(0, 50);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function buildPromptInventory(root = process.cwd(), generatedAt = new Date().toISOString()): PromptInventoryReport {
|
|
152
|
+
const resolvedRoot = root;
|
|
153
|
+
const paths = listPromptSurfacePaths(resolvedRoot);
|
|
154
|
+
const surfaces = paths.map((path) => inventorySurface(resolvedRoot, path));
|
|
155
|
+
return {
|
|
156
|
+
generatedAt,
|
|
157
|
+
root: resolvedRoot,
|
|
158
|
+
totals: {
|
|
159
|
+
files: surfaces.length,
|
|
160
|
+
lines: surfaces.reduce((sum, surface) => sum + surface.lines, 0),
|
|
161
|
+
approximateTokens: surfaces.reduce((sum, surface) => sum + surface.approximateTokens, 0),
|
|
162
|
+
absoluteDirectiveCount: surfaces.reduce((sum, surface) => sum + surface.absoluteDirectiveCount, 0),
|
|
163
|
+
},
|
|
164
|
+
surfaces,
|
|
165
|
+
duplicateFragmentFamilies: duplicateFragmentFamilies(resolvedRoot, paths),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function renderPromptInventoryMarkdown(report: PromptInventoryReport): string {
|
|
170
|
+
const rows = report.surfaces.map((surface) => {
|
|
171
|
+
const markerHits = Object.entries(surface.markers)
|
|
172
|
+
.filter(([, count]) => count > 0)
|
|
173
|
+
.map(([marker, count]) => `${marker} (${count})`)
|
|
174
|
+
.join('<br>');
|
|
175
|
+
return `| ${surface.path} | ${surface.lines} | ${surface.approximateTokens} | ${surface.absoluteDirectiveCount} | ${markerHits || '—'} |`;
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const duplicates = report.duplicateFragmentFamilies.length === 0
|
|
179
|
+
? ['- None detected.']
|
|
180
|
+
: report.duplicateFragmentFamilies.map(
|
|
181
|
+
(family) => `- ${family.count} files: ${family.text}\n - ${family.paths.join(', ')}`,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
return [
|
|
185
|
+
'# Prompt Inventory',
|
|
186
|
+
'',
|
|
187
|
+
`Generated: ${report.generatedAt}`,
|
|
188
|
+
`Root: ${relative(process.cwd(), report.root) || '.'}`,
|
|
189
|
+
'',
|
|
190
|
+
'## Totals',
|
|
191
|
+
'',
|
|
192
|
+
`- Files: ${report.totals.files}`,
|
|
193
|
+
`- Lines: ${report.totals.lines}`,
|
|
194
|
+
`- Approximate tokens: ${report.totals.approximateTokens}`,
|
|
195
|
+
`- Absolute directive lines: ${report.totals.absoluteDirectiveCount}`,
|
|
196
|
+
'',
|
|
197
|
+
'## Surfaces',
|
|
198
|
+
'',
|
|
199
|
+
'| Path | Lines | Approx. tokens | Absolute directive lines | Markers |',
|
|
200
|
+
'| --- | ---: | ---: | ---: | --- |',
|
|
201
|
+
...rows,
|
|
202
|
+
'',
|
|
203
|
+
'## Duplicated fragment families',
|
|
204
|
+
'',
|
|
205
|
+
...duplicates,
|
|
206
|
+
'',
|
|
207
|
+
].join('\n');
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
211
|
+
const root = process.argv.includes('--root') ? process.argv[process.argv.indexOf('--root') + 1] : process.cwd();
|
|
212
|
+
const report = buildPromptInventory(root);
|
|
213
|
+
if (process.argv.includes('--json')) {
|
|
214
|
+
console.log(JSON.stringify(report, null, 2));
|
|
215
|
+
} else {
|
|
216
|
+
console.log(renderPromptInventoryMarkdown(report));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -2,6 +2,9 @@ import { spawnSync } from 'node:child_process';
|
|
|
2
2
|
import { readdirSync, statSync } from 'node:fs';
|
|
3
3
|
import { join, resolve } from 'node:path';
|
|
4
4
|
|
|
5
|
+
const DEFAULT_TEST_TIMEOUT_MS = 0;
|
|
6
|
+
const DEFAULT_RUNNER_TIMEOUT_MS = 30 * 60 * 1_000;
|
|
7
|
+
|
|
5
8
|
function collectTests(path: string, out: string[]): void {
|
|
6
9
|
let stats;
|
|
7
10
|
try {
|
|
@@ -22,6 +25,13 @@ function collectTests(path: string, out: string[]): void {
|
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
function parseTimeoutMs(value: string | undefined, defaultTimeoutMs: number): number {
|
|
29
|
+
if (!value) return defaultTimeoutMs;
|
|
30
|
+
const parsed = Number(value);
|
|
31
|
+
if (!Number.isFinite(parsed) || parsed < 0) return defaultTimeoutMs;
|
|
32
|
+
return Math.floor(parsed);
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
const roots = process.argv.slice(2);
|
|
26
36
|
const targets = roots.length > 0 ? roots : ['dist'];
|
|
27
37
|
const files: string[] = [];
|
|
@@ -36,13 +46,42 @@ if (files.length === 0) {
|
|
|
36
46
|
process.exit(1);
|
|
37
47
|
}
|
|
38
48
|
|
|
39
|
-
const
|
|
49
|
+
const testTimeoutMs = parseTimeoutMs(process.env.OMX_NODE_TEST_TIMEOUT_MS, DEFAULT_TEST_TIMEOUT_MS);
|
|
50
|
+
const runnerTimeoutMs = parseTimeoutMs(process.env.OMX_NODE_TEST_RUNNER_TIMEOUT_MS, DEFAULT_RUNNER_TIMEOUT_MS);
|
|
51
|
+
const testArgs = ['--test'];
|
|
52
|
+
if (testTimeoutMs > 0) {
|
|
53
|
+
testArgs.push(`--test-timeout=${testTimeoutMs}`);
|
|
54
|
+
}
|
|
55
|
+
testArgs.push(...files);
|
|
56
|
+
|
|
57
|
+
console.error(
|
|
58
|
+
`[run-test-files] running ${files.length} test file(s) from ${targets.join(', ')}${
|
|
59
|
+
testTimeoutMs > 0 ? ` with per-test timeout ${testTimeoutMs}ms` : ' with per-test timeout disabled'
|
|
60
|
+
}${runnerTimeoutMs > 0 ? ` and runner timeout ${runnerTimeoutMs}ms` : ' and runner timeout disabled'}`,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const childEnv = { ...process.env };
|
|
64
|
+
delete childEnv.NODE_TEST_CONTEXT;
|
|
65
|
+
childEnv.OMX_TEST_RELAX_TMUX_TIMEOUT = '1';
|
|
66
|
+
|
|
67
|
+
const result = spawnSync(process.execPath, testArgs, {
|
|
40
68
|
stdio: 'inherit',
|
|
41
|
-
env:
|
|
69
|
+
env: childEnv,
|
|
70
|
+
timeout: runnerTimeoutMs > 0 ? runnerTimeoutMs : undefined,
|
|
71
|
+
killSignal: 'SIGTERM',
|
|
42
72
|
});
|
|
43
73
|
|
|
44
74
|
if (typeof result.status === 'number') {
|
|
45
75
|
process.exit(result.status);
|
|
46
76
|
}
|
|
47
77
|
|
|
78
|
+
if (result.error) {
|
|
79
|
+
console.error(`[run-test-files] node --test error: ${result.error.message}`);
|
|
80
|
+
}
|
|
81
|
+
console.error(
|
|
82
|
+
`[run-test-files] node --test did not exit normally${result.signal ? ` (signal: ${result.signal})` : ''}. `
|
|
83
|
+
+ `Roots: ${targets.join(', ')}. Test files: ${files.length}. `
|
|
84
|
+
+ `Per-test timeout: ${testTimeoutMs > 0 ? `${testTimeoutMs}ms` : 'disabled'}. `
|
|
85
|
+
+ `Runner timeout: ${runnerTimeoutMs > 0 ? `${runnerTimeoutMs}ms` : 'disabled'}.`,
|
|
86
|
+
);
|
|
48
87
|
process.exit(1);
|
|
@@ -110,6 +110,15 @@ function npmBinName(name: string): string {
|
|
|
110
110
|
return process.platform === 'win32' ? `${name}.cmd` : name;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
export function parseNpmPackJsonOutput(stdout: string): Array<{ filename: string }> {
|
|
114
|
+
const start = stdout.lastIndexOf('\n[');
|
|
115
|
+
const jsonText = (start >= 0 ? stdout.slice(start + 1) : stdout).trim();
|
|
116
|
+
if (!jsonText.startsWith('[')) {
|
|
117
|
+
throw new Error(`npm pack did not return JSON output: ${stdout.trim()}`);
|
|
118
|
+
}
|
|
119
|
+
return JSON.parse(jsonText) as Array<{ filename: string }>;
|
|
120
|
+
}
|
|
121
|
+
|
|
113
122
|
async function main(): Promise<void> {
|
|
114
123
|
parseArgs(process.argv.slice(2));
|
|
115
124
|
|
|
@@ -125,7 +134,7 @@ async function main(): Promise<void> {
|
|
|
125
134
|
});
|
|
126
135
|
|
|
127
136
|
const pack = run('npm', ['pack', '--json'], { cwd: repoRoot });
|
|
128
|
-
const packOutput =
|
|
137
|
+
const packOutput = parseNpmPackJsonOutput(pack.stdout as string);
|
|
129
138
|
const tarballName = packOutput[0]?.filename;
|
|
130
139
|
if (!tarballName) throw new Error('npm pack did not return a tarball filename');
|
|
131
140
|
tarballPath = join(repoRoot, tarballName);
|