@jeger-ai/opengantry 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +235 -0
- package/NOTICE +16 -0
- package/README.md +337 -0
- package/dist/cli/commands/arch.d.ts +19 -0
- package/dist/cli/commands/arch.d.ts.map +1 -0
- package/dist/cli/commands/arch.js +86 -0
- package/dist/cli/commands/arch.js.map +1 -0
- package/dist/cli/commands/check.d.ts +2 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +16 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +12 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +40 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +18 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +185 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/legislate.d.ts +21 -0
- package/dist/cli/commands/legislate.d.ts.map +1 -0
- package/dist/cli/commands/legislate.js +143 -0
- package/dist/cli/commands/legislate.js.map +1 -0
- package/dist/cli/commands/mcp-serve.d.ts +2 -0
- package/dist/cli/commands/mcp-serve.d.ts.map +1 -0
- package/dist/cli/commands/mcp-serve.js +14 -0
- package/dist/cli/commands/mcp-serve.js.map +1 -0
- package/dist/cli/commands/metrics.d.ts +6 -0
- package/dist/cli/commands/metrics.d.ts.map +1 -0
- package/dist/cli/commands/metrics.js +20 -0
- package/dist/cli/commands/metrics.js.map +1 -0
- package/dist/cli/commands/mission.d.ts +3 -0
- package/dist/cli/commands/mission.d.ts.map +1 -0
- package/dist/cli/commands/mission.js +29 -0
- package/dist/cli/commands/mission.js.map +1 -0
- package/dist/cli/commands/onboarding.d.ts +2 -0
- package/dist/cli/commands/onboarding.d.ts.map +1 -0
- package/dist/cli/commands/onboarding.js +85 -0
- package/dist/cli/commands/onboarding.js.map +1 -0
- package/dist/cli/commands/runtime.d.ts +19 -0
- package/dist/cli/commands/runtime.d.ts.map +1 -0
- package/dist/cli/commands/runtime.js +101 -0
- package/dist/cli/commands/runtime.js.map +1 -0
- package/dist/cli/commands/start.d.ts +4 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +3 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +8 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +65 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/teacher.d.ts +11 -0
- package/dist/cli/commands/teacher.d.ts.map +1 -0
- package/dist/cli/commands/teacher.js +48 -0
- package/dist/cli/commands/teacher.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +10 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +48 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/upgrade.d.ts +10 -0
- package/dist/cli/commands/upgrade.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.js +89 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +6 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +33 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +13 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/lib/agent-error.d.ts +20 -0
- package/dist/cli/lib/agent-error.d.ts.map +1 -0
- package/dist/cli/lib/agent-error.js +58 -0
- package/dist/cli/lib/agent-error.js.map +1 -0
- package/dist/cli/lib/architecture-credential.d.ts +22 -0
- package/dist/cli/lib/architecture-credential.d.ts.map +1 -0
- package/dist/cli/lib/architecture-credential.js +198 -0
- package/dist/cli/lib/architecture-credential.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-discovery.d.ts +7 -0
- package/dist/cli/lib/architecture-pointer-discovery.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-discovery.js +60 -0
- package/dist/cli/lib/architecture-pointer-discovery.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-doctor.d.ts +3 -0
- package/dist/cli/lib/architecture-pointer-doctor.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-doctor.js +114 -0
- package/dist/cli/lib/architecture-pointer-doctor.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-schema.d.ts +5 -0
- package/dist/cli/lib/architecture-pointer-schema.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-schema.js +137 -0
- package/dist/cli/lib/architecture-pointer-schema.js.map +1 -0
- package/dist/cli/lib/architecture-pointer-types.d.ts +24 -0
- package/dist/cli/lib/architecture-pointer-types.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer-types.js +7 -0
- package/dist/cli/lib/architecture-pointer-types.js.map +1 -0
- package/dist/cli/lib/architecture-pointer.d.ts +7 -0
- package/dist/cli/lib/architecture-pointer.d.ts.map +1 -0
- package/dist/cli/lib/architecture-pointer.js +10 -0
- package/dist/cli/lib/architecture-pointer.js.map +1 -0
- package/dist/cli/lib/atomic-fs.d.ts +9 -0
- package/dist/cli/lib/atomic-fs.d.ts.map +1 -0
- package/dist/cli/lib/atomic-fs.js +63 -0
- package/dist/cli/lib/atomic-fs.js.map +1 -0
- package/dist/cli/lib/audience-output.d.ts +18 -0
- package/dist/cli/lib/audience-output.d.ts.map +1 -0
- package/dist/cli/lib/audience-output.js +80 -0
- package/dist/cli/lib/audience-output.js.map +1 -0
- package/dist/cli/lib/break-glass.d.ts +25 -0
- package/dist/cli/lib/break-glass.d.ts.map +1 -0
- package/dist/cli/lib/break-glass.js +134 -0
- package/dist/cli/lib/break-glass.js.map +1 -0
- package/dist/cli/lib/cli-io.d.ts +9 -0
- package/dist/cli/lib/cli-io.d.ts.map +1 -0
- package/dist/cli/lib/cli-io.js +38 -0
- package/dist/cli/lib/cli-io.js.map +1 -0
- package/dist/cli/lib/cli-timeout.d.ts +9 -0
- package/dist/cli/lib/cli-timeout.d.ts.map +1 -0
- package/dist/cli/lib/cli-timeout.js +17 -0
- package/dist/cli/lib/cli-timeout.js.map +1 -0
- package/dist/cli/lib/constants.d.ts +26 -0
- package/dist/cli/lib/constants.d.ts.map +1 -0
- package/dist/cli/lib/constants.js +26 -0
- package/dist/cli/lib/constants.js.map +1 -0
- package/dist/cli/lib/dirty-missions.d.ts +8 -0
- package/dist/cli/lib/dirty-missions.d.ts.map +1 -0
- package/dist/cli/lib/dirty-missions.js +65 -0
- package/dist/cli/lib/dirty-missions.js.map +1 -0
- package/dist/cli/lib/doctor-checks.d.ts +16 -0
- package/dist/cli/lib/doctor-checks.d.ts.map +1 -0
- package/dist/cli/lib/doctor-checks.js +138 -0
- package/dist/cli/lib/doctor-checks.js.map +1 -0
- package/dist/cli/lib/doctor-integration-checks.d.ts +5 -0
- package/dist/cli/lib/doctor-integration-checks.d.ts.map +1 -0
- package/dist/cli/lib/doctor-integration-checks.js +88 -0
- package/dist/cli/lib/doctor-integration-checks.js.map +1 -0
- package/dist/cli/lib/doctor-orchestration.d.ts +10 -0
- package/dist/cli/lib/doctor-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/doctor-orchestration.js +25 -0
- package/dist/cli/lib/doctor-orchestration.js.map +1 -0
- package/dist/cli/lib/draft-token.d.ts +37 -0
- package/dist/cli/lib/draft-token.d.ts.map +1 -0
- package/dist/cli/lib/draft-token.js +171 -0
- package/dist/cli/lib/draft-token.js.map +1 -0
- package/dist/cli/lib/fix-hints.d.ts +51 -0
- package/dist/cli/lib/fix-hints.d.ts.map +1 -0
- package/dist/cli/lib/fix-hints.js +197 -0
- package/dist/cli/lib/fix-hints.js.map +1 -0
- package/dist/cli/lib/forbidden-scan.d.ts +18 -0
- package/dist/cli/lib/forbidden-scan.d.ts.map +1 -0
- package/dist/cli/lib/forbidden-scan.js +96 -0
- package/dist/cli/lib/forbidden-scan.js.map +1 -0
- package/dist/cli/lib/gate.d.ts +10 -0
- package/dist/cli/lib/gate.d.ts.map +1 -0
- package/dist/cli/lib/gate.js +30 -0
- package/dist/cli/lib/gate.js.map +1 -0
- package/dist/cli/lib/git-metrics-missions.d.ts +3 -0
- package/dist/cli/lib/git-metrics-missions.d.ts.map +1 -0
- package/dist/cli/lib/git-metrics-missions.js +51 -0
- package/dist/cli/lib/git-metrics-missions.js.map +1 -0
- package/dist/cli/lib/git-metrics-stream.d.ts +24 -0
- package/dist/cli/lib/git-metrics-stream.d.ts.map +1 -0
- package/dist/cli/lib/git-metrics-stream.js +137 -0
- package/dist/cli/lib/git-metrics-stream.js.map +1 -0
- package/dist/cli/lib/git-metrics.d.ts +18 -0
- package/dist/cli/lib/git-metrics.d.ts.map +1 -0
- package/dist/cli/lib/git-metrics.js +39 -0
- package/dist/cli/lib/git-metrics.js.map +1 -0
- package/dist/cli/lib/git-proof-errors.d.ts +3 -0
- package/dist/cli/lib/git-proof-errors.d.ts.map +1 -0
- package/dist/cli/lib/git-proof-errors.js +7 -0
- package/dist/cli/lib/git-proof-errors.js.map +1 -0
- package/dist/cli/lib/git-proof.d.ts +37 -0
- package/dist/cli/lib/git-proof.d.ts.map +1 -0
- package/dist/cli/lib/git-proof.js +147 -0
- package/dist/cli/lib/git-proof.js.map +1 -0
- package/dist/cli/lib/git-repo.d.ts +17 -0
- package/dist/cli/lib/git-repo.d.ts.map +1 -0
- package/dist/cli/lib/git-repo.js +39 -0
- package/dist/cli/lib/git-repo.js.map +1 -0
- package/dist/cli/lib/git.d.ts +2 -0
- package/dist/cli/lib/git.d.ts.map +1 -0
- package/dist/cli/lib/git.js +19 -0
- package/dist/cli/lib/git.js.map +1 -0
- package/dist/cli/lib/gitignore-gxt.d.ts +2 -0
- package/dist/cli/lib/gitignore-gxt.d.ts.map +1 -0
- package/dist/cli/lib/gitignore-gxt.js +24 -0
- package/dist/cli/lib/gitignore-gxt.js.map +1 -0
- package/dist/cli/lib/gxt-error-codes.d.ts +19 -0
- package/dist/cli/lib/gxt-error-codes.d.ts.map +1 -0
- package/dist/cli/lib/gxt-error-codes.js +60 -0
- package/dist/cli/lib/gxt-error-codes.js.map +1 -0
- package/dist/cli/lib/init-asset-catalog.d.ts +15 -0
- package/dist/cli/lib/init-asset-catalog.d.ts.map +1 -0
- package/dist/cli/lib/init-asset-catalog.js +163 -0
- package/dist/cli/lib/init-asset-catalog.js.map +1 -0
- package/dist/cli/lib/init-assets.d.ts +8 -0
- package/dist/cli/lib/init-assets.d.ts.map +1 -0
- package/dist/cli/lib/init-assets.js +3 -0
- package/dist/cli/lib/init-assets.js.map +1 -0
- package/dist/cli/lib/init-compose-arch-pointer.d.ts +6 -0
- package/dist/cli/lib/init-compose-arch-pointer.d.ts.map +1 -0
- package/dist/cli/lib/init-compose-arch-pointer.js +64 -0
- package/dist/cli/lib/init-compose-arch-pointer.js.map +1 -0
- package/dist/cli/lib/init-compose-doc.d.ts +5 -0
- package/dist/cli/lib/init-compose-doc.d.ts.map +1 -0
- package/dist/cli/lib/init-compose-doc.js +37 -0
- package/dist/cli/lib/init-compose-doc.js.map +1 -0
- package/dist/cli/lib/init-interactive.d.ts +8 -0
- package/dist/cli/lib/init-interactive.d.ts.map +1 -0
- package/dist/cli/lib/init-interactive.js +195 -0
- package/dist/cli/lib/init-interactive.js.map +1 -0
- package/dist/cli/lib/init-plan.d.ts +20 -0
- package/dist/cli/lib/init-plan.d.ts.map +1 -0
- package/dist/cli/lib/init-plan.js +92 -0
- package/dist/cli/lib/init-plan.js.map +1 -0
- package/dist/cli/lib/init-profile.d.ts +39 -0
- package/dist/cli/lib/init-profile.d.ts.map +1 -0
- package/dist/cli/lib/init-profile.js +93 -0
- package/dist/cli/lib/init-profile.js.map +1 -0
- package/dist/cli/lib/init-tutorial.d.ts +2 -0
- package/dist/cli/lib/init-tutorial.d.ts.map +1 -0
- package/dist/cli/lib/init-tutorial.js +156 -0
- package/dist/cli/lib/init-tutorial.js.map +1 -0
- package/dist/cli/lib/integration-compat.d.ts +24 -0
- package/dist/cli/lib/integration-compat.d.ts.map +1 -0
- package/dist/cli/lib/integration-compat.js +50 -0
- package/dist/cli/lib/integration-compat.js.map +1 -0
- package/dist/cli/lib/legislate-skill.d.ts +20 -0
- package/dist/cli/lib/legislate-skill.d.ts.map +1 -0
- package/dist/cli/lib/legislate-skill.js +30 -0
- package/dist/cli/lib/legislate-skill.js.map +1 -0
- package/dist/cli/lib/manifest.d.ts +6 -0
- package/dist/cli/lib/manifest.d.ts.map +1 -0
- package/dist/cli/lib/manifest.js +53 -0
- package/dist/cli/lib/manifest.js.map +1 -0
- package/dist/cli/lib/mcp-legislation.d.ts +82 -0
- package/dist/cli/lib/mcp-legislation.d.ts.map +1 -0
- package/dist/cli/lib/mcp-legislation.js +181 -0
- package/dist/cli/lib/mcp-legislation.js.map +1 -0
- package/dist/cli/lib/mcp-orchestration.d.ts +12 -0
- package/dist/cli/lib/mcp-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/mcp-orchestration.js +54 -0
- package/dist/cli/lib/mcp-orchestration.js.map +1 -0
- package/dist/cli/lib/mcp-runtime.d.ts +60 -0
- package/dist/cli/lib/mcp-runtime.d.ts.map +1 -0
- package/dist/cli/lib/mcp-runtime.js +133 -0
- package/dist/cli/lib/mcp-runtime.js.map +1 -0
- package/dist/cli/lib/mcp-tools-register.d.ts +4 -0
- package/dist/cli/lib/mcp-tools-register.d.ts.map +1 -0
- package/dist/cli/lib/mcp-tools-register.js +78 -0
- package/dist/cli/lib/mcp-tools-register.js.map +1 -0
- package/dist/cli/lib/mcp-upgrade.d.ts +7 -0
- package/dist/cli/lib/mcp-upgrade.d.ts.map +1 -0
- package/dist/cli/lib/mcp-upgrade.js +38 -0
- package/dist/cli/lib/mcp-upgrade.js.map +1 -0
- package/dist/cli/lib/mission-emit.d.ts +7 -0
- package/dist/cli/lib/mission-emit.d.ts.map +1 -0
- package/dist/cli/lib/mission-emit.js +23 -0
- package/dist/cli/lib/mission-emit.js.map +1 -0
- package/dist/cli/lib/mission-legislative-stub.d.ts +9 -0
- package/dist/cli/lib/mission-legislative-stub.d.ts.map +1 -0
- package/dist/cli/lib/mission-legislative-stub.js +36 -0
- package/dist/cli/lib/mission-legislative-stub.js.map +1 -0
- package/dist/cli/lib/mission-markdown.d.ts +6 -0
- package/dist/cli/lib/mission-markdown.d.ts.map +1 -0
- package/dist/cli/lib/mission-markdown.js +84 -0
- package/dist/cli/lib/mission-markdown.js.map +1 -0
- package/dist/cli/lib/mission-msn.d.ts +10 -0
- package/dist/cli/lib/mission-msn.d.ts.map +1 -0
- package/dist/cli/lib/mission-msn.js +85 -0
- package/dist/cli/lib/mission-msn.js.map +1 -0
- package/dist/cli/lib/mission-parser.d.ts +6 -0
- package/dist/cli/lib/mission-parser.d.ts.map +1 -0
- package/dist/cli/lib/mission-parser.js +29 -0
- package/dist/cli/lib/mission-parser.js.map +1 -0
- package/dist/cli/lib/mission-path.d.ts +4 -0
- package/dist/cli/lib/mission-path.d.ts.map +1 -0
- package/dist/cli/lib/mission-path.js +28 -0
- package/dist/cli/lib/mission-path.js.map +1 -0
- package/dist/cli/lib/mission-resolution.d.ts +14 -0
- package/dist/cli/lib/mission-resolution.d.ts.map +1 -0
- package/dist/cli/lib/mission-resolution.js +60 -0
- package/dist/cli/lib/mission-resolution.js.map +1 -0
- package/dist/cli/lib/mission-yaml.d.ts +12 -0
- package/dist/cli/lib/mission-yaml.d.ts.map +1 -0
- package/dist/cli/lib/mission-yaml.js +96 -0
- package/dist/cli/lib/mission-yaml.js.map +1 -0
- package/dist/cli/lib/msn-allocate.d.ts +13 -0
- package/dist/cli/lib/msn-allocate.d.ts.map +1 -0
- package/dist/cli/lib/msn-allocate.js +98 -0
- package/dist/cli/lib/msn-allocate.js.map +1 -0
- package/dist/cli/lib/msn.d.ts +2 -0
- package/dist/cli/lib/msn.d.ts.map +1 -0
- package/dist/cli/lib/msn.js +5 -0
- package/dist/cli/lib/msn.js.map +1 -0
- package/dist/cli/lib/onboarding-flow.d.ts +11 -0
- package/dist/cli/lib/onboarding-flow.d.ts.map +1 -0
- package/dist/cli/lib/onboarding-flow.js +25 -0
- package/dist/cli/lib/onboarding-flow.js.map +1 -0
- package/dist/cli/lib/out-of-scope-hint.d.ts +7 -0
- package/dist/cli/lib/out-of-scope-hint.d.ts.map +1 -0
- package/dist/cli/lib/out-of-scope-hint.js +79 -0
- package/dist/cli/lib/out-of-scope-hint.js.map +1 -0
- package/dist/cli/lib/output-context.d.ts +22 -0
- package/dist/cli/lib/output-context.d.ts.map +1 -0
- package/dist/cli/lib/output-context.js +55 -0
- package/dist/cli/lib/output-context.js.map +1 -0
- package/dist/cli/lib/program-audience-hook.d.ts +4 -0
- package/dist/cli/lib/program-audience-hook.d.ts.map +1 -0
- package/dist/cli/lib/program-audience-hook.js +35 -0
- package/dist/cli/lib/program-audience-hook.js.map +1 -0
- package/dist/cli/lib/runtime-env.d.ts +23 -0
- package/dist/cli/lib/runtime-env.d.ts.map +1 -0
- package/dist/cli/lib/runtime-env.js +64 -0
- package/dist/cli/lib/runtime-env.js.map +1 -0
- package/dist/cli/lib/runtime-exec-orchestrator.d.ts +14 -0
- package/dist/cli/lib/runtime-exec-orchestrator.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-orchestrator.js +131 -0
- package/dist/cli/lib/runtime-exec-orchestrator.js.map +1 -0
- package/dist/cli/lib/runtime-exec-process.d.ts +23 -0
- package/dist/cli/lib/runtime-exec-process.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-process.js +55 -0
- package/dist/cli/lib/runtime-exec-process.js.map +1 -0
- package/dist/cli/lib/runtime-exec-result.d.ts +21 -0
- package/dist/cli/lib/runtime-exec-result.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-result.js +42 -0
- package/dist/cli/lib/runtime-exec-result.js.map +1 -0
- package/dist/cli/lib/runtime-exec-worker.d.ts +18 -0
- package/dist/cli/lib/runtime-exec-worker.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec-worker.js +49 -0
- package/dist/cli/lib/runtime-exec-worker.js.map +1 -0
- package/dist/cli/lib/runtime-exec.d.ts +5 -0
- package/dist/cli/lib/runtime-exec.d.ts.map +1 -0
- package/dist/cli/lib/runtime-exec.js +5 -0
- package/dist/cli/lib/runtime-exec.js.map +1 -0
- package/dist/cli/lib/skill-sync.d.ts +11 -0
- package/dist/cli/lib/skill-sync.d.ts.map +1 -0
- package/dist/cli/lib/skill-sync.js +39 -0
- package/dist/cli/lib/skill-sync.js.map +1 -0
- package/dist/cli/lib/start-orchestration.d.ts +29 -0
- package/dist/cli/lib/start-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/start-orchestration.js +176 -0
- package/dist/cli/lib/start-orchestration.js.map +1 -0
- package/dist/cli/lib/start-state.d.ts +12 -0
- package/dist/cli/lib/start-state.d.ts.map +1 -0
- package/dist/cli/lib/start-state.js +86 -0
- package/dist/cli/lib/start-state.js.map +1 -0
- package/dist/cli/lib/status-report.d.ts +21 -0
- package/dist/cli/lib/status-report.d.ts.map +1 -0
- package/dist/cli/lib/status-report.js +77 -0
- package/dist/cli/lib/status-report.js.map +1 -0
- package/dist/cli/lib/substrate-version.d.ts +22 -0
- package/dist/cli/lib/substrate-version.d.ts.map +1 -0
- package/dist/cli/lib/substrate-version.js +97 -0
- package/dist/cli/lib/substrate-version.js.map +1 -0
- package/dist/cli/lib/teacher-identity.d.ts +24 -0
- package/dist/cli/lib/teacher-identity.d.ts.map +1 -0
- package/dist/cli/lib/teacher-identity.js +123 -0
- package/dist/cli/lib/teacher-identity.js.map +1 -0
- package/dist/cli/lib/telemetry-log.d.ts +22 -0
- package/dist/cli/lib/telemetry-log.d.ts.map +1 -0
- package/dist/cli/lib/telemetry-log.js +50 -0
- package/dist/cli/lib/telemetry-log.js.map +1 -0
- package/dist/cli/lib/trace-failure-kind.d.ts +4 -0
- package/dist/cli/lib/trace-failure-kind.d.ts.map +1 -0
- package/dist/cli/lib/trace-failure-kind.js +23 -0
- package/dist/cli/lib/trace-failure-kind.js.map +1 -0
- package/dist/cli/lib/trace.d.ts +25 -0
- package/dist/cli/lib/trace.d.ts.map +1 -0
- package/dist/cli/lib/trace.js +121 -0
- package/dist/cli/lib/trace.js.map +1 -0
- package/dist/cli/lib/triage-logic.d.ts +10 -0
- package/dist/cli/lib/triage-logic.d.ts.map +1 -0
- package/dist/cli/lib/triage-logic.js +105 -0
- package/dist/cli/lib/triage-logic.js.map +1 -0
- package/dist/cli/lib/types.d.ts +62 -0
- package/dist/cli/lib/types.d.ts.map +1 -0
- package/dist/cli/lib/types.js +2 -0
- package/dist/cli/lib/types.js.map +1 -0
- package/dist/cli/lib/upgrade-apply.d.ts +15 -0
- package/dist/cli/lib/upgrade-apply.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-apply.js +122 -0
- package/dist/cli/lib/upgrade-apply.js.map +1 -0
- package/dist/cli/lib/upgrade-eligible-assets.d.ts +5 -0
- package/dist/cli/lib/upgrade-eligible-assets.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-eligible-assets.js +9 -0
- package/dist/cli/lib/upgrade-eligible-assets.js.map +1 -0
- package/dist/cli/lib/upgrade-plan.d.ts +43 -0
- package/dist/cli/lib/upgrade-plan.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan.js +220 -0
- package/dist/cli/lib/upgrade-plan.js.map +1 -0
- package/dist/cli/lib/upgrade-profile.d.ts +4 -0
- package/dist/cli/lib/upgrade-profile.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-profile.js +27 -0
- package/dist/cli/lib/upgrade-profile.js.map +1 -0
- package/dist/cli/lib/user-error.d.ts +20 -0
- package/dist/cli/lib/user-error.d.ts.map +1 -0
- package/dist/cli/lib/user-error.js +64 -0
- package/dist/cli/lib/user-error.js.map +1 -0
- package/dist/cli/lib/verify-engine.d.ts +33 -0
- package/dist/cli/lib/verify-engine.d.ts.map +1 -0
- package/dist/cli/lib/verify-engine.js +104 -0
- package/dist/cli/lib/verify-engine.js.map +1 -0
- package/dist/cli/lib/verify-failure-presentation.d.ts +31 -0
- package/dist/cli/lib/verify-failure-presentation.d.ts.map +1 -0
- package/dist/cli/lib/verify-failure-presentation.js +93 -0
- package/dist/cli/lib/verify-failure-presentation.js.map +1 -0
- package/dist/cli/lib/verify-flow.d.ts +21 -0
- package/dist/cli/lib/verify-flow.d.ts.map +1 -0
- package/dist/cli/lib/verify-flow.js +103 -0
- package/dist/cli/lib/verify-flow.js.map +1 -0
- package/dist/cli/lib/verify-repair.d.ts +4 -0
- package/dist/cli/lib/verify-repair.d.ts.map +1 -0
- package/dist/cli/lib/verify-repair.js +61 -0
- package/dist/cli/lib/verify-repair.js.map +1 -0
- package/dist/cli/lib/verify-types.d.ts +21 -0
- package/dist/cli/lib/verify-types.d.ts.map +1 -0
- package/dist/cli/lib/verify-types.js +2 -0
- package/dist/cli/lib/verify-types.js.map +1 -0
- package/dist/cli/lib/version.gen.d.ts +4 -0
- package/dist/cli/lib/version.gen.d.ts.map +1 -0
- package/dist/cli/lib/version.gen.js +4 -0
- package/dist/cli/lib/version.gen.js.map +1 -0
- package/dist/cli/lib/worker-log-line-map.d.ts +12 -0
- package/dist/cli/lib/worker-log-line-map.d.ts.map +1 -0
- package/dist/cli/lib/worker-log-line-map.js +29 -0
- package/dist/cli/lib/worker-log-line-map.js.map +1 -0
- package/dist/cli/lib/workspace.d.ts +11 -0
- package/dist/cli/lib/workspace.d.ts.map +1 -0
- package/dist/cli/lib/workspace.js +14 -0
- package/dist/cli/lib/workspace.js.map +1 -0
- package/dist/cli/program-arch.d.ts +3 -0
- package/dist/cli/program-arch.d.ts.map +1 -0
- package/dist/cli/program-arch.js +45 -0
- package/dist/cli/program-arch.js.map +1 -0
- package/dist/cli/program-core.d.ts +3 -0
- package/dist/cli/program-core.d.ts.map +1 -0
- package/dist/cli/program-core.js +154 -0
- package/dist/cli/program-core.js.map +1 -0
- package/dist/cli/program-mcp.d.ts +3 -0
- package/dist/cli/program-mcp.d.ts.map +1 -0
- package/dist/cli/program-mcp.js +12 -0
- package/dist/cli/program-mcp.js.map +1 -0
- package/dist/cli/program-mission.d.ts +3 -0
- package/dist/cli/program-mission.d.ts.map +1 -0
- package/dist/cli/program-mission.js +77 -0
- package/dist/cli/program-mission.js.map +1 -0
- package/dist/cli/program-teacher.d.ts +3 -0
- package/dist/cli/program-teacher.d.ts.map +1 -0
- package/dist/cli/program-teacher.js +19 -0
- package/dist/cli/program-teacher.js.map +1 -0
- package/dist/cli/program-workflow.d.ts +3 -0
- package/dist/cli/program-workflow.d.ts.map +1 -0
- package/dist/cli/program-workflow.js +81 -0
- package/dist/cli/program-workflow.js.map +1 -0
- package/dist/cli/program.d.ts +4 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +25 -0
- package/dist/cli/program.js.map +1 -0
- package/package.json +66 -0
- package/templates/.cursor/hooks/gxt-before-shell.sh +63 -0
- package/templates/.cursor/hooks/gxt-session-start.sh +68 -0
- package/templates/.cursor/hooks.json +15 -0
- package/templates/.cursor/mcp.json +8 -0
- package/templates/.cursor/rules/opengantry-gxt-substrate.mdc +43 -0
- package/templates/.gitagent/ARCHITECTURE.pointer.external.example.json +13 -0
- package/templates/.gitagent/ARCHITECTURE.pointer.json +9 -0
- package/templates/.gitagent/foreman/BYPASS.sha256 +2 -0
- package/templates/.gitagent/foreman/MANIFEST.json +37 -0
- package/templates/.gitagent/foreman/SUBSTRATE.version.json +6 -0
- package/templates/.gitagent/foreman/TEACHER.allowlist.example +4 -0
- package/templates/.gitagent/missions/README.md +18 -0
- package/templates/.gitagent/teacher/ARCHITECTURE-ACCESS.md +85 -0
- package/templates/.gitagent/teacher/ARCHITECTURE-DISCOVERY.md +40 -0
- package/templates/.gitagent/teacher/MISSION-ARCHITECT.md +93 -0
- package/templates/.gitagent/teacher/MISSION.schema.yaml +80 -0
- package/templates/.gitagent/teacher/RULES.md +36 -0
- package/templates/.gitagent/teacher/WORKER_LOG.template.md +2 -0
- package/templates/.githooks/post-checkout +26 -0
- package/templates/.githooks/pre-push +53 -0
- package/templates/.github/workflows/gxt-validate.yml +129 -0
- package/templates/.gitignore.gxt +8 -0
- package/templates/AGENTS.md +24 -0
- package/templates/docs/ARCHITECTURE.md +23 -0
- package/templates/integrations/aider/.aider.conf.yml +4 -0
- package/templates/integrations/antigravity/.agent/rules/gxt.md +11 -0
- package/templates/integrations/claude-code/CLAUDE.md +9 -0
- package/templates/integrations/cline/.clinerules/gxt.md +7 -0
- package/templates/integrations/codex-cli/.codex/config.toml +3 -0
- package/templates/integrations/compatibility.json +92 -0
- package/templates/integrations/junie/.junie/guidelines.md +11 -0
- package/templates/integrations/opencode/opencode.json +3 -0
- package/templates/integrations/openhands/.openhands/microagents/gxt.md +11 -0
- package/templates/integrations/recipes/_footer.md +20 -0
- package/templates/integrations/recipes/_preamble.md +46 -0
- package/templates/integrations/recipes/aider.md +13 -0
- package/templates/integrations/recipes/antigravity.md +8 -0
- package/templates/integrations/recipes/claude-code.md +14 -0
- package/templates/integrations/recipes/cline.md +8 -0
- package/templates/integrations/recipes/codex-cli.md +16 -0
- package/templates/integrations/recipes/cursor.md +19 -0
- package/templates/integrations/recipes/junie.md +8 -0
- package/templates/integrations/recipes/opencode.md +8 -0
- package/templates/integrations/recipes/openhands.md +8 -0
- package/templates/scripts/dev-validate.sh +24 -0
- package/templates/scripts/gxt-cursor-env.sh +5 -0
- package/templates/scripts/gxt-manifest-lib.mjs +139 -0
- package/templates/scripts/gxt-pin-mission.sh +31 -0
- package/templates/scripts/gxt-resolve-mission.sh +47 -0
- package/templates/scripts/gxt-runtime-env.sh +32 -0
- package/templates/scripts/validate-gxt.sh +184 -0
- package/templates/skills/gapman.md +5 -0
- package/templates/skills/logic.md +3 -0
- package/templates/skills/substrate.md +3 -0
- package/templates/skills/ui.md +3 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { CLI_NAME } from "./constants.js";
|
|
5
|
+
import { gitHead, gitRevParse, gitRun } from "./git-repo.js";
|
|
6
|
+
export const ENV_BYPASS_SECRET = "GXT_BYPASS_SECRET";
|
|
7
|
+
export const REL_BYPASS_SHA256 = ".gitagent/foreman/BYPASS.sha256";
|
|
8
|
+
export const GXT_BYPASS_NOTES_REF = "refs/notes/gxt-bypass";
|
|
9
|
+
const MIN_REASON_LENGTH = 10;
|
|
10
|
+
function sha256Hex(value) {
|
|
11
|
+
return crypto.createHash("sha256").update(value, "utf8").digest("hex");
|
|
12
|
+
}
|
|
13
|
+
function timingSafeEqualHex(a, b) {
|
|
14
|
+
const aBuf = Buffer.from(a, "utf8");
|
|
15
|
+
const bBuf = Buffer.from(b, "utf8");
|
|
16
|
+
if (aBuf.length !== bBuf.length)
|
|
17
|
+
return false;
|
|
18
|
+
return crypto.timingSafeEqual(aBuf, bBuf);
|
|
19
|
+
}
|
|
20
|
+
function readAnchorHash(repoRoot) {
|
|
21
|
+
const anchorPath = path.join(repoRoot, REL_BYPASS_SHA256);
|
|
22
|
+
if (!fs.existsSync(anchorPath))
|
|
23
|
+
return null;
|
|
24
|
+
for (const line of fs.readFileSync(anchorPath, "utf8").split(/\r?\n/)) {
|
|
25
|
+
const trimmed = line.trim();
|
|
26
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
27
|
+
continue;
|
|
28
|
+
if (/^[a-f0-9]{64}$/i.test(trimmed))
|
|
29
|
+
return trimmed.toLowerCase();
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/** True when GXT_BYPASS_SECRET matches committed BYPASS.sha256 anchor. */
|
|
34
|
+
export function isBypassSecretAuthorized(repoRoot) {
|
|
35
|
+
const secret = process.env[ENV_BYPASS_SECRET];
|
|
36
|
+
if (!secret?.length)
|
|
37
|
+
return false;
|
|
38
|
+
const anchor = readAnchorHash(repoRoot);
|
|
39
|
+
if (!anchor)
|
|
40
|
+
return false;
|
|
41
|
+
return timingSafeEqualHex(sha256Hex(secret), anchor);
|
|
42
|
+
}
|
|
43
|
+
export function assertBypassSecretAuthorized(repoRoot) {
|
|
44
|
+
if (isBypassSecretAuthorized(repoRoot))
|
|
45
|
+
return;
|
|
46
|
+
const anchorPath = path.join(repoRoot, REL_BYPASS_SHA256);
|
|
47
|
+
if (!fs.existsSync(anchorPath)) {
|
|
48
|
+
throw new Error(`${CLI_NAME}: break-glass: BYPASS_NOT_CONFIGURED — ${REL_BYPASS_SHA256} is missing. Teacher must install a SHA-256 anchor of the team secret.`);
|
|
49
|
+
}
|
|
50
|
+
if (!process.env[ENV_BYPASS_SECRET]?.length) {
|
|
51
|
+
throw new Error(`${CLI_NAME}: break-glass: BYPASS_SECRET_MISSING — Set ${ENV_BYPASS_SECRET} in the execution environment.`);
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`${CLI_NAME}: break-glass: BYPASS_SECRET_INVALID — ${ENV_BYPASS_SECRET} does not match ${REL_BYPASS_SHA256}.`);
|
|
54
|
+
}
|
|
55
|
+
export function validateBreakGlassReason(reason) {
|
|
56
|
+
const trimmed = reason?.trim() ?? "";
|
|
57
|
+
if (trimmed.length < MIN_REASON_LENGTH) {
|
|
58
|
+
throw new Error(`${CLI_NAME}: break-glass: REASON_REQUIRED — Provide --reason with at least ${String(MIN_REASON_LENGTH)} characters.`);
|
|
59
|
+
}
|
|
60
|
+
return trimmed;
|
|
61
|
+
}
|
|
62
|
+
export function parseBypassNoteBody(noteBody) {
|
|
63
|
+
const trimmed = noteBody.trim();
|
|
64
|
+
if (!trimmed)
|
|
65
|
+
return null;
|
|
66
|
+
try {
|
|
67
|
+
const parsed = JSON.parse(trimmed);
|
|
68
|
+
if (parsed.v !== 1)
|
|
69
|
+
return null;
|
|
70
|
+
if (typeof parsed.reason !== "string" || parsed.reason.trim().length < MIN_REASON_LENGTH) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
v: 1,
|
|
75
|
+
reason: parsed.reason.trim(),
|
|
76
|
+
ts: typeof parsed.ts === "string" ? parsed.ts : "",
|
|
77
|
+
msn_id: typeof parsed.msn_id === "string" ? parsed.msn_id : undefined,
|
|
78
|
+
mission_file: typeof parsed.mission_file === "string" ? parsed.mission_file : undefined,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export function commitHasValidBypassNote(root, commit) {
|
|
86
|
+
const r = gitRun(root, ["notes", `--ref=${GXT_BYPASS_NOTES_REF}`, "show", commit]);
|
|
87
|
+
if (!r.ok)
|
|
88
|
+
return false;
|
|
89
|
+
return parseBypassNoteBody(r.stdout) !== null;
|
|
90
|
+
}
|
|
91
|
+
export function writeBypassGitNote(root, commit, payload) {
|
|
92
|
+
const message = JSON.stringify(payload);
|
|
93
|
+
const r = gitRun(root, ["notes", `--ref=${GXT_BYPASS_NOTES_REF}`, "add", "-f", "-m", message, commit]);
|
|
94
|
+
if (!r.ok) {
|
|
95
|
+
throw new Error(`${CLI_NAME}: break-glass: git notes add failed: ${r.stderr.trim() || "unknown"}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function resolveAuditCommit(root, commit) {
|
|
99
|
+
if (commit?.trim()) {
|
|
100
|
+
const sha = gitRevParse(root, commit);
|
|
101
|
+
if (!sha) {
|
|
102
|
+
throw new Error(`${CLI_NAME}: break-glass: invalid --commit ${commit}`);
|
|
103
|
+
}
|
|
104
|
+
return sha;
|
|
105
|
+
}
|
|
106
|
+
const sha = gitHead(root);
|
|
107
|
+
if (!sha) {
|
|
108
|
+
throw new Error(`${CLI_NAME}: break-glass: cannot resolve HEAD`);
|
|
109
|
+
}
|
|
110
|
+
return sha;
|
|
111
|
+
}
|
|
112
|
+
export function runBreakGlassAudit(root, options) {
|
|
113
|
+
const commitSha = resolveAuditCommit(root, options.commit);
|
|
114
|
+
const payload = {
|
|
115
|
+
v: 1,
|
|
116
|
+
reason: options.reason,
|
|
117
|
+
ts: new Date().toISOString(),
|
|
118
|
+
...(options.msnId ? { msn_id: options.msnId } : {}),
|
|
119
|
+
...(options.missionFile ? { mission_file: options.missionFile } : {}),
|
|
120
|
+
};
|
|
121
|
+
if (options.auditCommit === true) {
|
|
122
|
+
const subjectReason = options.reason.length > 72 ? `${options.reason.slice(0, 69)}...` : options.reason;
|
|
123
|
+
const subject = `[GXT-AUDIT] break-glass: ${subjectReason}`;
|
|
124
|
+
const body = JSON.stringify(payload, null, 2);
|
|
125
|
+
const r = gitRun(root, ["commit", "--allow-empty", "-m", subject, "-m", body]);
|
|
126
|
+
if (!r.ok) {
|
|
127
|
+
throw new Error(`${CLI_NAME}: break-glass: audit commit failed: ${r.stderr.trim() || "unknown"}`);
|
|
128
|
+
}
|
|
129
|
+
return gitHead(root) ?? commitSha;
|
|
130
|
+
}
|
|
131
|
+
writeBypassGitNote(root, commitSha, payload);
|
|
132
|
+
return commitSha;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=break-glass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"break-glass.js","sourceRoot":"","sources":["../../../src/cli/lib/break-glass.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,iCAAiC,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE5D,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAU7B,SAAS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): void;
|
|
2
|
+
export declare function logWarn(message: string): void;
|
|
3
|
+
export declare function logError(message: string): void;
|
|
4
|
+
/** Red stderr for existing managed-asset conflicts (respects NO_COLOR). */
|
|
5
|
+
export declare function logManagedAssetConflicts(conflicts: string[]): void;
|
|
6
|
+
/** Relative path for user-facing messages */
|
|
7
|
+
export declare function formatRepoRelative(repoRoot: string, absolutePath: string): string;
|
|
8
|
+
export declare function setExitCode(code: number): void;
|
|
9
|
+
//# sourceMappingURL=cli-io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-io.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/cli-io.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAG7C;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAG7C;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAG9C;AAED,2EAA2E;AAC3E,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAWlE;AAED,6CAA6C;AAC7C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { CLI_NAME } from "./constants.js";
|
|
3
|
+
import { shouldEmitError, shouldEmitInfo, shouldEmitWarn } from "./output-context.js";
|
|
4
|
+
export function logInfo(message) {
|
|
5
|
+
if (!shouldEmitInfo())
|
|
6
|
+
return;
|
|
7
|
+
console.log(message);
|
|
8
|
+
}
|
|
9
|
+
export function logWarn(message) {
|
|
10
|
+
if (!shouldEmitWarn())
|
|
11
|
+
return;
|
|
12
|
+
console.error(`${CLI_NAME}: warning: ${message}`);
|
|
13
|
+
}
|
|
14
|
+
export function logError(message) {
|
|
15
|
+
if (!shouldEmitError(message))
|
|
16
|
+
return;
|
|
17
|
+
console.error(`${CLI_NAME}: ${message}`);
|
|
18
|
+
}
|
|
19
|
+
/** Red stderr for existing managed-asset conflicts (respects NO_COLOR). */
|
|
20
|
+
export function logManagedAssetConflicts(conflicts) {
|
|
21
|
+
if (!shouldEmitWarn())
|
|
22
|
+
return;
|
|
23
|
+
const useColor = process.env.NO_COLOR === undefined;
|
|
24
|
+
const red = useColor ? "\x1b[31m" : "";
|
|
25
|
+
const reset = useColor ? "\x1b[0m" : "";
|
|
26
|
+
console.error(`${red}${CLI_NAME}: warning: managed files already exist and differ from templates:${reset}`);
|
|
27
|
+
for (const rel of conflicts) {
|
|
28
|
+
console.error(`${red} - ${rel}${reset}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** Relative path for user-facing messages */
|
|
32
|
+
export function formatRepoRelative(repoRoot, absolutePath) {
|
|
33
|
+
return path.relative(repoRoot, absolutePath);
|
|
34
|
+
}
|
|
35
|
+
export function setExitCode(code) {
|
|
36
|
+
process.exitCode = code;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cli-io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-io.js","sourceRoot":"","sources":["../../../src/cli/lib/cli-io.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEtF,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,IAAI,CAAC,cAAc,EAAE;QAAE,OAAO;IAC9B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,IAAI,CAAC,c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outMs(raw: string | undefined): {
|
|
3
|
+
ok: true;
|
|
4
|
+
ms: number | undefined;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=cli-timeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-timeout.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/cli-timeout.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAYvE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Strict `--timeout-ms` parsing for CLI boundary (reject NaN/non-integer junk). */
|
|
2
|
+
export function parseOptionalTimeoutMs(raw) {
|
|
3
|
+
if (raw === undefined)
|
|
4
|
+
return { ok: true, ms: undefined };
|
|
5
|
+
const t = raw.trim();
|
|
6
|
+
if (t === "")
|
|
7
|
+
return { ok: true, ms: undefined };
|
|
8
|
+
if (!/^\d+$/.test(t)) {
|
|
9
|
+
return {
|
|
10
|
+
ok: false,
|
|
11
|
+
message: "gapman: runtime exec: --timeout-ms must be a non-negative integer",
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const n = Number.parseInt(t, 10);
|
|
15
|
+
return { ok: true, ms: Number.isFinite(n) ? n : undefined };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=cli-timeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-timeout.js","sourceRoot":"","sources":["../../../src/cli/lib/cli-timeout.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,UAAU,sBAAsB,CACpC,GAAuB;IAEvB,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;IAC1D,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACrB,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;IACjD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,mEAAmE;SAC7E,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Repo-relative paths used across gapman */
|
|
2
|
+
export declare const REL_MANIFEST: ".gitagent/foreman/MANIFEST.json";
|
|
3
|
+
/** Agent discovery for code layout (file, directory, or external). */
|
|
4
|
+
export declare const REL_ARCHITECTURE_POINTER: ".gitagent/ARCHITECTURE.pointer.json";
|
|
5
|
+
/** Agent instructions when architecture access requires authentication. */
|
|
6
|
+
export declare const REL_ARCHITECTURE_ACCESS_SKILL: ".gitagent/teacher/ARCHITECTURE-ACCESS.md";
|
|
7
|
+
/** Agent instructions when architecture is unset, stub, or uncertain — ask before implementing. */
|
|
8
|
+
export declare const REL_ARCHITECTURE_DISCOVERY_SKILL: ".gitagent/teacher/ARCHITECTURE-DISCOVERY.md";
|
|
9
|
+
/** Git-ignored credential slots for architecture sources (see gapman arch cred). */
|
|
10
|
+
export declare const REL_ARCHITECTURE_CREDENTIALS_DIR: ".gitagent/history/credentials";
|
|
11
|
+
export declare const REL_MISSION_SCHEMA: ".gitagent/teacher/MISSION.schema.yaml";
|
|
12
|
+
export declare const REL_MISSION_TEMPLATE: ".gitagent/teacher/MISSION.template.md";
|
|
13
|
+
export declare const REL_HISTORY_DIR: ".gitagent/history";
|
|
14
|
+
/** Git-ignored machine-readable runtime error (see templates/.gitignore.gxt). */
|
|
15
|
+
export declare const REL_AGENT_ERROR_FILE: ".gitagent/history/.ignored-last-error.json";
|
|
16
|
+
/** ADR markdown (optional `match_terms` in frontmatter) — Foreman may emit non-binding hints only. */
|
|
17
|
+
export declare const REL_OUT_OF_SCOPE_DIR: ".gitagent/out-of-scope";
|
|
18
|
+
export declare const SKILLS_DIR_NAME: "skills";
|
|
19
|
+
export declare const WORKER_LOG_FILENAME: "WORKER_LOG.md";
|
|
20
|
+
/** Default path for `--emit-mission` (must stay under `.gitagent/missions/` for `gapman verify` git-proof). */
|
|
21
|
+
export declare const DEFAULT_ACTIVE_MISSION: ".gitagent/missions/ACTIVE_MISSION.md";
|
|
22
|
+
/** Mission id in commits / missions (four digits) */
|
|
23
|
+
export declare const MSN_ID_PATTERN: RegExp;
|
|
24
|
+
export declare const CLI_NAME = "gapman";
|
|
25
|
+
export { CLI_VERSION, NPM_PACKAGE_NAME } from "./version.gen.js";
|
|
26
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/constants.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,eAAO,MAAM,YAAY,EAAG,iCAA0C,CAAC;AACvE,sEAAsE;AACtE,eAAO,MAAM,wBAAwB,EAAG,qCAA8C,CAAC;AACvF,2EAA2E;AAC3E,eAAO,MAAM,6BAA6B,EAAG,0CAAmD,CAAC;AACjG,mGAAmG;AACnG,eAAO,MAAM,gCAAgC,EAAG,6CAAsD,CAAC;AACvG,oFAAoF;AACpF,eAAO,MAAM,gCAAgC,EAAG,+BAAwC,CAAC;AACzF,eAAO,MAAM,kBAAkB,EAAG,uCAAgD,CAAC;AACnF,eAAO,MAAM,oBAAoB,EAAG,uCAAgD,CAAC;AACrF,eAAO,MAAM,eAAe,EAAG,mBAA4B,CAAC;AAC5D,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,EAAG,4CAAqD,CAAC;AAC1F,sGAAsG;AACtG,eAAO,MAAM,oBAAoB,EAAG,wBAAiC,CAAC;AACtE,eAAO,MAAM,eAAe,EAAG,QAAiB,CAAC;AACjD,eAAO,MAAM,mBAAmB,EAAG,eAAwB,CAAC;AAC5D,+GAA+G;AAC/G,eAAO,MAAM,sBAAsB,EAAG,sCAA+C,CAAC;AAEtF,qDAAqD;AACrD,eAAO,MAAM,cAAc,QAAgB,CAAC;AAE5C,eAAO,MAAM,QAAQ,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Repo-relative paths used across gapman */
|
|
2
|
+
export const REL_MANIFEST = ".gitagent/foreman/MANIFEST.json";
|
|
3
|
+
/** Agent discovery for code layout (file, directory, or external). */
|
|
4
|
+
export const REL_ARCHITECTURE_POINTER = ".gitagent/ARCHITECTURE.pointer.json";
|
|
5
|
+
/** Agent instructions when architecture access requires authentication. */
|
|
6
|
+
export const REL_ARCHITECTURE_ACCESS_SKILL = ".gitagent/teacher/ARCHITECTURE-ACCESS.md";
|
|
7
|
+
/** Agent instructions when architecture is unset, stub, or uncertain — ask before implementing. */
|
|
8
|
+
export const REL_ARCHITECTURE_DISCOVERY_SKILL = ".gitagent/teacher/ARCHITECTURE-DISCOVERY.md";
|
|
9
|
+
/** Git-ignored credential slots for architecture sources (see gapman arch cred). */
|
|
10
|
+
export const REL_ARCHITECTURE_CREDENTIALS_DIR = ".gitagent/history/credentials";
|
|
11
|
+
export const REL_MISSION_SCHEMA = ".gitagent/teacher/MISSION.schema.yaml";
|
|
12
|
+
export const REL_MISSION_TEMPLATE = ".gitagent/teacher/MISSION.template.md";
|
|
13
|
+
export const REL_HISTORY_DIR = ".gitagent/history";
|
|
14
|
+
/** Git-ignored machine-readable runtime error (see templates/.gitignore.gxt). */
|
|
15
|
+
export const REL_AGENT_ERROR_FILE = ".gitagent/history/.ignored-last-error.json";
|
|
16
|
+
/** ADR markdown (optional `match_terms` in frontmatter) — Foreman may emit non-binding hints only. */
|
|
17
|
+
export const REL_OUT_OF_SCOPE_DIR = ".gitagent/out-of-scope";
|
|
18
|
+
export const SKILLS_DIR_NAME = "skills";
|
|
19
|
+
export const WORKER_LOG_FILENAME = "WORKER_LOG.md";
|
|
20
|
+
/** Default path for `--emit-mission` (must stay under `.gitagent/missions/` for `gapman verify` git-proof). */
|
|
21
|
+
export const DEFAULT_ACTIVE_MISSION = ".gitagent/missions/ACTIVE_MISSION.md";
|
|
22
|
+
/** Mission id in commits / missions (four digits) */
|
|
23
|
+
export const MSN_ID_PATTERN = /^MSN-\d{4}$/;
|
|
24
|
+
export const CLI_NAME = "gapman";
|
|
25
|
+
export { CLI_VERSION, NPM_PACKAGE_NAME } from "./version.gen.js";
|
|
26
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/cli/lib/constants.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG,iCAA0C,CAAC;AACvE,sEAAsE;AACtE,MAAM,CAAC,MAAM,wBAAwB,GAAG,qCAA8C,CAAC;AACvF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,6BAA6B,GAAG,0CAAmD,CAAC;AACjG,mGAAmG;AACnG,MAAM,CAAC,MAAM,gCAAgC,GAAG,6CAAsD,CAAC;AACvG,oFAAoF;AACpF,MAAM,CAAC,MAAM,gCAAgC,GAAG,+BAAwC,CAAC;AACzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,uCAAgD,CAAC;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,uCAAgD,CAAC;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,mBAA4B,CAAC;AAC5D,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,4CAAqD,CAAC;AAC1F,sGAAsG;AACtG,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAiC,CAAC;AACtE,MAAM,CAAC,MAAM,eAAe,GAAG,QAAiB,CAAC;AACjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAwB,CAAC;AAC5D,+GAA+G;AAC/G,MAAM,CAAC,MAAM,sBAAsB,GAAG,sCAA+C,CAAC;AAEtF,qDAAqD;AACrD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** True for YAML/Markdown mission work orders under `.gitagent/missions/` (excludes README). */
|
|
2
|
+
export declare function isVerifiableMissionPath(rel: string): boolean;
|
|
3
|
+
/** Resolve merge-base for branch-scoped mission diff (pre-push). */
|
|
4
|
+
export declare function resolveMergeBase(root: string): string | null;
|
|
5
|
+
/** Repo-relative mission paths changed between base and HEAD. */
|
|
6
|
+
export declare function listDirtyMissionPaths(repoRoot: string, baseRef?: string): string[];
|
|
7
|
+
export declare function listDirtyMissionPathsAbsolute(repoRoot: string, baseRef?: string): string[];
|
|
8
|
+
//# sourceMappingURL=dirty-missions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirty-missions.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/dirty-missions.ts"],"names":[],"mappings":"AAQA,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO5D;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkB5D;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBlF;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAI1F"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { gitRunOk } from "./git-repo.js";
|
|
3
|
+
const MISSIONS_PREFIX = ".gitagent/missions/";
|
|
4
|
+
/** Docs under missions/ are not gapman verify targets (no gate/trace contract). */
|
|
5
|
+
const NON_VERIFIABLE_BASENAMES = new Set(["README.md"]);
|
|
6
|
+
/** True for YAML/Markdown mission work orders under `.gitagent/missions/` (excludes README). */
|
|
7
|
+
export function isVerifiableMissionPath(rel) {
|
|
8
|
+
const norm = rel.trim().replace(/\\/g, "/");
|
|
9
|
+
if (!norm.startsWith(MISSIONS_PREFIX))
|
|
10
|
+
return false;
|
|
11
|
+
if (!/\.(ya?ml|md)$/i.test(norm))
|
|
12
|
+
return false;
|
|
13
|
+
const base = norm.slice(MISSIONS_PREFIX.length).split("/").pop() ?? "";
|
|
14
|
+
if (NON_VERIFIABLE_BASENAMES.has(base))
|
|
15
|
+
return false;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
/** Resolve merge-base for branch-scoped mission diff (pre-push). */
|
|
19
|
+
export function resolveMergeBase(root) {
|
|
20
|
+
const upstream = gitRunOk(root, [
|
|
21
|
+
"rev-parse",
|
|
22
|
+
"--abbrev-ref",
|
|
23
|
+
"--symbolic-full-name",
|
|
24
|
+
"@{upstream}",
|
|
25
|
+
]);
|
|
26
|
+
if (upstream.ok && upstream.stdout.trim()) {
|
|
27
|
+
const base = gitRunOk(root, ["merge-base", "HEAD", "@{upstream}"]);
|
|
28
|
+
if (base.ok && base.stdout.trim())
|
|
29
|
+
return base.stdout.trim();
|
|
30
|
+
}
|
|
31
|
+
for (const ref of ["main", "master"]) {
|
|
32
|
+
const base = gitRunOk(root, ["merge-base", "HEAD", ref]);
|
|
33
|
+
if (base.ok && base.stdout.trim())
|
|
34
|
+
return base.stdout.trim();
|
|
35
|
+
}
|
|
36
|
+
const parent = gitRunOk(root, ["rev-parse", "HEAD~1"]);
|
|
37
|
+
if (parent.ok && parent.stdout.trim())
|
|
38
|
+
return parent.stdout.trim();
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
/** Repo-relative mission paths changed between base and HEAD. */
|
|
42
|
+
export function listDirtyMissionPaths(repoRoot, baseRef) {
|
|
43
|
+
const base = baseRef?.trim() || resolveMergeBase(repoRoot);
|
|
44
|
+
if (!base)
|
|
45
|
+
return [];
|
|
46
|
+
const r = gitRunOk(repoRoot, [
|
|
47
|
+
"diff",
|
|
48
|
+
"--name-only",
|
|
49
|
+
"--diff-filter=ACMRT",
|
|
50
|
+
`${base}..HEAD`,
|
|
51
|
+
"--",
|
|
52
|
+
MISSIONS_PREFIX,
|
|
53
|
+
]);
|
|
54
|
+
if (!r.ok)
|
|
55
|
+
return [];
|
|
56
|
+
const paths = r.stdout
|
|
57
|
+
.split("\n")
|
|
58
|
+
.map((p) => p.trim().replace(/\\/g, "/"))
|
|
59
|
+
.filter((p) => isVerifiableMissionPath(p));
|
|
60
|
+
return [...new Set(paths)].sort();
|
|
61
|
+
}
|
|
62
|
+
export function listDirtyMissionPathsAbsolute(repoRoot, baseRef) {
|
|
63
|
+
return listDirtyMissionPaths(repoRoot, baseRef).map((rel) => path.join(repoRoot, rel.split("/").join(path.sep)));
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=dirty-missions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirty-missions.js","sourceRoot":"","sources":["../../../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AE,GAAG,CAAC,CAAC;SACxC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,QAAgB,EAAE,OAAgB;IAC9E,OAAO,qBAAqB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAC1D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Manifest } from "./types.js";
|
|
2
|
+
export type DoctorLevel = "ok" | "warn" | "fail";
|
|
3
|
+
export interface DoctorLine {
|
|
4
|
+
level: DoctorLevel;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DoctorCheckResult {
|
|
8
|
+
lines: DoctorLine[];
|
|
9
|
+
hasFail: boolean;
|
|
10
|
+
nextStep: string | null;
|
|
11
|
+
teacherAllowlistUnset: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function pickNextStep(current: string | null, candidate: string): string | null;
|
|
14
|
+
export declare function doctorLinesHasFail(lines: DoctorLine[]): boolean;
|
|
15
|
+
export declare function runDoctorChecks(root: string, manifest: Manifest): DoctorCheckResult;
|
|
16
|
+
//# sourceMappingURL=doctor-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-checks.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/doctor-checks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAcD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAErF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAE/D;AA2FD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,iBAAiB,CA6BnF"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { ENV_BYPASS_SECRET, isBypassSecretAuthorized, REL_BYPASS_SHA256 } from "./break-glass.js";
|
|
4
|
+
import { REL_AGENT_ERROR_FILE, REL_MANIFEST } from "./constants.js";
|
|
5
|
+
import { agentErrorAbsolutePath } from "./agent-error.js";
|
|
6
|
+
import { gitConfigGet } from "./git-repo.js";
|
|
7
|
+
import { resolveTeacherEmails } from "./teacher-identity.js";
|
|
8
|
+
import { checkSkillManifestSync } from "./skill-sync.js";
|
|
9
|
+
function readBypassAnchorState(repoRoot) {
|
|
10
|
+
const p = path.join(repoRoot, REL_BYPASS_SHA256);
|
|
11
|
+
if (!fs.existsSync(p))
|
|
12
|
+
return "missing";
|
|
13
|
+
const raw = fs.readFileSync(p, "utf8");
|
|
14
|
+
if (/^[a-f0-9]{64}$/im.test(raw))
|
|
15
|
+
return "configured";
|
|
16
|
+
return "placeholder";
|
|
17
|
+
}
|
|
18
|
+
function readHooksPath(repoRoot) {
|
|
19
|
+
return gitConfigGet(repoRoot, "core.hooksPath");
|
|
20
|
+
}
|
|
21
|
+
export function pickNextStep(current, candidate) {
|
|
22
|
+
return current ?? candidate;
|
|
23
|
+
}
|
|
24
|
+
export function doctorLinesHasFail(lines) {
|
|
25
|
+
return lines.some((line) => line.level === "fail");
|
|
26
|
+
}
|
|
27
|
+
function appendTeacherAllowlistChecks(root, lines, nextStep) {
|
|
28
|
+
const teacherIdentity = resolveTeacherEmails(root);
|
|
29
|
+
if (teacherIdentity.emails.length > 0) {
|
|
30
|
+
lines.push({
|
|
31
|
+
level: "ok",
|
|
32
|
+
message: `Teacher allowlist (${teacherIdentity.source}): ${teacherIdentity.emails.join(", ")}`,
|
|
33
|
+
});
|
|
34
|
+
if (teacherIdentity.source === "env") {
|
|
35
|
+
lines.push({
|
|
36
|
+
level: "warn",
|
|
37
|
+
message: "Teacher identity from GAPMAN_TEACHER_EMAILS env — prefer repo-local .gitagent/foreman/TEACHER.allowlist.local when working across projects",
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return { nextStep, teacherAllowlistUnset: false };
|
|
41
|
+
}
|
|
42
|
+
lines.push({ level: "warn", message: "Teacher allowlist unset — verify git-proof will fail" });
|
|
43
|
+
nextStep = pickNextStep(nextStep, 'gapman teacher set "$(git config user.email)"');
|
|
44
|
+
return { nextStep, teacherAllowlistUnset: true };
|
|
45
|
+
}
|
|
46
|
+
function appendBypassChecks(root, lines) {
|
|
47
|
+
const bypassState = readBypassAnchorState(root);
|
|
48
|
+
if (bypassState === "configured") {
|
|
49
|
+
lines.push({ level: "ok", message: "BYPASS.sha256 anchor present" });
|
|
50
|
+
const secret = process.env[ENV_BYPASS_SECRET];
|
|
51
|
+
if (secret?.length) {
|
|
52
|
+
const authorized = isBypassSecretAuthorized(root);
|
|
53
|
+
lines.push({
|
|
54
|
+
level: authorized ? "ok" : "warn",
|
|
55
|
+
message: authorized
|
|
56
|
+
? "bypass: GXT_BYPASS_SECRET matches anchor"
|
|
57
|
+
: "bypass: GXT_BYPASS_SECRET does NOT match anchor",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
lines.push({ level: "warn", message: "bypass: GXT_BYPASS_SECRET unset (expected unless in emergency)" });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (bypassState === "placeholder") {
|
|
65
|
+
lines.push({ level: "warn", message: "BYPASS.sha256 has no hash line — break-glass not provisioned" });
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
lines.push({ level: "warn", message: `${REL_BYPASS_SHA256} missing` });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function appendHooksAndExampleMissionChecks(root, lines, nextStep) {
|
|
72
|
+
const hooks = readHooksPath(root);
|
|
73
|
+
if (hooks === ".githooks") {
|
|
74
|
+
lines.push({ level: "ok", message: "core.hooksPath=.githooks" });
|
|
75
|
+
}
|
|
76
|
+
else if (hooks) {
|
|
77
|
+
lines.push({ level: "warn", message: `core.hooksPath=${hooks} (expected .githooks for GXT hooks)` });
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
lines.push({ level: "warn", message: "core.hooksPath unset — run: git config core.hooksPath .githooks" });
|
|
81
|
+
}
|
|
82
|
+
const exampleMission = ".gitagent/missions/example.verify.yaml";
|
|
83
|
+
const teacherIdentity = resolveTeacherEmails(root);
|
|
84
|
+
if (fs.existsSync(path.join(root, exampleMission))) {
|
|
85
|
+
lines.push({ level: "ok", message: `example mission: ${exampleMission}` });
|
|
86
|
+
if (teacherIdentity.emails.length > 0) {
|
|
87
|
+
nextStep = pickNextStep(nextStep, `gapman verify --mission ${exampleMission}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
lines.push({ level: "warn", message: "no example.verify.yaml — legislate a mission first" });
|
|
92
|
+
nextStep = pickNextStep(nextStep, 'gapman legislate "<intent>" --msn MSN-0001 --skill-key <key>');
|
|
93
|
+
}
|
|
94
|
+
return nextStep;
|
|
95
|
+
}
|
|
96
|
+
function appendAgentErrorCheck(root, lines) {
|
|
97
|
+
const errPath = agentErrorAbsolutePath(root);
|
|
98
|
+
if (!fs.existsSync(errPath))
|
|
99
|
+
return;
|
|
100
|
+
try {
|
|
101
|
+
const payload = JSON.parse(fs.readFileSync(errPath, "utf8"));
|
|
102
|
+
const summary = typeof payload.summary === "string" ? payload.summary : "(no summary)";
|
|
103
|
+
lines.push({ level: "warn", message: `last agent error: ${summary}` });
|
|
104
|
+
lines.push({ level: "warn", message: ` file: ${REL_AGENT_ERROR_FILE}` });
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
lines.push({ level: "warn", message: `stale ${REL_AGENT_ERROR_FILE} (unreadable)` });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export function runDoctorChecks(root, manifest) {
|
|
111
|
+
const lines = [{ level: "ok", message: `repo: ${root}` }];
|
|
112
|
+
let hasFail = false;
|
|
113
|
+
let nextStep = null;
|
|
114
|
+
let teacherAllowlistUnset = false;
|
|
115
|
+
const skillSync = checkSkillManifestSync(root, manifest);
|
|
116
|
+
if (skillSync.ok) {
|
|
117
|
+
lines.push({ level: "ok", message: "manifest + skills/ Rule 4.4 sync" });
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
for (const err of skillSync.errors)
|
|
121
|
+
lines.push({ level: "fail", message: err });
|
|
122
|
+
hasFail = true;
|
|
123
|
+
nextStep = pickNextStep(nextStep, "gapman check");
|
|
124
|
+
}
|
|
125
|
+
const teacherResult = appendTeacherAllowlistChecks(root, lines, nextStep);
|
|
126
|
+
nextStep = teacherResult.nextStep;
|
|
127
|
+
teacherAllowlistUnset = teacherResult.teacherAllowlistUnset;
|
|
128
|
+
appendBypassChecks(root, lines);
|
|
129
|
+
nextStep = appendHooksAndExampleMissionChecks(root, lines, nextStep);
|
|
130
|
+
appendAgentErrorCheck(root, lines);
|
|
131
|
+
if (!fs.existsSync(path.join(root, REL_MANIFEST))) {
|
|
132
|
+
lines.push({ level: "fail", message: `${REL_MANIFEST} missing` });
|
|
133
|
+
hasFail = true;
|
|
134
|
+
nextStep = pickNextStep(nextStep, "gapman init");
|
|
135
|
+
}
|
|
136
|
+
return { lines, hasFail, nextStep, teacherAllowlistUnset };
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=doctor-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-checks.js","sourceRoot":"","sources":["../../../src/cli/lib/doctor-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAiBzD,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACvC,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IACtD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,YA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CAAC;QACf,QAAQ,GAAG,YAAY,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,aAAa,GAAG,4BAA4B,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC1E,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;IAClC,qBAAqB,GAAG,aAAa,CAAC,qBAAqB,CAAC;IAC5D,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAChC,QAAQ,GAAG,kCAAkC,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrE,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,UAAU,EAAE,CAAC,CAAC;QAClE,OAAO,GAAG,IAAI,CAAC;QACf,QAAQ,GAAG,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { INTEGRATION_IDE_KEYS, loadIntegrationCompat, integrationWizardLabel } from "./integration-compat.js";
|
|
2
|
+
import type { DoctorLine } from "./doctor-checks.js";
|
|
3
|
+
export declare function runIntegrationDoctorChecks(repoRoot: string, templatesRoot: string): DoctorLine[];
|
|
4
|
+
export { integrationWizardLabel, INTEGRATION_IDE_KEYS, loadIntegrationCompat };
|
|
5
|
+
//# sourceMappingURL=doctor-integration-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-integration-checks.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/doctor-integration-checks.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAiCrD,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB,UAAU,EAAE,CAsDd;AAED,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
|