@jeger-ai/opengantry 3.4.0 → 3.6.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/README.md +12 -1
- package/dist/cli/commands/arch.js +3 -3
- package/dist/cli/commands/arch.js.map +1 -1
- package/dist/cli/commands/audit-rigor.js +2 -2
- package/dist/cli/commands/audit-rigor.js.map +1 -1
- package/dist/cli/commands/context-request.js +1 -1
- package/dist/cli/commands/context-request.js.map +1 -1
- package/dist/cli/commands/contract.d.ts +18 -1
- package/dist/cli/commands/contract.d.ts.map +1 -1
- package/dist/cli/commands/contract.js +66 -7
- package/dist/cli/commands/contract.js.map +1 -1
- package/dist/cli/commands/deps.js +1 -1
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/hooks.d.ts +4 -0
- package/dist/cli/commands/hooks.d.ts.map +1 -0
- package/dist/cli/commands/hooks.js +38 -0
- package/dist/cli/commands/hooks.js.map +1 -0
- package/dist/cli/commands/init.js +11 -11
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/interrogate.js +3 -3
- package/dist/cli/commands/interrogate.js.map +1 -1
- package/dist/cli/commands/ledger.js +1 -1
- package/dist/cli/commands/ledger.js.map +1 -1
- package/dist/cli/commands/legislate.d.ts +1 -1
- package/dist/cli/commands/legislate.d.ts.map +1 -1
- package/dist/cli/commands/legislate.js +1 -1
- package/dist/cli/commands/legislate.js.map +1 -1
- package/dist/cli/commands/mcp-serve.js +1 -1
- package/dist/cli/commands/mcp-serve.js.map +1 -1
- package/dist/cli/commands/metrics.js +1 -1
- package/dist/cli/commands/metrics.js.map +1 -1
- package/dist/cli/commands/onboarding.js +2 -2
- package/dist/cli/commands/onboarding.js.map +1 -1
- package/dist/cli/commands/perimeter.js +1 -1
- package/dist/cli/commands/perimeter.js.map +1 -1
- package/dist/cli/commands/pin.d.ts.map +1 -1
- package/dist/cli/commands/pin.js +1 -1
- package/dist/cli/commands/pin.js.map +1 -1
- package/dist/cli/commands/report.js +4 -4
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/runtime.d.ts +2 -0
- package/dist/cli/commands/runtime.d.ts.map +1 -1
- package/dist/cli/commands/runtime.js +8 -1
- package/dist/cli/commands/runtime.js.map +1 -1
- package/dist/cli/commands/status.js +2 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tmvc-guard.js +1 -1
- package/dist/cli/commands/tmvc-guard.js.map +1 -1
- package/dist/cli/commands/upgrade.js +3 -3
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/verify.d.ts +2 -2
- package/dist/cli/commands/verify.d.ts.map +1 -1
- package/dist/cli/commands/verify.js +47 -27
- package/dist/cli/commands/verify.js.map +1 -1
- package/dist/cli/kernel.d.ts +5 -5
- package/dist/cli/kernel.d.ts.map +1 -1
- package/dist/cli/kernel.js +2 -2
- package/dist/cli/kernel.js.map +1 -1
- package/dist/cli/lib/adapter-preflight-checks.d.ts +1 -1
- package/dist/cli/lib/adapter-preflight-checks.d.ts.map +1 -1
- package/dist/cli/lib/aider-scope.d.ts +14 -0
- package/dist/cli/lib/aider-scope.d.ts.map +1 -0
- package/dist/cli/lib/aider-scope.js +41 -0
- package/dist/cli/lib/aider-scope.js.map +1 -0
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.d.ts +1 -1
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.d.ts.map +1 -1
- package/dist/cli/lib/arch/cage/target-architecture-doctor.d.ts +1 -1
- package/dist/cli/lib/arch/cage/target-architecture-doctor.d.ts.map +1 -1
- package/dist/cli/lib/arch/cage/target-architecture.d.ts +10 -8
- package/dist/cli/lib/arch/cage/target-architecture.d.ts.map +1 -1
- package/dist/cli/lib/arch/cage/target-architecture.js +57 -46
- package/dist/cli/lib/arch/cage/target-architecture.js.map +1 -1
- package/dist/cli/lib/arch/external/architecture-pointer.d.ts +1 -1
- package/dist/cli/lib/arch/external/architecture-pointer.d.ts.map +1 -1
- package/dist/cli/lib/arch/external/architecture-pointer.js +29 -32
- package/dist/cli/lib/arch/external/architecture-pointer.js.map +1 -1
- package/dist/cli/lib/attestation-receipt.js +2 -2
- package/dist/cli/lib/attestation-receipt.js.map +1 -1
- package/dist/cli/lib/break-glass.d.ts +1 -1
- package/dist/cli/lib/break-glass.d.ts.map +1 -1
- package/dist/cli/lib/break-glass.js +1 -1
- package/dist/cli/lib/break-glass.js.map +1 -1
- package/dist/cli/lib/cli-io.d.ts +2 -0
- package/dist/cli/lib/cli-io.d.ts.map +1 -1
- package/dist/cli/lib/cli-io.js +9 -1
- package/dist/cli/lib/cli-io.js.map +1 -1
- package/dist/cli/lib/command-boundary.js +3 -3
- package/dist/cli/lib/command-boundary.js.map +1 -1
- package/dist/cli/lib/command-reporter.d.ts +3 -5
- package/dist/cli/lib/command-reporter.d.ts.map +1 -1
- package/dist/cli/lib/command-reporter.js +0 -5
- package/dist/cli/lib/command-reporter.js.map +1 -1
- package/dist/cli/lib/config-namespace.js +1 -1
- package/dist/cli/lib/config-namespace.js.map +1 -1
- package/dist/cli/lib/context-feed-remediation.d.ts +3 -3
- package/dist/cli/lib/context-feed-remediation.d.ts.map +1 -1
- package/dist/cli/lib/context-feed-remediation.js +4 -4
- package/dist/cli/lib/context-feed-remediation.js.map +1 -1
- package/dist/cli/lib/context-feed-store.d.ts +1 -1
- package/dist/cli/lib/context-feed-store.d.ts.map +1 -1
- package/dist/cli/lib/context-request.js +1 -1
- package/dist/cli/lib/context-request.js.map +1 -1
- package/dist/cli/lib/contract/contract-drift.d.ts +20 -0
- package/dist/cli/lib/contract/contract-drift.d.ts.map +1 -0
- package/dist/cli/lib/contract/contract-drift.js +75 -0
- package/dist/cli/lib/contract/contract-drift.js.map +1 -0
- package/dist/cli/lib/contract/contract-scan.js +1 -1
- package/dist/cli/lib/contract/contract-scan.js.map +1 -1
- package/dist/cli/lib/contract/embedding-provider.d.ts +28 -0
- package/dist/cli/lib/contract/embedding-provider.d.ts.map +1 -0
- package/dist/cli/lib/contract/embedding-provider.js +145 -0
- package/dist/cli/lib/contract/embedding-provider.js.map +1 -0
- package/dist/cli/lib/contract/intent-path-tokens.d.ts +7 -0
- package/dist/cli/lib/contract/intent-path-tokens.d.ts.map +1 -0
- package/dist/cli/lib/contract/intent-path-tokens.js +30 -0
- package/dist/cli/lib/contract/intent-path-tokens.js.map +1 -0
- package/dist/cli/lib/contract/preflight-heuristic.d.ts +11 -0
- package/dist/cli/lib/contract/preflight-heuristic.d.ts.map +1 -0
- package/dist/cli/lib/contract/preflight-heuristic.js +38 -0
- package/dist/cli/lib/contract/preflight-heuristic.js.map +1 -0
- package/dist/cli/lib/contract/preflight-jev.d.ts +54 -0
- package/dist/cli/lib/contract/preflight-jev.d.ts.map +1 -0
- package/dist/cli/lib/contract/preflight-jev.js +247 -0
- package/dist/cli/lib/contract/preflight-jev.js.map +1 -0
- package/dist/cli/lib/contract/preflight-types.d.ts +19 -0
- package/dist/cli/lib/contract/preflight-types.d.ts.map +1 -0
- package/dist/cli/lib/contract/preflight-types.js +9 -0
- package/dist/cli/lib/contract/preflight-types.js.map +1 -0
- package/dist/cli/lib/contract/preflight.d.ts +16 -0
- package/dist/cli/lib/contract/preflight.d.ts.map +1 -0
- package/dist/cli/lib/contract/preflight.js +34 -0
- package/dist/cli/lib/contract/preflight.js.map +1 -0
- package/dist/cli/lib/contract/propose-imports.js +1 -1
- package/dist/cli/lib/contract/propose-imports.js.map +1 -1
- package/dist/cli/lib/contract/propose.d.ts.map +1 -1
- package/dist/cli/lib/contract/propose.js +2 -23
- package/dist/cli/lib/contract/propose.js.map +1 -1
- package/dist/cli/lib/contract/vector-store.d.ts +43 -0
- package/dist/cli/lib/contract/vector-store.d.ts.map +1 -0
- package/dist/cli/lib/contract/vector-store.js +89 -0
- package/dist/cli/lib/contract/vector-store.js.map +1 -0
- package/dist/cli/lib/defensive-guard.js +1 -1
- package/dist/cli/lib/defensive-guard.js.map +1 -1
- package/dist/cli/lib/deps/deps-fetch.js +1 -1
- package/dist/cli/lib/deps/deps-fetch.js.map +1 -1
- package/dist/cli/lib/dirty-missions.js +1 -1
- package/dist/cli/lib/dirty-missions.js.map +1 -1
- package/dist/cli/lib/{doctor-adapter-preflight.d.ts → doctor/doctor-adapter-preflight.d.ts} +2 -2
- package/dist/cli/lib/doctor/doctor-adapter-preflight.d.ts.map +1 -0
- package/dist/cli/lib/{doctor-adapter-preflight.js → doctor/doctor-adapter-preflight.js} +5 -4
- package/dist/cli/lib/doctor/doctor-adapter-preflight.js.map +1 -0
- package/dist/cli/lib/{doctor-core.d.ts → doctor/doctor-core.d.ts} +1 -1
- package/dist/cli/lib/doctor/doctor-core.d.ts.map +1 -0
- package/dist/cli/lib/{doctor-core.js → doctor/doctor-core.js} +18 -18
- package/dist/cli/lib/doctor/doctor-core.js.map +1 -0
- package/dist/cli/lib/{doctor-integration.d.ts → doctor/doctor-integration.d.ts} +1 -1
- package/dist/cli/lib/doctor/doctor-integration.d.ts.map +1 -0
- package/dist/cli/lib/{doctor-integration.js → doctor/doctor-integration.js} +2 -2
- package/dist/cli/lib/doctor/doctor-integration.js.map +1 -0
- package/dist/cli/lib/doctor/doctor-substrate.d.ts.map +1 -0
- package/dist/cli/lib/{doctor-substrate.js → doctor/doctor-substrate.js} +3 -3
- package/dist/cli/lib/doctor/doctor-substrate.js.map +1 -0
- package/dist/cli/lib/doctor/doctor-types.d.ts.map +1 -0
- package/dist/cli/lib/doctor/doctor-types.js.map +1 -0
- package/dist/cli/lib/doctor-preflight/eslint.d.ts +1 -1
- package/dist/cli/lib/doctor-preflight/eslint.d.ts.map +1 -1
- package/dist/cli/lib/doctor-preflight/eslint.js +2 -2
- package/dist/cli/lib/doctor-preflight/eslint.js.map +1 -1
- package/dist/cli/lib/doctor-preflight/tsc.d.ts +1 -1
- package/dist/cli/lib/doctor-preflight/tsc.d.ts.map +1 -1
- package/dist/cli/lib/doctor-preflight/tsc.js +1 -1
- package/dist/cli/lib/doctor-preflight/tsc.js.map +1 -1
- package/dist/cli/lib/domains/domain-code.d.ts.map +1 -1
- package/dist/cli/lib/domains/domain-code.js +2 -0
- package/dist/cli/lib/domains/domain-code.js.map +1 -1
- package/dist/cli/lib/domains/domain-content.d.ts.map +1 -1
- package/dist/cli/lib/domains/domain-content.js +3 -0
- package/dist/cli/lib/domains/domain-content.js.map +1 -1
- package/dist/cli/lib/draft-token.js +1 -1
- package/dist/cli/lib/draft-token.js.map +1 -1
- package/dist/cli/lib/executor-log-integrity.d.ts +1 -1
- package/dist/cli/lib/executor-log-integrity.d.ts.map +1 -1
- package/dist/cli/lib/fix-hints.d.ts +1 -0
- package/dist/cli/lib/fix-hints.d.ts.map +1 -1
- package/dist/cli/lib/fix-hints.js +7 -0
- package/dist/cli/lib/fix-hints.js.map +1 -1
- package/dist/cli/lib/flight-telemetry-doctor.d.ts +1 -1
- package/dist/cli/lib/flight-telemetry-doctor.d.ts.map +1 -1
- package/dist/cli/lib/gate-adapters/adapter-findings.d.ts +1 -1
- package/dist/cli/lib/gate-adapters/adapter-findings.d.ts.map +1 -1
- package/dist/cli/lib/gate-adapters/adapter-findings.js +2 -2
- package/dist/cli/lib/gate-adapters/adapter-findings.js.map +1 -1
- package/dist/cli/lib/gate-adapters/eslint-json-adapter.d.ts +1 -1
- package/dist/cli/lib/gate-adapters/eslint-json-adapter.d.ts.map +1 -1
- package/dist/cli/lib/gate-adapters/gate-adapter-types.d.ts +1 -1
- package/dist/cli/lib/gate-adapters/gate-adapter-types.d.ts.map +1 -1
- package/dist/cli/lib/gate-adapters/tsc-adapter.d.ts +1 -1
- package/dist/cli/lib/gate-adapters/tsc-adapter.d.ts.map +1 -1
- package/dist/cli/lib/git/git-hooks.d.ts +28 -0
- package/dist/cli/lib/git/git-hooks.d.ts.map +1 -0
- package/dist/cli/lib/git/git-hooks.js +52 -0
- package/dist/cli/lib/git/git-hooks.js.map +1 -0
- package/dist/cli/lib/git/git-metrics.d.ts.map +1 -0
- package/dist/cli/lib/{git-metrics.js → git/git-metrics.js} +3 -3
- package/dist/cli/lib/git/git-metrics.js.map +1 -0
- package/dist/cli/lib/git/git-proof.d.ts.map +1 -0
- package/dist/cli/lib/{git-proof.js → git/git-proof.js} +11 -11
- package/dist/cli/lib/git/git-proof.js.map +1 -0
- package/dist/cli/lib/git/git-staged.d.ts.map +1 -0
- package/dist/cli/lib/git/git-staged.js.map +1 -0
- package/dist/cli/lib/git/git.d.ts.map +1 -0
- package/dist/cli/lib/{git.js → git/git.js} +1 -1
- package/dist/cli/lib/git/git.js.map +1 -0
- package/dist/cli/lib/gxt-error-codes.d.ts +1 -0
- package/dist/cli/lib/gxt-error-codes.d.ts.map +1 -1
- package/dist/cli/lib/gxt-error-codes.js +2 -0
- package/dist/cli/lib/gxt-error-codes.js.map +1 -1
- package/dist/cli/lib/{init-asset-catalog.d.ts → init/init-asset-catalog.d.ts} +1 -1
- package/dist/cli/lib/init/init-asset-catalog.d.ts.map +1 -0
- package/dist/cli/lib/{init-asset-catalog.js → init/init-asset-catalog.js} +1 -1
- package/dist/cli/lib/init/init-asset-catalog.js.map +1 -0
- package/dist/cli/lib/{init-compose.d.ts → init/init-compose.d.ts} +2 -2
- package/dist/cli/lib/init/init-compose.d.ts.map +1 -0
- package/dist/cli/lib/{init-compose.js → init/init-compose.js} +2 -2
- package/dist/cli/lib/init/init-compose.js.map +1 -0
- package/dist/cli/lib/{init-defensive-profile.d.ts → init/init-defensive-profile.d.ts} +1 -1
- package/dist/cli/lib/init/init-defensive-profile.d.ts.map +1 -0
- package/dist/cli/lib/{init-defensive-profile.js → init/init-defensive-profile.js} +1 -1
- package/dist/cli/lib/init/init-defensive-profile.js.map +1 -0
- package/dist/cli/lib/{init-discover.d.ts → init/init-discover.d.ts} +2 -2
- package/dist/cli/lib/init/init-discover.d.ts.map +1 -0
- package/dist/cli/lib/{init-discover.js → init/init-discover.js} +3 -3
- package/dist/cli/lib/init/init-discover.js.map +1 -0
- package/dist/cli/lib/init/init-interactive.d.ts.map +1 -0
- package/dist/cli/lib/{init-interactive.js → init/init-interactive.js} +2 -2
- package/dist/cli/lib/init/init-interactive.js.map +1 -0
- package/dist/cli/lib/init/init-plan.d.ts.map +1 -0
- package/dist/cli/lib/{init-plan.js → init/init-plan.js} +4 -4
- package/dist/cli/lib/init/init-plan.js.map +1 -0
- package/dist/cli/lib/{init-profile.d.ts → init/init-profile.d.ts} +2 -2
- package/dist/cli/lib/init/init-profile.d.ts.map +1 -0
- package/dist/cli/lib/{init-profile.js → init/init-profile.js} +1 -1
- package/dist/cli/lib/init/init-profile.js.map +1 -0
- package/dist/cli/lib/init/init-tutorial.d.ts.map +1 -0
- package/dist/cli/lib/{init-tutorial.js → init/init-tutorial.js} +8 -8
- package/dist/cli/lib/init/init-tutorial.js.map +1 -0
- package/dist/cli/lib/interrogate/gaps.js +1 -1
- package/dist/cli/lib/interrogate/gaps.js.map +1 -1
- package/dist/cli/lib/kpi-advisory-findings.d.ts +1 -1
- package/dist/cli/lib/kpi-advisory-findings.d.ts.map +1 -1
- package/dist/cli/lib/kpi-advisory-findings.js +1 -1
- package/dist/cli/lib/kpi-advisory-findings.js.map +1 -1
- package/dist/cli/lib/kpi-engine.d.ts +2 -2
- package/dist/cli/lib/kpi-engine.d.ts.map +1 -1
- package/dist/cli/lib/kpi-engine.js +1 -1
- package/dist/cli/lib/kpi-engine.js.map +1 -1
- package/dist/cli/lib/ledger/ledger-append.js +1 -1
- package/dist/cli/lib/ledger/ledger-append.js.map +1 -1
- package/dist/cli/lib/ledger/ledger-chain.js +1 -1
- package/dist/cli/lib/ledger/ledger-chain.js.map +1 -1
- package/dist/cli/lib/{legislate-forbidden-zone.d.ts → legislate/legislate-forbidden-zone.d.ts} +1 -1
- package/dist/cli/lib/legislate/legislate-forbidden-zone.d.ts.map +1 -0
- package/dist/cli/lib/{legislate-forbidden-zone.js → legislate/legislate-forbidden-zone.js} +1 -1
- package/dist/cli/lib/legislate/legislate-forbidden-zone.js.map +1 -0
- package/dist/cli/lib/{legislate-from-intent.d.ts → legislate/legislate-from-intent.d.ts} +2 -0
- package/dist/cli/lib/legislate/legislate-from-intent.d.ts.map +1 -0
- package/dist/cli/lib/{legislate-from-intent.js → legislate/legislate-from-intent.js} +38 -6
- package/dist/cli/lib/legislate/legislate-from-intent.js.map +1 -0
- package/dist/cli/lib/{legislate-gate-options.d.ts → legislate/legislate-gate-options.d.ts} +1 -1
- package/dist/cli/lib/legislate/legislate-gate-options.d.ts.map +1 -0
- package/dist/cli/lib/{legislate-gate-options.js → legislate/legislate-gate-options.js} +1 -1
- package/dist/cli/lib/legislate/legislate-gate-options.js.map +1 -0
- package/dist/cli/lib/legislate/legislate-policy-warn.d.ts.map +1 -0
- package/dist/cli/lib/{legislate-policy-warn.js → legislate/legislate-policy-warn.js} +2 -2
- package/dist/cli/lib/legislate/legislate-policy-warn.js.map +1 -0
- package/dist/cli/lib/{legislate.d.ts → legislate/legislate.d.ts} +2 -2
- package/dist/cli/lib/legislate/legislate.d.ts.map +1 -0
- package/dist/cli/lib/{legislate.js → legislate/legislate.js} +19 -12
- package/dist/cli/lib/legislate/legislate.js.map +1 -0
- package/dist/cli/lib/mcp/mcp-check-signature.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-check-signature.js → mcp/mcp-check-signature.js} +4 -4
- package/dist/cli/lib/mcp/mcp-check-signature.js.map +1 -0
- package/dist/cli/lib/{mcp-doctor.d.ts → mcp/mcp-doctor.d.ts} +2 -2
- package/dist/cli/lib/mcp/mcp-doctor.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-doctor.js → mcp/mcp-doctor.js} +3 -3
- package/dist/cli/lib/mcp/mcp-doctor.js.map +1 -0
- package/dist/cli/lib/mcp/mcp-draft-legislation.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-draft-legislation.js → mcp/mcp-draft-legislation.js} +11 -11
- package/dist/cli/lib/mcp/mcp-draft-legislation.js.map +1 -0
- package/dist/cli/lib/mcp/mcp-execute-legislation.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-execute-legislation.js → mcp/mcp-execute-legislation.js} +4 -4
- package/dist/cli/lib/mcp/mcp-execute-legislation.js.map +1 -0
- package/dist/cli/lib/{mcp-governance-shared.d.ts → mcp/mcp-governance-shared.d.ts} +3 -3
- package/dist/cli/lib/mcp/mcp-governance-shared.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-governance-shared.js → mcp/mcp-governance-shared.js} +3 -3
- package/dist/cli/lib/mcp/mcp-governance-shared.js.map +1 -0
- package/dist/cli/lib/{mcp-interrogate.d.ts → mcp/mcp-interrogate.d.ts} +2 -2
- package/dist/cli/lib/mcp/mcp-interrogate.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-interrogate.js → mcp/mcp-interrogate.js} +4 -4
- package/dist/cli/lib/mcp/mcp-interrogate.js.map +1 -0
- package/dist/cli/lib/{mcp-org.d.ts → mcp/mcp-org.d.ts} +3 -3
- package/dist/cli/lib/mcp/mcp-org.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-org.js → mcp/mcp-org.js} +6 -6
- package/dist/cli/lib/mcp/mcp-org.js.map +1 -0
- package/dist/cli/lib/mcp/mcp-preflight-contract.d.ts +19 -0
- package/dist/cli/lib/mcp/mcp-preflight-contract.d.ts.map +1 -0
- package/dist/cli/lib/mcp/mcp-preflight-contract.js +31 -0
- package/dist/cli/lib/mcp/mcp-preflight-contract.js.map +1 -0
- package/dist/cli/lib/{mcp-propose-contract.d.ts → mcp/mcp-propose-contract.d.ts} +1 -1
- package/dist/cli/lib/mcp/mcp-propose-contract.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-propose-contract.js → mcp/mcp-propose-contract.js} +6 -6
- package/dist/cli/lib/mcp/mcp-propose-contract.js.map +1 -0
- package/dist/cli/lib/{mcp-runtime.d.ts → mcp/mcp-runtime.d.ts} +5 -5
- package/dist/cli/lib/mcp/mcp-runtime.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-runtime.js → mcp/mcp-runtime.js} +12 -11
- package/dist/cli/lib/mcp/mcp-runtime.js.map +1 -0
- package/dist/cli/lib/mcp/mcp-start-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-start-orchestration.js → mcp/mcp-start-orchestration.js} +3 -3
- package/dist/cli/lib/mcp/mcp-start-orchestration.js.map +1 -0
- package/dist/cli/lib/mcp/mcp-tools-register.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-tools-register.js → mcp/mcp-tools-register.js} +11 -2
- package/dist/cli/lib/mcp/mcp-tools-register.js.map +1 -0
- package/dist/cli/lib/{mcp-upgrade.d.ts → mcp/mcp-upgrade.d.ts} +2 -2
- package/dist/cli/lib/mcp/mcp-upgrade.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-upgrade.js → mcp/mcp-upgrade.js} +7 -7
- package/dist/cli/lib/mcp/mcp-upgrade.js.map +1 -0
- package/dist/cli/lib/{mcp-write-guard.d.ts → mcp/mcp-write-guard.d.ts} +2 -2
- package/dist/cli/lib/mcp/mcp-write-guard.d.ts.map +1 -0
- package/dist/cli/lib/{mcp-write-guard.js → mcp/mcp-write-guard.js} +4 -4
- package/dist/cli/lib/mcp/mcp-write-guard.js.map +1 -0
- package/dist/cli/lib/mission-arg.d.ts.map +1 -1
- package/dist/cli/lib/mission-arg.js +1 -1
- package/dist/cli/lib/mission-arg.js.map +1 -1
- package/dist/cli/lib/mission-changed.js +1 -1
- package/dist/cli/lib/mission-changed.js.map +1 -1
- package/dist/cli/lib/missions/adapter-command-guard.d.ts +10 -0
- package/dist/cli/lib/missions/adapter-command-guard.d.ts.map +1 -0
- package/dist/cli/lib/missions/adapter-command-guard.js +66 -0
- package/dist/cli/lib/missions/adapter-command-guard.js.map +1 -0
- package/dist/cli/lib/missions/parser.d.ts +0 -22
- package/dist/cli/lib/missions/parser.d.ts.map +1 -1
- package/dist/cli/lib/missions/parser.js +3 -110
- package/dist/cli/lib/missions/parser.js.map +1 -1
- package/dist/cli/lib/missions/resolution.d.ts +23 -0
- package/dist/cli/lib/missions/resolution.d.ts.map +1 -0
- package/dist/cli/lib/missions/resolution.js +114 -0
- package/dist/cli/lib/missions/resolution.js.map +1 -0
- package/dist/cli/lib/msn-allocate.d.ts.map +1 -1
- package/dist/cli/lib/msn-allocate.js +3 -2
- package/dist/cli/lib/msn-allocate.js.map +1 -1
- package/dist/cli/lib/output-context.d.ts +7 -2
- package/dist/cli/lib/output-context.d.ts.map +1 -1
- package/dist/cli/lib/output-context.js +17 -9
- package/dist/cli/lib/output-context.js.map +1 -1
- package/dist/cli/lib/perimeter.js +2 -2
- package/dist/cli/lib/perimeter.js.map +1 -1
- package/dist/cli/lib/planner-identity.js +1 -1
- package/dist/cli/lib/planner-identity.js.map +1 -1
- package/dist/cli/lib/planner-signature.js +1 -1
- package/dist/cli/lib/planner-signature.js.map +1 -1
- package/dist/cli/lib/policy/policy-doctor.d.ts +1 -1
- package/dist/cli/lib/policy/policy-doctor.d.ts.map +1 -1
- package/dist/cli/lib/policy/policy-fetch.js +1 -1
- package/dist/cli/lib/policy/policy-fetch.js.map +1 -1
- package/dist/cli/lib/policy-digest-doctor.d.ts +1 -1
- package/dist/cli/lib/policy-digest-doctor.d.ts.map +1 -1
- package/dist/cli/lib/receipt-attribution.js +1 -1
- package/dist/cli/lib/receipt-attribution.js.map +1 -1
- package/dist/cli/lib/receipt-signing.js +1 -1
- package/dist/cli/lib/receipt-signing.js.map +1 -1
- package/dist/cli/lib/report/report-demo-fixtures.d.ts.map +1 -0
- package/dist/cli/lib/report/report-demo-fixtures.js.map +1 -0
- package/dist/cli/lib/report/report-demo-mode.d.ts.map +1 -0
- package/dist/cli/lib/{report-demo-mode.js → report/report-demo-mode.js} +1 -1
- package/dist/cli/lib/report/report-demo-mode.js.map +1 -0
- package/dist/cli/lib/{report-overview-projector.d.ts → report/report-overview-projector.d.ts} +3 -3
- package/dist/cli/lib/report/report-overview-projector.d.ts.map +1 -0
- package/dist/cli/lib/{report-overview-projector.js → report/report-overview-projector.js} +5 -5
- package/dist/cli/lib/report/report-overview-projector.js.map +1 -0
- package/dist/cli/lib/{report-projector.d.ts → report/report-projector.d.ts} +2 -2
- package/dist/cli/lib/report/report-projector.d.ts.map +1 -0
- package/dist/cli/lib/{report-projector.js → report/report-projector.js} +1 -1
- package/dist/cli/lib/report/report-projector.js.map +1 -0
- package/dist/cli/lib/report/report-server.d.ts.map +1 -0
- package/dist/cli/lib/{report-server.js → report/report-server.js} +3 -3
- package/dist/cli/lib/report/report-server.js.map +1 -0
- package/dist/cli/lib/report/report-template-css.d.ts.map +1 -0
- package/dist/cli/lib/report/report-template-css.js.map +1 -0
- package/dist/cli/lib/report/report-template-html.d.ts.map +1 -0
- package/dist/cli/lib/report/report-template-html.js.map +1 -0
- package/dist/cli/lib/report/report-template-overview.d.ts.map +1 -0
- package/dist/cli/lib/report/report-template-overview.js.map +1 -0
- package/dist/cli/lib/{report-template-shared.d.ts → report/report-template-shared.d.ts} +1 -1
- package/dist/cli/lib/report/report-template-shared.d.ts.map +1 -0
- package/dist/cli/lib/report/report-template-shared.js.map +1 -0
- package/dist/cli/lib/runtime-env.d.ts.map +1 -1
- package/dist/cli/lib/runtime-env.js +1 -0
- package/dist/cli/lib/runtime-env.js.map +1 -1
- package/dist/cli/lib/sarif-uri.d.ts +3 -0
- package/dist/cli/lib/sarif-uri.d.ts.map +1 -0
- package/dist/cli/lib/sarif-uri.js +15 -0
- package/dist/cli/lib/sarif-uri.js.map +1 -0
- package/dist/cli/lib/staged-tmvc-guard.d.ts.map +1 -1
- package/dist/cli/lib/staged-tmvc-guard.js +3 -2
- package/dist/cli/lib/staged-tmvc-guard.js.map +1 -1
- package/dist/cli/lib/start-orchestration.js +2 -2
- package/dist/cli/lib/start-orchestration.js.map +1 -1
- package/dist/cli/lib/status-report.d.ts +1 -1
- package/dist/cli/lib/status-report.d.ts.map +1 -1
- package/dist/cli/lib/status-report.js +2 -2
- package/dist/cli/lib/status-report.js.map +1 -1
- package/dist/cli/lib/surgeons/registry.d.ts +1 -1
- package/dist/cli/lib/surgeons/registry.d.ts.map +1 -1
- package/dist/cli/lib/trace-evidence.js +1 -1
- package/dist/cli/lib/trace-evidence.js.map +1 -1
- package/dist/cli/lib/upgrade/upgrade-apply.d.ts.map +1 -0
- package/dist/cli/lib/{upgrade-apply.js → upgrade/upgrade-apply.js} +12 -12
- package/dist/cli/lib/upgrade/upgrade-apply.js.map +1 -0
- package/dist/cli/lib/{upgrade-plan-catalog.d.ts → upgrade/upgrade-plan-catalog.d.ts} +3 -3
- package/dist/cli/lib/upgrade/upgrade-plan-catalog.d.ts.map +1 -0
- package/dist/cli/lib/{upgrade-plan-catalog.js → upgrade/upgrade-plan-catalog.js} +4 -4
- package/dist/cli/lib/upgrade/upgrade-plan-catalog.js.map +1 -0
- package/dist/cli/lib/upgrade/upgrade-plan-payload.d.ts.map +1 -0
- package/dist/cli/lib/upgrade/upgrade-plan-payload.js.map +1 -0
- package/dist/cli/lib/{upgrade-plan-scaffold.d.ts → upgrade/upgrade-plan-scaffold.d.ts} +1 -1
- package/dist/cli/lib/upgrade/upgrade-plan-scaffold.d.ts.map +1 -0
- package/dist/cli/lib/{upgrade-plan-scaffold.js → upgrade/upgrade-plan-scaffold.js} +4 -4
- package/dist/cli/lib/upgrade/upgrade-plan-scaffold.js.map +1 -0
- package/dist/cli/lib/upgrade/upgrade-plan-types.d.ts.map +1 -0
- package/dist/cli/lib/upgrade/upgrade-plan-types.js.map +1 -0
- package/dist/cli/lib/upgrade/upgrade-plan.d.ts.map +1 -0
- package/dist/cli/lib/{upgrade-plan.js → upgrade/upgrade-plan.js} +7 -7
- package/dist/cli/lib/upgrade/upgrade-plan.js.map +1 -0
- package/dist/cli/lib/verify/verify-contract.d.ts.map +1 -0
- package/dist/cli/lib/{verify-contract.js → verify/verify-contract.js} +7 -7
- package/dist/cli/lib/verify/verify-contract.js.map +1 -0
- package/dist/cli/lib/{verify-defensive-phase.d.ts → verify/verify-defensive-phase.d.ts} +1 -1
- package/dist/cli/lib/verify/verify-defensive-phase.d.ts.map +1 -0
- package/dist/cli/lib/{verify-defensive-phase.js → verify/verify-defensive-phase.js} +1 -1
- package/dist/cli/lib/verify/verify-defensive-phase.js.map +1 -0
- package/dist/cli/lib/{verify-engine.d.ts → verify/verify-engine.d.ts} +2 -2
- package/dist/cli/lib/verify/verify-engine.d.ts.map +1 -0
- package/dist/cli/lib/{verify-engine.js → verify/verify-engine.js} +6 -6
- package/dist/cli/lib/verify/verify-engine.js.map +1 -0
- package/dist/cli/lib/verify/verify-evidence-snippet.d.ts.map +1 -0
- package/dist/cli/lib/verify/verify-evidence-snippet.js.map +1 -0
- package/dist/cli/lib/verify/verify-export.d.ts +22 -0
- package/dist/cli/lib/verify/verify-export.d.ts.map +1 -0
- package/dist/cli/lib/{verify-export.js → verify/verify-export.js} +49 -26
- package/dist/cli/lib/verify/verify-export.js.map +1 -0
- package/dist/cli/lib/{verify-failure-normalize.d.ts → verify/verify-failure-normalize.d.ts} +3 -3
- package/dist/cli/lib/verify/verify-failure-normalize.d.ts.map +1 -0
- package/dist/cli/lib/{verify-failure-normalize.js → verify/verify-failure-normalize.js} +5 -5
- package/dist/cli/lib/verify/verify-failure-normalize.js.map +1 -0
- package/dist/cli/lib/{verify-failure.d.ts → verify/verify-failure.d.ts} +4 -4
- package/dist/cli/lib/verify/verify-failure.d.ts.map +1 -0
- package/dist/cli/lib/verify/verify-failure.js.map +1 -0
- package/dist/cli/lib/verify/verify-finding-fingerprint.d.ts.map +1 -0
- package/dist/cli/lib/{verify-finding-fingerprint.js → verify/verify-finding-fingerprint.js} +1 -1
- package/dist/cli/lib/verify/verify-finding-fingerprint.js.map +1 -0
- package/dist/cli/lib/verify/verify-finding-gate-projector.d.ts.map +1 -0
- package/dist/cli/lib/{verify-finding-gate-projector.js → verify/verify-finding-gate-projector.js} +2 -2
- package/dist/cli/lib/verify/verify-finding-gate-projector.js.map +1 -0
- package/dist/cli/lib/verify/verify-finding.d.ts.map +1 -0
- package/dist/cli/lib/verify/verify-finding.js.map +1 -0
- package/dist/cli/lib/{verify-hints.d.ts → verify/verify-hints.d.ts} +2 -2
- package/dist/cli/lib/verify/verify-hints.d.ts.map +1 -0
- package/dist/cli/lib/{verify-hints.js → verify/verify-hints.js} +4 -4
- package/dist/cli/lib/verify/verify-hints.js.map +1 -0
- package/dist/cli/lib/{verify-interrogation.d.ts → verify/verify-interrogation.d.ts} +1 -1
- package/dist/cli/lib/verify/verify-interrogation.d.ts.map +1 -0
- package/dist/cli/lib/{verify-interrogation.js → verify/verify-interrogation.js} +9 -9
- package/dist/cli/lib/verify/verify-interrogation.js.map +1 -0
- package/dist/cli/lib/{verify-options.d.ts → verify/verify-options.d.ts} +3 -3
- package/dist/cli/lib/verify/verify-options.d.ts.map +1 -0
- package/dist/cli/lib/verify/verify-options.js.map +1 -0
- package/dist/cli/lib/{verify-org-phases.d.ts → verify/verify-org-phases.d.ts} +1 -1
- package/dist/cli/lib/verify/verify-org-phases.d.ts.map +1 -0
- package/dist/cli/lib/{verify-org-phases.js → verify/verify-org-phases.js} +4 -4
- package/dist/cli/lib/verify/verify-org-phases.js.map +1 -0
- package/dist/cli/lib/{verify-payload.d.ts → verify/verify-payload.d.ts} +2 -2
- package/dist/cli/lib/verify/verify-payload.d.ts.map +1 -0
- package/dist/cli/lib/{verify-payload.js → verify/verify-payload.js} +3 -3
- package/dist/cli/lib/verify/verify-payload.js.map +1 -0
- package/dist/cli/lib/verify/verify-phase-clock.d.ts.map +1 -0
- package/dist/cli/lib/verify/verify-phase-clock.js.map +1 -0
- package/dist/cli/lib/{verify-phase-steps.d.ts → verify/verify-phase-steps.d.ts} +2 -2
- package/dist/cli/lib/verify/verify-phase-steps.d.ts.map +1 -0
- package/dist/cli/lib/{verify-phase-steps.js → verify/verify-phase-steps.js} +8 -8
- package/dist/cli/lib/verify/verify-phase-steps.js.map +1 -0
- package/dist/cli/lib/{verify-presenters.d.ts → verify/verify-presenters.d.ts} +9 -5
- package/dist/cli/lib/verify/verify-presenters.d.ts.map +1 -0
- package/dist/cli/lib/{verify-presenters.js → verify/verify-presenters.js} +44 -22
- package/dist/cli/lib/verify/verify-presenters.js.map +1 -0
- package/dist/cli/lib/{verify-remediation-pipeline.d.ts → verify/verify-remediation-pipeline.d.ts} +2 -2
- package/dist/cli/lib/verify/verify-remediation-pipeline.d.ts.map +1 -0
- package/dist/cli/lib/{verify-remediation-pipeline.js → verify/verify-remediation-pipeline.js} +3 -3
- package/dist/cli/lib/verify/verify-remediation-pipeline.js.map +1 -0
- package/dist/cli/lib/{verify-run-ring.d.ts → verify/verify-run-ring.d.ts} +1 -1
- package/dist/cli/lib/verify/verify-run-ring.d.ts.map +1 -0
- package/dist/cli/lib/{verify-run-ring.js → verify/verify-run-ring.js} +2 -2
- package/dist/cli/lib/verify/verify-run-ring.js.map +1 -0
- package/dist/cli/lib/{verify-run.d.ts → verify/verify-run.d.ts} +1 -1
- package/dist/cli/lib/verify/verify-run.d.ts.map +1 -0
- package/dist/cli/lib/{verify-run.js → verify/verify-run.js} +8 -8
- package/dist/cli/lib/verify/verify-run.js.map +1 -0
- package/dist/cli/lib/version.gen.d.ts +1 -1
- package/dist/cli/lib/version.gen.js +1 -1
- package/dist/cli/lib/workspace.js +1 -1
- package/dist/cli/lib/workspace.js.map +1 -1
- package/dist/cli/program-audience-hook.d.ts +4 -0
- package/dist/cli/program-audience-hook.d.ts.map +1 -0
- package/dist/cli/program-audience-hook.js +85 -0
- package/dist/cli/program-audience-hook.js.map +1 -0
- package/dist/cli/program-core.d.ts.map +1 -1
- package/dist/cli/program-core.js +23 -0
- package/dist/cli/program-core.js.map +1 -1
- package/dist/cli/program-mission.d.ts.map +1 -1
- package/dist/cli/program-mission.js +53 -5
- package/dist/cli/program-mission.js.map +1 -1
- package/dist/cli/program-workflow.d.ts +3 -1
- package/dist/cli/program-workflow.d.ts.map +1 -1
- package/dist/cli/program-workflow.js +31 -4
- package/dist/cli/program-workflow.js.map +1 -1
- package/dist/cli/program.js +1 -1
- package/dist/cli/program.js.map +1 -1
- package/package.json +5 -2
- package/templates/.cursor/mcp.json +1 -2
- package/templates/.cursor/rules/opengantry-gxt-substrate.mdc +1 -1
- package/templates/.gitagent/foreman/SUBSTRATE.version.json +1 -1
- package/templates/.gitagent/planner/MISSION-ARCHITECT.md +4 -2
- package/templates/.githooks/pre-commit +9 -2
- package/templates/integrations/asset-catalog.json +1 -0
- package/templates/integrations/compatibility.json +1 -1
- package/templates/integrations/recipes/aider.md +2 -1
- package/templates/integrations/recipes/cursor.md +1 -1
- package/templates/scripts/mcp-launcher.sh +11 -0
- package/templates/scripts/validate-mcp-dogfood.mjs +12 -7
- package/dist/cli/lib/doctor-adapter-preflight.d.ts.map +0 -1
- package/dist/cli/lib/doctor-adapter-preflight.js.map +0 -1
- package/dist/cli/lib/doctor-core.d.ts.map +0 -1
- package/dist/cli/lib/doctor-core.js.map +0 -1
- package/dist/cli/lib/doctor-integration.d.ts.map +0 -1
- package/dist/cli/lib/doctor-integration.js.map +0 -1
- package/dist/cli/lib/doctor-substrate.d.ts.map +0 -1
- package/dist/cli/lib/doctor-substrate.js.map +0 -1
- package/dist/cli/lib/doctor-types.d.ts.map +0 -1
- package/dist/cli/lib/doctor-types.js.map +0 -1
- package/dist/cli/lib/git-metrics.d.ts.map +0 -1
- package/dist/cli/lib/git-metrics.js.map +0 -1
- package/dist/cli/lib/git-proof.d.ts.map +0 -1
- package/dist/cli/lib/git-proof.js.map +0 -1
- package/dist/cli/lib/git-staged.d.ts.map +0 -1
- package/dist/cli/lib/git-staged.js.map +0 -1
- package/dist/cli/lib/git.d.ts.map +0 -1
- package/dist/cli/lib/git.js.map +0 -1
- package/dist/cli/lib/init-asset-catalog.d.ts.map +0 -1
- package/dist/cli/lib/init-asset-catalog.js.map +0 -1
- package/dist/cli/lib/init-compose.d.ts.map +0 -1
- package/dist/cli/lib/init-compose.js.map +0 -1
- package/dist/cli/lib/init-defensive-profile.d.ts.map +0 -1
- package/dist/cli/lib/init-defensive-profile.js.map +0 -1
- package/dist/cli/lib/init-discover.d.ts.map +0 -1
- package/dist/cli/lib/init-discover.js.map +0 -1
- package/dist/cli/lib/init-interactive.d.ts.map +0 -1
- package/dist/cli/lib/init-interactive.js.map +0 -1
- package/dist/cli/lib/init-plan.d.ts.map +0 -1
- package/dist/cli/lib/init-plan.js.map +0 -1
- package/dist/cli/lib/init-profile.d.ts.map +0 -1
- package/dist/cli/lib/init-profile.js.map +0 -1
- package/dist/cli/lib/init-tutorial.d.ts.map +0 -1
- package/dist/cli/lib/init-tutorial.js.map +0 -1
- package/dist/cli/lib/legislate-forbidden-zone.d.ts.map +0 -1
- package/dist/cli/lib/legislate-forbidden-zone.js.map +0 -1
- package/dist/cli/lib/legislate-from-intent.d.ts.map +0 -1
- package/dist/cli/lib/legislate-from-intent.js.map +0 -1
- package/dist/cli/lib/legislate-gate-options.d.ts.map +0 -1
- package/dist/cli/lib/legislate-gate-options.js.map +0 -1
- package/dist/cli/lib/legislate-policy-warn.d.ts.map +0 -1
- package/dist/cli/lib/legislate-policy-warn.js.map +0 -1
- package/dist/cli/lib/legislate.d.ts.map +0 -1
- package/dist/cli/lib/legislate.js.map +0 -1
- package/dist/cli/lib/mcp-check-signature.d.ts.map +0 -1
- package/dist/cli/lib/mcp-check-signature.js.map +0 -1
- package/dist/cli/lib/mcp-doctor.d.ts.map +0 -1
- package/dist/cli/lib/mcp-doctor.js.map +0 -1
- package/dist/cli/lib/mcp-draft-legislation.d.ts.map +0 -1
- package/dist/cli/lib/mcp-draft-legislation.js.map +0 -1
- package/dist/cli/lib/mcp-execute-legislation.d.ts.map +0 -1
- package/dist/cli/lib/mcp-execute-legislation.js.map +0 -1
- package/dist/cli/lib/mcp-governance-shared.d.ts.map +0 -1
- package/dist/cli/lib/mcp-governance-shared.js.map +0 -1
- package/dist/cli/lib/mcp-interrogate.d.ts.map +0 -1
- package/dist/cli/lib/mcp-interrogate.js.map +0 -1
- package/dist/cli/lib/mcp-org.d.ts.map +0 -1
- package/dist/cli/lib/mcp-org.js.map +0 -1
- package/dist/cli/lib/mcp-propose-contract.d.ts.map +0 -1
- package/dist/cli/lib/mcp-propose-contract.js.map +0 -1
- package/dist/cli/lib/mcp-runtime.d.ts.map +0 -1
- package/dist/cli/lib/mcp-runtime.js.map +0 -1
- package/dist/cli/lib/mcp-start-orchestration.d.ts.map +0 -1
- package/dist/cli/lib/mcp-start-orchestration.js.map +0 -1
- package/dist/cli/lib/mcp-tools-register.d.ts.map +0 -1
- package/dist/cli/lib/mcp-tools-register.js.map +0 -1
- package/dist/cli/lib/mcp-upgrade.d.ts.map +0 -1
- package/dist/cli/lib/mcp-upgrade.js.map +0 -1
- package/dist/cli/lib/mcp-write-guard.d.ts.map +0 -1
- package/dist/cli/lib/mcp-write-guard.js.map +0 -1
- package/dist/cli/lib/program-audience-hook.d.ts +0 -4
- package/dist/cli/lib/program-audience-hook.d.ts.map +0 -1
- package/dist/cli/lib/program-audience-hook.js +0 -35
- package/dist/cli/lib/program-audience-hook.js.map +0 -1
- package/dist/cli/lib/report-demo-fixtures.d.ts.map +0 -1
- package/dist/cli/lib/report-demo-fixtures.js.map +0 -1
- package/dist/cli/lib/report-demo-mode.d.ts.map +0 -1
- package/dist/cli/lib/report-demo-mode.js.map +0 -1
- package/dist/cli/lib/report-overview-projector.d.ts.map +0 -1
- package/dist/cli/lib/report-overview-projector.js.map +0 -1
- package/dist/cli/lib/report-projector.d.ts.map +0 -1
- package/dist/cli/lib/report-projector.js.map +0 -1
- package/dist/cli/lib/report-server.d.ts.map +0 -1
- package/dist/cli/lib/report-server.js.map +0 -1
- package/dist/cli/lib/report-template-css.d.ts.map +0 -1
- package/dist/cli/lib/report-template-css.js.map +0 -1
- package/dist/cli/lib/report-template-html.d.ts.map +0 -1
- package/dist/cli/lib/report-template-html.js.map +0 -1
- package/dist/cli/lib/report-template-overview.d.ts.map +0 -1
- package/dist/cli/lib/report-template-overview.js.map +0 -1
- package/dist/cli/lib/report-template-shared.d.ts.map +0 -1
- package/dist/cli/lib/report-template-shared.js.map +0 -1
- package/dist/cli/lib/upgrade-apply.d.ts.map +0 -1
- package/dist/cli/lib/upgrade-apply.js.map +0 -1
- package/dist/cli/lib/upgrade-plan-catalog.d.ts.map +0 -1
- package/dist/cli/lib/upgrade-plan-catalog.js.map +0 -1
- package/dist/cli/lib/upgrade-plan-payload.d.ts.map +0 -1
- package/dist/cli/lib/upgrade-plan-payload.js.map +0 -1
- package/dist/cli/lib/upgrade-plan-scaffold.d.ts.map +0 -1
- package/dist/cli/lib/upgrade-plan-scaffold.js.map +0 -1
- package/dist/cli/lib/upgrade-plan-types.d.ts.map +0 -1
- package/dist/cli/lib/upgrade-plan-types.js.map +0 -1
- package/dist/cli/lib/upgrade-plan.d.ts.map +0 -1
- package/dist/cli/lib/upgrade-plan.js.map +0 -1
- package/dist/cli/lib/verify-contract.d.ts.map +0 -1
- package/dist/cli/lib/verify-contract.js.map +0 -1
- package/dist/cli/lib/verify-defensive-phase.d.ts.map +0 -1
- package/dist/cli/lib/verify-defensive-phase.js.map +0 -1
- package/dist/cli/lib/verify-engine.d.ts.map +0 -1
- package/dist/cli/lib/verify-engine.js.map +0 -1
- package/dist/cli/lib/verify-evidence-snippet.d.ts.map +0 -1
- package/dist/cli/lib/verify-evidence-snippet.js.map +0 -1
- package/dist/cli/lib/verify-export.d.ts +0 -6
- package/dist/cli/lib/verify-export.d.ts.map +0 -1
- package/dist/cli/lib/verify-export.js.map +0 -1
- package/dist/cli/lib/verify-failure-normalize.d.ts.map +0 -1
- package/dist/cli/lib/verify-failure-normalize.js.map +0 -1
- package/dist/cli/lib/verify-failure.d.ts.map +0 -1
- package/dist/cli/lib/verify-failure.js.map +0 -1
- package/dist/cli/lib/verify-finding-fingerprint.d.ts.map +0 -1
- package/dist/cli/lib/verify-finding-fingerprint.js.map +0 -1
- package/dist/cli/lib/verify-finding-gate-projector.d.ts.map +0 -1
- package/dist/cli/lib/verify-finding-gate-projector.js.map +0 -1
- package/dist/cli/lib/verify-finding.d.ts.map +0 -1
- package/dist/cli/lib/verify-finding.js.map +0 -1
- package/dist/cli/lib/verify-hints.d.ts.map +0 -1
- package/dist/cli/lib/verify-hints.js.map +0 -1
- package/dist/cli/lib/verify-interrogation.d.ts.map +0 -1
- package/dist/cli/lib/verify-interrogation.js.map +0 -1
- package/dist/cli/lib/verify-options.d.ts.map +0 -1
- package/dist/cli/lib/verify-options.js.map +0 -1
- package/dist/cli/lib/verify-org-phases.d.ts.map +0 -1
- package/dist/cli/lib/verify-org-phases.js.map +0 -1
- package/dist/cli/lib/verify-payload.d.ts.map +0 -1
- package/dist/cli/lib/verify-payload.js.map +0 -1
- package/dist/cli/lib/verify-phase-clock.d.ts.map +0 -1
- package/dist/cli/lib/verify-phase-clock.js.map +0 -1
- package/dist/cli/lib/verify-phase-steps.d.ts.map +0 -1
- package/dist/cli/lib/verify-phase-steps.js.map +0 -1
- package/dist/cli/lib/verify-presenters.d.ts.map +0 -1
- package/dist/cli/lib/verify-presenters.js.map +0 -1
- package/dist/cli/lib/verify-remediation-pipeline.d.ts.map +0 -1
- package/dist/cli/lib/verify-remediation-pipeline.js.map +0 -1
- package/dist/cli/lib/verify-run-ring.d.ts.map +0 -1
- package/dist/cli/lib/verify-run-ring.js.map +0 -1
- package/dist/cli/lib/verify-run.d.ts.map +0 -1
- package/dist/cli/lib/verify-run.js.map +0 -1
- /package/dist/cli/lib/{doctor-substrate.d.ts → doctor/doctor-substrate.d.ts} +0 -0
- /package/dist/cli/lib/{doctor-types.d.ts → doctor/doctor-types.d.ts} +0 -0
- /package/dist/cli/lib/{doctor-types.js → doctor/doctor-types.js} +0 -0
- /package/dist/cli/lib/{git-metrics.d.ts → git/git-metrics.d.ts} +0 -0
- /package/dist/cli/lib/{git-proof.d.ts → git/git-proof.d.ts} +0 -0
- /package/dist/cli/lib/{git-staged.d.ts → git/git-staged.d.ts} +0 -0
- /package/dist/cli/lib/{git-staged.js → git/git-staged.js} +0 -0
- /package/dist/cli/lib/{git.d.ts → git/git.d.ts} +0 -0
- /package/dist/cli/lib/{init-interactive.d.ts → init/init-interactive.d.ts} +0 -0
- /package/dist/cli/lib/{init-plan.d.ts → init/init-plan.d.ts} +0 -0
- /package/dist/cli/lib/{init-tutorial.d.ts → init/init-tutorial.d.ts} +0 -0
- /package/dist/cli/lib/{legislate-policy-warn.d.ts → legislate/legislate-policy-warn.d.ts} +0 -0
- /package/dist/cli/lib/{mcp-check-signature.d.ts → mcp/mcp-check-signature.d.ts} +0 -0
- /package/dist/cli/lib/{mcp-draft-legislation.d.ts → mcp/mcp-draft-legislation.d.ts} +0 -0
- /package/dist/cli/lib/{mcp-execute-legislation.d.ts → mcp/mcp-execute-legislation.d.ts} +0 -0
- /package/dist/cli/lib/{mcp-start-orchestration.d.ts → mcp/mcp-start-orchestration.d.ts} +0 -0
- /package/dist/cli/lib/{mcp-tools-register.d.ts → mcp/mcp-tools-register.d.ts} +0 -0
- /package/dist/cli/lib/{report-demo-fixtures.d.ts → report/report-demo-fixtures.d.ts} +0 -0
- /package/dist/cli/lib/{report-demo-fixtures.js → report/report-demo-fixtures.js} +0 -0
- /package/dist/cli/lib/{report-demo-mode.d.ts → report/report-demo-mode.d.ts} +0 -0
- /package/dist/cli/lib/{report-server.d.ts → report/report-server.d.ts} +0 -0
- /package/dist/cli/lib/{report-template-css.d.ts → report/report-template-css.d.ts} +0 -0
- /package/dist/cli/lib/{report-template-css.js → report/report-template-css.js} +0 -0
- /package/dist/cli/lib/{report-template-html.d.ts → report/report-template-html.d.ts} +0 -0
- /package/dist/cli/lib/{report-template-html.js → report/report-template-html.js} +0 -0
- /package/dist/cli/lib/{report-template-overview.d.ts → report/report-template-overview.d.ts} +0 -0
- /package/dist/cli/lib/{report-template-overview.js → report/report-template-overview.js} +0 -0
- /package/dist/cli/lib/{report-template-shared.js → report/report-template-shared.js} +0 -0
- /package/dist/cli/lib/{upgrade-apply.d.ts → upgrade/upgrade-apply.d.ts} +0 -0
- /package/dist/cli/lib/{upgrade-plan-payload.d.ts → upgrade/upgrade-plan-payload.d.ts} +0 -0
- /package/dist/cli/lib/{upgrade-plan-payload.js → upgrade/upgrade-plan-payload.js} +0 -0
- /package/dist/cli/lib/{upgrade-plan-types.d.ts → upgrade/upgrade-plan-types.d.ts} +0 -0
- /package/dist/cli/lib/{upgrade-plan-types.js → upgrade/upgrade-plan-types.js} +0 -0
- /package/dist/cli/lib/{upgrade-plan.d.ts → upgrade/upgrade-plan.d.ts} +0 -0
- /package/dist/cli/lib/{verify-contract.d.ts → verify/verify-contract.d.ts} +0 -0
- /package/dist/cli/lib/{verify-evidence-snippet.d.ts → verify/verify-evidence-snippet.d.ts} +0 -0
- /package/dist/cli/lib/{verify-evidence-snippet.js → verify/verify-evidence-snippet.js} +0 -0
- /package/dist/cli/lib/{verify-failure.js → verify/verify-failure.js} +0 -0
- /package/dist/cli/lib/{verify-finding-fingerprint.d.ts → verify/verify-finding-fingerprint.d.ts} +0 -0
- /package/dist/cli/lib/{verify-finding-gate-projector.d.ts → verify/verify-finding-gate-projector.d.ts} +0 -0
- /package/dist/cli/lib/{verify-finding.d.ts → verify/verify-finding.d.ts} +0 -0
- /package/dist/cli/lib/{verify-finding.js → verify/verify-finding.js} +0 -0
- /package/dist/cli/lib/{verify-options.js → verify/verify-options.js} +0 -0
- /package/dist/cli/lib/{verify-phase-clock.d.ts → verify/verify-phase-clock.d.ts} +0 -0
- /package/dist/cli/lib/{verify-phase-clock.js → verify/verify-phase-clock.js} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { GantryUserError, isGantryUserError } from "../errors.js";
|
|
4
|
+
/** Must stay equal to `EMBEDDING_DIMENSIONS` in vector-store.ts. This module does not import it (sqlite-vec). */
|
|
5
|
+
export const OPENAI_EMBEDDING_DIMENSIONS = 1536;
|
|
6
|
+
export const OPENAI_EMBEDDINGS_URL = "https://api.openai.com/v1/embeddings";
|
|
7
|
+
export const OPENAI_EMBEDDING_MODEL = "text-embedding-3-small";
|
|
8
|
+
export const OPENAI_API_KEY_ENV = "OPENAI_API_KEY";
|
|
9
|
+
export const OPENAI_EMBEDDING_TIMEOUT_MS = 5000;
|
|
10
|
+
export class OpenAiEmbeddingProvider {
|
|
11
|
+
options;
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this.options = options;
|
|
14
|
+
}
|
|
15
|
+
async generateEmbedding(text) {
|
|
16
|
+
const trimmed = text.trim();
|
|
17
|
+
if (!trimmed) {
|
|
18
|
+
throw new GantryUserError("INVALID_ARGUMENT", "intent text is required to generate an embedding", undefined, 2);
|
|
19
|
+
}
|
|
20
|
+
const apiKey = resolveApiKey(this.options.apiKey);
|
|
21
|
+
if (!apiKey) {
|
|
22
|
+
throw new GantryUserError("INVALID_ARGUMENT", "OPENAI_API_KEY is required to generate an embedding", "export OPENAI_API_KEY", 2);
|
|
23
|
+
}
|
|
24
|
+
const response = await postEmbeddings(this.options.fetchImpl ?? globalThis.fetch, apiKey, trimmed, resolveTimeoutMs(this.options.timeoutMs));
|
|
25
|
+
if (!response.ok)
|
|
26
|
+
throw statusError(response.status);
|
|
27
|
+
return parseEmbeddingPayload(await readJson(response));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function writeHostEmbeddingFile(filePath, doc) {
|
|
31
|
+
const summary = doc.summary.trim();
|
|
32
|
+
if (!summary) {
|
|
33
|
+
throw new GantryUserError("INVALID_ARGUMENT", "contract embed: summary is required", undefined, 2);
|
|
34
|
+
}
|
|
35
|
+
const body = {
|
|
36
|
+
summary,
|
|
37
|
+
embedding: doc.embedding,
|
|
38
|
+
};
|
|
39
|
+
const msnId = doc.msn_id?.trim();
|
|
40
|
+
if (msnId)
|
|
41
|
+
body.msn_id = msnId;
|
|
42
|
+
fs.mkdirSync(path.dirname(path.resolve(filePath)), { recursive: true });
|
|
43
|
+
fs.writeFileSync(filePath, `${JSON.stringify(body, null, 2)}\n`);
|
|
44
|
+
}
|
|
45
|
+
function resolveApiKey(explicit) {
|
|
46
|
+
return (explicit ?? process.env[OPENAI_API_KEY_ENV] ?? "").trim();
|
|
47
|
+
}
|
|
48
|
+
function resolveTimeoutMs(timeoutMs) {
|
|
49
|
+
if (typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0)
|
|
50
|
+
return timeoutMs;
|
|
51
|
+
return OPENAI_EMBEDDING_TIMEOUT_MS;
|
|
52
|
+
}
|
|
53
|
+
function timeoutError() {
|
|
54
|
+
return new GantryUserError("INVALID_ARGUMENT", "OpenAI embeddings request timed out", undefined, 2);
|
|
55
|
+
}
|
|
56
|
+
function statusError(status) {
|
|
57
|
+
if (status === 401) {
|
|
58
|
+
return new GantryUserError("INVALID_ARGUMENT", "OpenAI rejected OPENAI_API_KEY (HTTP 401)", "export a valid OPENAI_API_KEY", 2);
|
|
59
|
+
}
|
|
60
|
+
if (status === 429) {
|
|
61
|
+
return new GantryUserError("INVALID_ARGUMENT", "OpenAI rate limit (HTTP 429). Retry later.", undefined, 2);
|
|
62
|
+
}
|
|
63
|
+
return new GantryUserError("INVALID_ARGUMENT", `OpenAI embeddings request failed (HTTP ${String(status)})`, undefined, 2);
|
|
64
|
+
}
|
|
65
|
+
function isAbortError(error) {
|
|
66
|
+
return error instanceof Error && error.name === "AbortError";
|
|
67
|
+
}
|
|
68
|
+
async function postEmbeddings(fetchImpl, apiKey, text, timeoutMs) {
|
|
69
|
+
const controller = new AbortController();
|
|
70
|
+
let timer;
|
|
71
|
+
let timedOut = false;
|
|
72
|
+
const timedOutPromise = new Promise((_, reject) => {
|
|
73
|
+
timer = setTimeout(() => {
|
|
74
|
+
timedOut = true;
|
|
75
|
+
controller.abort();
|
|
76
|
+
reject(timeoutError());
|
|
77
|
+
}, timeoutMs);
|
|
78
|
+
});
|
|
79
|
+
try {
|
|
80
|
+
const request = fetchImpl(OPENAI_EMBEDDINGS_URL, {
|
|
81
|
+
method: "POST",
|
|
82
|
+
headers: {
|
|
83
|
+
Authorization: `Bearer ${apiKey}`,
|
|
84
|
+
"Content-Type": "application/json",
|
|
85
|
+
},
|
|
86
|
+
body: JSON.stringify({
|
|
87
|
+
model: OPENAI_EMBEDDING_MODEL,
|
|
88
|
+
input: text,
|
|
89
|
+
dimensions: OPENAI_EMBEDDING_DIMENSIONS,
|
|
90
|
+
}),
|
|
91
|
+
signal: controller.signal,
|
|
92
|
+
});
|
|
93
|
+
void request.catch(() => undefined);
|
|
94
|
+
return await Promise.race([request, timedOutPromise]);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
if (isGantryUserError(error))
|
|
98
|
+
throw error;
|
|
99
|
+
if (timedOut || isAbortError(error))
|
|
100
|
+
throw timeoutError();
|
|
101
|
+
throw new GantryUserError("INVALID_ARGUMENT", "OpenAI embeddings request failed", undefined, 2);
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
if (timer !== undefined)
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function readJson(response) {
|
|
109
|
+
try {
|
|
110
|
+
return (await response.json());
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
throw new GantryUserError("INVALID_ARGUMENT", "OpenAI embeddings response is not JSON", undefined, 2);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function parseEmbeddingPayload(body) {
|
|
117
|
+
const embedding = embeddingArray(body);
|
|
118
|
+
if (embedding.length !== OPENAI_EMBEDDING_DIMENSIONS) {
|
|
119
|
+
throw new GantryUserError("INVALID_ARGUMENT", `embedding must contain ${String(OPENAI_EMBEDDING_DIMENSIONS)} numbers (got ${String(embedding.length)})`, undefined, 2);
|
|
120
|
+
}
|
|
121
|
+
const out = [];
|
|
122
|
+
for (let i = 0; i < embedding.length; i += 1) {
|
|
123
|
+
const value = embedding[i];
|
|
124
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
125
|
+
throw new GantryUserError("INVALID_ARGUMENT", `embedding[${String(i)}] is not a finite number`, undefined, 2);
|
|
126
|
+
}
|
|
127
|
+
out.push(value);
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
function embeddingArray(body) {
|
|
132
|
+
if (!body || typeof body !== "object") {
|
|
133
|
+
throw new GantryUserError("INVALID_ARGUMENT", "OpenAI embeddings response is not JSON", undefined, 2);
|
|
134
|
+
}
|
|
135
|
+
const data = body.data;
|
|
136
|
+
if (!Array.isArray(data) || data.length === 0 || !data[0] || typeof data[0] !== "object") {
|
|
137
|
+
throw new GantryUserError("INVALID_ARGUMENT", "OpenAI embeddings response has no embedding array", undefined, 2);
|
|
138
|
+
}
|
|
139
|
+
const embedding = data[0].embedding;
|
|
140
|
+
if (!Array.isArray(embedding)) {
|
|
141
|
+
throw new GantryUserError("INVALID_ARGUMENT", "OpenAI embeddings response has no embedding array", undefined, 2);
|
|
142
|
+
}
|
|
143
|
+
return embedding;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=embedding-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedding-provider.js","sourceRoot":"","sources":["../../../../src/cli/lib/contract/embedding-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAElE,iHAAiH;AACjH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAoBhD,MAAM,OAAO,uBAAuB;IACL;IAA7B,YAA6B,UAA0C,EAAE;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AC,kBAAkB,EAAE,aAAa,MAAM,CAAC,CAAC,CAAC,0BAA0B,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QAChH,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,cAAc,CAAC,IAAa;IACnC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,IAAI,eAAe,CAAC,kBAAkB,EAAE,wCAAwC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACxG,CAAC;IACD,MAAM,IAAI,GAAI,IAA2B,CAAC,IAAI,CAAC;IAC/C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QACzF,MAAM,IAAI,eAAe,CAAC,kBAAkB,EAAE,mDAAmD,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACnH,CAAC;IACD,MAAM,SAAS,GAAI,IAAI,CAAC,CAAC,CAA6B,CAAC,SAAS,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,eAAe,CAAC,kBAAkB,EAAE,mDAAmD,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACnH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function existsRepoPath(root: string, rel: string): boolean;
|
|
2
|
+
/** Path-like tokens from intent prose (same regex as contract propose). */
|
|
3
|
+
export declare function intentPathTokens(intent: string): string[];
|
|
4
|
+
export declare function intersectWithSkillRoots(candidates: readonly string[], skillRoots: readonly string[]): string[];
|
|
5
|
+
/** Intent/--path hints that exist on disk and sit under skill roots. */
|
|
6
|
+
export declare function existingHintedPaths(root: string, intent: string, paths: readonly string[] | undefined, skillRoots: readonly string[]): string[];
|
|
7
|
+
//# sourceMappingURL=intent-path-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-path-tokens.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/contract/intent-path-tokens.ts"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAOzD;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,MAAM,EAAE,CAGV;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACpC,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,MAAM,EAAE,CAIV"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { normalizeContractPath } from "./contract-hash.js";
|
|
4
|
+
import { isPathUnderRoot } from "../tmvc-path.js";
|
|
5
|
+
const PATH_TOKEN_RE = /(?:\.{0,2}\/)?[A-Za-z0-9_.@-]+(?:\/[A-Za-z0-9_.@-]+)+\/?/g;
|
|
6
|
+
export function existsRepoPath(root, rel) {
|
|
7
|
+
return fs.existsSync(path.join(root, rel));
|
|
8
|
+
}
|
|
9
|
+
/** Path-like tokens from intent prose (same regex as contract propose). */
|
|
10
|
+
export function intentPathTokens(intent) {
|
|
11
|
+
const out = [];
|
|
12
|
+
for (const m of intent.matchAll(PATH_TOKEN_RE)) {
|
|
13
|
+
const norm = normalizeContractPath(m[0]);
|
|
14
|
+
if (norm && !norm.includes("://"))
|
|
15
|
+
out.push(norm);
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
export function intersectWithSkillRoots(candidates, skillRoots) {
|
|
20
|
+
if (skillRoots.length === 0)
|
|
21
|
+
return [...candidates];
|
|
22
|
+
return candidates.filter((c) => skillRoots.some((s) => isPathUnderRoot(c, s)));
|
|
23
|
+
}
|
|
24
|
+
/** Intent/--path hints that exist on disk and sit under skill roots. */
|
|
25
|
+
export function existingHintedPaths(root, intent, paths, skillRoots) {
|
|
26
|
+
const hinted = [...intentPathTokens(intent), ...(paths ?? []).map(normalizeContractPath)];
|
|
27
|
+
const existing = [...new Set(hinted)].filter((p) => existsRepoPath(root, p.replace(/\/$/, ""))).sort();
|
|
28
|
+
return intersectWithSkillRoots(existing, skillRoots);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=intent-path-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-path-tokens.js","sourceRoot":"","sources":["../../../../src/cli/lib/contract/intent-path-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,aAAa,GAAG,2DAA2D,CAAC;AAElF,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAA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ight-types.js";
|
|
2
|
+
import type { Manifest } from "../types.js";
|
|
3
|
+
export interface HeuristicPreflightInput {
|
|
4
|
+
root: string;
|
|
5
|
+
manifest: Manifest;
|
|
6
|
+
intent: string;
|
|
7
|
+
paths?: string[];
|
|
8
|
+
}
|
|
9
|
+
/** Offline skill/path classifier. Never calls a network. */
|
|
10
|
+
export declare function runHeuristicPreflight(input: HeuristicPreflightInput): PreflightResult;
|
|
11
|
+
//# sourceMappingURL=preflight-heuristic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight-heuristic.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/contract/preflight-heuristic.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,eAAe,EAA0B,MAAM,sBAAsB,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAiBD,4DAA4D;AAC5D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,uBAAuB,GAAG,eAAe,CAiBrF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { normalizeContractPath } from "./contract-hash.js";
|
|
2
|
+
import { existingHintedPaths } from "./intent-path-tokens.js";
|
|
3
|
+
import { PREFLIGHT_MIN_CONFIDENCE } from "./preflight-types.js";
|
|
4
|
+
import { isTriageEscalated, triageIntent } from "../triage-logic.js";
|
|
5
|
+
function skillRootsFor(manifest, skillKey) {
|
|
6
|
+
if (!skillKey)
|
|
7
|
+
return [];
|
|
8
|
+
return (manifest.skills[skillKey]?.tmvc_roots ?? []).map(normalizeContractPath);
|
|
9
|
+
}
|
|
10
|
+
function candidateScores(paths) {
|
|
11
|
+
return paths.map((path) => ({ path, score: 1 }));
|
|
12
|
+
}
|
|
13
|
+
function emitSkillKey(skillKey, confidence, escalate) {
|
|
14
|
+
if (escalate || skillKey === null || skillKey === "NONE")
|
|
15
|
+
return null;
|
|
16
|
+
if (confidence < PREFLIGHT_MIN_CONFIDENCE)
|
|
17
|
+
return null;
|
|
18
|
+
return skillKey;
|
|
19
|
+
}
|
|
20
|
+
/** Offline skill/path classifier. Never calls a network. */
|
|
21
|
+
export function runHeuristicPreflight(input) {
|
|
22
|
+
const triage = triageIntent(input.root, input.intent, input.manifest);
|
|
23
|
+
const escalate = isTriageEscalated(triage);
|
|
24
|
+
const resolved = escalate ? null : triage.skill_key === "NONE" ? null : triage.skill_key;
|
|
25
|
+
const roots = skillRootsFor(input.manifest, resolved);
|
|
26
|
+
const hinted = existingHintedPaths(input.root, input.intent, input.paths, roots);
|
|
27
|
+
const tmvc_root_candidates = hinted.length > 0 ? candidateScores(hinted) : candidateScores([...roots].sort());
|
|
28
|
+
const rationale = [...triage.match_reasons, triage.reason];
|
|
29
|
+
return {
|
|
30
|
+
provider: "heuristic",
|
|
31
|
+
skill_key: emitSkillKey(resolved, triage.confidence, escalate),
|
|
32
|
+
skill_confidence: triage.confidence,
|
|
33
|
+
tmvc_root_candidates,
|
|
34
|
+
escalate,
|
|
35
|
+
rationale,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=preflight-heuristic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight-heuristic.js","sourceRoot":"","sources":["../../../../src/cli/lib/contract/preflight-heuristic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAgD,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUrE,SAAS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AAK,CAAC,CAAC;IACjF,MAAM,oBAAoB,GACxB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnF,MAAM,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,QAAQ,EAAE,WAAW;QACrB,SAAS,EAAE,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC;QAC9D,gBAAgB,EAAE,MAAM,CAAC,UAAU;QACnC,oBAAoB;QACpB,QAAQ;QACR,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type JevFallbackReason, type PreflightResult, type TmvcRootCandidate } from "./preflight-types.js";
|
|
2
|
+
import type { Manifest } from "../types.js";
|
|
3
|
+
export declare const JEV_SYSTEM_ONE_URL = "https://api.typesafe.ai/v1/systemone";
|
|
4
|
+
export declare const JEV_MODEL = "jev-latest";
|
|
5
|
+
export declare const TYPESAFE_API_KEY_ENV = "TYPESAFE_API_KEY";
|
|
6
|
+
export declare const JEV_FETCH_TIMEOUT_MS = 2000;
|
|
7
|
+
export interface JevPreflightInput {
|
|
8
|
+
root: string;
|
|
9
|
+
manifest: Manifest;
|
|
10
|
+
intent: string;
|
|
11
|
+
paths?: string[];
|
|
12
|
+
apiKey: string;
|
|
13
|
+
fetchImpl?: typeof fetch;
|
|
14
|
+
/** Override fetch timeout (ms). Production default is `JEV_FETCH_TIMEOUT_MS`. */
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface JevQuestionSpec {
|
|
18
|
+
type: "choice" | "noul";
|
|
19
|
+
instructions: string;
|
|
20
|
+
criteria?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export interface JevSystemOneRequest {
|
|
23
|
+
model: string;
|
|
24
|
+
state: {
|
|
25
|
+
intent: string;
|
|
26
|
+
paths: string[];
|
|
27
|
+
skills: Record<string, {
|
|
28
|
+
desc: string;
|
|
29
|
+
tmvc_roots: string[];
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
questions: Record<string, JevQuestionSpec>;
|
|
33
|
+
}
|
|
34
|
+
type JevParsed = {
|
|
35
|
+
skillKey: string;
|
|
36
|
+
skillConfidence: number;
|
|
37
|
+
escalate: boolean;
|
|
38
|
+
candidates: TmvcRootCandidate[];
|
|
39
|
+
};
|
|
40
|
+
export declare function buildJevRequest(input: {
|
|
41
|
+
intent: string;
|
|
42
|
+
paths?: string[];
|
|
43
|
+
manifest: Manifest;
|
|
44
|
+
}): JevSystemOneRequest;
|
|
45
|
+
export declare function parseJevAnswers(body: unknown, manifest: Manifest): {
|
|
46
|
+
ok: true;
|
|
47
|
+
value: JevParsed;
|
|
48
|
+
} | {
|
|
49
|
+
ok: false;
|
|
50
|
+
reason: JevFallbackReason;
|
|
51
|
+
};
|
|
52
|
+
export declare function runJevPreflight(input: JevPreflightInput): Promise<PreflightResult>;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=preflight-jev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight-jev.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/contract/preflight-jev.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AACzE,eAAO,MAAM,SAAS,eAAe,CAAC;AACtC,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,oBAAoB,OAAO,CAAC;AA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E,IAAI,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAA;CAAE,CA0B3E;AA0DD,wBAAsB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAwCxF"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { normalizeContractPath } from "./contract-hash.js";
|
|
2
|
+
import { runHeuristicPreflight } from "./preflight-heuristic.js";
|
|
3
|
+
import { PREFLIGHT_MIN_CONFIDENCE, jevFallbackRationale, } from "./preflight-types.js";
|
|
4
|
+
import { logWarn } from "../cli-io.js";
|
|
5
|
+
import { GantryUserError } from "../errors.js";
|
|
6
|
+
export const JEV_SYSTEM_ONE_URL = "https://api.typesafe.ai/v1/systemone";
|
|
7
|
+
export const JEV_MODEL = "jev-latest";
|
|
8
|
+
export const TYPESAFE_API_KEY_ENV = "TYPESAFE_API_KEY";
|
|
9
|
+
export const JEV_FETCH_TIMEOUT_MS = 2000;
|
|
10
|
+
const SKILL_Q = "skill";
|
|
11
|
+
const ESCALATE_Q = "escalate";
|
|
12
|
+
const ROOT_PREFIX = "root:";
|
|
13
|
+
function skillCatalog(manifest) {
|
|
14
|
+
const out = {};
|
|
15
|
+
for (const [key, skill] of Object.entries(manifest.skills)) {
|
|
16
|
+
out[key] = { desc: skill.desc ?? key, tmvc_roots: skill.tmvc_roots.map(normalizeContractPath) };
|
|
17
|
+
}
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
function allSkillRoots(manifest) {
|
|
21
|
+
const roots = new Set();
|
|
22
|
+
for (const skill of Object.values(manifest.skills)) {
|
|
23
|
+
for (const r of skill.tmvc_roots)
|
|
24
|
+
roots.add(normalizeContractPath(r));
|
|
25
|
+
}
|
|
26
|
+
return [...roots].sort();
|
|
27
|
+
}
|
|
28
|
+
export function buildJevRequest(input) {
|
|
29
|
+
const catalog = skillCatalog(input.manifest);
|
|
30
|
+
const criteria = {};
|
|
31
|
+
for (const [key, meta] of Object.entries(catalog)) {
|
|
32
|
+
criteria[key] = meta.desc;
|
|
33
|
+
}
|
|
34
|
+
const questions = {
|
|
35
|
+
[SKILL_Q]: {
|
|
36
|
+
type: "choice",
|
|
37
|
+
instructions: "Which manifest skill_key owns this intent?",
|
|
38
|
+
criteria,
|
|
39
|
+
},
|
|
40
|
+
[ESCALATE_Q]: {
|
|
41
|
+
type: "noul",
|
|
42
|
+
instructions: "Does this intent hit path_risks or risk_keywords that require Planner escalation?",
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
for (const root of allSkillRoots(input.manifest)) {
|
|
46
|
+
questions[`${ROOT_PREFIX}${root}`] = {
|
|
47
|
+
type: "noul",
|
|
48
|
+
instructions: `Is ${root} a relevant TMVC root for this intent?`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
model: JEV_MODEL,
|
|
53
|
+
state: { intent: input.intent, paths: [...(input.paths ?? [])], skills: catalog },
|
|
54
|
+
questions,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function fallback(input, reason) {
|
|
58
|
+
logWarn(`jev_preflight fallback reason=${reason}`);
|
|
59
|
+
const heuristic = runHeuristicPreflight({
|
|
60
|
+
root: input.root,
|
|
61
|
+
manifest: input.manifest,
|
|
62
|
+
intent: input.intent,
|
|
63
|
+
paths: input.paths,
|
|
64
|
+
});
|
|
65
|
+
return { ...heuristic, rationale: [jevFallbackRationale(reason), ...heuristic.rationale] };
|
|
66
|
+
}
|
|
67
|
+
function isUnit(n) {
|
|
68
|
+
return typeof n === "number" && Number.isFinite(n) && n >= 0 && n <= 1;
|
|
69
|
+
}
|
|
70
|
+
function asAnswers(body) {
|
|
71
|
+
if (!body || typeof body !== "object" || !("answers" in body))
|
|
72
|
+
return { ok: false, reason: "malformed_response" };
|
|
73
|
+
const answers = body.answers;
|
|
74
|
+
if (!answers || typeof answers !== "object" || Array.isArray(answers)) {
|
|
75
|
+
return { ok: false, reason: "malformed_response" };
|
|
76
|
+
}
|
|
77
|
+
const out = {};
|
|
78
|
+
for (const [key, value] of Object.entries(answers)) {
|
|
79
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
80
|
+
return { ok: false, reason: classifyProbabilities(value) };
|
|
81
|
+
}
|
|
82
|
+
const rec = value;
|
|
83
|
+
if (!isUnit(rec.noul) && rec.noul !== undefined)
|
|
84
|
+
return { ok: false, reason: "invalid_probability" };
|
|
85
|
+
if (!isUnit(rec.confidence) && rec.confidence !== undefined)
|
|
86
|
+
return { ok: false, reason: "invalid_probability" };
|
|
87
|
+
out[key] = rec;
|
|
88
|
+
}
|
|
89
|
+
return { ok: true, answers: out };
|
|
90
|
+
}
|
|
91
|
+
function classifyProbabilities(value) {
|
|
92
|
+
if (value && typeof value === "object") {
|
|
93
|
+
const rec = value;
|
|
94
|
+
for (const field of ["noul", "confidence"]) {
|
|
95
|
+
const n = rec[field];
|
|
96
|
+
if (typeof n === "number" && !isUnit(n))
|
|
97
|
+
return "invalid_probability";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return "malformed_response";
|
|
101
|
+
}
|
|
102
|
+
function parseRootCandidates(answers, skillRoots, knownRoots) {
|
|
103
|
+
const skillRootSet = new Set(skillRoots);
|
|
104
|
+
const knownRootSet = new Set(knownRoots);
|
|
105
|
+
const candidates = [];
|
|
106
|
+
for (const [key, answer] of Object.entries(answers)) {
|
|
107
|
+
if (!key.startsWith(ROOT_PREFIX))
|
|
108
|
+
continue;
|
|
109
|
+
const rootPath = normalizeContractPath(key.slice(ROOT_PREFIX.length));
|
|
110
|
+
if (!knownRootSet.has(rootPath))
|
|
111
|
+
return { ok: false, reason: "unexpected_choice" };
|
|
112
|
+
if (!skillRootSet.has(rootPath))
|
|
113
|
+
continue;
|
|
114
|
+
if (answer.type !== "noul" || !isUnit(answer.noul))
|
|
115
|
+
return { ok: false, reason: "malformed_response" };
|
|
116
|
+
candidates.push({ path: rootPath, score: answer.noul });
|
|
117
|
+
}
|
|
118
|
+
return { ok: true, candidates: candidates.sort((a, b) => a.path.localeCompare(b.path)) };
|
|
119
|
+
}
|
|
120
|
+
function classifyParseFail(body) {
|
|
121
|
+
const parsed = asAnswers(body);
|
|
122
|
+
if (parsed.ok)
|
|
123
|
+
return "malformed_response";
|
|
124
|
+
return parsed.reason;
|
|
125
|
+
}
|
|
126
|
+
export function parseJevAnswers(body, manifest) {
|
|
127
|
+
const parsed = asAnswers(body);
|
|
128
|
+
if (!parsed.ok)
|
|
129
|
+
return parsed;
|
|
130
|
+
const skillAnswer = parsed.answers[SKILL_Q];
|
|
131
|
+
if (!skillAnswer || skillAnswer.type !== "choice" || typeof skillAnswer.choice !== "string" || !isUnit(skillAnswer.confidence)) {
|
|
132
|
+
return { ok: false, reason: classifyParseFail(body) };
|
|
133
|
+
}
|
|
134
|
+
const skillKeys = Object.keys(manifest.skills);
|
|
135
|
+
if (!skillKeys.includes(skillAnswer.choice))
|
|
136
|
+
return { ok: false, reason: "unexpected_choice" };
|
|
137
|
+
const escalateAnswer = parsed.answers[ESCALATE_Q];
|
|
138
|
+
const escalate = escalateAnswer?.type === "noul" && isUnit(escalateAnswer.noul)
|
|
139
|
+
? escalateAnswer.noul >= PREFLIGHT_MIN_CONFIDENCE
|
|
140
|
+
: false;
|
|
141
|
+
const skillRoots = (manifest.skills[skillAnswer.choice]?.tmvc_roots ?? []).map(normalizeContractPath);
|
|
142
|
+
const roots = parseRootCandidates(parsed.answers, skillRoots, allSkillRoots(manifest));
|
|
143
|
+
if (!roots.ok)
|
|
144
|
+
return roots;
|
|
145
|
+
return {
|
|
146
|
+
ok: true,
|
|
147
|
+
value: {
|
|
148
|
+
skillKey: skillAnswer.choice,
|
|
149
|
+
skillConfidence: skillAnswer.confidence,
|
|
150
|
+
escalate,
|
|
151
|
+
candidates: roots.candidates,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function emitFromParsed(parsed) {
|
|
156
|
+
const low = parsed.skillConfidence < PREFLIGHT_MIN_CONFIDENCE;
|
|
157
|
+
return {
|
|
158
|
+
provider: "jev",
|
|
159
|
+
skill_key: parsed.escalate || low ? null : parsed.skillKey,
|
|
160
|
+
skill_confidence: parsed.skillConfidence,
|
|
161
|
+
tmvc_root_candidates: parsed.candidates,
|
|
162
|
+
escalate: parsed.escalate || low,
|
|
163
|
+
rationale: ["jev: systemone choice+noul pass"],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function isMappedPreflightValid(result) {
|
|
167
|
+
if (result.skill_key !== null && typeof result.skill_key !== "string")
|
|
168
|
+
return false;
|
|
169
|
+
if (!isUnit(result.skill_confidence))
|
|
170
|
+
return false;
|
|
171
|
+
if (!Array.isArray(result.tmvc_root_candidates))
|
|
172
|
+
return false;
|
|
173
|
+
for (const candidate of result.tmvc_root_candidates) {
|
|
174
|
+
if (!candidate || typeof candidate !== "object")
|
|
175
|
+
return false;
|
|
176
|
+
if (typeof candidate.path !== "string" || !isUnit(candidate.score))
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
function isTimeoutFailure(error) {
|
|
182
|
+
return error instanceof Error && error.name === "AbortError";
|
|
183
|
+
}
|
|
184
|
+
function resolveFetchTimeoutMs(timeoutMs) {
|
|
185
|
+
if (typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0)
|
|
186
|
+
return timeoutMs;
|
|
187
|
+
return JEV_FETCH_TIMEOUT_MS;
|
|
188
|
+
}
|
|
189
|
+
async function fetchWithTimeout(fetchImpl, init, timeoutMs) {
|
|
190
|
+
const controller = new AbortController();
|
|
191
|
+
let timer;
|
|
192
|
+
const timedOut = new Promise((_, reject) => {
|
|
193
|
+
timer = setTimeout(() => {
|
|
194
|
+
controller.abort();
|
|
195
|
+
const err = new Error("jev_timeout");
|
|
196
|
+
err.name = "AbortError";
|
|
197
|
+
reject(err);
|
|
198
|
+
}, timeoutMs);
|
|
199
|
+
});
|
|
200
|
+
try {
|
|
201
|
+
const request = fetchImpl(JEV_SYSTEM_ONE_URL, { ...init, signal: controller.signal });
|
|
202
|
+
void request.catch(() => undefined);
|
|
203
|
+
return await Promise.race([request, timedOut]);
|
|
204
|
+
}
|
|
205
|
+
finally {
|
|
206
|
+
if (timer !== undefined)
|
|
207
|
+
clearTimeout(timer);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
export async function runJevPreflight(input) {
|
|
211
|
+
if (!input.apiKey.trim()) {
|
|
212
|
+
throw new GantryUserError("INVALID_ARGUMENT", "contract preflight --provider jev requires TYPESAFE_API_KEY", "export TYPESAFE_API_KEY or use --provider heuristic", 2);
|
|
213
|
+
}
|
|
214
|
+
const fetchImpl = input.fetchImpl ?? globalThis.fetch;
|
|
215
|
+
const payload = buildJevRequest(input);
|
|
216
|
+
let response;
|
|
217
|
+
try {
|
|
218
|
+
response = await fetchWithTimeout(fetchImpl, {
|
|
219
|
+
method: "POST",
|
|
220
|
+
headers: {
|
|
221
|
+
Authorization: `Bearer ${input.apiKey}`,
|
|
222
|
+
"Content-Type": "application/json",
|
|
223
|
+
},
|
|
224
|
+
body: JSON.stringify(payload),
|
|
225
|
+
}, resolveFetchTimeoutMs(input.timeoutMs));
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
return fallback(input, isTimeoutFailure(error) ? "timeout" : "transport_error");
|
|
229
|
+
}
|
|
230
|
+
if (!response.ok)
|
|
231
|
+
return fallback(input, "transport_error");
|
|
232
|
+
let body;
|
|
233
|
+
try {
|
|
234
|
+
body = await response.json();
|
|
235
|
+
}
|
|
236
|
+
catch {
|
|
237
|
+
return fallback(input, "malformed_response");
|
|
238
|
+
}
|
|
239
|
+
const parsed = parseJevAnswers(body, input.manifest);
|
|
240
|
+
if (!parsed.ok)
|
|
241
|
+
return fallback(input, parsed.reason);
|
|
242
|
+
const emitted = emitFromParsed(parsed.value);
|
|
243
|
+
if (!isMappedPreflightValid(emitted))
|
|
244
|
+
return fallback(input, "malformed_response");
|
|
245
|
+
return emitted;
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=preflight-jev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight-jev.js","sourceRoot":"","sources":["../../../../src/cli/lib/contract/preflight-jev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GAIrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,MAAM,OAAO,GAAG,OAAO,CAAC;AACxB,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,WAAW,GAAG,OAAO,CAAC;AAgC5B,SAAS,YAAY,CAAC,QAAkB;IACtC,MAAM,GAAG,GAA2D,EAAE,CAAC;IACvE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC;IAClG,CAAC;IACD,OAAO,GAAG,CA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CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;QAAE,OAAO,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;IACnF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const PREFLIGHT_PROVIDERS: readonly ["heuristic", "jev"];
|
|
2
|
+
export type PreflightProvider = (typeof PREFLIGHT_PROVIDERS)[number];
|
|
3
|
+
export declare const PREFLIGHT_MIN_CONFIDENCE = 0.5;
|
|
4
|
+
export type JevFallbackReason = "malformed_response" | "unexpected_choice" | "transport_error" | "timeout" | "invalid_probability";
|
|
5
|
+
export interface TmvcRootCandidate {
|
|
6
|
+
path: string;
|
|
7
|
+
score: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PreflightResult {
|
|
10
|
+
provider: PreflightProvider;
|
|
11
|
+
skill_key: string | null;
|
|
12
|
+
skill_confidence: number;
|
|
13
|
+
tmvc_root_candidates: TmvcRootCandidate[];
|
|
14
|
+
escalate: boolean;
|
|
15
|
+
rationale: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function isPreflightProvider(value: string): value is PreflightProvider;
|
|
18
|
+
export declare function jevFallbackRationale(reason: JevFallbackReason): string;
|
|
19
|
+
//# sourceMappingURL=preflight-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight-types.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/contract/preflight-types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,+BAAgC,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GACzB,oBAAoB,GACpB,mBAAmB,GACnB,iBAAiB,GACjB,SAAS,GACT,qBAAqB,CAAC;AAE1B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,iBAAiB,EAAE,CAAC;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAE7E;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAEtE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const PREFLIGHT_PROVIDERS = ["heuristic", "jev"];
|
|
2
|
+
export const PREFLIGHT_MIN_CONFIDENCE = 0.5;
|
|
3
|
+
export function isPreflightProvider(value) {
|
|
4
|
+
return PREFLIGHT_PROVIDERS.includes(value);
|
|
5
|
+
}
|
|
6
|
+
export function jevFallbackRationale(reason) {
|
|
7
|
+
return `jev_fallback: ${reason}`;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=preflight-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight-types.js","sourceRoot":"","sources":["../../../../src/cli/lib/contract/preflight-types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,WAAW,EAAE,KAAK,CAAU,CAAC;AAGjE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAuB5C,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAQ,mBAAyC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAyB;IAC5D,OAAO,iBAAiB,MAAM,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type PreflightProvider, type PreflightResult } from "./preflight-types.js";
|
|
2
|
+
import type { Manifest } from "../types.js";
|
|
3
|
+
export type { PreflightProvider, PreflightResult, TmvcRootCandidate } from "./preflight-types.js";
|
|
4
|
+
export { PREFLIGHT_MIN_CONFIDENCE, PREFLIGHT_PROVIDERS, isPreflightProvider } from "./preflight-types.js";
|
|
5
|
+
export interface RunPreflightInput {
|
|
6
|
+
root: string;
|
|
7
|
+
manifest: Manifest;
|
|
8
|
+
intent: string;
|
|
9
|
+
paths?: string[];
|
|
10
|
+
provider?: PreflightProvider;
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
fetchImpl?: typeof fetch;
|
|
13
|
+
}
|
|
14
|
+
/** Advisory classifier in front of proposeContract. Never writes a contract or hash. */
|
|
15
|
+
export declare function runPreflight(input: RunPreflightInput): Promise<PreflightResult>;
|
|
16
|
+
//# sourceMappingURL=preflight.d.ts.map
|