@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,156 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { CLI_NAME } from "./constants.js";
|
|
4
|
+
import { logError, logInfo, setExitCode } from "./cli-io.js";
|
|
5
|
+
import { teacherMissionStamped } from "./git-proof.js";
|
|
6
|
+
import { ONBOARDING_ADOPTION_DOC, onboardingRuntimeEnvHint, onboardingStatusHint, onboardingVerifyHint, tutorialTeacherStampBlock, TUTORIAL_INTENT, TUTORIAL_MSN_ID, } from "./onboarding-flow.js";
|
|
7
|
+
import { runStartOrchestration } from "./start-orchestration.js";
|
|
8
|
+
import { loadWorkspace } from "./workspace.js";
|
|
9
|
+
import { runVerify } from "../commands/verify.js";
|
|
10
|
+
function findExistingTutorialMission(repoRoot) {
|
|
11
|
+
const missionsDir = path.join(repoRoot, ".gitagent", "missions");
|
|
12
|
+
if (!fs.existsSync(missionsDir))
|
|
13
|
+
return null;
|
|
14
|
+
for (const name of fs.readdirSync(missionsDir)) {
|
|
15
|
+
if (name.startsWith(`${TUTORIAL_MSN_ID}.`) && name.endsWith(".yaml")) {
|
|
16
|
+
return `.gitagent/missions/${name}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
function pickTutorialSkillKey(skillKeys) {
|
|
22
|
+
const preferred = ["logic", "ui", "gapman"];
|
|
23
|
+
for (const key of preferred) {
|
|
24
|
+
if (skillKeys.includes(key))
|
|
25
|
+
return key;
|
|
26
|
+
}
|
|
27
|
+
const nonSubstrate = skillKeys.filter((k) => k !== "substrate");
|
|
28
|
+
return nonSubstrate[0] ?? skillKeys[0] ?? "logic";
|
|
29
|
+
}
|
|
30
|
+
function missionAbsolute(repoRoot, missionRel) {
|
|
31
|
+
return path.join(repoRoot, missionRel.split("/").join(path.sep));
|
|
32
|
+
}
|
|
33
|
+
async function confirmTeacherStamp(p, repoRoot, missionPath) {
|
|
34
|
+
while (true) {
|
|
35
|
+
logInfo(tutorialTeacherStampBlock(missionPath, TUTORIAL_MSN_ID));
|
|
36
|
+
const ready = await p.confirm({
|
|
37
|
+
message: "I've run the git commands above (gapman will check git history before continuing)",
|
|
38
|
+
initialValue: false,
|
|
39
|
+
});
|
|
40
|
+
if (p.isCancel(ready) || !ready)
|
|
41
|
+
return false;
|
|
42
|
+
if (teacherMissionStamped(repoRoot, missionAbsolute(repoRoot, missionPath), { msnId: TUTORIAL_MSN_ID })) {
|
|
43
|
+
p.log.success("Teacher stamp OK — [MSN-9001] commit touches this mission file");
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
p.log.warn("Git-proof not satisfied yet: no allowlisted Teacher commit [MSN-9001] modifying this mission file.");
|
|
47
|
+
const retry = await p.confirm({
|
|
48
|
+
message: "Run the commands above in another terminal, then check again?",
|
|
49
|
+
initialValue: true,
|
|
50
|
+
});
|
|
51
|
+
if (p.isCancel(retry) || !retry)
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function verifyExitOk() {
|
|
56
|
+
const code = process.exitCode;
|
|
57
|
+
return code === undefined || code === 0;
|
|
58
|
+
}
|
|
59
|
+
async function scaffoldTutorialMission(p, repoRoot, skillKey) {
|
|
60
|
+
p.log.step("Step 2 — Scaffold tutorial mission (gapman start)");
|
|
61
|
+
const existing = findExistingTutorialMission(repoRoot);
|
|
62
|
+
if (existing) {
|
|
63
|
+
p.log.message(`Using existing tutorial mission: ${existing}`);
|
|
64
|
+
return existing;
|
|
65
|
+
}
|
|
66
|
+
const start = runStartOrchestration({
|
|
67
|
+
intent: TUTORIAL_INTENT,
|
|
68
|
+
msn: TUTORIAL_MSN_ID,
|
|
69
|
+
skillKey,
|
|
70
|
+
gateCommand: "gapman check",
|
|
71
|
+
writeMission: true,
|
|
72
|
+
silent: true,
|
|
73
|
+
audience: "teacher",
|
|
74
|
+
});
|
|
75
|
+
if (!start.ok || !start.mission_file_path) {
|
|
76
|
+
logError("Tutorial start failed — run gapman onboarding or pass --skill-key");
|
|
77
|
+
setExitCode(start.exit_code);
|
|
78
|
+
p.outro("Tutorial incomplete");
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
p.log.success(`Mission scaffold: ${start.mission_file_path}`);
|
|
82
|
+
return start.mission_file_path;
|
|
83
|
+
}
|
|
84
|
+
async function runTutorialVerifyStep(p, missionPath) {
|
|
85
|
+
p.log.step("Step 5 — Verify");
|
|
86
|
+
logInfo(` ${onboardingVerifyHint(missionPath)}`);
|
|
87
|
+
const runVerifyNow = await p.confirm({
|
|
88
|
+
message: "Run gapman verify now (git-proof, gate, trace — expect errors until trace is complete)?",
|
|
89
|
+
initialValue: true,
|
|
90
|
+
});
|
|
91
|
+
if (p.isCancel(runVerifyNow) || !runVerifyNow) {
|
|
92
|
+
return { verifyOk: true, ranVerify: false };
|
|
93
|
+
}
|
|
94
|
+
process.exitCode = undefined;
|
|
95
|
+
await runVerify({
|
|
96
|
+
mission: missionPath,
|
|
97
|
+
fix: true,
|
|
98
|
+
fixNonInteractive: true,
|
|
99
|
+
audience: "teacher",
|
|
100
|
+
});
|
|
101
|
+
const verifyOk = verifyExitOk();
|
|
102
|
+
if (!verifyOk) {
|
|
103
|
+
p.log.warn("Verify did not pass yet — expected until gate runs and trace rows cite WORKER_LOG.md");
|
|
104
|
+
}
|
|
105
|
+
return { verifyOk, ranVerify: true };
|
|
106
|
+
}
|
|
107
|
+
function emitTutorialOutro(p, missionPath, verifyOk, ranVerify) {
|
|
108
|
+
if (!verifyOk) {
|
|
109
|
+
setExitCode(typeof process.exitCode === "number" ? process.exitCode : 1);
|
|
110
|
+
p.outro(`Tutorial incomplete — finish stamp/trace, then: gapman verify --mission ${missionPath} — see ${ONBOARDING_ADOPTION_DOC}`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (!ranVerify) {
|
|
114
|
+
p.outro(`Tutorial paused before verify — run: gapman verify --mission ${missionPath} — see ${ONBOARDING_ADOPTION_DOC}`);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
p.outro(`Tutorial complete — full loop: ${ONBOARDING_ADOPTION_DOC}`);
|
|
118
|
+
}
|
|
119
|
+
export async function runInitTutorial() {
|
|
120
|
+
const p = await import("@clack/prompts");
|
|
121
|
+
const { root: repoRoot, manifest } = loadWorkspace();
|
|
122
|
+
const manifestPath = path.join(repoRoot, ".gitagent", "foreman", "MANIFEST.json");
|
|
123
|
+
if (!fs.existsSync(manifestPath)) {
|
|
124
|
+
logError("init --tutorial: substrate missing — init must complete before tutorial");
|
|
125
|
+
setExitCode(2);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
p.intro(`${CLI_NAME} init --tutorial — first mission loop (~3 min)`);
|
|
129
|
+
const confirm = await p.confirm({
|
|
130
|
+
message: "Walk through scaffold → Teacher stamp → trace → verify (strict checks)?",
|
|
131
|
+
initialValue: true,
|
|
132
|
+
});
|
|
133
|
+
if (p.isCancel(confirm) || !confirm) {
|
|
134
|
+
p.cancel("Tutorial skipped");
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
p.log.step("Step 1 — Teacher allowlist");
|
|
138
|
+
logInfo(' gapman teacher set "$(git config user.email)"');
|
|
139
|
+
const missionPath = await scaffoldTutorialMission(p, repoRoot, pickTutorialSkillKey(Object.keys(manifest.skills)));
|
|
140
|
+
if (!missionPath)
|
|
141
|
+
return;
|
|
142
|
+
p.log.step("Step 3 — Teacher stamp (manual, required)");
|
|
143
|
+
if (!(await confirmTeacherStamp(p, repoRoot, missionPath))) {
|
|
144
|
+
p.note("Verify will fail until git-proof passes. Re-run: gapman verify --mission " + missionPath, "Paused");
|
|
145
|
+
p.outro(`Tutorial paused — see ${ONBOARDING_ADOPTION_DOC}`);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
p.log.step("Step 4 — Worker trace");
|
|
149
|
+
logInfo(` ${onboardingRuntimeEnvHint(missionPath)}`);
|
|
150
|
+
logInfo(" Append a unique gate evidence line to WORKER_LOG.md, then set mission trace_row PASS + trace_quote");
|
|
151
|
+
const { verifyOk, ranVerify } = await runTutorialVerifyStep(p, missionPath);
|
|
152
|
+
p.log.step("Step 6 — Status dashboard");
|
|
153
|
+
logInfo(` ${onboardingStatusHint()}`);
|
|
154
|
+
emitTutorialOutro(p, missionPath, verifyOk, ranVerify);
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=init-tutorial.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-tutorial.js","sourceRoot":"","sources":["../../../src/cli/lib/init-tutorial.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,eAAe,EACf,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,SAAS,2BAA2B,CAAC,QAAgB;IACnD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IACjE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7C,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,eAAe,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAA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
|
+
export type IntegrationIdeKey = (typeof INTEGRATION_IDE_KEYS)[number];
|
|
3
|
+
export interface IntegrationCompatEntry {
|
|
4
|
+
display_name: string;
|
|
5
|
+
verified_date: string;
|
|
6
|
+
docs_url: string;
|
|
7
|
+
recipe_file: string;
|
|
8
|
+
canonical_paths: string[];
|
|
9
|
+
deprecated_paths: string[];
|
|
10
|
+
hooks_schema_version?: number;
|
|
11
|
+
cli_probe?: string[] | null;
|
|
12
|
+
disambiguation?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IntegrationCompatManifest {
|
|
15
|
+
schema_version: string;
|
|
16
|
+
opengantry_version: string;
|
|
17
|
+
integrations: Record<IntegrationIdeKey, IntegrationCompatEntry>;
|
|
18
|
+
}
|
|
19
|
+
export declare function isIntegrationIdeKey(key: string): key is IntegrationIdeKey;
|
|
20
|
+
export declare function resolveTemplateRootFromModule(): string;
|
|
21
|
+
export declare function loadIntegrationCompat(templatesRoot?: string): IntegrationCompatManifest;
|
|
22
|
+
export declare function validateIntegrationCompat(manifest: IntegrationCompatManifest): void;
|
|
23
|
+
export declare function integrationWizardLabel(entry: IntegrationCompatEntry): string;
|
|
24
|
+
//# sourceMappingURL=integration-compat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-compat.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/integration-compat.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,oHAUvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;CACjE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,iBAAiB,CAEzE;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAOtD;AAED,wBAAgB,qBAAqB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,yBAAyB,CAMvF;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI,CAUnF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAE5E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
export const INTEGRATION_IDE_KEYS = [
|
|
5
|
+
"cursor",
|
|
6
|
+
"claude-code",
|
|
7
|
+
"codex-cli",
|
|
8
|
+
"opencode",
|
|
9
|
+
"junie",
|
|
10
|
+
"antigravity",
|
|
11
|
+
"cline",
|
|
12
|
+
"aider",
|
|
13
|
+
"openhands",
|
|
14
|
+
];
|
|
15
|
+
export function isIntegrationIdeKey(key) {
|
|
16
|
+
return INTEGRATION_IDE_KEYS.includes(key);
|
|
17
|
+
}
|
|
18
|
+
export function resolveTemplateRootFromModule() {
|
|
19
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
const root = path.resolve(moduleDir, "../../../templates");
|
|
21
|
+
if (!fs.existsSync(root)) {
|
|
22
|
+
throw new Error(`missing templates directory at ${root}`);
|
|
23
|
+
}
|
|
24
|
+
return root;
|
|
25
|
+
}
|
|
26
|
+
export function loadIntegrationCompat(templatesRoot) {
|
|
27
|
+
const root = templatesRoot ?? resolveTemplateRootFromModule();
|
|
28
|
+
const compatPath = path.join(root, "integrations/compatibility.json");
|
|
29
|
+
const raw = JSON.parse(fs.readFileSync(compatPath, "utf8"));
|
|
30
|
+
validateIntegrationCompat(raw);
|
|
31
|
+
return raw;
|
|
32
|
+
}
|
|
33
|
+
export function validateIntegrationCompat(manifest) {
|
|
34
|
+
if (manifest.schema_version !== "1") {
|
|
35
|
+
throw new Error(`integration compat: unsupported schema_version ${manifest.schema_version}`);
|
|
36
|
+
}
|
|
37
|
+
for (const key of INTEGRATION_IDE_KEYS) {
|
|
38
|
+
const entry = manifest.integrations[key];
|
|
39
|
+
if (!entry)
|
|
40
|
+
throw new Error(`integration compat: missing entry for ${key}`);
|
|
41
|
+
if (!entry.recipe_file)
|
|
42
|
+
throw new Error(`integration compat: ${key} missing recipe_file`);
|
|
43
|
+
if (!entry.display_name)
|
|
44
|
+
throw new Error(`integration compat: ${key} missing display_name`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function integrationWizardLabel(entry) {
|
|
48
|
+
return `${entry.display_name} (verified ${entry.verified_date})`;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=integration-compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-compat.js","sourceRoot":"","sources":["../../../src/cli/lib/integration-compat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ;IACR,aAAa;IACb,WAAW;IACX,UAAU;IACV,OAAO;IACP,aAAa;IACb,OAAO;IACP,OAAO;IACP,WAAW;CACH,CAAC;AAsBX,MA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,CAAC,CAAC;QAC5E,IAAI,CAAC,KAAK,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,sBAAsB,CAAC,CAAC;QAC1F,IAAI,CAAC,KAAK,CAAC,YAAY;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,uBAAuB,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAA6B;IAClE,OAAO,GAAG,KAAK,CAAC,YAAY,cAAc,KAAK,CAAC,aAAa,GAAG,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Manifest } from "./types.js";
|
|
2
|
+
import type { TriageResult } from "./types.js";
|
|
3
|
+
export declare function isTriageEscalated(triage: TriageResult): boolean;
|
|
4
|
+
export type ResolveSkillKeyResult = {
|
|
5
|
+
ok: true;
|
|
6
|
+
skillKey: string;
|
|
7
|
+
triage: TriageResult;
|
|
8
|
+
} | {
|
|
9
|
+
ok: false;
|
|
10
|
+
triage: TriageResult;
|
|
11
|
+
reason: string;
|
|
12
|
+
kind: "unknown_skill" | "escalated";
|
|
13
|
+
};
|
|
14
|
+
export declare function resolveSkillKeyForLegislation(opts: {
|
|
15
|
+
root: string;
|
|
16
|
+
manifest: Manifest;
|
|
17
|
+
intent: string;
|
|
18
|
+
skillKey?: string;
|
|
19
|
+
}): ResolveSkillKeyResult;
|
|
20
|
+
//# sourceMappingURL=legislate-skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legislate-skill.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/legislate-skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE/D;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACpD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,eAAe,GAAG,WAAW,CAAA;CAAE,CAAC;AAE7F,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,qBAAqB,CAyBxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { triageIntent } from "./triage-logic.js";
|
|
2
|
+
export function isTriageEscalated(triage) {
|
|
3
|
+
return triage.action !== "DIRECT_EXECUTION" || triage.skill_key === "NONE";
|
|
4
|
+
}
|
|
5
|
+
export function resolveSkillKeyForLegislation(opts) {
|
|
6
|
+
const explicit = opts.skillKey?.trim();
|
|
7
|
+
if (explicit) {
|
|
8
|
+
if (!opts.manifest.skills[explicit]) {
|
|
9
|
+
return {
|
|
10
|
+
ok: false,
|
|
11
|
+
triage: triageIntent(opts.root, opts.intent, opts.manifest),
|
|
12
|
+
reason: `unknown skill_key "${explicit}" (manifest skills: ${Object.keys(opts.manifest.skills).join(", ")})`,
|
|
13
|
+
kind: "unknown_skill",
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const triage = triageIntent(opts.root, opts.intent, opts.manifest);
|
|
17
|
+
return { ok: true, skillKey: explicit, triage };
|
|
18
|
+
}
|
|
19
|
+
const triage = triageIntent(opts.root, opts.intent, opts.manifest);
|
|
20
|
+
if (isTriageEscalated(triage)) {
|
|
21
|
+
return {
|
|
22
|
+
ok: false,
|
|
23
|
+
triage,
|
|
24
|
+
reason: `triage escalation — ${triage.reason}. Pass --skill-key <manifest skill> after Teacher assigns scope.`,
|
|
25
|
+
kind: "escalated",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return { ok: true, skillKey: triage.skill_key, triage };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=legislate-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legislate-skill.js","sourceRoot":"","sources":["../../../src/cli/lib/legislate-skill.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACpD,OAAO,MAAM,CAAC,MAAM,KAAK,kBAAkB,IAAI,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC;AAC7E,CAAC;AAMD,MAAM,UAAU,6BAA6B,CAAC,IAK7C;IACC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;gBAC3D,MAAM,EAAE,sBAAsB,QAAQ,uBAAuB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBAC5G,IAAI,EAAE,eAAe;aACtB,CAAC;QACJ,CAAC;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnE,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM;YACN,MAAM,EAAE,uBAAuB,MAAM,CAAC,MAAM,kEAAkE;YAC9G,IAAI,EAAE,WAAW;SAClB,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Manifest } from "./types.js";
|
|
2
|
+
export declare function manifestPath(root: string): string;
|
|
3
|
+
export declare function loadManifest(root: string): Manifest;
|
|
4
|
+
/** Mirrors scripts/validate-gxt.sh manifest checks */
|
|
5
|
+
export declare function validateManifestShape(m: unknown): asserts m is Manifest;
|
|
6
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAQnD;AAED,sDAAsD;AACtD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,IAAI,QAAQ,CA2BvE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { REL_MANIFEST } from "./constants.js";
|
|
4
|
+
export function manifestPath(root) {
|
|
5
|
+
return path.join(root, REL_MANIFEST);
|
|
6
|
+
}
|
|
7
|
+
export function loadManifest(root) {
|
|
8
|
+
const p = manifestPath(root);
|
|
9
|
+
if (!fs.existsSync(p)) {
|
|
10
|
+
throw new Error(`gapman: missing ${REL_MANIFEST}`);
|
|
11
|
+
}
|
|
12
|
+
const raw = JSON.parse(fs.readFileSync(p, "utf8"));
|
|
13
|
+
validateManifestShape(raw);
|
|
14
|
+
return raw;
|
|
15
|
+
}
|
|
16
|
+
/** Mirrors scripts/validate-gxt.sh manifest checks */
|
|
17
|
+
export function validateManifestShape(m) {
|
|
18
|
+
if (typeof m !== "object" || m === null)
|
|
19
|
+
throw new Error("MANIFEST: not an object");
|
|
20
|
+
const o = m;
|
|
21
|
+
if (typeof o.schema_version !== "string" || o.schema_version.length === 0) {
|
|
22
|
+
throw new Error("MANIFEST: schema_version must be a non-empty string");
|
|
23
|
+
}
|
|
24
|
+
if (typeof o.skills !== "object" || o.skills === null || Array.isArray(o.skills)) {
|
|
25
|
+
throw new Error("MANIFEST: skills must be an object");
|
|
26
|
+
}
|
|
27
|
+
const skills = o.skills;
|
|
28
|
+
if (Object.keys(skills).length === 0)
|
|
29
|
+
throw new Error("MANIFEST: skills must be non-empty");
|
|
30
|
+
if (typeof o.path_risks !== "object" || o.path_risks === null || Array.isArray(o.path_risks)) {
|
|
31
|
+
throw new Error("MANIFEST: path_risks must be an object");
|
|
32
|
+
}
|
|
33
|
+
if (!Array.isArray(o.risk_keywords))
|
|
34
|
+
throw new Error("MANIFEST: risk_keywords must be an array");
|
|
35
|
+
for (const k of Object.keys(skills)) {
|
|
36
|
+
const s = skills[k];
|
|
37
|
+
if (typeof s !== "object" || s === null)
|
|
38
|
+
throw new Error(`MANIFEST: skills.${k} must be an object`);
|
|
39
|
+
const sk = s;
|
|
40
|
+
if (!("trust_threshold" in sk))
|
|
41
|
+
throw new Error(`MANIFEST: skills.${k} missing trust_threshold`);
|
|
42
|
+
if (!("tmvc_roots" in sk))
|
|
43
|
+
throw new Error(`MANIFEST: skills.${k} missing tmvc_roots`);
|
|
44
|
+
if (!("forbidden_zones" in sk))
|
|
45
|
+
throw new Error(`MANIFEST: skills.${k} missing forbidden_zones`);
|
|
46
|
+
if (!Array.isArray(sk.tmvc_roots))
|
|
47
|
+
throw new Error(`MANIFEST: skills.${k}.tmvc_roots must be array`);
|
|
48
|
+
if (!Array.isArray(sk.forbidden_zones)) {
|
|
49
|
+
throw new Error(`MANIFEST: skills.${k}.forbidden_zones must be array`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/cli/lib/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,mBAAmB,YAAY,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAY,CAAC;IAC9D,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,GAAG,CAAC;AACb,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,qBAAqB,CAAC,CAAU;IAC9C,IA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AAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;QACpG,MAAM,EAAE,GAAG,CAA4B,CAAC;QACxC,IAAI,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;QACjG,IAAI,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;QACvF,IAAI,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;QACjG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,2BAA2B,CAAC,CAAC;QACrG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type McpToolStatus = "awaiting_human_approval" | "pending_signature" | "signature_valid" | "signature_missing" | "error";
|
|
2
|
+
export interface McpErrorBody {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
retryable: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface DraftLegislationInput {
|
|
8
|
+
title: string;
|
|
9
|
+
msn_id: string;
|
|
10
|
+
skill_key: string;
|
|
11
|
+
gate_command: string;
|
|
12
|
+
gate_success_substring?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface DraftLegislationResult {
|
|
15
|
+
status: "awaiting_human_approval";
|
|
16
|
+
draft_token: string;
|
|
17
|
+
chat_message_to_user: string;
|
|
18
|
+
expires_at: string;
|
|
19
|
+
requires_teacher_commit: true;
|
|
20
|
+
}
|
|
21
|
+
export interface ExecuteLegislationResult {
|
|
22
|
+
status: "pending_signature";
|
|
23
|
+
msn_id: string;
|
|
24
|
+
mission_file_path: string;
|
|
25
|
+
suggested_human_action: string;
|
|
26
|
+
commit_message: string;
|
|
27
|
+
commit_target: string;
|
|
28
|
+
requires_teacher_commit: true;
|
|
29
|
+
next_tool: "gxt_check_signature";
|
|
30
|
+
}
|
|
31
|
+
export interface CheckSignatureResult {
|
|
32
|
+
status: "signature_valid" | "signature_missing";
|
|
33
|
+
msn_id: string;
|
|
34
|
+
mission_file_path: string;
|
|
35
|
+
message: string;
|
|
36
|
+
next_tools?: string[];
|
|
37
|
+
}
|
|
38
|
+
export type PinMissionResult = {
|
|
39
|
+
status: "pinned";
|
|
40
|
+
mission_file_path: string;
|
|
41
|
+
message: string;
|
|
42
|
+
} | {
|
|
43
|
+
status: "error";
|
|
44
|
+
error: McpErrorBody;
|
|
45
|
+
};
|
|
46
|
+
export type ResolveMissionResult = {
|
|
47
|
+
status: "resolved";
|
|
48
|
+
mission_file_path: string;
|
|
49
|
+
} | {
|
|
50
|
+
status: "unpinned";
|
|
51
|
+
mission_file_path: null;
|
|
52
|
+
message: string;
|
|
53
|
+
};
|
|
54
|
+
export type LastErrorResult = {
|
|
55
|
+
status: "empty";
|
|
56
|
+
message: string;
|
|
57
|
+
} | {
|
|
58
|
+
status: "found";
|
|
59
|
+
payload: Record<string, unknown>;
|
|
60
|
+
} | {
|
|
61
|
+
status: "error";
|
|
62
|
+
message: string;
|
|
63
|
+
};
|
|
64
|
+
export declare function handleDraftLegislation(input: DraftLegislationInput): DraftLegislationResult | {
|
|
65
|
+
status: "error";
|
|
66
|
+
error: McpErrorBody;
|
|
67
|
+
};
|
|
68
|
+
export declare function handleExecuteLegislation(draftToken: string): ExecuteLegislationResult | {
|
|
69
|
+
status: "error";
|
|
70
|
+
error: McpErrorBody;
|
|
71
|
+
};
|
|
72
|
+
export declare function handleCheckSignature(missionFilePath: string): CheckSignatureResult | {
|
|
73
|
+
status: "error";
|
|
74
|
+
error: McpErrorBody;
|
|
75
|
+
};
|
|
76
|
+
export declare function handlePinMission(missionFilePath: string): PinMissionResult | {
|
|
77
|
+
status: "error";
|
|
78
|
+
error: McpErrorBody;
|
|
79
|
+
};
|
|
80
|
+
export declare function handleResolveMission(explicit?: string): ResolveMissionResult;
|
|
81
|
+
export declare function handleLastError(): LastErrorResult;
|
|
82
|
+
//# sourceMappingURL=mcp-legislation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-legislation.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-legislation.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,aAAa,GACrB,yBAAyB,GACzB,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,GACnB,OAAO,CAAC;AAEZ,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,yBAAyB,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,uBAAuB,EAAE,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC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AE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CAwCrE;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,GACtB,oBAAoB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CA8BjE;AAED,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,gBAAgB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CAcrH;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAgB5E;AAED,wBAAgB,eAAe,IAAI,eAAe,CAYjD"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { runLegislate } from "../commands/legislate.js";
|
|
4
|
+
import { formatRepoRelative } from "./cli-io.js";
|
|
5
|
+
import { MSN_ID_PATTERN } from "./constants.js";
|
|
6
|
+
import { DraftTokenError, createDraftToken, verifyDraftToken } from "./draft-token.js";
|
|
7
|
+
import { assertTeacherMissionProof } from "./git-proof.js";
|
|
8
|
+
import { pinMissionFile, resolveMissionFilePath, } from "./mission-path.js";
|
|
9
|
+
import { resolvePinnedMission } from "./mission-resolution.js";
|
|
10
|
+
import { GapmanUserError } from "./user-error.js";
|
|
11
|
+
import { loadWorkspace } from "./workspace.js";
|
|
12
|
+
function mcpError(code, message, retryable) {
|
|
13
|
+
return { status: "error", error: { code, message, retryable } };
|
|
14
|
+
}
|
|
15
|
+
function buildDraftChatMessage(input, manifestSkillDesc) {
|
|
16
|
+
const lines = [
|
|
17
|
+
"## Proposed GXT mission (draft — not yet written)",
|
|
18
|
+
"",
|
|
19
|
+
`- **Title:** ${input.title}`,
|
|
20
|
+
`- **MSN:** ${input.msn_id}`,
|
|
21
|
+
`- **Skill:** ${input.skill_key}`,
|
|
22
|
+
`- **Gate:** \`${input.gate_command}\``,
|
|
23
|
+
];
|
|
24
|
+
if (input.gate_success_substring?.trim()) {
|
|
25
|
+
lines.push(`- **Gate success substring:** \`${input.gate_success_substring.trim()}\``);
|
|
26
|
+
}
|
|
27
|
+
if (manifestSkillDesc) {
|
|
28
|
+
lines.push(`- **Skill scope:** ${manifestSkillDesc}`);
|
|
29
|
+
}
|
|
30
|
+
lines.push("", "Reply with clear approval (e.g. **yes**, **approve**, **looks good**) to execute legislation, or **deny** / **no** to cancel.", "", "_No mission file will be written until you approve._");
|
|
31
|
+
return lines.join("\n");
|
|
32
|
+
}
|
|
33
|
+
function validateDraftInput(input) {
|
|
34
|
+
if (!input.title?.trim()) {
|
|
35
|
+
return { code: "VALIDATION_ERROR", message: "title is required", retryable: true };
|
|
36
|
+
}
|
|
37
|
+
if (!MSN_ID_PATTERN.test(input.msn_id?.trim() ?? "")) {
|
|
38
|
+
return { code: "VALIDATION_ERROR", message: 'msn_id must match "MSN-0007"', retryable: true };
|
|
39
|
+
}
|
|
40
|
+
if (!input.skill_key?.trim()) {
|
|
41
|
+
return { code: "VALIDATION_ERROR", message: "skill_key is required", retryable: true };
|
|
42
|
+
}
|
|
43
|
+
if (!input.gate_command?.trim()) {
|
|
44
|
+
return { code: "VALIDATION_ERROR", message: "gate_command is required", retryable: true };
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
export function handleDraftLegislation(input) {
|
|
49
|
+
const validation = validateDraftInput(input);
|
|
50
|
+
if (validation)
|
|
51
|
+
return mcpError(validation.code, validation.message, validation.retryable);
|
|
52
|
+
const { root, manifest } = loadWorkspace();
|
|
53
|
+
const skillKey = input.skill_key.trim();
|
|
54
|
+
if (!manifest.skills[skillKey]) {
|
|
55
|
+
return mcpError("UNKNOWN_SKILL", `unknown skill_key "${skillKey}" (manifest skills: ${Object.keys(manifest.skills).join(", ")})`, true);
|
|
56
|
+
}
|
|
57
|
+
const token = createDraftToken(root, {
|
|
58
|
+
title: input.title,
|
|
59
|
+
msn_id: input.msn_id.trim(),
|
|
60
|
+
skill_key: skillKey,
|
|
61
|
+
gate_command: input.gate_command,
|
|
62
|
+
gate_success_substring: input.gate_success_substring,
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
status: "awaiting_human_approval",
|
|
66
|
+
draft_token: token.draft_token,
|
|
67
|
+
chat_message_to_user: buildDraftChatMessage(input, manifest.skills[skillKey]?.desc),
|
|
68
|
+
expires_at: token.expires_at,
|
|
69
|
+
requires_teacher_commit: true,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function handleExecuteLegislation(draftToken) {
|
|
73
|
+
const { root } = loadWorkspace();
|
|
74
|
+
let payload;
|
|
75
|
+
try {
|
|
76
|
+
payload = verifyDraftToken(root, draftToken, { consume: true });
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
if (err instanceof DraftTokenError) {
|
|
80
|
+
return mcpError(err.code, err.message, err.retryable);
|
|
81
|
+
}
|
|
82
|
+
throw err;
|
|
83
|
+
}
|
|
84
|
+
const legislateOpts = {
|
|
85
|
+
intent: payload.title,
|
|
86
|
+
msn: payload.msn_id,
|
|
87
|
+
skillKey: payload.skill_key,
|
|
88
|
+
gateCommand: payload.gate_command,
|
|
89
|
+
gateSuccessSubstring: payload.gate_success_substring,
|
|
90
|
+
};
|
|
91
|
+
const result = runLegislate(legislateOpts);
|
|
92
|
+
if (!result.ok) {
|
|
93
|
+
return mcpError("LEGISLATE_FAILED", "gapman legislate failed; check skill_key, msn, or output path", true);
|
|
94
|
+
}
|
|
95
|
+
const missionRel = formatRepoRelative(root, result.missionAbs);
|
|
96
|
+
const commitMessage = `[${payload.msn_id}] Legislate ${payload.title.replace(/"/g, '\\"')}`;
|
|
97
|
+
const suggestedHumanAction = `git add ${missionRel} && git commit -m "${commitMessage}"`;
|
|
98
|
+
return {
|
|
99
|
+
status: "pending_signature",
|
|
100
|
+
msn_id: payload.msn_id,
|
|
101
|
+
mission_file_path: missionRel,
|
|
102
|
+
suggested_human_action: suggestedHumanAction,
|
|
103
|
+
commit_message: commitMessage,
|
|
104
|
+
commit_target: missionRel,
|
|
105
|
+
requires_teacher_commit: true,
|
|
106
|
+
next_tool: "gxt_check_signature",
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function handleCheckSignature(missionFilePath) {
|
|
110
|
+
const { root } = loadWorkspace();
|
|
111
|
+
const missionAbs = resolveMissionFilePath(root, missionFilePath);
|
|
112
|
+
if (!fs.existsSync(missionAbs)) {
|
|
113
|
+
return mcpError("MISSION_NOT_FOUND", `mission file not found: ${missionFilePath}`, true);
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const msnId = assertTeacherMissionProof(root, missionAbs);
|
|
117
|
+
const rel = formatRepoRelative(root, missionAbs);
|
|
118
|
+
return {
|
|
119
|
+
status: "signature_valid",
|
|
120
|
+
msn_id: msnId,
|
|
121
|
+
mission_file_path: rel,
|
|
122
|
+
message: `Teacher signature valid for ${msnId}. You may pin the mission and begin worker execution.`,
|
|
123
|
+
next_tools: ["gxt_pin_mission", "gxt_runtime_env"],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
if (err instanceof GapmanUserError) {
|
|
128
|
+
return {
|
|
129
|
+
status: "signature_missing",
|
|
130
|
+
msn_id: "unknown",
|
|
131
|
+
mission_file_path: formatRepoRelative(root, missionAbs),
|
|
132
|
+
message: err.message,
|
|
133
|
+
next_tools: [],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
throw err;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export function handlePinMission(missionFilePath) {
|
|
140
|
+
const { root } = loadWorkspace();
|
|
141
|
+
const missionAbs = resolveMissionFilePath(root, missionFilePath);
|
|
142
|
+
if (!fs.existsSync(missionAbs)) {
|
|
143
|
+
return mcpError("MISSION_NOT_FOUND", `mission file not found: ${missionFilePath}`, true);
|
|
144
|
+
}
|
|
145
|
+
const rel = pinMissionFile(root, missionAbs);
|
|
146
|
+
return {
|
|
147
|
+
status: "pinned",
|
|
148
|
+
mission_file_path: rel,
|
|
149
|
+
message: `Pinned active mission: ${rel}`,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export function handleResolveMission(explicit) {
|
|
153
|
+
const { root } = loadWorkspace();
|
|
154
|
+
const resolved = resolvePinnedMission(root, {
|
|
155
|
+
explicit,
|
|
156
|
+
profile: "full",
|
|
157
|
+
});
|
|
158
|
+
if (resolved) {
|
|
159
|
+
return { status: "resolved", mission_file_path: resolved };
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
status: "unpinned",
|
|
163
|
+
mission_file_path: null,
|
|
164
|
+
message: "No active mission pinned. Run Mission Architect / gxt_draft_legislation first.",
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export function handleLastError() {
|
|
168
|
+
const { root } = loadWorkspace();
|
|
169
|
+
const errPath = path.join(root, ".gitagent", "history", ".ignored-last-error.json");
|
|
170
|
+
if (!fs.existsSync(errPath)) {
|
|
171
|
+
return { status: "empty", message: "No last error recorded." };
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const payload = JSON.parse(fs.readFileSync(errPath, "utf8"));
|
|
175
|
+
return { status: "found", payload };
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return { status: "error", message: "Failed to parse last error file." };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=mcp-legislation.js.map
|