sneakoscope 1.0.2 → 1.0.4
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/README.md +45 -2
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/bin/sks.js +1 -1
- package/dist/build-manifest.json +64 -587
- package/dist/cli/command-registry.d.ts +4 -0
- package/dist/cli/command-registry.js +2 -0
- package/dist/cli/feature-commands.js +42 -1
- package/dist/commands/codex-lb.js +107 -18
- package/dist/commands/codex.d.ts +2 -0
- package/dist/commands/codex.js +47 -0
- package/dist/commands/git.d.ts +2 -0
- package/dist/commands/git.js +5 -0
- package/dist/commands/wiki.d.ts +1 -1
- package/dist/core/bench.js +1 -1
- package/dist/core/codex-compat/codex-compat-report.d.ts +58 -0
- package/dist/core/codex-compat/codex-compat-report.js +38 -0
- package/dist/core/codex-compat/codex-config-policy.d.ts +18 -0
- package/dist/core/codex-compat/codex-config-policy.js +85 -0
- package/dist/core/codex-compat/codex-hook-output-normalizer.d.ts +2 -0
- package/dist/core/codex-compat/codex-hook-output-normalizer.js +69 -0
- package/dist/core/codex-compat/codex-hook-schema.d.ts +20 -0
- package/dist/core/codex-compat/codex-hook-schema.js +109 -0
- package/dist/core/codex-compat/codex-hook-warning-detector.d.ts +32 -0
- package/dist/core/codex-compat/codex-hook-warning-detector.js +90 -0
- package/dist/core/codex-compat/codex-schema-snapshot.d.ts +20 -0
- package/dist/core/codex-compat/codex-schema-snapshot.js +96 -0
- package/dist/core/codex-compat/codex-version-policy.d.ts +15 -0
- package/dist/core/codex-compat/codex-version-policy.js +44 -0
- package/dist/core/codex-compat/codex-version.d.ts +16 -0
- package/dist/core/codex-compat/codex-version.js +87 -0
- package/dist/core/commands/computer-use-command.js +44 -0
- package/dist/core/commands/git-command.d.ts +2 -0
- package/dist/core/commands/git-command.js +159 -0
- package/dist/core/commands/paths-command.js +16 -2
- package/dist/core/commands/wiki-command.d.ts +1 -1
- package/dist/core/commands/wiki-command.js +47 -2
- package/dist/core/computer-use-status.d.ts +11 -0
- package/dist/core/computer-use-status.js +65 -0
- package/dist/core/evidence/evidence-router.js +7 -7
- package/dist/core/feature-fixtures.js +2 -0
- package/dist/core/feature-registry.js +4 -2
- package/dist/core/fsx.d.ts +1 -1
- package/dist/core/fsx.js +1 -1
- package/dist/core/git-hygiene/collaboration-trust.d.ts +11 -0
- package/dist/core/git-hygiene/collaboration-trust.js +23 -0
- package/dist/core/git-hygiene/git-doctor.d.ts +24 -0
- package/dist/core/git-hygiene/git-doctor.js +148 -0
- package/dist/core/git-hygiene/git-policy.d.ts +78 -0
- package/dist/core/git-hygiene/git-policy.js +273 -0
- package/dist/core/git-hygiene/git-precommit.d.ts +15 -0
- package/dist/core/git-hygiene/git-precommit.js +77 -0
- package/dist/core/git-hygiene/git-status.d.ts +29 -0
- package/dist/core/git-hygiene/git-status.js +128 -0
- package/dist/core/git-hygiene/gitattributes-writer.d.ts +8 -0
- package/dist/core/git-hygiene/gitattributes-writer.js +27 -0
- package/dist/core/git-hygiene/gitignore-writer.d.ts +18 -0
- package/dist/core/git-hygiene/gitignore-writer.js +107 -0
- package/dist/core/git-hygiene/shared-memory-manifest.d.ts +2 -0
- package/dist/core/git-hygiene/shared-memory-manifest.js +2 -0
- package/dist/core/git-hygiene/shared-memory-publish.d.ts +38 -0
- package/dist/core/git-hygiene/shared-memory-publish.js +371 -0
- package/dist/core/git-hygiene/shared-memory-security.d.ts +5 -0
- package/dist/core/git-hygiene/shared-memory-security.js +37 -0
- package/dist/core/git-hygiene/validators.d.ts +11 -0
- package/dist/core/git-hygiene/validators.js +62 -0
- package/dist/core/hooks-runtime.js +16 -0
- package/dist/core/init.d.ts +3 -0
- package/dist/core/init.js +113 -2
- package/dist/core/managed-paths.d.ts +4 -1
- package/dist/core/managed-paths.js +23 -7
- package/dist/core/routes.d.ts +1 -1
- package/dist/core/routes.js +5 -3
- package/dist/core/triwiki-wrongness/wrongness-cli.d.ts +2 -2
- package/dist/core/triwiki-wrongness/wrongness-cli.js +25 -2
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +33 -1
- package/dist/core/trust-kernel/trust-report.js +8 -0
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/permission-request.command.input.schema.json +61 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/permission-request.command.output.schema.json +103 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-compact.command.input.schema.json +52 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-compact.command.output.schema.json +24 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-tool-use.command.input.schema.json +67 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-tool-use.command.output.schema.json +84 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-compact.command.input.schema.json +52 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-compact.command.output.schema.json +24 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-tool-use.command.input.schema.json +65 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-tool-use.command.output.schema.json +105 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/session-start.command.input.schema.json +59 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/session-start.command.output.schema.json +63 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/snapshot-metadata.json +29 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/stop.command.input.schema.json +63 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/stop.command.output.schema.json +45 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/user-prompt-submit.command.input.schema.json +59 -0
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/user-prompt-submit.command.output.schema.json +81 -0
- package/package.json +11 -2
- package/dist/bin/sks.d.ts.map +0 -1
- package/dist/bin/sks.js.map +0 -1
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/codex-app-command.d.ts.map +0 -1
- package/dist/cli/codex-app-command.js.map +0 -1
- package/dist/cli/command-registry.d.ts.map +0 -1
- package/dist/cli/command-registry.js.map +0 -1
- package/dist/cli/context7-command.d.ts.map +0 -1
- package/dist/cli/context7-command.js.map +0 -1
- package/dist/cli/feature-commands.d.ts.map +0 -1
- package/dist/cli/feature-commands.js.map +0 -1
- package/dist/cli/help-fast.d.ts.map +0 -1
- package/dist/cli/help-fast.js.map +0 -1
- package/dist/cli/install-helpers.d.ts.map +0 -1
- package/dist/cli/install-helpers.js.map +0 -1
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js.map +0 -1
- package/dist/cli/openclaw-command.d.ts.map +0 -1
- package/dist/cli/openclaw-command.js.map +0 -1
- package/dist/cli/output.d.ts.map +0 -1
- package/dist/cli/output.js.map +0 -1
- package/dist/cli/recallpulse-command.d.ts.map +0 -1
- package/dist/cli/recallpulse-command.js.map +0 -1
- package/dist/cli/router.d.ts.map +0 -1
- package/dist/cli/router.js.map +0 -1
- package/dist/commands/aliases.d.ts.map +0 -1
- package/dist/commands/aliases.js.map +0 -1
- package/dist/commands/all-features.d.ts.map +0 -1
- package/dist/commands/all-features.js.map +0 -1
- package/dist/commands/auto-review.d.ts.map +0 -1
- package/dist/commands/auto-review.js.map +0 -1
- package/dist/commands/autoresearch.d.ts.map +0 -1
- package/dist/commands/autoresearch.js.map +0 -1
- package/dist/commands/bench.d.ts.map +0 -1
- package/dist/commands/bench.js.map +0 -1
- package/dist/commands/bootstrap.d.ts.map +0 -1
- package/dist/commands/bootstrap.js.map +0 -1
- package/dist/commands/code-structure.d.ts.map +0 -1
- package/dist/commands/code-structure.js.map +0 -1
- package/dist/commands/codex-app.d.ts.map +0 -1
- package/dist/commands/codex-app.js.map +0 -1
- package/dist/commands/codex-lb.d.ts.map +0 -1
- package/dist/commands/codex-lb.js.map +0 -1
- package/dist/commands/commands.d.ts.map +0 -1
- package/dist/commands/commands.js.map +0 -1
- package/dist/commands/commit-and-push.d.ts.map +0 -1
- package/dist/commands/commit-and-push.js.map +0 -1
- package/dist/commands/commit.d.ts.map +0 -1
- package/dist/commands/commit.js.map +0 -1
- package/dist/commands/computer-use.d.ts.map +0 -1
- package/dist/commands/computer-use.js.map +0 -1
- package/dist/commands/conflicts.d.ts.map +0 -1
- package/dist/commands/conflicts.js.map +0 -1
- package/dist/commands/context7.d.ts.map +0 -1
- package/dist/commands/context7.js.map +0 -1
- package/dist/commands/db.d.ts.map +0 -1
- package/dist/commands/db.js.map +0 -1
- package/dist/commands/deps.d.ts.map +0 -1
- package/dist/commands/deps.js.map +0 -1
- package/dist/commands/dfix.d.ts.map +0 -1
- package/dist/commands/dfix.js.map +0 -1
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/dollar-commands.d.ts.map +0 -1
- package/dist/commands/dollar-commands.js.map +0 -1
- package/dist/commands/eval.d.ts.map +0 -1
- package/dist/commands/eval.js.map +0 -1
- package/dist/commands/features.d.ts.map +0 -1
- package/dist/commands/features.js.map +0 -1
- package/dist/commands/fix-path.d.ts.map +0 -1
- package/dist/commands/fix-path.js.map +0 -1
- package/dist/commands/gc.d.ts.map +0 -1
- package/dist/commands/gc.js.map +0 -1
- package/dist/commands/goal.d.ts.map +0 -1
- package/dist/commands/goal.js.map +0 -1
- package/dist/commands/guard.d.ts.map +0 -1
- package/dist/commands/guard.js.map +0 -1
- package/dist/commands/gx.d.ts.map +0 -1
- package/dist/commands/gx.js.map +0 -1
- package/dist/commands/harness.d.ts.map +0 -1
- package/dist/commands/harness.js.map +0 -1
- package/dist/commands/help.d.ts.map +0 -1
- package/dist/commands/help.js.map +0 -1
- package/dist/commands/hook.d.ts.map +0 -1
- package/dist/commands/hook.js.map +0 -1
- package/dist/commands/hooks.d.ts.map +0 -1
- package/dist/commands/hooks.js.map +0 -1
- package/dist/commands/hproof.d.ts.map +0 -1
- package/dist/commands/hproof.js.map +0 -1
- package/dist/commands/image-ux-review.d.ts.map +0 -1
- package/dist/commands/image-ux-review.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mad-sks.d.ts.map +0 -1
- package/dist/commands/mad-sks.js.map +0 -1
- package/dist/commands/memory.d.ts.map +0 -1
- package/dist/commands/memory.js.map +0 -1
- package/dist/commands/openclaw.d.ts.map +0 -1
- package/dist/commands/openclaw.js.map +0 -1
- package/dist/commands/paths.d.ts.map +0 -1
- package/dist/commands/paths.js.map +0 -1
- package/dist/commands/perf.d.ts.map +0 -1
- package/dist/commands/perf.js.map +0 -1
- package/dist/commands/pipeline.d.ts.map +0 -1
- package/dist/commands/pipeline.js.map +0 -1
- package/dist/commands/postinstall.d.ts.map +0 -1
- package/dist/commands/postinstall.js.map +0 -1
- package/dist/commands/ppt.d.ts.map +0 -1
- package/dist/commands/ppt.js.map +0 -1
- package/dist/commands/profile.d.ts.map +0 -1
- package/dist/commands/profile.js.map +0 -1
- package/dist/commands/proof-field.d.ts.map +0 -1
- package/dist/commands/proof-field.js.map +0 -1
- package/dist/commands/proof.d.ts.map +0 -1
- package/dist/commands/proof.js.map +0 -1
- package/dist/commands/qa-loop.d.ts.map +0 -1
- package/dist/commands/qa-loop.js.map +0 -1
- package/dist/commands/quickstart.d.ts.map +0 -1
- package/dist/commands/quickstart.js.map +0 -1
- package/dist/commands/reasoning.d.ts.map +0 -1
- package/dist/commands/reasoning.js.map +0 -1
- package/dist/commands/recallpulse.d.ts.map +0 -1
- package/dist/commands/recallpulse.js.map +0 -1
- package/dist/commands/research.d.ts.map +0 -1
- package/dist/commands/research.js.map +0 -1
- package/dist/commands/rollback.d.ts.map +0 -1
- package/dist/commands/rollback.js.map +0 -1
- package/dist/commands/root.d.ts.map +0 -1
- package/dist/commands/root.js.map +0 -1
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/rust.d.ts.map +0 -1
- package/dist/commands/rust.js.map +0 -1
- package/dist/commands/scouts.d.ts.map +0 -1
- package/dist/commands/scouts.js.map +0 -1
- package/dist/commands/selftest.d.ts.map +0 -1
- package/dist/commands/selftest.js.map +0 -1
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/skill-dream.d.ts.map +0 -1
- package/dist/commands/skill-dream.js.map +0 -1
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/team.d.ts.map +0 -1
- package/dist/commands/team.js.map +0 -1
- package/dist/commands/tmux.d.ts.map +0 -1
- package/dist/commands/tmux.js.map +0 -1
- package/dist/commands/trust.d.ts.map +0 -1
- package/dist/commands/trust.js.map +0 -1
- package/dist/commands/update-check.d.ts.map +0 -1
- package/dist/commands/update-check.js.map +0 -1
- package/dist/commands/usage.d.ts.map +0 -1
- package/dist/commands/usage.js.map +0 -1
- package/dist/commands/validate-artifacts.d.ts.map +0 -1
- package/dist/commands/validate-artifacts.js.map +0 -1
- package/dist/commands/version.d.ts.map +0 -1
- package/dist/commands/version.js.map +0 -1
- package/dist/commands/versioning.d.ts.map +0 -1
- package/dist/commands/versioning.js.map +0 -1
- package/dist/commands/wiki.d.ts.map +0 -1
- package/dist/commands/wiki.js.map +0 -1
- package/dist/core/artifact-schemas.d.ts.map +0 -1
- package/dist/core/artifact-schemas.js.map +0 -1
- package/dist/core/auto-review.d.ts.map +0 -1
- package/dist/core/auto-review.js.map +0 -1
- package/dist/core/bench.d.ts.map +0 -1
- package/dist/core/bench.js.map +0 -1
- package/dist/core/code-structure.d.ts.map +0 -1
- package/dist/core/code-structure.js.map +0 -1
- package/dist/core/codex-adapter.d.ts.map +0 -1
- package/dist/core/codex-adapter.js.map +0 -1
- package/dist/core/codex-app.d.ts.map +0 -1
- package/dist/core/codex-app.js.map +0 -1
- package/dist/core/codex-lb-circuit.d.ts.map +0 -1
- package/dist/core/codex-lb-circuit.js.map +0 -1
- package/dist/core/codex-model-guard.d.ts.map +0 -1
- package/dist/core/codex-model-guard.js.map +0 -1
- package/dist/core/commands/autoresearch-command.d.ts.map +0 -1
- package/dist/core/commands/autoresearch-command.js.map +0 -1
- package/dist/core/commands/basic-cli.d.ts.map +0 -1
- package/dist/core/commands/basic-cli.js.map +0 -1
- package/dist/core/commands/bench-command.d.ts.map +0 -1
- package/dist/core/commands/bench-command.js.map +0 -1
- package/dist/core/commands/code-structure-command.d.ts.map +0 -1
- package/dist/core/commands/code-structure-command.js.map +0 -1
- package/dist/core/commands/command-utils.d.ts.map +0 -1
- package/dist/core/commands/command-utils.js.map +0 -1
- package/dist/core/commands/computer-use-command.d.ts.map +0 -1
- package/dist/core/commands/computer-use-command.js.map +0 -1
- package/dist/core/commands/db-command.d.ts.map +0 -1
- package/dist/core/commands/db-command.js.map +0 -1
- package/dist/core/commands/eval-command.d.ts.map +0 -1
- package/dist/core/commands/eval-command.js.map +0 -1
- package/dist/core/commands/gc-command.d.ts.map +0 -1
- package/dist/core/commands/gc-command.js.map +0 -1
- package/dist/core/commands/goal-command.d.ts.map +0 -1
- package/dist/core/commands/goal-command.js.map +0 -1
- package/dist/core/commands/gx-command.d.ts.map +0 -1
- package/dist/core/commands/gx-command.js.map +0 -1
- package/dist/core/commands/harness-command.d.ts.map +0 -1
- package/dist/core/commands/harness-command.js.map +0 -1
- package/dist/core/commands/hproof-command.d.ts.map +0 -1
- package/dist/core/commands/hproof-command.js.map +0 -1
- package/dist/core/commands/image-ux-review-command.d.ts.map +0 -1
- package/dist/core/commands/image-ux-review-command.js.map +0 -1
- package/dist/core/commands/mad-sks-command.d.ts.map +0 -1
- package/dist/core/commands/mad-sks-command.js.map +0 -1
- package/dist/core/commands/paths-command.d.ts.map +0 -1
- package/dist/core/commands/paths-command.js.map +0 -1
- package/dist/core/commands/perf-command.d.ts.map +0 -1
- package/dist/core/commands/perf-command.js.map +0 -1
- package/dist/core/commands/pipeline-command.d.ts.map +0 -1
- package/dist/core/commands/pipeline-command.js.map +0 -1
- package/dist/core/commands/ppt-command.d.ts.map +0 -1
- package/dist/core/commands/ppt-command.js.map +0 -1
- package/dist/core/commands/profile-command.d.ts.map +0 -1
- package/dist/core/commands/profile-command.js.map +0 -1
- package/dist/core/commands/proof-field-command.d.ts.map +0 -1
- package/dist/core/commands/proof-field-command.js.map +0 -1
- package/dist/core/commands/qa-loop-command.d.ts.map +0 -1
- package/dist/core/commands/qa-loop-command.js.map +0 -1
- package/dist/core/commands/recallpulse-command.d.ts.map +0 -1
- package/dist/core/commands/recallpulse-command.js.map +0 -1
- package/dist/core/commands/research-command.d.ts.map +0 -1
- package/dist/core/commands/research-command.js.map +0 -1
- package/dist/core/commands/rollback-command.d.ts.map +0 -1
- package/dist/core/commands/rollback-command.js.map +0 -1
- package/dist/core/commands/run-command.d.ts.map +0 -1
- package/dist/core/commands/run-command.js.map +0 -1
- package/dist/core/commands/rust-command.d.ts.map +0 -1
- package/dist/core/commands/rust-command.js.map +0 -1
- package/dist/core/commands/scouts-command.d.ts.map +0 -1
- package/dist/core/commands/scouts-command.js.map +0 -1
- package/dist/core/commands/skill-dream-command.d.ts.map +0 -1
- package/dist/core/commands/skill-dream-command.js.map +0 -1
- package/dist/core/commands/status-command.d.ts.map +0 -1
- package/dist/core/commands/status-command.js.map +0 -1
- package/dist/core/commands/team-command.d.ts.map +0 -1
- package/dist/core/commands/team-command.js.map +0 -1
- package/dist/core/commands/trust-command.d.ts.map +0 -1
- package/dist/core/commands/trust-command.js.map +0 -1
- package/dist/core/commands/validate-artifacts-command.d.ts.map +0 -1
- package/dist/core/commands/validate-artifacts-command.js.map +0 -1
- package/dist/core/commands/wiki-command.d.ts.map +0 -1
- package/dist/core/commands/wiki-command.js.map +0 -1
- package/dist/core/commands/wrongness-command.d.ts.map +0 -1
- package/dist/core/commands/wrongness-command.js.map +0 -1
- package/dist/core/context7-client.d.ts.map +0 -1
- package/dist/core/context7-client.js.map +0 -1
- package/dist/core/db-safety.d.ts.map +0 -1
- package/dist/core/db-safety.js.map +0 -1
- package/dist/core/decision-contract.d.ts.map +0 -1
- package/dist/core/decision-contract.js.map +0 -1
- package/dist/core/decision-lattice.d.ts.map +0 -1
- package/dist/core/decision-lattice.js.map +0 -1
- package/dist/core/dogfood-loop.d.ts.map +0 -1
- package/dist/core/dogfood-loop.js.map +0 -1
- package/dist/core/effort-orchestrator.d.ts.map +0 -1
- package/dist/core/effort-orchestrator.js.map +0 -1
- package/dist/core/evaluation.d.ts.map +0 -1
- package/dist/core/evaluation.js.map +0 -1
- package/dist/core/evidence/evidence-dedupe.d.ts.map +0 -1
- package/dist/core/evidence/evidence-dedupe.js.map +0 -1
- package/dist/core/evidence/evidence-freshness.d.ts.map +0 -1
- package/dist/core/evidence/evidence-freshness.js.map +0 -1
- package/dist/core/evidence/evidence-proof-linker.d.ts.map +0 -1
- package/dist/core/evidence/evidence-proof-linker.js.map +0 -1
- package/dist/core/evidence/evidence-redaction.d.ts.map +0 -1
- package/dist/core/evidence/evidence-redaction.js.map +0 -1
- package/dist/core/evidence/evidence-router.d.ts.map +0 -1
- package/dist/core/evidence/evidence-router.js.map +0 -1
- package/dist/core/evidence/evidence-schema.d.ts.map +0 -1
- package/dist/core/evidence/evidence-schema.js.map +0 -1
- package/dist/core/evidence/evidence-store.d.ts.map +0 -1
- package/dist/core/evidence/evidence-store.js.map +0 -1
- package/dist/core/feature-fixture-runner.d.ts.map +0 -1
- package/dist/core/feature-fixture-runner.js.map +0 -1
- package/dist/core/feature-fixtures.d.ts.map +0 -1
- package/dist/core/feature-fixtures.js.map +0 -1
- package/dist/core/feature-registry.d.ts.map +0 -1
- package/dist/core/feature-registry.js.map +0 -1
- package/dist/core/features/feature-fixtures.d.ts.map +0 -1
- package/dist/core/features/feature-fixtures.js.map +0 -1
- package/dist/core/features/feature-registry.d.ts.map +0 -1
- package/dist/core/features/feature-registry.js.map +0 -1
- package/dist/core/from-chat-img-forensics.d.ts.map +0 -1
- package/dist/core/from-chat-img-forensics.js.map +0 -1
- package/dist/core/fsx.d.ts.map +0 -1
- package/dist/core/fsx.js.map +0 -1
- package/dist/core/git-simple.d.ts.map +0 -1
- package/dist/core/git-simple.js.map +0 -1
- package/dist/core/goal-workflow.d.ts.map +0 -1
- package/dist/core/goal-workflow.js.map +0 -1
- package/dist/core/gx-renderer.d.ts.map +0 -1
- package/dist/core/gx-renderer.js.map +0 -1
- package/dist/core/harness-conflicts.d.ts.map +0 -1
- package/dist/core/harness-conflicts.js.map +0 -1
- package/dist/core/harness-guard.d.ts.map +0 -1
- package/dist/core/harness-guard.js.map +0 -1
- package/dist/core/hooks-runtime.d.ts.map +0 -1
- package/dist/core/hooks-runtime.js.map +0 -1
- package/dist/core/hproof.d.ts.map +0 -1
- package/dist/core/hproof.js.map +0 -1
- package/dist/core/image-ux-review.d.ts.map +0 -1
- package/dist/core/image-ux-review.js.map +0 -1
- package/dist/core/init.d.ts.map +0 -1
- package/dist/core/init.js.map +0 -1
- package/dist/core/language-preference.d.ts.map +0 -1
- package/dist/core/language-preference.js.map +0 -1
- package/dist/core/managed-paths.d.ts.map +0 -1
- package/dist/core/managed-paths.js.map +0 -1
- package/dist/core/memory-governor.d.ts.map +0 -1
- package/dist/core/memory-governor.js.map +0 -1
- package/dist/core/mission.d.ts.map +0 -1
- package/dist/core/mission.js.map +0 -1
- package/dist/core/mistake-memory.d.ts.map +0 -1
- package/dist/core/mistake-memory.js.map +0 -1
- package/dist/core/mistake-recall.d.ts.map +0 -1
- package/dist/core/mistake-recall.js.map +0 -1
- package/dist/core/no-question-guard.d.ts.map +0 -1
- package/dist/core/no-question-guard.js.map +0 -1
- package/dist/core/openclaw.d.ts.map +0 -1
- package/dist/core/openclaw.js.map +0 -1
- package/dist/core/perf-bench.d.ts.map +0 -1
- package/dist/core/perf-bench.js.map +0 -1
- package/dist/core/permission-gates.d.ts.map +0 -1
- package/dist/core/permission-gates.js.map +0 -1
- package/dist/core/pipeline/active-context.d.ts.map +0 -1
- package/dist/core/pipeline/active-context.js.map +0 -1
- package/dist/core/pipeline/pipeline-plan-writer.d.ts.map +0 -1
- package/dist/core/pipeline/pipeline-plan-writer.js.map +0 -1
- package/dist/core/pipeline/plan-schema.d.ts.map +0 -1
- package/dist/core/pipeline/plan-schema.js.map +0 -1
- package/dist/core/pipeline/prompt-context-answer.d.ts.map +0 -1
- package/dist/core/pipeline/prompt-context-answer.js.map +0 -1
- package/dist/core/pipeline/prompt-context-computer-use.d.ts.map +0 -1
- package/dist/core/pipeline/prompt-context-computer-use.js.map +0 -1
- package/dist/core/pipeline/prompt-context-dfix.d.ts.map +0 -1
- package/dist/core/pipeline/prompt-context-dfix.js.map +0 -1
- package/dist/core/pipeline/prompt-context.d.ts.map +0 -1
- package/dist/core/pipeline/prompt-context.js.map +0 -1
- package/dist/core/pipeline/route-prep-db.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep-db.js.map +0 -1
- package/dist/core/pipeline/route-prep-gx.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep-gx.js.map +0 -1
- package/dist/core/pipeline/route-prep-image-ux.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep-image-ux.js.map +0 -1
- package/dist/core/pipeline/route-prep-ppt.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep-ppt.js.map +0 -1
- package/dist/core/pipeline/route-prep-qa.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep-qa.js.map +0 -1
- package/dist/core/pipeline/route-prep-research.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep-research.js.map +0 -1
- package/dist/core/pipeline/route-prep-team.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep-team.js.map +0 -1
- package/dist/core/pipeline/route-prep.d.ts.map +0 -1
- package/dist/core/pipeline/route-prep.js.map +0 -1
- package/dist/core/pipeline/scout-stage-policy.d.ts.map +0 -1
- package/dist/core/pipeline/scout-stage-policy.js.map +0 -1
- package/dist/core/pipeline/stage-policy.d.ts.map +0 -1
- package/dist/core/pipeline/stage-policy.js.map +0 -1
- package/dist/core/pipeline/stop-gate-context7.d.ts.map +0 -1
- package/dist/core/pipeline/stop-gate-context7.js.map +0 -1
- package/dist/core/pipeline/stop-gate-proof.d.ts.map +0 -1
- package/dist/core/pipeline/stop-gate-proof.js.map +0 -1
- package/dist/core/pipeline/stop-gate-subagents.d.ts.map +0 -1
- package/dist/core/pipeline/stop-gate-subagents.js.map +0 -1
- package/dist/core/pipeline/stop-gate.d.ts.map +0 -1
- package/dist/core/pipeline/stop-gate.js.map +0 -1
- package/dist/core/pipeline/validation.d.ts.map +0 -1
- package/dist/core/pipeline/validation.js.map +0 -1
- package/dist/core/pipeline-internals/runtime-core.d.ts.map +0 -1
- package/dist/core/pipeline-internals/runtime-core.js.map +0 -1
- package/dist/core/pipeline-internals/runtime-gates.d.ts.map +0 -1
- package/dist/core/pipeline-internals/runtime-gates.js.map +0 -1
- package/dist/core/pipeline-runtime.d.ts.map +0 -1
- package/dist/core/pipeline-runtime.js.map +0 -1
- package/dist/core/pipeline.d.ts.map +0 -1
- package/dist/core/pipeline.js.map +0 -1
- package/dist/core/ppt.d.ts.map +0 -1
- package/dist/core/ppt.js.map +0 -1
- package/dist/core/prompt-context-builder.d.ts.map +0 -1
- package/dist/core/prompt-context-builder.js.map +0 -1
- package/dist/core/proof/auto-finalize.d.ts.map +0 -1
- package/dist/core/proof/auto-finalize.js.map +0 -1
- package/dist/core/proof/claim-ledger.d.ts.map +0 -1
- package/dist/core/proof/claim-ledger.js.map +0 -1
- package/dist/core/proof/command-ledger.d.ts.map +0 -1
- package/dist/core/proof/command-ledger.js.map +0 -1
- package/dist/core/proof/evidence-collector.d.ts.map +0 -1
- package/dist/core/proof/evidence-collector.js.map +0 -1
- package/dist/core/proof/file-change-ledger.d.ts.map +0 -1
- package/dist/core/proof/file-change-ledger.js.map +0 -1
- package/dist/core/proof/proof-reader.d.ts.map +0 -1
- package/dist/core/proof/proof-reader.js.map +0 -1
- package/dist/core/proof/proof-redaction.test-helper.d.ts.map +0 -1
- package/dist/core/proof/proof-redaction.test-helper.js.map +0 -1
- package/dist/core/proof/proof-schema.d.ts.map +0 -1
- package/dist/core/proof/proof-schema.js.map +0 -1
- package/dist/core/proof/proof-writer.d.ts.map +0 -1
- package/dist/core/proof/proof-writer.js.map +0 -1
- package/dist/core/proof/route-adapter.d.ts.map +0 -1
- package/dist/core/proof/route-adapter.js.map +0 -1
- package/dist/core/proof/route-finalizer-fixtures.d.ts.map +0 -1
- package/dist/core/proof/route-finalizer-fixtures.js.map +0 -1
- package/dist/core/proof/route-finalizer-policy.d.ts.map +0 -1
- package/dist/core/proof/route-finalizer-policy.js.map +0 -1
- package/dist/core/proof/route-finalizer.d.ts.map +0 -1
- package/dist/core/proof/route-finalizer.js.map +0 -1
- package/dist/core/proof/route-proof-gate.d.ts.map +0 -1
- package/dist/core/proof/route-proof-gate.js.map +0 -1
- package/dist/core/proof/route-proof-policy.d.ts.map +0 -1
- package/dist/core/proof/route-proof-policy.js.map +0 -1
- package/dist/core/proof/selftest-proof-fixtures.d.ts.map +0 -1
- package/dist/core/proof/selftest-proof-fixtures.js.map +0 -1
- package/dist/core/proof/validation.d.ts.map +0 -1
- package/dist/core/proof/validation.js.map +0 -1
- package/dist/core/proof-field.d.ts.map +0 -1
- package/dist/core/proof-field.js.map +0 -1
- package/dist/core/qa-loop.d.ts.map +0 -1
- package/dist/core/qa-loop.js.map +0 -1
- package/dist/core/questions.d.ts.map +0 -1
- package/dist/core/questions.js.map +0 -1
- package/dist/core/recallpulse.d.ts.map +0 -1
- package/dist/core/recallpulse.js.map +0 -1
- package/dist/core/research.d.ts.map +0 -1
- package/dist/core/research.js.map +0 -1
- package/dist/core/retention.d.ts.map +0 -1
- package/dist/core/retention.js.map +0 -1
- package/dist/core/routes.d.ts.map +0 -1
- package/dist/core/routes.js.map +0 -1
- package/dist/core/rust-accelerator.d.ts.map +0 -1
- package/dist/core/rust-accelerator.js.map +0 -1
- package/dist/core/scouts/engines/codex-app-subagent-engine.d.ts.map +0 -1
- package/dist/core/scouts/engines/codex-app-subagent-engine.js.map +0 -1
- package/dist/core/scouts/engines/codex-exec-parallel-engine.d.ts.map +0 -1
- package/dist/core/scouts/engines/codex-exec-parallel-engine.js.map +0 -1
- package/dist/core/scouts/engines/local-static-engine.d.ts.map +0 -1
- package/dist/core/scouts/engines/local-static-engine.js.map +0 -1
- package/dist/core/scouts/engines/scout-engine-base.d.ts.map +0 -1
- package/dist/core/scouts/engines/scout-engine-base.js.map +0 -1
- package/dist/core/scouts/engines/scout-engine-detect.d.ts.map +0 -1
- package/dist/core/scouts/engines/scout-engine-detect.js.map +0 -1
- package/dist/core/scouts/engines/scout-engine-policy.d.ts.map +0 -1
- package/dist/core/scouts/engines/scout-engine-policy.js.map +0 -1
- package/dist/core/scouts/engines/sequential-fallback-engine.d.ts.map +0 -1
- package/dist/core/scouts/engines/sequential-fallback-engine.js.map +0 -1
- package/dist/core/scouts/engines/tmux-lane-cleanup.d.ts.map +0 -1
- package/dist/core/scouts/engines/tmux-lane-cleanup.js.map +0 -1
- package/dist/core/scouts/engines/tmux-lane-engine.d.ts.map +0 -1
- package/dist/core/scouts/engines/tmux-lane-engine.js.map +0 -1
- package/dist/core/scouts/engines/tmux-lane-watcher.d.ts.map +0 -1
- package/dist/core/scouts/engines/tmux-lane-watcher.js.map +0 -1
- package/dist/core/scouts/scout-artifacts.d.ts.map +0 -1
- package/dist/core/scouts/scout-artifacts.js.map +0 -1
- package/dist/core/scouts/scout-consensus.d.ts.map +0 -1
- package/dist/core/scouts/scout-consensus.js.map +0 -1
- package/dist/core/scouts/scout-gate.d.ts.map +0 -1
- package/dist/core/scouts/scout-gate.js.map +0 -1
- package/dist/core/scouts/scout-output-fixtures.d.ts.map +0 -1
- package/dist/core/scouts/scout-output-fixtures.js.map +0 -1
- package/dist/core/scouts/scout-output-normalizer.d.ts.map +0 -1
- package/dist/core/scouts/scout-output-normalizer.js.map +0 -1
- package/dist/core/scouts/scout-output-parser.d.ts.map +0 -1
- package/dist/core/scouts/scout-output-parser.js.map +0 -1
- package/dist/core/scouts/scout-output-validator.d.ts.map +0 -1
- package/dist/core/scouts/scout-output-validator.js.map +0 -1
- package/dist/core/scouts/scout-plan.d.ts.map +0 -1
- package/dist/core/scouts/scout-plan.js.map +0 -1
- package/dist/core/scouts/scout-proof-evidence.d.ts.map +0 -1
- package/dist/core/scouts/scout-proof-evidence.js.map +0 -1
- package/dist/core/scouts/scout-readonly-guard.d.ts.map +0 -1
- package/dist/core/scouts/scout-readonly-guard.js.map +0 -1
- package/dist/core/scouts/scout-runner.d.ts.map +0 -1
- package/dist/core/scouts/scout-runner.js.map +0 -1
- package/dist/core/scouts/scout-schema.d.ts.map +0 -1
- package/dist/core/scouts/scout-schema.js.map +0 -1
- package/dist/core/scouts/scout-triwiki.d.ts.map +0 -1
- package/dist/core/scouts/scout-triwiki.js.map +0 -1
- package/dist/core/secret-redaction.d.ts.map +0 -1
- package/dist/core/secret-redaction.js.map +0 -1
- package/dist/core/skill-forge.d.ts.map +0 -1
- package/dist/core/skill-forge.js.map +0 -1
- package/dist/core/team-dag.d.ts.map +0 -1
- package/dist/core/team-dag.js.map +0 -1
- package/dist/core/team-dashboard-renderer.d.ts.map +0 -1
- package/dist/core/team-dashboard-renderer.js.map +0 -1
- package/dist/core/team-live.d.ts.map +0 -1
- package/dist/core/team-live.js.map +0 -1
- package/dist/core/team-review-policy.d.ts.map +0 -1
- package/dist/core/team-review-policy.js.map +0 -1
- package/dist/core/tmux-ui.d.ts.map +0 -1
- package/dist/core/tmux-ui.js.map +0 -1
- package/dist/core/triwiki-attention.d.ts.map +0 -1
- package/dist/core/triwiki-attention.js.map +0 -1
- package/dist/core/triwiki-wrongness/avoidance-rules.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/avoidance-rules.js.map +0 -1
- package/dist/core/triwiki-wrongness/image-wrongness.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/image-wrongness.js.map +0 -1
- package/dist/core/triwiki-wrongness/validators.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/validators.js.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-cli.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-cli.js.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-ledger.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-ledger.js.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-proof-linker.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-proof-linker.js.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-retrieval.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-retrieval.js.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-schema.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-schema.js.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-trust-policy.d.ts.map +0 -1
- package/dist/core/triwiki-wrongness/wrongness-trust-policy.js.map +0 -1
- package/dist/core/trust-kernel/completion-contract.d.ts.map +0 -1
- package/dist/core/trust-kernel/completion-contract.js.map +0 -1
- package/dist/core/trust-kernel/evidence-router.d.ts.map +0 -1
- package/dist/core/trust-kernel/evidence-router.js.map +0 -1
- package/dist/core/trust-kernel/route-contract.d.ts.map +0 -1
- package/dist/core/trust-kernel/route-contract.js.map +0 -1
- package/dist/core/trust-kernel/route-state-machine.d.ts.map +0 -1
- package/dist/core/trust-kernel/route-state-machine.js.map +0 -1
- package/dist/core/trust-kernel/trust-kernel-schema.d.ts.map +0 -1
- package/dist/core/trust-kernel/trust-kernel-schema.js.map +0 -1
- package/dist/core/trust-kernel/trust-report.d.ts.map +0 -1
- package/dist/core/trust-kernel/trust-report.js.map +0 -1
- package/dist/core/trust-kernel/trust-status.d.ts.map +0 -1
- package/dist/core/trust-kernel/trust-status.js.map +0 -1
- package/dist/core/validators/completion-proof-validator.d.ts.map +0 -1
- package/dist/core/validators/completion-proof-validator.js.map +0 -1
- package/dist/core/validators/evidence-validator.d.ts.map +0 -1
- package/dist/core/validators/evidence-validator.js.map +0 -1
- package/dist/core/validators/feature-fixture-validator.d.ts.map +0 -1
- package/dist/core/validators/feature-fixture-validator.js.map +0 -1
- package/dist/core/validators/image-voxel-validator.d.ts.map +0 -1
- package/dist/core/validators/image-voxel-validator.js.map +0 -1
- package/dist/core/validators/route-contract-validator.d.ts.map +0 -1
- package/dist/core/validators/route-contract-validator.js.map +0 -1
- package/dist/core/validators/scout-result-validator.d.ts.map +0 -1
- package/dist/core/validators/scout-result-validator.js.map +0 -1
- package/dist/core/validators/trust-report-validator.d.ts.map +0 -1
- package/dist/core/validators/trust-report-validator.js.map +0 -1
- package/dist/core/validators/validation-error.d.ts.map +0 -1
- package/dist/core/validators/validation-error.js.map +0 -1
- package/dist/core/version-manager.d.ts.map +0 -1
- package/dist/core/version-manager.js.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/core/version.js.map +0 -1
- package/dist/core/wiki-coordinate.d.ts.map +0 -1
- package/dist/core/wiki-coordinate.js.map +0 -1
- package/dist/core/wiki-image/bbox.d.ts.map +0 -1
- package/dist/core/wiki-image/bbox.js.map +0 -1
- package/dist/core/wiki-image/before-after-relation.d.ts.map +0 -1
- package/dist/core/wiki-image/before-after-relation.js.map +0 -1
- package/dist/core/wiki-image/callout-parser.d.ts.map +0 -1
- package/dist/core/wiki-image/callout-parser.js.map +0 -1
- package/dist/core/wiki-image/computer-use-evidence.d.ts.map +0 -1
- package/dist/core/wiki-image/computer-use-evidence.js.map +0 -1
- package/dist/core/wiki-image/computer-use-ledger.d.ts.map +0 -1
- package/dist/core/wiki-image/computer-use-ledger.js.map +0 -1
- package/dist/core/wiki-image/generated-review-parser.d.ts.map +0 -1
- package/dist/core/wiki-image/generated-review-parser.js.map +0 -1
- package/dist/core/wiki-image/image-hash.d.ts.map +0 -1
- package/dist/core/wiki-image/image-hash.js.map +0 -1
- package/dist/core/wiki-image/image-relation.d.ts.map +0 -1
- package/dist/core/wiki-image/image-relation.js.map +0 -1
- package/dist/core/wiki-image/image-ux-evidence.d.ts.map +0 -1
- package/dist/core/wiki-image/image-ux-evidence.js.map +0 -1
- package/dist/core/wiki-image/image-voxel-ledger.d.ts.map +0 -1
- package/dist/core/wiki-image/image-voxel-ledger.js.map +0 -1
- package/dist/core/wiki-image/image-voxel-schema.d.ts.map +0 -1
- package/dist/core/wiki-image/image-voxel-schema.js.map +0 -1
- package/dist/core/wiki-image/ppt-image-evidence.d.ts.map +0 -1
- package/dist/core/wiki-image/ppt-image-evidence.js.map +0 -1
- package/dist/core/wiki-image/proof-linker.d.ts.map +0 -1
- package/dist/core/wiki-image/proof-linker.js.map +0 -1
- package/dist/core/wiki-image/route-image-evidence.d.ts.map +0 -1
- package/dist/core/wiki-image/route-image-evidence.js.map +0 -1
- package/dist/core/wiki-image/validation.d.ts.map +0 -1
- package/dist/core/wiki-image/validation.js.map +0 -1
- package/dist/core/wiki-image/visual-anchor.d.ts.map +0 -1
- package/dist/core/wiki-image/visual-anchor.js.map +0 -1
- package/dist/core/work-order-ledger.d.ts.map +0 -1
- package/dist/core/work-order-ledger.js.map +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { exists, projectRoot, readJson } from '../fsx.js';
|
|
3
|
+
import { CODEX_HOOK_EVENTS, codexHookEventName, readCodexHookSchema } from './codex-schema-snapshot.js';
|
|
4
|
+
export async function validateCodexHookOutput(eventLike, output) {
|
|
5
|
+
const event = codexHookEventName(eventLike) || 'UserPromptSubmit';
|
|
6
|
+
const schema = await readCodexHookSchema(event, 'output');
|
|
7
|
+
const issues = validateJsonValue(output, schema, schema, '$');
|
|
8
|
+
return { ok: issues.length === 0, event, issues };
|
|
9
|
+
}
|
|
10
|
+
export async function validateCodexFixtureOutputs(root) {
|
|
11
|
+
root ||= await projectRoot();
|
|
12
|
+
const fixtureRoot = path.join(root, 'test', 'fixtures', 'codex-hooks', 'rust-v0.131.0');
|
|
13
|
+
const outputs = [];
|
|
14
|
+
for (const event of CODEX_HOOK_EVENTS) {
|
|
15
|
+
const candidates = await expectedOutputFilesForEvent(fixtureRoot, event);
|
|
16
|
+
for (const file of candidates) {
|
|
17
|
+
const output = await readJson(file, {});
|
|
18
|
+
const validation = await validateCodexHookOutput(event, output);
|
|
19
|
+
outputs.push({ file, ...validation });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const ok = outputs.length > 0 && outputs.every((row) => row.ok);
|
|
23
|
+
return {
|
|
24
|
+
schema: 'sks.codex-hook-fixture-validation.v1',
|
|
25
|
+
ok,
|
|
26
|
+
fixture_root: fixtureRoot,
|
|
27
|
+
checked: outputs.length,
|
|
28
|
+
outputs
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async function expectedOutputFilesForEvent(fixtureRoot, event) {
|
|
32
|
+
if (!(await exists(fixtureRoot)))
|
|
33
|
+
return [];
|
|
34
|
+
const fs = await import('node:fs/promises');
|
|
35
|
+
const eventStem = {
|
|
36
|
+
PreToolUse: 'pre-tool-use',
|
|
37
|
+
PermissionRequest: 'permission-request',
|
|
38
|
+
PostToolUse: 'post-tool-use',
|
|
39
|
+
PreCompact: 'pre-compact',
|
|
40
|
+
PostCompact: 'post-compact',
|
|
41
|
+
SessionStart: 'session-start',
|
|
42
|
+
UserPromptSubmit: 'user-prompt-submit',
|
|
43
|
+
Stop: 'stop'
|
|
44
|
+
}[event];
|
|
45
|
+
const entries = await fs.readdir(fixtureRoot).catch(() => []);
|
|
46
|
+
return entries
|
|
47
|
+
.filter((entry) => entry.startsWith(eventStem) && entry.endsWith('.output.expected.json'))
|
|
48
|
+
.map((entry) => path.join(fixtureRoot, entry));
|
|
49
|
+
}
|
|
50
|
+
function validateJsonValue(value, schema, root, pointer) {
|
|
51
|
+
const issues = [];
|
|
52
|
+
if (!schema || typeof schema !== 'object')
|
|
53
|
+
return issues;
|
|
54
|
+
if (schema.$ref)
|
|
55
|
+
return validateJsonValue(value, resolveRef(root, schema.$ref), root, pointer);
|
|
56
|
+
for (const child of schema.allOf || [])
|
|
57
|
+
issues.push(...validateJsonValue(value, child, root, pointer));
|
|
58
|
+
if (schema.const !== undefined && value !== schema.const)
|
|
59
|
+
issues.push(`${pointer}:const`);
|
|
60
|
+
if (Array.isArray(schema.enum) && !schema.enum.includes(value))
|
|
61
|
+
issues.push(`${pointer}:enum`);
|
|
62
|
+
if (schema.type) {
|
|
63
|
+
const types = Array.isArray(schema.type) ? schema.type : [schema.type];
|
|
64
|
+
if (!types.some((type) => matchesJsonType(value, type)))
|
|
65
|
+
issues.push(`${pointer}:type:${types.join('|')}`);
|
|
66
|
+
}
|
|
67
|
+
if (schema.type === 'object' || schema.properties || schema.additionalProperties === false) {
|
|
68
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
69
|
+
return issues;
|
|
70
|
+
const properties = schema.properties || {};
|
|
71
|
+
const required = Array.isArray(schema.required) ? schema.required : [];
|
|
72
|
+
for (const key of required) {
|
|
73
|
+
if (!Object.prototype.hasOwnProperty.call(value, key))
|
|
74
|
+
issues.push(`${pointer}.${key}:required`);
|
|
75
|
+
}
|
|
76
|
+
if (schema.additionalProperties === false) {
|
|
77
|
+
for (const key of Object.keys(value)) {
|
|
78
|
+
if (!Object.prototype.hasOwnProperty.call(properties, key))
|
|
79
|
+
issues.push(`${pointer}.${key}:unknown_field`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
for (const [key, childSchema] of Object.entries(properties)) {
|
|
83
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
84
|
+
issues.push(...validateJsonValue(value[key], childSchema, root, `${pointer}.${key}`));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (schema.type === 'array' && Array.isArray(value) && schema.items) {
|
|
89
|
+
value.forEach((item, index) => issues.push(...validateJsonValue(item, schema.items, root, `${pointer}[${index}]`)));
|
|
90
|
+
}
|
|
91
|
+
return issues;
|
|
92
|
+
}
|
|
93
|
+
function resolveRef(root, ref) {
|
|
94
|
+
if (!ref.startsWith('#/'))
|
|
95
|
+
return {};
|
|
96
|
+
return ref.slice(2).split('/').reduce((node, part) => node?.[part], root) || {};
|
|
97
|
+
}
|
|
98
|
+
function matchesJsonType(value, type) {
|
|
99
|
+
if (type === 'null')
|
|
100
|
+
return value === null;
|
|
101
|
+
if (type === 'array')
|
|
102
|
+
return Array.isArray(value);
|
|
103
|
+
if (type === 'object')
|
|
104
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
105
|
+
if (type === 'integer')
|
|
106
|
+
return Number.isInteger(value);
|
|
107
|
+
return typeof value === type;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=codex-hook-schema.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare function detectCodexHookOutputWarnings(eventLike: unknown, output: any): Promise<{
|
|
2
|
+
schema: string;
|
|
3
|
+
ok: boolean;
|
|
4
|
+
event: "UserPromptSubmit" | "PreToolUse" | "PostToolUse" | "PermissionRequest" | "Stop" | "PreCompact" | "PostCompact" | "SessionStart";
|
|
5
|
+
warnings: string[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare function codexHookWarningCheck(root?: string, opts?: any): Promise<{
|
|
8
|
+
schema: string;
|
|
9
|
+
ok: boolean;
|
|
10
|
+
baseline: string;
|
|
11
|
+
warnings_count: number;
|
|
12
|
+
warnings: string[];
|
|
13
|
+
events: {
|
|
14
|
+
event: "UserPromptSubmit" | "PreToolUse" | "PostToolUse" | "PermissionRequest" | "Stop" | "PreCompact" | "PostCompact" | "SessionStart";
|
|
15
|
+
checked: number;
|
|
16
|
+
ok: boolean;
|
|
17
|
+
warnings: string[];
|
|
18
|
+
}[];
|
|
19
|
+
config: {
|
|
20
|
+
schema: string;
|
|
21
|
+
ok: boolean;
|
|
22
|
+
files: {
|
|
23
|
+
path: string;
|
|
24
|
+
exists: boolean;
|
|
25
|
+
ok: boolean;
|
|
26
|
+
issues: string[];
|
|
27
|
+
}[];
|
|
28
|
+
issues: string[];
|
|
29
|
+
};
|
|
30
|
+
wrongness: import("../triwiki-wrongness/wrongness-schema.js").WrongnessRecord | null;
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=codex-hook-warning-detector.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { projectRoot, readJson } from '../fsx.js';
|
|
3
|
+
import { recordHookPolicyMismatchWrongness } from '../triwiki-wrongness/wrongness-ledger.js';
|
|
4
|
+
import { CODEX_HOOK_EVENTS, codexHookEventName } from './codex-schema-snapshot.js';
|
|
5
|
+
import { validateCodexFixtureOutputs, validateCodexHookOutput } from './codex-hook-schema.js';
|
|
6
|
+
import { validateCodexHookConfigFiles } from './codex-config-policy.js';
|
|
7
|
+
const RESERVED_PERMISSION_REQUEST_FIELDS = ['updatedInput', 'updatedPermissions', 'interrupt'];
|
|
8
|
+
const LEGACY_TOP_LEVEL_KEYS = ['permissionDecision', 'permissionDecisionReason', 'updatedInput', 'additionalContext', 'hookEventName'];
|
|
9
|
+
export async function detectCodexHookOutputWarnings(eventLike, output) {
|
|
10
|
+
const event = codexHookEventName(eventLike) || 'UserPromptSubmit';
|
|
11
|
+
const validation = await validateCodexHookOutput(event, output);
|
|
12
|
+
const warnings = [...validation.issues];
|
|
13
|
+
warnings.push(...snakeCaseKeyWarnings(output));
|
|
14
|
+
for (const key of LEGACY_TOP_LEVEL_KEYS) {
|
|
15
|
+
if (output && typeof output === 'object' && Object.prototype.hasOwnProperty.call(output, key))
|
|
16
|
+
warnings.push(`legacy_top_level:${key}`);
|
|
17
|
+
}
|
|
18
|
+
if (event === 'PermissionRequest') {
|
|
19
|
+
const decision = output?.hookSpecificOutput?.decision || {};
|
|
20
|
+
for (const key of RESERVED_PERMISSION_REQUEST_FIELDS) {
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(decision, key))
|
|
22
|
+
warnings.push(`permission_request_reserved:${key}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (event === 'Stop' && output?.decision === 'block' && !String(output?.reason || '').trim())
|
|
26
|
+
warnings.push('stop_block_without_reason');
|
|
27
|
+
const actualEvent = output?.hookSpecificOutput?.hookEventName;
|
|
28
|
+
if (actualEvent && actualEvent !== event)
|
|
29
|
+
warnings.push(`hook_event_mismatch:${actualEvent}`);
|
|
30
|
+
return {
|
|
31
|
+
schema: 'sks.codex-hook-warning-detection.v1',
|
|
32
|
+
ok: warnings.length === 0,
|
|
33
|
+
event,
|
|
34
|
+
warnings: [...new Set(warnings)]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export async function codexHookWarningCheck(root, opts = {}) {
|
|
38
|
+
root ||= await projectRoot();
|
|
39
|
+
const fixtureValidation = await validateCodexFixtureOutputs(root);
|
|
40
|
+
const rows = [];
|
|
41
|
+
for (const row of fixtureValidation.outputs || []) {
|
|
42
|
+
const output = await readJson(row.file, {});
|
|
43
|
+
const warning = await detectCodexHookOutputWarnings(row.event, output);
|
|
44
|
+
rows.push({ event: row.event, file: row.file, warnings: warning.warnings, ok: warning.ok });
|
|
45
|
+
}
|
|
46
|
+
const config = await validateCodexHookConfigFiles(root);
|
|
47
|
+
const warnings = [
|
|
48
|
+
...rows.flatMap((row) => row.warnings.map((warning) => `${path.relative(root, row.file)}:${warning}`)),
|
|
49
|
+
...config.issues
|
|
50
|
+
];
|
|
51
|
+
let wrongness = null;
|
|
52
|
+
if (warnings.length && opts.recordWrongness !== false) {
|
|
53
|
+
wrongness = await recordHookPolicyMismatchWrongness(root, {
|
|
54
|
+
artifact: 'test/fixtures/codex-hooks/rust-v0.131.0',
|
|
55
|
+
expected: 'Codex rust-v0.131.0 schema-compatible hook output with warning count 0',
|
|
56
|
+
actual: warnings.join(', '),
|
|
57
|
+
detail: 'Codex hook warning check failed',
|
|
58
|
+
route: '$Hooks'
|
|
59
|
+
}).catch(() => null);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
schema: 'sks.codex-hook-warning-check.v1',
|
|
63
|
+
ok: warnings.length === 0,
|
|
64
|
+
baseline: 'rust-v0.131.0',
|
|
65
|
+
warnings_count: warnings.length,
|
|
66
|
+
warnings,
|
|
67
|
+
events: CODEX_HOOK_EVENTS.map((event) => ({
|
|
68
|
+
event,
|
|
69
|
+
checked: rows.filter((row) => row.event === event).length,
|
|
70
|
+
ok: rows.filter((row) => row.event === event).every((row) => row.ok),
|
|
71
|
+
warnings: rows.filter((row) => row.event === event).flatMap((row) => row.warnings)
|
|
72
|
+
})),
|
|
73
|
+
config,
|
|
74
|
+
wrongness
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function snakeCaseKeyWarnings(value, pointer = '$') {
|
|
78
|
+
if (!value || typeof value !== 'object')
|
|
79
|
+
return [];
|
|
80
|
+
if (Array.isArray(value))
|
|
81
|
+
return value.flatMap((item, index) => snakeCaseKeyWarnings(item, `${pointer}[${index}]`));
|
|
82
|
+
const warnings = [];
|
|
83
|
+
for (const [key, child] of Object.entries(value)) {
|
|
84
|
+
if (/_/.test(key))
|
|
85
|
+
warnings.push(`${pointer}.${key}:snake_case`);
|
|
86
|
+
warnings.push(...snakeCaseKeyWarnings(child, `${pointer}.${key}`));
|
|
87
|
+
}
|
|
88
|
+
return warnings;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=codex-hook-warning-detector.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const CODEX_HOOK_EVENTS: readonly ["PreToolUse", "PermissionRequest", "PostToolUse", "PreCompact", "PostCompact", "SessionStart", "UserPromptSubmit", "Stop"];
|
|
2
|
+
export type CodexHookEventName = typeof CODEX_HOOK_EVENTS[number];
|
|
3
|
+
export declare const CODEX_HOOK_EVENT_TO_FILE_STEM: Record<CodexHookEventName, string>;
|
|
4
|
+
export declare function codexHookEventName(value: unknown): CodexHookEventName | null;
|
|
5
|
+
export declare function codexHookSchemaPath(event: CodexHookEventName, direction?: 'input' | 'output'): Promise<string>;
|
|
6
|
+
export declare function readCodexHookSchema(event: CodexHookEventName, direction?: 'input' | 'output'): Promise<any>;
|
|
7
|
+
export declare function readCodexSchemaSnapshotMetadata(): Promise<any>;
|
|
8
|
+
export declare function codexSchemaSnapshotReport(): Promise<{
|
|
9
|
+
schema: string;
|
|
10
|
+
ok: boolean;
|
|
11
|
+
baseline: string;
|
|
12
|
+
metadata: any;
|
|
13
|
+
files: {
|
|
14
|
+
event: "UserPromptSubmit" | "PreToolUse" | "PostToolUse" | "PermissionRequest" | "Stop" | "PreCompact" | "PostCompact" | "SessionStart";
|
|
15
|
+
direction: "input" | "output";
|
|
16
|
+
path: string;
|
|
17
|
+
exists: boolean;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=codex-schema-snapshot.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { exists, packageRoot, readJson } from '../fsx.js';
|
|
3
|
+
import { CODEX_REQUIRED_BASELINE_TAG, CODEX_REQUIRED_VERSION } from './codex-version-policy.js';
|
|
4
|
+
export const CODEX_HOOK_EVENTS = [
|
|
5
|
+
'PreToolUse',
|
|
6
|
+
'PermissionRequest',
|
|
7
|
+
'PostToolUse',
|
|
8
|
+
'PreCompact',
|
|
9
|
+
'PostCompact',
|
|
10
|
+
'SessionStart',
|
|
11
|
+
'UserPromptSubmit',
|
|
12
|
+
'Stop'
|
|
13
|
+
];
|
|
14
|
+
export const CODEX_HOOK_EVENT_TO_FILE_STEM = {
|
|
15
|
+
PreToolUse: 'pre-tool-use',
|
|
16
|
+
PermissionRequest: 'permission-request',
|
|
17
|
+
PostToolUse: 'post-tool-use',
|
|
18
|
+
PreCompact: 'pre-compact',
|
|
19
|
+
PostCompact: 'post-compact',
|
|
20
|
+
SessionStart: 'session-start',
|
|
21
|
+
UserPromptSubmit: 'user-prompt-submit',
|
|
22
|
+
Stop: 'stop'
|
|
23
|
+
};
|
|
24
|
+
export function codexHookEventName(value) {
|
|
25
|
+
const normalized = String(value || '').replace(/[_\s]+/g, '-').toLowerCase();
|
|
26
|
+
if (normalized === 'pre-tool' || normalized === 'pre-tool-use' || normalized === 'pretooluse')
|
|
27
|
+
return 'PreToolUse';
|
|
28
|
+
if (normalized === 'permission-request' || normalized === 'permissionrequest')
|
|
29
|
+
return 'PermissionRequest';
|
|
30
|
+
if (normalized === 'post-tool' || normalized === 'post-tool-use' || normalized === 'posttooluse')
|
|
31
|
+
return 'PostToolUse';
|
|
32
|
+
if (normalized === 'pre-compact' || normalized === 'precompact')
|
|
33
|
+
return 'PreCompact';
|
|
34
|
+
if (normalized === 'post-compact' || normalized === 'postcompact')
|
|
35
|
+
return 'PostCompact';
|
|
36
|
+
if (normalized === 'session-start' || normalized === 'sessionstart')
|
|
37
|
+
return 'SessionStart';
|
|
38
|
+
if (normalized === 'user-prompt-submit' || normalized === 'userpromptsubmit')
|
|
39
|
+
return 'UserPromptSubmit';
|
|
40
|
+
if (normalized === 'stop')
|
|
41
|
+
return 'Stop';
|
|
42
|
+
return CODEX_HOOK_EVENTS.find((event) => event.toLowerCase() === normalized.toLowerCase()) ?? null;
|
|
43
|
+
}
|
|
44
|
+
export async function codexHookSchemaPath(event, direction = 'output') {
|
|
45
|
+
const stem = CODEX_HOOK_EVENT_TO_FILE_STEM[event];
|
|
46
|
+
const file = `${stem}.command.${direction}.schema.json`;
|
|
47
|
+
for (const base of candidateSnapshotDirs()) {
|
|
48
|
+
const candidate = path.join(base, file);
|
|
49
|
+
if (await exists(candidate))
|
|
50
|
+
return candidate;
|
|
51
|
+
}
|
|
52
|
+
return path.join(candidateSnapshotDirs()[0] || packageRoot(), file);
|
|
53
|
+
}
|
|
54
|
+
export async function readCodexHookSchema(event, direction = 'output') {
|
|
55
|
+
return readJson(await codexHookSchemaPath(event, direction), {});
|
|
56
|
+
}
|
|
57
|
+
export async function readCodexSchemaSnapshotMetadata() {
|
|
58
|
+
for (const base of candidateSnapshotDirs()) {
|
|
59
|
+
const candidate = path.join(base, 'snapshot-metadata.json');
|
|
60
|
+
if (await exists(candidate))
|
|
61
|
+
return readJson(candidate, {});
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
schema: 'sks.codex-hook-schema-snapshot.v1',
|
|
65
|
+
upstream: 'openai/codex',
|
|
66
|
+
tag: CODEX_REQUIRED_BASELINE_TAG,
|
|
67
|
+
codex_version: CODEX_REQUIRED_VERSION,
|
|
68
|
+
status: 'missing'
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export async function codexSchemaSnapshotReport() {
|
|
72
|
+
const metadata = await readCodexSchemaSnapshotMetadata();
|
|
73
|
+
const files = [];
|
|
74
|
+
for (const event of CODEX_HOOK_EVENTS) {
|
|
75
|
+
for (const direction of ['input', 'output']) {
|
|
76
|
+
const file = await codexHookSchemaPath(event, direction);
|
|
77
|
+
files.push({ event, direction, path: file, exists: await exists(file) });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const ok = files.every((file) => file.exists) && metadata.tag === CODEX_REQUIRED_BASELINE_TAG;
|
|
81
|
+
return {
|
|
82
|
+
schema: 'sks.codex-hook-schema-snapshot-report.v1',
|
|
83
|
+
ok,
|
|
84
|
+
baseline: CODEX_REQUIRED_BASELINE_TAG,
|
|
85
|
+
metadata,
|
|
86
|
+
files
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function candidateSnapshotDirs() {
|
|
90
|
+
const root = packageRoot();
|
|
91
|
+
return [
|
|
92
|
+
path.join(root, 'src', 'vendor', 'openai-codex', CODEX_REQUIRED_BASELINE_TAG, 'hooks'),
|
|
93
|
+
path.join(root, 'dist', 'vendor', 'openai-codex', CODEX_REQUIRED_BASELINE_TAG, 'hooks')
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=codex-schema-snapshot.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const CODEX_COMPAT_SCHEMA = "sks.codex-compat.v1";
|
|
2
|
+
export declare const CODEX_REQUIRED_BASELINE_TAG = "rust-v0.131.0";
|
|
3
|
+
export declare const CODEX_REQUIRED_VERSION = "0.131.0";
|
|
4
|
+
export declare function compareSemverLike(a: unknown, b: unknown): number;
|
|
5
|
+
export declare function parseCodexVersionText(text: unknown): string | null;
|
|
6
|
+
export declare function codexVersionPolicy(detected?: {
|
|
7
|
+
available?: boolean;
|
|
8
|
+
version?: string | null;
|
|
9
|
+
source?: string | null;
|
|
10
|
+
}): {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
status: string;
|
|
13
|
+
warnings: string[];
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=codex-version-policy.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const CODEX_COMPAT_SCHEMA = 'sks.codex-compat.v1';
|
|
2
|
+
export const CODEX_REQUIRED_BASELINE_TAG = 'rust-v0.131.0';
|
|
3
|
+
export const CODEX_REQUIRED_VERSION = '0.131.0';
|
|
4
|
+
export function compareSemverLike(a, b) {
|
|
5
|
+
const pa = parseVersionParts(a);
|
|
6
|
+
const pb = parseVersionParts(b);
|
|
7
|
+
for (let i = 0; i < Math.max(pa.length, pb.length, 3); i += 1) {
|
|
8
|
+
const left = pa[i] ?? 0;
|
|
9
|
+
const right = pb[i] ?? 0;
|
|
10
|
+
if (left > right)
|
|
11
|
+
return 1;
|
|
12
|
+
if (left < right)
|
|
13
|
+
return -1;
|
|
14
|
+
}
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
export function parseCodexVersionText(text) {
|
|
18
|
+
const match = String(text || '').match(/\b(?:rust-v)?(\d+\.\d+\.\d+)(?:[-+][0-9A-Za-z.-]+)?\b/);
|
|
19
|
+
return match?.[1] ?? null;
|
|
20
|
+
}
|
|
21
|
+
export function codexVersionPolicy(detected = {}) {
|
|
22
|
+
if (!detected.available || !detected.version) {
|
|
23
|
+
return {
|
|
24
|
+
ok: true,
|
|
25
|
+
status: 'integration_optional',
|
|
26
|
+
warnings: ['codex binary not detected; release schema checks use vendored rust-v0.131.0 snapshots']
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (compareSemverLike(detected.version, CODEX_REQUIRED_VERSION) >= 0) {
|
|
30
|
+
return { ok: true, status: 'ok', warnings: [] };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
ok: true,
|
|
34
|
+
status: 'compatibility_degraded',
|
|
35
|
+
warnings: [
|
|
36
|
+
`detected Codex ${detected.version} from ${detected.source || 'unknown'}; upgrade to ${CODEX_REQUIRED_BASELINE_TAG} or newer`
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function parseVersionParts(value) {
|
|
41
|
+
const parsed = parseCodexVersionText(value) || String(value || '0.0.0');
|
|
42
|
+
return parsed.split(/[.-]/).map((part) => Number.parseInt(part, 10) || 0);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=codex-version-policy.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type CodexDetectedVersion = {
|
|
2
|
+
available: boolean;
|
|
3
|
+
version: string | null;
|
|
4
|
+
source: string | null;
|
|
5
|
+
raw?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function detectCodexVersion(opts?: any): Promise<CodexDetectedVersion>;
|
|
8
|
+
export declare function codexVersionReport(opts?: any): Promise<{
|
|
9
|
+
detected: CodexDetectedVersion;
|
|
10
|
+
policy: {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
status: string;
|
|
13
|
+
warnings: string[];
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=codex-version.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { runProcess, which } from '../fsx.js';
|
|
2
|
+
import { codexVersionPolicy, parseCodexVersionText } from './codex-version-policy.js';
|
|
3
|
+
export async function detectCodexVersion(opts = {}) {
|
|
4
|
+
const codexBin = opts.codexBin || await which('codex').catch(() => null);
|
|
5
|
+
if (codexBin) {
|
|
6
|
+
const fromVersion = await detectFromCommand(codexBin, ['--version'], 'codex --version', opts);
|
|
7
|
+
if (fromVersion.version)
|
|
8
|
+
return fromVersion;
|
|
9
|
+
const fromHelp = await detectFromCommand(codexBin, ['--help'], 'codex --help', opts);
|
|
10
|
+
if (fromHelp.version)
|
|
11
|
+
return fromHelp;
|
|
12
|
+
}
|
|
13
|
+
const npmDetected = await detectFromNpm(opts);
|
|
14
|
+
if (npmDetected.version)
|
|
15
|
+
return npmDetected;
|
|
16
|
+
const brewDetected = await detectFromBrew(opts);
|
|
17
|
+
if (brewDetected.version)
|
|
18
|
+
return brewDetected;
|
|
19
|
+
return { available: false, version: null, source: null };
|
|
20
|
+
}
|
|
21
|
+
export async function codexVersionReport(opts = {}) {
|
|
22
|
+
const detected = await detectCodexVersion(opts);
|
|
23
|
+
const policy = codexVersionPolicy(detected);
|
|
24
|
+
return {
|
|
25
|
+
detected,
|
|
26
|
+
policy
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
async function detectFromCommand(bin, args, source, opts) {
|
|
30
|
+
const result = await runProcess(bin, args, {
|
|
31
|
+
timeoutMs: opts.timeoutMs || 3000,
|
|
32
|
+
maxOutputBytes: 16 * 1024,
|
|
33
|
+
env: opts.env || process.env
|
|
34
|
+
}).catch((err) => ({ code: 1, stdout: '', stderr: err.message }));
|
|
35
|
+
const raw = `${result.stdout || ''}\n${result.stderr || ''}`.trim();
|
|
36
|
+
const version = parseCodexVersionText(raw);
|
|
37
|
+
return {
|
|
38
|
+
available: Boolean(version),
|
|
39
|
+
version,
|
|
40
|
+
source: version ? source : null,
|
|
41
|
+
raw
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async function detectFromNpm(opts) {
|
|
45
|
+
const npmBin = opts.npmBin || await which('npm').catch(() => null);
|
|
46
|
+
if (!npmBin)
|
|
47
|
+
return { available: false, version: null, source: null };
|
|
48
|
+
const result = await runProcess(npmBin, ['list', '-g', '@openai/codex', '--json', '--depth=0'], {
|
|
49
|
+
timeoutMs: opts.timeoutMs || 5000,
|
|
50
|
+
maxOutputBytes: 64 * 1024,
|
|
51
|
+
env: opts.env || process.env
|
|
52
|
+
}).catch((err) => ({ code: 1, stdout: '', stderr: err.message }));
|
|
53
|
+
if (!result.stdout)
|
|
54
|
+
return { available: false, version: null, source: null, raw: result.stderr || '' };
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(result.stdout);
|
|
57
|
+
const version = parsed?.dependencies?.['@openai/codex']?.version || null;
|
|
58
|
+
return { available: Boolean(version), version, source: version ? 'npm @openai/codex' : null, raw: result.stdout };
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return { available: false, version: null, source: null, raw: result.stdout };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function detectFromBrew(opts) {
|
|
65
|
+
const brewBin = opts.brewBin || await which('brew').catch(() => null);
|
|
66
|
+
if (!brewBin)
|
|
67
|
+
return { available: false, version: null, source: null };
|
|
68
|
+
const result = await runProcess(brewBin, ['info', '--cask', 'codex', '--json=v2'], {
|
|
69
|
+
timeoutMs: opts.timeoutMs || 5000,
|
|
70
|
+
maxOutputBytes: 64 * 1024,
|
|
71
|
+
env: opts.env || process.env
|
|
72
|
+
}).catch((err) => ({ code: 1, stdout: '', stderr: err.message }));
|
|
73
|
+
if (result.code !== 0 || !result.stdout)
|
|
74
|
+
return { available: false, version: null, source: null, raw: result.stderr || '' };
|
|
75
|
+
const parsed = await parseJsonText(result.stdout);
|
|
76
|
+
const version = parsed?.casks?.[0]?.version || null;
|
|
77
|
+
return { available: Boolean(version), version, source: version ? 'Homebrew cask codex' : null, raw: result.stdout };
|
|
78
|
+
}
|
|
79
|
+
async function parseJsonText(text) {
|
|
80
|
+
try {
|
|
81
|
+
return JSON.parse(text);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=codex-version.js.map
|
|
@@ -4,9 +4,53 @@ import { createMission, findLatestMission } from '../mission.js';
|
|
|
4
4
|
import { flag } from '../../cli/args.js';
|
|
5
5
|
import { printJson } from '../../cli/output.js';
|
|
6
6
|
import { maybeFinalizeRoute } from '../proof/auto-finalize.js';
|
|
7
|
+
import { computerUseStatusReport } from '../computer-use-status.js';
|
|
7
8
|
export async function computerUseCommand(command, args = []) {
|
|
8
9
|
const root = await projectRoot();
|
|
9
10
|
const action = args[0] || 'import';
|
|
11
|
+
if (action === 'status' || action === 'doctor') {
|
|
12
|
+
const result = await computerUseStatusReport();
|
|
13
|
+
if (flag(args, '--json'))
|
|
14
|
+
return printJson(result);
|
|
15
|
+
console.log(`Computer Use status: ${result.status}`);
|
|
16
|
+
if (result.guidance?.length)
|
|
17
|
+
for (const line of result.guidance)
|
|
18
|
+
console.log(`- ${line}`);
|
|
19
|
+
if (!result.ok && action === 'doctor')
|
|
20
|
+
process.exitCode = result.status === 'not_macos' ? 0 : 1;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (action === 'enable') {
|
|
24
|
+
const result = await computerUseStatusReport();
|
|
25
|
+
const response = {
|
|
26
|
+
schema: 'sks.computer-use-enable.v1',
|
|
27
|
+
ok: result.status === 'available',
|
|
28
|
+
status: result.status,
|
|
29
|
+
macos: process.platform === 'darwin',
|
|
30
|
+
guidance: [
|
|
31
|
+
'Open Codex App and grant Screen Recording/Accessibility if macOS prompts.',
|
|
32
|
+
'SKS does not widen MAD-SKS or DB permissions for Computer Use.'
|
|
33
|
+
],
|
|
34
|
+
current: result
|
|
35
|
+
};
|
|
36
|
+
if (flag(args, '--json'))
|
|
37
|
+
return printJson(response);
|
|
38
|
+
console.log(`Computer Use enable: ${response.ok ? 'available' : response.status}`);
|
|
39
|
+
for (const line of response.guidance)
|
|
40
|
+
console.log(`- ${line}`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (action === 'require') {
|
|
44
|
+
const routeArg = args.includes('--route') ? args[args.indexOf('--route') + 1] : null;
|
|
45
|
+
const result = await computerUseStatusReport();
|
|
46
|
+
const response = { schema: 'sks.computer-use-require.v1', ok: result.status === 'available', route: routeArg || null, status: result.status, evidence: result.evidence, blocker: result.status === 'available' ? null : result.status };
|
|
47
|
+
if (flag(args, '--json'))
|
|
48
|
+
return printJson(response);
|
|
49
|
+
console.log(`Computer Use requirement for ${routeArg || 'route'}: ${response.ok ? 'available' : `blocked (${response.blocker})`}`);
|
|
50
|
+
if (!response.ok)
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
10
54
|
if (action === 'import-fixture')
|
|
11
55
|
return importFixture(root, command, args);
|
|
12
56
|
const missionArg = args.find((arg) => !String(arg).startsWith('--')) || 'latest';
|