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
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
buildFullChangelogLine,
|
|
9
9
|
generateReleaseBody,
|
|
10
10
|
renderContributorsSection,
|
|
11
|
+
verifyCompareRange,
|
|
11
12
|
type Contributor,
|
|
12
13
|
} from '../generate-release-body.js';
|
|
13
14
|
|
|
@@ -94,6 +95,18 @@ describe('generate-release-body', () => {
|
|
|
94
95
|
it('prefers GitHub contributor handles when compare metadata is available', async () => {
|
|
95
96
|
const root = await mkdtemp(join(tmpdir(), 'omx-generate-release-body-gh-'));
|
|
96
97
|
try {
|
|
98
|
+
git(root, ['init']);
|
|
99
|
+
git(root, ['config', 'user.name', 'Release Bot']);
|
|
100
|
+
git(root, ['config', 'user.email', 'release@example.com']);
|
|
101
|
+
await writeFile(join(root, 'notes.txt'), 'base\n');
|
|
102
|
+
git(root, ['add', '.']);
|
|
103
|
+
git(root, ['commit', '-m', 'base']);
|
|
104
|
+
git(root, ['tag', 'v0.13.0']);
|
|
105
|
+
await writeFile(join(root, 'notes.txt'), 'release\n');
|
|
106
|
+
git(root, ['add', 'notes.txt']);
|
|
107
|
+
git(root, ['commit', '-m', 'release']);
|
|
108
|
+
git(root, ['tag', 'v0.13.1']);
|
|
109
|
+
|
|
97
110
|
await writeFile(join(root, 'RELEASE_BODY.md'), TEMPLATE);
|
|
98
111
|
const originalFetch = global.fetch;
|
|
99
112
|
global.fetch = (async () => new Response(JSON.stringify({
|
|
@@ -126,9 +139,105 @@ describe('generate-release-body', () => {
|
|
|
126
139
|
});
|
|
127
140
|
|
|
128
141
|
|
|
142
|
+
it('skips off-ancestry semver-previous tags when auto-resolving the compare base', async () => {
|
|
143
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-generate-release-body-off-ancestry-'));
|
|
144
|
+
try {
|
|
145
|
+
git(root, ['init']);
|
|
146
|
+
git(root, ['config', 'user.name', 'Release Bot']);
|
|
147
|
+
git(root, ['config', 'user.email', 'release@example.com']);
|
|
148
|
+
await writeFile(join(root, 'notes.txt'), 'base\n');
|
|
149
|
+
git(root, ['add', '.']);
|
|
150
|
+
git(root, ['commit', '-m', 'base']);
|
|
151
|
+
git(root, ['tag', 'v0.14.3']);
|
|
152
|
+
|
|
153
|
+
await writeFile(join(root, 'notes.txt'), 'dev train\n');
|
|
154
|
+
git(root, ['add', 'notes.txt']);
|
|
155
|
+
git(root, ['commit', '-m', 'dev train']);
|
|
156
|
+
git(root, ['tag', 'v0.15.1']);
|
|
157
|
+
|
|
158
|
+
git(root, ['checkout', '-b', 'side-release', 'v0.14.3']);
|
|
159
|
+
await writeFile(join(root, 'side.txt'), 'side release\n');
|
|
160
|
+
git(root, ['add', 'side.txt']);
|
|
161
|
+
git(root, ['commit', '-m', 'side release']);
|
|
162
|
+
git(root, ['tag', 'v0.15.0']);
|
|
163
|
+
git(root, ['checkout', 'v0.15.1']);
|
|
164
|
+
|
|
165
|
+
await writeFile(join(root, 'RELEASE_BODY.md'), TEMPLATE);
|
|
166
|
+
await generateReleaseBody({
|
|
167
|
+
cwd: root,
|
|
168
|
+
templatePath: 'RELEASE_BODY.md',
|
|
169
|
+
outPath: 'RELEASE_BODY.generated.md',
|
|
170
|
+
currentTag: 'v0.15.1',
|
|
171
|
+
repo: 'example/oh-my-codex',
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const generated = await readFile(join(root, 'RELEASE_BODY.generated.md'), 'utf-8');
|
|
175
|
+
assert.match(generated, /`v0\.14\.3\.\.\.v0\.15\.1`/);
|
|
176
|
+
assert.doesNotMatch(generated, /`v0\.15\.0\.\.\.v0\.15\.1`/);
|
|
177
|
+
} finally {
|
|
178
|
+
await rm(root, { recursive: true, force: true });
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
it('rejects missing or inverted compare refs before rendering a compare link', async () => {
|
|
184
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-generate-release-body-range-'));
|
|
185
|
+
try {
|
|
186
|
+
git(root, ['init']);
|
|
187
|
+
git(root, ['config', 'user.name', 'Release Bot']);
|
|
188
|
+
git(root, ['config', 'user.email', 'release@example.com']);
|
|
189
|
+
await writeFile(join(root, 'notes.txt'), 'base\n');
|
|
190
|
+
git(root, ['add', '.']);
|
|
191
|
+
git(root, ['commit', '-m', 'base']);
|
|
192
|
+
git(root, ['tag', 'v0.13.0']);
|
|
193
|
+
await writeFile(join(root, 'notes.txt'), 'release\n');
|
|
194
|
+
git(root, ['add', 'notes.txt']);
|
|
195
|
+
git(root, ['commit', '-m', 'release']);
|
|
196
|
+
git(root, ['tag', 'v0.13.1']);
|
|
197
|
+
|
|
198
|
+
assert.doesNotThrow(() => verifyCompareRange(root, 'v0.13.1', 'v0.13.0'));
|
|
199
|
+
assert.throws(
|
|
200
|
+
() => verifyCompareRange(root, 'v0.13.1', 'v9.99.9'),
|
|
201
|
+
/unable to verify previous tag ref for release compare: v9\.99\.9/,
|
|
202
|
+
);
|
|
203
|
+
assert.throws(
|
|
204
|
+
() => verifyCompareRange(root, 'v0.13.0', 'v0.13.1'),
|
|
205
|
+
/invalid release compare range: v0\.13\.1 is not an ancestor of v0\.13\.0/,
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
await writeFile(join(root, 'RELEASE_BODY.md'), TEMPLATE);
|
|
209
|
+
await assert.rejects(
|
|
210
|
+
generateReleaseBody({
|
|
211
|
+
cwd: root,
|
|
212
|
+
templatePath: 'RELEASE_BODY.md',
|
|
213
|
+
outPath: 'RELEASE_BODY.generated.md',
|
|
214
|
+
currentTag: 'v0.13.1',
|
|
215
|
+
previousTag: 'v9.99.9',
|
|
216
|
+
repo: 'example/oh-my-codex',
|
|
217
|
+
}),
|
|
218
|
+
/unable to verify previous tag ref for release compare: v9\.99\.9/,
|
|
219
|
+
);
|
|
220
|
+
} finally {
|
|
221
|
+
await rm(root, { recursive: true, force: true });
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
|
|
129
226
|
it('fails validation when the template is missing required metadata anchors', async () => {
|
|
130
227
|
const root = await mkdtemp(join(tmpdir(), 'omx-generate-release-body-invalid-'));
|
|
131
228
|
try {
|
|
229
|
+
git(root, ['init']);
|
|
230
|
+
git(root, ['config', 'user.name', 'Release Bot']);
|
|
231
|
+
git(root, ['config', 'user.email', 'release@example.com']);
|
|
232
|
+
await writeFile(join(root, 'notes.txt'), 'base\n');
|
|
233
|
+
git(root, ['add', '.']);
|
|
234
|
+
git(root, ['commit', '-m', 'base']);
|
|
235
|
+
git(root, ['tag', 'v0.13.0']);
|
|
236
|
+
await writeFile(join(root, 'notes.txt'), 'release\n');
|
|
237
|
+
git(root, ['add', 'notes.txt']);
|
|
238
|
+
git(root, ['commit', '-m', 'release']);
|
|
239
|
+
git(root, ['tag', 'v0.13.1']);
|
|
240
|
+
|
|
132
241
|
await writeFile(join(root, 'RELEASE_BODY.md'), `# oh-my-codex v0.0.0
|
|
133
242
|
|
|
134
243
|
## Summary
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import assert from 'node:assert/strict';
|
|
2
|
-
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
3
|
+
import { once } from 'node:events';
|
|
3
4
|
import { existsSync } from 'node:fs';
|
|
4
|
-
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
5
|
+
import { appendFile, mkdir, mkdtemp, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
5
6
|
import { tmpdir } from 'node:os';
|
|
6
7
|
import { join } from 'node:path';
|
|
7
8
|
import { describe, it } from 'node:test';
|
|
@@ -18,7 +19,34 @@ function todaySessionDir(baseHome: string): string {
|
|
|
18
19
|
);
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
async function sleep(ms: number): Promise<void> {
|
|
23
|
+
await new Promise(resolve => setTimeout(resolve, ms));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function waitFor(predicate: () => Promise<boolean>, timeoutMs: number = 3000, stepMs: number = 50): Promise<void> {
|
|
27
|
+
const deadline = Date.now() + timeoutMs;
|
|
28
|
+
while (Date.now() < deadline) {
|
|
29
|
+
if (await predicate()) return;
|
|
30
|
+
await sleep(stepMs);
|
|
31
|
+
}
|
|
32
|
+
throw new Error(`waitFor timed out after ${timeoutMs}ms`);
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
describe('hook-derived-watcher', () => {
|
|
36
|
+
it('uses offset-bounded rollout reads instead of re-reading whole tracked files', async () => {
|
|
37
|
+
const source = await readFile(new URL('../hook-derived-watcher.js', import.meta.url), 'utf-8');
|
|
38
|
+
|
|
39
|
+
assert.match(source, /async function readFileDelta/);
|
|
40
|
+
assert.match(source, /while \(totalBytesRead < length\)/);
|
|
41
|
+
assert.match(source, /nextOffset: offset \+ totalBytesRead/);
|
|
42
|
+
assert.match(source, /new StringDecoder\('utf8'\)/);
|
|
43
|
+
assert.match(source, /decoder\.write\(bytes\)/);
|
|
44
|
+
assert.match(source, /const fileStat = await stat\(path\)\.catch\(\(\) => null\);\s*if \(!fileStat\)\s*continue;/);
|
|
45
|
+
assert.match(source, /if \(currentSize < meta\.offset\) \{\s*meta\.offset = 0;\s*meta\.partial = '';/);
|
|
46
|
+
assert.doesNotMatch(source, /const content = await readFile\(path, 'utf-8'\)[\s\S]*const delta = content\.slice\(meta\.offset\)/);
|
|
47
|
+
assert.doesNotMatch(source, /stat\(path\)\.catch\(\(\) => \(\{ size: 0 \}\)\)/);
|
|
48
|
+
});
|
|
49
|
+
|
|
22
50
|
it('dispatches needs-input for assistant_message content arrays', async () => {
|
|
23
51
|
const base = await mkdtemp(join(tmpdir(), 'omx-hook-derived-array-'));
|
|
24
52
|
const homeDir = join(base, 'home');
|
|
@@ -108,4 +136,106 @@ export async function onHookEvent(event) {
|
|
|
108
136
|
await rm(base, { recursive: true, force: true });
|
|
109
137
|
}
|
|
110
138
|
});
|
|
139
|
+
|
|
140
|
+
it('preserves multibyte assistant text split across polling reads', async () => {
|
|
141
|
+
const base = await mkdtemp(join(tmpdir(), 'omx-hook-derived-utf8-'));
|
|
142
|
+
const homeDir = join(base, 'home');
|
|
143
|
+
const cwd = join(base, 'cwd');
|
|
144
|
+
const hookLogPath = join(cwd, '.omx', 'hook-events.jsonl');
|
|
145
|
+
|
|
146
|
+
try {
|
|
147
|
+
await mkdir(todaySessionDir(homeDir), { recursive: true });
|
|
148
|
+
await mkdir(join(cwd, '.omx', 'hooks'), { recursive: true });
|
|
149
|
+
|
|
150
|
+
await writeFile(
|
|
151
|
+
join(cwd, '.omx', 'hooks', 'capture-needs-input.mjs'),
|
|
152
|
+
`import { appendFile, mkdir } from 'node:fs/promises';
|
|
153
|
+
import { dirname } from 'node:path';
|
|
154
|
+
|
|
155
|
+
export async function onHookEvent(event) {
|
|
156
|
+
await mkdir(dirname(${JSON.stringify(hookLogPath)}), { recursive: true });
|
|
157
|
+
await appendFile(${JSON.stringify(hookLogPath)}, JSON.stringify(event) + '\\n');
|
|
158
|
+
}
|
|
159
|
+
`,
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const rolloutPath = join(todaySessionDir(homeDir), 'rollout-hook-derived-utf8.jsonl');
|
|
163
|
+
await writeFile(
|
|
164
|
+
rolloutPath,
|
|
165
|
+
`${JSON.stringify({
|
|
166
|
+
type: 'session_meta',
|
|
167
|
+
payload: {
|
|
168
|
+
id: 'thread-hook-utf8',
|
|
169
|
+
cwd,
|
|
170
|
+
},
|
|
171
|
+
})}\n`,
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
const watcherScript = new URL('../hook-derived-watcher.js', import.meta.url).pathname;
|
|
175
|
+
const child = spawn(
|
|
176
|
+
process.execPath,
|
|
177
|
+
[watcherScript, '--cwd', cwd, '--poll-ms', '75'],
|
|
178
|
+
{
|
|
179
|
+
cwd,
|
|
180
|
+
stdio: 'ignore',
|
|
181
|
+
env: {
|
|
182
|
+
...process.env,
|
|
183
|
+
HOME: homeDir,
|
|
184
|
+
OMX_HOOK_DERIVED_SIGNALS: '1',
|
|
185
|
+
OMX_HOOK_PLUGINS: '1',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const watcherStatePath = join(cwd, '.omx', 'state', 'hook-derived-watcher-state.json');
|
|
191
|
+
await waitFor(async () => {
|
|
192
|
+
try {
|
|
193
|
+
const state = JSON.parse(await readFile(watcherStatePath, 'utf-8'));
|
|
194
|
+
return state.tracked_files === 1;
|
|
195
|
+
} catch {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
const questionText = 'Can you preserve split emoji 🧪 please?';
|
|
201
|
+
const eventLine = `${JSON.stringify({
|
|
202
|
+
timestamp: new Date().toISOString(),
|
|
203
|
+
type: 'event_msg',
|
|
204
|
+
payload: {
|
|
205
|
+
type: 'assistant_message',
|
|
206
|
+
turn_id: 'turn-hook-utf8',
|
|
207
|
+
content: [{ type: 'output_text', text: questionText }],
|
|
208
|
+
},
|
|
209
|
+
})}\n`;
|
|
210
|
+
const bytes = Buffer.from(eventLine, 'utf8');
|
|
211
|
+
const emojiOffset = bytes.indexOf(Buffer.from('🧪', 'utf8'));
|
|
212
|
+
assert.ok(emojiOffset > 0, 'expected test payload to contain emoji bytes');
|
|
213
|
+
|
|
214
|
+
await appendFile(rolloutPath, bytes.subarray(0, emojiOffset + 1));
|
|
215
|
+
await sleep(250);
|
|
216
|
+
assert.equal(existsSync(hookLogPath), false, 'incomplete UTF-8 and JSON line should not dispatch');
|
|
217
|
+
|
|
218
|
+
const hiddenRolloutPath = `${rolloutPath}.missing`;
|
|
219
|
+
await rename(rolloutPath, hiddenRolloutPath);
|
|
220
|
+
await sleep(250);
|
|
221
|
+
assert.equal(existsSync(hookLogPath), false, 'transient missing file should preserve buffered bytes');
|
|
222
|
+
await rename(hiddenRolloutPath, rolloutPath);
|
|
223
|
+
|
|
224
|
+
await appendFile(rolloutPath, bytes.subarray(emojiOffset + 1));
|
|
225
|
+
await waitFor(async () => {
|
|
226
|
+
if (!existsSync(hookLogPath)) return false;
|
|
227
|
+
const raw = await readFile(hookLogPath, 'utf-8');
|
|
228
|
+
return raw.includes('turn-hook-utf8') && raw.includes(questionText);
|
|
229
|
+
}, 4000, 75);
|
|
230
|
+
|
|
231
|
+
child.kill('SIGTERM');
|
|
232
|
+
await once(child, 'exit');
|
|
233
|
+
|
|
234
|
+
const raw = await readFile(hookLogPath, 'utf-8');
|
|
235
|
+
assert.match(raw, /turn-hook-utf8/);
|
|
236
|
+
assert.match(raw, /Can you preserve split emoji 🧪 please\?/);
|
|
237
|
+
} finally {
|
|
238
|
+
await rm(base, { recursive: true, force: true });
|
|
239
|
+
}
|
|
240
|
+
});
|
|
111
241
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdtemp,
|
|
2
|
+
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { describe, it } from "node:test";
|
|
@@ -24,70 +24,58 @@ describe("isGlobalInstallLifecycle", () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
describe("runPostinstall", () => {
|
|
27
|
-
it("
|
|
27
|
+
it("records the installed version and prints an explicit opt-in setup hint for bumped global installs", async () => {
|
|
28
28
|
const root = await mkdtemp(join(tmpdir(), "omx-postinstall-"));
|
|
29
29
|
const stampPath = join(root, ".codex", ".omx", "install-state.json");
|
|
30
30
|
const logs: string[] = [];
|
|
31
|
-
let setupCalls = 0;
|
|
32
31
|
|
|
33
32
|
try {
|
|
34
33
|
const result = await runPostinstall({
|
|
35
34
|
env: { npm_config_global: "true" },
|
|
36
35
|
getCurrentVersion: async () => "0.14.1",
|
|
37
|
-
isInteractive: () => true,
|
|
38
36
|
log: (message) => logs.push(message),
|
|
39
37
|
readStamp: async () => ({
|
|
40
38
|
installed_version: "0.14.0",
|
|
41
39
|
setup_completed_version: "0.14.0",
|
|
42
40
|
updated_at: "2026-04-20T00:00:00.000Z",
|
|
43
41
|
}),
|
|
44
|
-
runSetup: async () => {
|
|
45
|
-
setupCalls += 1;
|
|
46
|
-
},
|
|
47
42
|
writeStamp: async (stamp) => writeUserInstallStamp(stamp, stampPath),
|
|
48
43
|
});
|
|
49
44
|
|
|
50
|
-
assert.equal(result.status, "
|
|
51
|
-
assert.
|
|
52
|
-
assert.match(logs.join("\n"), /Launching interactive setup/);
|
|
45
|
+
assert.equal(result.status, "hinted");
|
|
46
|
+
assert.match(logs.join("\n"), /OMX setup is explicit opt-in; run `omx setup` or `omx update` when you're ready/);
|
|
53
47
|
|
|
54
48
|
const stamp = JSON.parse(await readFile(stampPath, "utf-8")) as {
|
|
55
49
|
installed_version: string;
|
|
56
50
|
setup_completed_version: string;
|
|
57
51
|
};
|
|
58
52
|
assert.equal(stamp.installed_version, "0.14.1");
|
|
59
|
-
assert.equal(stamp.setup_completed_version, "0.14.
|
|
53
|
+
assert.equal(stamp.setup_completed_version, "0.14.0");
|
|
60
54
|
} finally {
|
|
61
55
|
await rm(root, { recursive: true, force: true });
|
|
62
56
|
}
|
|
63
57
|
});
|
|
64
58
|
|
|
65
|
-
it("records the installed version and
|
|
59
|
+
it("records the installed version and preserves prior setup state when printing the postinstall hint", async () => {
|
|
66
60
|
const root = await mkdtemp(join(tmpdir(), "omx-postinstall-"));
|
|
67
61
|
const stampPath = join(root, ".codex", ".omx", "install-state.json");
|
|
68
62
|
const logs: string[] = [];
|
|
69
|
-
let setupCalls = 0;
|
|
70
63
|
|
|
71
64
|
try {
|
|
72
65
|
const result = await runPostinstall({
|
|
73
66
|
env: { npm_config_global: "true" },
|
|
74
67
|
getCurrentVersion: async () => "0.14.1",
|
|
75
|
-
isInteractive: () => false,
|
|
76
68
|
log: (message) => logs.push(message),
|
|
77
69
|
readStamp: async () => ({
|
|
78
70
|
installed_version: "0.14.0",
|
|
79
71
|
setup_completed_version: "0.14.0",
|
|
80
72
|
updated_at: "2026-04-20T00:00:00.000Z",
|
|
81
73
|
}),
|
|
82
|
-
runSetup: async () => {
|
|
83
|
-
setupCalls += 1;
|
|
84
|
-
},
|
|
85
74
|
writeStamp: async (stamp) => writeUserInstallStamp(stamp, stampPath),
|
|
86
75
|
});
|
|
87
76
|
|
|
88
77
|
assert.equal(result.status, "hinted");
|
|
89
|
-
assert.
|
|
90
|
-
assert.match(logs.join("\n"), /Run `omx setup` \(interactive\) or `omx update`/);
|
|
78
|
+
assert.match(logs.join("\n"), /run `omx setup` or `omx update` when you're ready/i);
|
|
91
79
|
|
|
92
80
|
const stamp = JSON.parse(await readFile(stampPath, "utf-8")) as {
|
|
93
81
|
installed_version: string;
|
|
@@ -101,110 +89,25 @@ describe("runPostinstall", () => {
|
|
|
101
89
|
});
|
|
102
90
|
|
|
103
91
|
it("skips local installs", async () => {
|
|
104
|
-
let setupCalls = 0;
|
|
105
92
|
const result = await runPostinstall({
|
|
106
93
|
env: { npm_config_global: "false" },
|
|
107
94
|
getCurrentVersion: async () => "0.14.1",
|
|
108
|
-
isInteractive: () => true,
|
|
109
|
-
runSetup: async () => {
|
|
110
|
-
setupCalls += 1;
|
|
111
|
-
},
|
|
112
95
|
});
|
|
113
96
|
|
|
114
97
|
assert.equal(result.status, "noop-local");
|
|
115
|
-
assert.equal(setupCalls, 0);
|
|
116
98
|
});
|
|
117
99
|
|
|
118
100
|
it("does not rerun setup when the installed version matches the saved stamp", async () => {
|
|
119
|
-
let setupCalls = 0;
|
|
120
101
|
const result = await runPostinstall({
|
|
121
102
|
env: { npm_config_global: "true" },
|
|
122
103
|
getCurrentVersion: async () => "0.14.1",
|
|
123
|
-
isInteractive: () => true,
|
|
124
104
|
readStamp: async () => ({
|
|
125
105
|
installed_version: "0.14.1",
|
|
126
106
|
setup_completed_version: "0.14.1",
|
|
127
107
|
updated_at: "2026-04-20T00:00:00.000Z",
|
|
128
108
|
}),
|
|
129
|
-
runSetup: async () => {
|
|
130
|
-
setupCalls += 1;
|
|
131
|
-
},
|
|
132
109
|
});
|
|
133
110
|
|
|
134
111
|
assert.equal(result.status, "noop-same-version");
|
|
135
|
-
assert.equal(setupCalls, 0);
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
it("warns and exits cleanly when setup fails", async () => {
|
|
139
|
-
const warnings: string[] = [];
|
|
140
|
-
const result = await runPostinstall({
|
|
141
|
-
env: { npm_config_global: "true" },
|
|
142
|
-
getCurrentVersion: async () => "0.14.1",
|
|
143
|
-
isInteractive: () => true,
|
|
144
|
-
readStamp: async () => ({
|
|
145
|
-
installed_version: "0.14.0",
|
|
146
|
-
setup_completed_version: "0.14.0",
|
|
147
|
-
updated_at: "2026-04-20T00:00:00.000Z",
|
|
148
|
-
}),
|
|
149
|
-
runSetup: async () => {
|
|
150
|
-
throw new Error("boom");
|
|
151
|
-
},
|
|
152
|
-
warn: (message) => warnings.push(message),
|
|
153
|
-
writeStamp: async () => {},
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
assert.equal(result.status, "setup-failed");
|
|
157
|
-
assert.match(warnings.join("\n"), /non-fatal error: boom/);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it("runs interactive setup from the npm install prefix instead of the package dir or INIT_CWD", async () => {
|
|
161
|
-
const installRoot = await mkdtemp(join(tmpdir(), "omx-postinstall-install-root-"));
|
|
162
|
-
const packageRoot = await mkdtemp(join(tmpdir(), "omx-postinstall-package-root-"));
|
|
163
|
-
const initCwd = await mkdtemp(join(tmpdir(), "omx-postinstall-init-cwd-"));
|
|
164
|
-
const originalCwd = process.cwd();
|
|
165
|
-
const scopeFile = join(installRoot, ".omx", "setup-scope.json");
|
|
166
|
-
const packageScopeFile = join(packageRoot, ".omx", "setup-scope.json");
|
|
167
|
-
const initCwdScopeFile = join(initCwd, ".omx", "setup-scope.json");
|
|
168
|
-
|
|
169
|
-
try {
|
|
170
|
-
process.chdir(packageRoot);
|
|
171
|
-
|
|
172
|
-
const result = await runPostinstall({
|
|
173
|
-
env: {
|
|
174
|
-
npm_config_global: "true",
|
|
175
|
-
npm_config_prefix: installRoot,
|
|
176
|
-
INIT_CWD: initCwd,
|
|
177
|
-
},
|
|
178
|
-
getCurrentVersion: async () => "0.14.1",
|
|
179
|
-
isInteractive: () => true,
|
|
180
|
-
readStamp: async () => ({
|
|
181
|
-
installed_version: "0.14.0",
|
|
182
|
-
setup_completed_version: "0.14.0",
|
|
183
|
-
updated_at: "2026-04-20T00:00:00.000Z",
|
|
184
|
-
}),
|
|
185
|
-
runSetup: async () => {
|
|
186
|
-
await mkdir(join(process.cwd(), ".omx"), { recursive: true });
|
|
187
|
-
await writeFile(
|
|
188
|
-
join(process.cwd(), ".omx", "setup-scope.json"),
|
|
189
|
-
JSON.stringify({ scope: "project" }),
|
|
190
|
-
);
|
|
191
|
-
},
|
|
192
|
-
writeStamp: async () => {},
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
assert.equal(result.status, "setup-ran");
|
|
196
|
-
assert.equal(process.cwd(), packageRoot);
|
|
197
|
-
assert.equal(
|
|
198
|
-
JSON.parse(await readFile(scopeFile, "utf-8")).scope,
|
|
199
|
-
"project",
|
|
200
|
-
);
|
|
201
|
-
await assert.rejects(() => readFile(packageScopeFile, "utf-8"));
|
|
202
|
-
await assert.rejects(() => readFile(initCwdScopeFile, "utf-8"));
|
|
203
|
-
} finally {
|
|
204
|
-
process.chdir(originalCwd);
|
|
205
|
-
await rm(installRoot, { recursive: true, force: true });
|
|
206
|
-
await rm(packageRoot, { recursive: true, force: true });
|
|
207
|
-
await rm(initCwd, { recursive: true, force: true });
|
|
208
|
-
}
|
|
209
112
|
});
|
|
210
113
|
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { mkdtemp, rm, writeFile, mkdir } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { describe, it } from 'node:test';
|
|
6
|
+
import { buildPromptInventory, listPromptSurfacePaths, renderPromptInventoryMarkdown } from '../prompt-inventory.js';
|
|
7
|
+
|
|
8
|
+
describe('prompt inventory', () => {
|
|
9
|
+
it('counts prompt surfaces, absolute directives, markers, and duplicate fragments', async () => {
|
|
10
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-prompt-inventory-'));
|
|
11
|
+
try {
|
|
12
|
+
await mkdir(join(root, 'templates'), { recursive: true });
|
|
13
|
+
await mkdir(join(root, 'prompts'), { recursive: true });
|
|
14
|
+
await mkdir(join(root, 'skills', 'worker'), { recursive: true });
|
|
15
|
+
await mkdir(join(root, 'docs', 'prompt-guidance-fragments'), { recursive: true });
|
|
16
|
+
await mkdir(join(root, 'src', 'hooks'), { recursive: true });
|
|
17
|
+
await mkdir(join(root, 'src', 'config'), { recursive: true });
|
|
18
|
+
await mkdir(join(root, 'src', 'cli'), { recursive: true });
|
|
19
|
+
|
|
20
|
+
const repeated = 'AUTO-CONTINUE for clear, already-requested, low-risk, reversible local work with evidence.';
|
|
21
|
+
await writeFile(join(root, 'AGENTS.md'), `# Root\n${repeated}\n<!-- omx:generated:agents-md -->\n`);
|
|
22
|
+
await writeFile(
|
|
23
|
+
join(root, 'templates', 'AGENTS.md'),
|
|
24
|
+
`# Template\nMUST preserve markers.\n${repeated}\n<!-- OMX:RUNTIME:START -->\n<!-- OMX:RUNTIME:END -->\n`,
|
|
25
|
+
);
|
|
26
|
+
await writeFile(join(root, 'prompts', 'executor.md'), `# Executor\nDO NOT stop early.\n${repeated}\n`);
|
|
27
|
+
await writeFile(join(root, 'skills', 'worker', 'SKILL.md'), '# Worker\nALWAYS claim tasks.\n');
|
|
28
|
+
await writeFile(join(root, 'docs', 'prompt-guidance-contract.md'), '# Contract\n');
|
|
29
|
+
await writeFile(join(root, 'docs', 'guidance-schema.md'), '# Schema\n');
|
|
30
|
+
await writeFile(join(root, 'docs', 'prompt-guidance-fragments', 'core.md'), 'fragment\n');
|
|
31
|
+
await writeFile(join(root, 'src', 'hooks', 'prompt-guidance-contract.ts'), 'export {};\n');
|
|
32
|
+
await writeFile(join(root, 'src', 'config', 'generator.ts'), 'export {};\n');
|
|
33
|
+
await writeFile(join(root, 'src', 'cli', 'setup.ts'), 'export {};\n');
|
|
34
|
+
|
|
35
|
+
const paths = listPromptSurfacePaths(root);
|
|
36
|
+
assert.deepEqual(paths, [
|
|
37
|
+
'AGENTS.md',
|
|
38
|
+
'docs/guidance-schema.md',
|
|
39
|
+
'docs/prompt-guidance-contract.md',
|
|
40
|
+
'docs/prompt-guidance-fragments/core.md',
|
|
41
|
+
'prompts/executor.md',
|
|
42
|
+
'skills/worker/SKILL.md',
|
|
43
|
+
'src/cli/setup.ts',
|
|
44
|
+
'src/config/generator.ts',
|
|
45
|
+
'src/hooks/prompt-guidance-contract.ts',
|
|
46
|
+
'templates/AGENTS.md',
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
const report = buildPromptInventory(root, '2026-01-01T00:00:00.000Z');
|
|
50
|
+
assert.equal(report.totals.files, paths.length);
|
|
51
|
+
assert.ok(report.totals.lines > 0);
|
|
52
|
+
assert.ok(report.totals.approximateTokens > 0);
|
|
53
|
+
assert.equal(report.totals.absoluteDirectiveCount, 6);
|
|
54
|
+
assert.equal(
|
|
55
|
+
report.surfaces.find((surface) => surface.path === 'templates/AGENTS.md')?.markers['<!-- OMX:RUNTIME:START -->'],
|
|
56
|
+
1,
|
|
57
|
+
);
|
|
58
|
+
assert.equal(report.duplicateFragmentFamilies[0]?.count, 3);
|
|
59
|
+
assert.match(renderPromptInventoryMarkdown(report), /# Prompt Inventory/);
|
|
60
|
+
} finally {
|
|
61
|
+
await rm(root, { recursive: true, force: true });
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { mkdirSync, mkdtempSync, writeFileSync, rmSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { describe, it } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
|
|
8
|
+
function runCompiledRunner(root: string, envOverrides: Record<string, string> = {}, timeoutMs = 5_000) {
|
|
9
|
+
return spawnSync(process.execPath, ['dist/scripts/run-test-files.js', root], {
|
|
10
|
+
cwd: process.cwd(),
|
|
11
|
+
encoding: 'utf-8',
|
|
12
|
+
env: {
|
|
13
|
+
...process.env,
|
|
14
|
+
...envOverrides,
|
|
15
|
+
},
|
|
16
|
+
timeout: timeoutMs,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe('run-test-files diagnostics', () => {
|
|
21
|
+
it('applies a bounded node --test timeout so hanging tests fail with file context', () => {
|
|
22
|
+
const wd = mkdtempSync(join(tmpdir(), 'omx-run-test-files-'));
|
|
23
|
+
try {
|
|
24
|
+
const testsDir = join(wd, '__tests__');
|
|
25
|
+
mkdirSync(testsDir, { recursive: true });
|
|
26
|
+
const testPath = join(testsDir, 'hang.test.js');
|
|
27
|
+
writeFileSync(
|
|
28
|
+
testPath,
|
|
29
|
+
[
|
|
30
|
+
"import { test } from 'node:test';",
|
|
31
|
+
"test('never resolves', async () => { await new Promise(() => setInterval(() => {}, 1_000)); });",
|
|
32
|
+
'',
|
|
33
|
+
].join('\n'),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const result = runCompiledRunner(wd, {
|
|
37
|
+
OMX_NODE_TEST_TIMEOUT_MS: '250',
|
|
38
|
+
OMX_NODE_TEST_RUNNER_TIMEOUT_MS: '750',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
assert.notEqual(result.status, 0);
|
|
42
|
+
assert.match(result.stderr, /per-test timeout 250ms/);
|
|
43
|
+
assert.match(result.stderr, /node --test did not exit normally|runner timeout 750ms/);
|
|
44
|
+
assert.match(`${result.stdout}\n${result.stderr}`, /hang\.test\.js|never resolves|cancelled/i);
|
|
45
|
+
} finally {
|
|
46
|
+
rmSync(wd, { recursive: true, force: true });
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('logs that per-test timeout is disabled by default', () => {
|
|
51
|
+
const wd = mkdtempSync(join(tmpdir(), 'omx-run-test-files-'));
|
|
52
|
+
try {
|
|
53
|
+
const testsDir = join(wd, '__tests__');
|
|
54
|
+
mkdirSync(testsDir, { recursive: true });
|
|
55
|
+
writeFileSync(
|
|
56
|
+
join(testsDir, 'pass.test.js'),
|
|
57
|
+
[
|
|
58
|
+
"import { test } from 'node:test';",
|
|
59
|
+
"test('passes', () => {});",
|
|
60
|
+
'',
|
|
61
|
+
].join('\n'),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const result = runCompiledRunner(wd);
|
|
65
|
+
|
|
66
|
+
assert.equal(result.status, 0, result.stderr || result.stdout);
|
|
67
|
+
assert.match(result.stderr, /per-test timeout disabled/);
|
|
68
|
+
} finally {
|
|
69
|
+
rmSync(wd, { recursive: true, force: true });
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ensureRepoDependencies,
|
|
9
9
|
hasUsableNodeModules,
|
|
10
10
|
PACKED_INSTALL_SMOKE_CORE_COMMANDS,
|
|
11
|
+
parseNpmPackJsonOutput,
|
|
11
12
|
resolveGitCommonDir,
|
|
12
13
|
resolveReusableNodeModulesSource,
|
|
13
14
|
} from '../smoke-packed-install.js';
|
|
@@ -23,6 +24,20 @@ test('packed install smoke stays limited to boot + core commands', () => {
|
|
|
23
24
|
);
|
|
24
25
|
});
|
|
25
26
|
|
|
27
|
+
test('parseNpmPackJsonOutput ignores prepack logs before npm pack JSON', () => {
|
|
28
|
+
const parsed = parseNpmPackJsonOutput([
|
|
29
|
+
'[sync-plugin-mirror] synced 29 canonical skill directories and plugin metadata',
|
|
30
|
+
'[',
|
|
31
|
+
' {',
|
|
32
|
+
' "filename": "oh-my-codex-0.15.0.tgz"',
|
|
33
|
+
' }',
|
|
34
|
+
']',
|
|
35
|
+
'',
|
|
36
|
+
].join('\n'));
|
|
37
|
+
|
|
38
|
+
assert.deepEqual(parsed, [{ filename: 'oh-my-codex-0.15.0.tgz' }]);
|
|
39
|
+
});
|
|
40
|
+
|
|
26
41
|
test('resolveGitCommonDir resolves relative git common dir output against the repo root', () => {
|
|
27
42
|
const commonDir = resolveGitCommonDir('/tmp/worktree', () => ({
|
|
28
43
|
status: 0,
|