@apexops/cli 0.10.0-next.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/assets/capability-packs/azure-governance-discovery/source/scripts/discover.py +1189 -0
- package/assets/capability-packs/azure-governance-discovery/source/scripts/render_governance.py +676 -0
- package/assets/capability-packs/registry.v1.json +73 -0
- package/assets/client-projection-metadata/copilot-cli-agent-tools.json +92 -0
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-architect.agent.md +78 -0
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-operator.agent.md +71 -0
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-planner.agent.md +79 -0
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-requirements.agent.md +69 -0
- package/assets/client-projections/github-copilot-cli/.github/agents/apex.agent.md +52 -0
- package/assets/client-projections/github-copilot-cli/.github/copilot-instructions.md +13 -0
- package/assets/client-projections/github-copilot-cli/.github/mcp.json +54 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-architecture/SKILL.md +36 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/SKILL.md +65 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/references/presentation-conventions.md +52 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/references/reference-only-outlines.md +78 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/architecture-assessment.md +35 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/cost-estimate.md +47 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/deployment-summary.md +35 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/governance-constraints.md +35 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/implementation-plan.md +43 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/operations-runbook.md +35 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/requirements.md +42 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/resource-inventory.md +29 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/SKILL.md +52 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-examples.md +38 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-guardrails.md +36 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-quality.md +21 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-record-fields.md +57 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/SKILL.md +55 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +29 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +27 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +26 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +27 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/SKILL.md +58 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +63 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/SKILL.md +36 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/compute-selection.md +26 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/pricing-evidence.md +11 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +44 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/SKILL.md +61 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +61 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/SKILL.md +59 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +29 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +53 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/cost-monitoring.md +47 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/decision-boundaries.md +19 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/governance-effects.md +28 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/naming.md +47 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/network-planning.md +47 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/security-baseline.md +40 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/service-selection.md +51 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/tag-precedence.md +31 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/SKILL.md +50 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/references/operational-checklist.md +26 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +48 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/SKILL.md +60 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +42 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/SKILL.md +52 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/references/evidence-interpretation.md +58 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/references/operational-checklist.md +25 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/SKILL.md +58 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +41 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/references/operational-checklist.md +25 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/SKILL.md +52 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +27 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/references/preparation-lineage.md +36 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/SKILL.md +53 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +48 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/references/operational-checklist.md +23 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/SKILL.md +45 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/references/assignment-intent.md +39 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +50 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/SKILL.md +54 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +49 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/SKILL.md +35 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/security-and-governance.md +12 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +33 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/storage-selection.md +12 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/SKILL.md +49 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/references/preflight-evidence.md +43 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/SKILL.md +41 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +11 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +46 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +74 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +56 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/network-and-observability.md +52 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-codegen/SKILL.md +32 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/SKILL.md +53 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/capability-receipts.md +21 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +36 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +26 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +27 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/SKILL.md +44 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/references/styling.md +33 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/references/syntax.md +99 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-microsoft-docs/SKILL.md +53 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-microsoft-docs/references/research-method.md +91 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-operations/SKILL.md +34 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-planning/SKILL.md +36 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-requirements/SKILL.md +43 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/SKILL.md +47 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/adoption-attestation.md +10 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/import-assessment.md +14 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/import-mapping.md +27 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +12 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/SKILL.md +49 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +20 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +11 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +14 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/network-and-observability.md +12 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +24 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/SKILL.md +45 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/evidence-acceptance.md +10 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +12 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +23 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/test-design.md +13 -0
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-workflow/SKILL.md +37 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-architect.agent.md +87 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-codegen.agent.md +54 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-operator.agent.md +75 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-planner.agent.md +89 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-requirements.agent.md +78 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-reviewer.agent.md +45 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-validator.agent.md +50 -0
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex.agent.md +71 -0
- package/assets/client-projections/github-copilot-vscode/.github/copilot-instructions.md +13 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-architecture/SKILL.md +36 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/SKILL.md +65 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/references/presentation-conventions.md +52 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/references/reference-only-outlines.md +78 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/architecture-assessment.md +35 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/cost-estimate.md +47 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/deployment-summary.md +35 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/governance-constraints.md +35 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/implementation-plan.md +43 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/operations-runbook.md +35 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/requirements.md +42 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/resource-inventory.md +29 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/SKILL.md +52 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-examples.md +38 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-guardrails.md +36 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-quality.md +21 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-record-fields.md +57 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/SKILL.md +55 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +29 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +27 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +26 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +27 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/SKILL.md +58 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +63 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/SKILL.md +36 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/compute-selection.md +26 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/pricing-evidence.md +11 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +44 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/SKILL.md +61 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +61 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/SKILL.md +59 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +29 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +53 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/cost-monitoring.md +47 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/decision-boundaries.md +19 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/governance-effects.md +28 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/naming.md +47 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/network-planning.md +47 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/security-baseline.md +40 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/service-selection.md +51 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/tag-precedence.md +31 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/SKILL.md +50 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/references/operational-checklist.md +26 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +48 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/SKILL.md +60 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +42 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/SKILL.md +52 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/references/evidence-interpretation.md +58 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/references/operational-checklist.md +25 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/SKILL.md +58 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +41 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/references/operational-checklist.md +25 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/SKILL.md +52 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +27 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/references/preparation-lineage.md +36 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/SKILL.md +53 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +48 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/references/operational-checklist.md +23 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/SKILL.md +45 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/references/assignment-intent.md +39 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +50 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/SKILL.md +54 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +49 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/SKILL.md +35 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/security-and-governance.md +12 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +33 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/storage-selection.md +12 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/SKILL.md +49 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/references/operational-checklist.md +24 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/references/preflight-evidence.md +43 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/SKILL.md +41 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +11 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +46 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +74 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +56 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/network-and-observability.md +52 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-codegen/SKILL.md +32 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/SKILL.md +53 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/capability-receipts.md +21 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +36 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +26 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +27 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/SKILL.md +44 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/references/styling.md +33 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/references/syntax.md +99 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-microsoft-docs/SKILL.md +53 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-microsoft-docs/references/research-method.md +91 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-operations/SKILL.md +34 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-planning/SKILL.md +36 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-requirements/SKILL.md +43 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/SKILL.md +47 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/adoption-attestation.md +10 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/import-assessment.md +14 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/import-mapping.md +27 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +12 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/SKILL.md +49 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +20 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +11 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +14 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/network-and-observability.md +12 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +24 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/SKILL.md +45 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/evidence-acceptance.md +10 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +12 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +23 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/test-design.md +13 -0
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-workflow/SKILL.md +37 -0
- package/assets/client-projections/github-copilot-vscode/.vscode/mcp.json +21 -0
- package/assets/config/capability-packs.v1.json +43 -0
- package/assets/config/defaults.v1.json +98 -0
- package/assets/config/improvement-policy.v1.json +37 -0
- package/assets/config/quality-scorecard.v1.json +105 -0
- package/assets/config/recipe-packs.v1.json +29 -0
- package/assets/config/runtime-bundle.v1.json +84 -0
- package/assets/config/toolchain.v1.json +134 -0
- package/assets/config/workflow.v1.json +876 -0
- package/assets/customizations/.github/agents/apex-architect.agent.md +80 -0
- package/assets/customizations/.github/agents/apex-codegen.agent.md +51 -0
- package/assets/customizations/.github/agents/apex-operator.agent.md +68 -0
- package/assets/customizations/.github/agents/apex-planner.agent.md +82 -0
- package/assets/customizations/.github/agents/apex-requirements.agent.md +71 -0
- package/assets/customizations/.github/agents/apex-reviewer.agent.md +42 -0
- package/assets/customizations/.github/agents/apex-validator.agent.md +47 -0
- package/assets/customizations/.github/agents/apex.agent.md +64 -0
- package/assets/customizations/.github/copilot-instructions.md +13 -0
- package/assets/customizations/.github/mcp.json +54 -0
- package/assets/customizations/.github/skills/apex-architecture/SKILL.md +36 -0
- package/assets/customizations/.github/skills/apex-artifacts/SKILL.md +65 -0
- package/assets/customizations/.github/skills/apex-artifacts/references/presentation-conventions.md +52 -0
- package/assets/customizations/.github/skills/apex-artifacts/references/reference-only-outlines.md +78 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/architecture-assessment.md +35 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/cost-estimate.md +47 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/deployment-summary.md +35 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/governance-constraints.md +35 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/implementation-plan.md +43 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/operations-runbook.md +35 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/requirements.md +42 -0
- package/assets/customizations/.github/skills/apex-artifacts/templates/resource-inventory.md +29 -0
- package/assets/customizations/.github/skills/apex-azure-adr/SKILL.md +52 -0
- package/assets/customizations/.github/skills/apex-azure-adr/references/decision-examples.md +38 -0
- package/assets/customizations/.github/skills/apex-azure-adr/references/decision-guardrails.md +36 -0
- package/assets/customizations/.github/skills/apex-azure-adr/references/decision-quality.md +21 -0
- package/assets/customizations/.github/skills/apex-azure-adr/references/decision-record-fields.md +57 -0
- package/assets/customizations/.github/skills/apex-azure-cloud-migrate/SKILL.md +55 -0
- package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +29 -0
- package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +27 -0
- package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +26 -0
- package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +27 -0
- package/assets/customizations/.github/skills/apex-azure-compliance/SKILL.md +58 -0
- package/assets/customizations/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +63 -0
- package/assets/customizations/.github/skills/apex-azure-compliance/references/operational-checklist.md +24 -0
- package/assets/customizations/.github/skills/apex-azure-compute/SKILL.md +36 -0
- package/assets/customizations/.github/skills/apex-azure-compute/references/compute-selection.md +26 -0
- package/assets/customizations/.github/skills/apex-azure-compute/references/pricing-evidence.md +11 -0
- package/assets/customizations/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +44 -0
- package/assets/customizations/.github/skills/apex-azure-cost-optimization/SKILL.md +61 -0
- package/assets/customizations/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +61 -0
- package/assets/customizations/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +24 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/SKILL.md +59 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +29 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +53 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/cost-monitoring.md +47 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/decision-boundaries.md +19 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/governance-effects.md +28 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/naming.md +47 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/network-planning.md +47 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/security-baseline.md +40 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/service-selection.md +51 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/tag-precedence.md +31 -0
- package/assets/customizations/.github/skills/apex-azure-deploy/SKILL.md +50 -0
- package/assets/customizations/.github/skills/apex-azure-deploy/references/operational-checklist.md +26 -0
- package/assets/customizations/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +48 -0
- package/assets/customizations/.github/skills/apex-azure-diagnostics/SKILL.md +60 -0
- package/assets/customizations/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +42 -0
- package/assets/customizations/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +24 -0
- package/assets/customizations/.github/skills/apex-azure-governance/SKILL.md +52 -0
- package/assets/customizations/.github/skills/apex-azure-governance/references/evidence-interpretation.md +58 -0
- package/assets/customizations/.github/skills/apex-azure-governance/references/operational-checklist.md +25 -0
- package/assets/customizations/.github/skills/apex-azure-kusto/SKILL.md +58 -0
- package/assets/customizations/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +41 -0
- package/assets/customizations/.github/skills/apex-azure-kusto/references/operational-checklist.md +25 -0
- package/assets/customizations/.github/skills/apex-azure-prepare/SKILL.md +52 -0
- package/assets/customizations/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +27 -0
- package/assets/customizations/.github/skills/apex-azure-prepare/references/preparation-lineage.md +36 -0
- package/assets/customizations/.github/skills/apex-azure-quotas/SKILL.md +53 -0
- package/assets/customizations/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +48 -0
- package/assets/customizations/.github/skills/apex-azure-quotas/references/operational-checklist.md +23 -0
- package/assets/customizations/.github/skills/apex-azure-rbac/SKILL.md +45 -0
- package/assets/customizations/.github/skills/apex-azure-rbac/references/assignment-intent.md +39 -0
- package/assets/customizations/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +50 -0
- package/assets/customizations/.github/skills/apex-azure-resources/SKILL.md +54 -0
- package/assets/customizations/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +49 -0
- package/assets/customizations/.github/skills/apex-azure-resources/references/operational-checklist.md +24 -0
- package/assets/customizations/.github/skills/apex-azure-storage/SKILL.md +35 -0
- package/assets/customizations/.github/skills/apex-azure-storage/references/security-and-governance.md +12 -0
- package/assets/customizations/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +33 -0
- package/assets/customizations/.github/skills/apex-azure-storage/references/storage-selection.md +12 -0
- package/assets/customizations/.github/skills/apex-azure-validate/SKILL.md +49 -0
- package/assets/customizations/.github/skills/apex-azure-validate/references/operational-checklist.md +24 -0
- package/assets/customizations/.github/skills/apex-azure-validate/references/preflight-evidence.md +43 -0
- package/assets/customizations/.github/skills/apex-bicep-patterns/SKILL.md +41 -0
- package/assets/customizations/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +11 -0
- package/assets/customizations/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +46 -0
- package/assets/customizations/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +74 -0
- package/assets/customizations/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +56 -0
- package/assets/customizations/.github/skills/apex-bicep-patterns/references/network-and-observability.md +52 -0
- package/assets/customizations/.github/skills/apex-codegen/SKILL.md +32 -0
- package/assets/customizations/.github/skills/apex-entra-app-registration/SKILL.md +53 -0
- package/assets/customizations/.github/skills/apex-entra-app-registration/references/capability-receipts.md +21 -0
- package/assets/customizations/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +36 -0
- package/assets/customizations/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +26 -0
- package/assets/customizations/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +27 -0
- package/assets/customizations/.github/skills/apex-mermaid/SKILL.md +44 -0
- package/assets/customizations/.github/skills/apex-mermaid/references/styling.md +33 -0
- package/assets/customizations/.github/skills/apex-mermaid/references/syntax.md +99 -0
- package/assets/customizations/.github/skills/apex-microsoft-docs/SKILL.md +53 -0
- package/assets/customizations/.github/skills/apex-microsoft-docs/references/research-method.md +91 -0
- package/assets/customizations/.github/skills/apex-operations/SKILL.md +34 -0
- package/assets/customizations/.github/skills/apex-planning/SKILL.md +36 -0
- package/assets/customizations/.github/skills/apex-requirements/SKILL.md +43 -0
- package/assets/customizations/.github/skills/apex-terraform-import/SKILL.md +47 -0
- package/assets/customizations/.github/skills/apex-terraform-import/references/adoption-attestation.md +10 -0
- package/assets/customizations/.github/skills/apex-terraform-import/references/import-assessment.md +14 -0
- package/assets/customizations/.github/skills/apex-terraform-import/references/import-mapping.md +27 -0
- package/assets/customizations/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +12 -0
- package/assets/customizations/.github/skills/apex-terraform-patterns/SKILL.md +49 -0
- package/assets/customizations/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +20 -0
- package/assets/customizations/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +11 -0
- package/assets/customizations/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +14 -0
- package/assets/customizations/.github/skills/apex-terraform-patterns/references/network-and-observability.md +12 -0
- package/assets/customizations/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +24 -0
- package/assets/customizations/.github/skills/apex-terraform-test/SKILL.md +45 -0
- package/assets/customizations/.github/skills/apex-terraform-test/references/evidence-acceptance.md +10 -0
- package/assets/customizations/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +12 -0
- package/assets/customizations/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +23 -0
- package/assets/customizations/.github/skills/apex-terraform-test/references/test-design.md +13 -0
- package/assets/customizations/.github/skills/apex-workflow/SKILL.md +37 -0
- package/assets/customizations/.vscode/mcp.json +21 -0
- package/assets/customizations/README.md +22 -0
- package/assets/customizations/manifest.json +251 -0
- package/assets/manifest.json +5027 -0
- package/dist/assets.d.ts +69 -0
- package/dist/assets.js +336 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +643 -0
- package/dist/dependency-revision.d.ts +5 -0
- package/dist/dependency-revision.js +21 -0
- package/dist/errors.d.ts +19 -0
- package/dist/errors.js +34 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.js +210 -0
- package/dist/provider-runtime.d.ts +27 -0
- package/dist/provider-runtime.js +229 -0
- package/dist/provider-transfer.d.ts +52 -0
- package/dist/provider-transfer.js +533 -0
- package/dist/service.d.ts +806 -0
- package/dist/service.js +3817 -0
- package/dist/state-transfer.d.ts +51 -0
- package/dist/state-transfer.js +559 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/dist/workflow-validators.d.ts +80 -0
- package/dist/workflow-validators.js +843 -0
- package/package.json +57 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdir, readFile, realpath, writeFile } from "node:fs/promises";
|
|
3
|
+
import { NativeBicepProvider, NativeTerraformProvider, ProcessRunner } from "@apexops/capabilities";
|
|
4
|
+
import { CONTRACT_VERSION, OnboardingConfigV1Schema, QualityMeasurementsV1Schema, } from "@apexops/contracts";
|
|
5
|
+
import { Value } from "@sinclair/typebox/value";
|
|
6
|
+
import { EventJournal, ValidatorRegistry, WriterTransferStore, atomicWriteJson, sha256Json } from "@apexops/kernel";
|
|
7
|
+
import { evaluateQualityScorecard, renderQualityScorecardEvaluation, } from "@apexops/renderers";
|
|
8
|
+
import { basename, join, resolve } from "node:path";
|
|
9
|
+
import { ApexError, EXIT_CODES, normalizeError } from "./errors.js";
|
|
10
|
+
import { dependencyRevision as calculateDependencyRevision } from "./dependency-revision.js";
|
|
11
|
+
import { resolveBundledAssets } from "./assets.js";
|
|
12
|
+
import { serveMcp } from "./mcp.js";
|
|
13
|
+
import { createFileProviderRuntime, hashTerraformConfiguration, hashTerraformLockFile } from "./provider-runtime.js";
|
|
14
|
+
import { exportProviderTransfer, importProviderTransfer } from "./provider-transfer.js";
|
|
15
|
+
import { ApexService } from "./service.js";
|
|
16
|
+
import { exportStateTransfer, importStateTransfer } from "./state-transfer.js";
|
|
17
|
+
import { APEX_VERSION } from "./version.js";
|
|
18
|
+
function addFlag(flags, name, value) {
|
|
19
|
+
const current = flags[name];
|
|
20
|
+
if (current === undefined)
|
|
21
|
+
flags[name] = value;
|
|
22
|
+
else if (typeof current === "string" && typeof value === "string")
|
|
23
|
+
flags[name] = [current, value];
|
|
24
|
+
else if (Array.isArray(current) && typeof value === "string")
|
|
25
|
+
current.push(value);
|
|
26
|
+
else
|
|
27
|
+
flags[name] = value;
|
|
28
|
+
}
|
|
29
|
+
function parse(argv) {
|
|
30
|
+
const words = [];
|
|
31
|
+
const flags = {};
|
|
32
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
33
|
+
const item = argv[index];
|
|
34
|
+
if (!item.startsWith("--")) {
|
|
35
|
+
words.push(item);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const [name, inline] = item.slice(2).split("=", 2);
|
|
39
|
+
if (inline !== undefined)
|
|
40
|
+
addFlag(flags, name, inline);
|
|
41
|
+
else if (argv[index + 1] !== undefined && !argv[index + 1].startsWith("--"))
|
|
42
|
+
addFlag(flags, name, argv[++index]);
|
|
43
|
+
else
|
|
44
|
+
addFlag(flags, name, true);
|
|
45
|
+
}
|
|
46
|
+
return { words, flags };
|
|
47
|
+
}
|
|
48
|
+
function required(flags, name) {
|
|
49
|
+
const value = flags[name];
|
|
50
|
+
if (typeof value !== "string")
|
|
51
|
+
throw new ApexError("APEX_USAGE", `Missing --${name}`, EXIT_CODES.usage);
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
function confirmed(flags, command) {
|
|
55
|
+
if (flags.yes !== true)
|
|
56
|
+
throw new ApexError("APEX_USAGE", `${command} requires --yes`, EXIT_CODES.usage);
|
|
57
|
+
}
|
|
58
|
+
function clientId(flags) {
|
|
59
|
+
const value = flags.client ?? "github-copilot-vscode";
|
|
60
|
+
if (value !== "github-copilot-cli" && value !== "github-copilot-vscode") {
|
|
61
|
+
throw new ApexError("APEX_USAGE", "--client must be github-copilot-vscode or github-copilot-cli", EXIT_CODES.usage);
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function profileClientId(flags) {
|
|
66
|
+
const value = clientId(flags);
|
|
67
|
+
if (value !== "github-copilot-vscode") {
|
|
68
|
+
throw new ApexError("APEX_USAGE", "Profile bootstrap is supported only for github-copilot-vscode", EXIT_CODES.usage);
|
|
69
|
+
}
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
async function inputJson(flags) {
|
|
73
|
+
return JSON.parse(await readFile(required(flags, "file"), "utf8"));
|
|
74
|
+
}
|
|
75
|
+
function defaultProjectId(root) {
|
|
76
|
+
let value = basename(resolve(root))
|
|
77
|
+
.toLowerCase()
|
|
78
|
+
.replace(/[^a-z0-9]+/g, "-");
|
|
79
|
+
while (value.startsWith("-"))
|
|
80
|
+
value = value.slice(1);
|
|
81
|
+
while (value.endsWith("-"))
|
|
82
|
+
value = value.slice(0, -1);
|
|
83
|
+
return value.length === 0 ? "apex-project" : value;
|
|
84
|
+
}
|
|
85
|
+
async function onboardingConfig(flags, root) {
|
|
86
|
+
const config = typeof flags.file === "string"
|
|
87
|
+
? await inputJson(flags)
|
|
88
|
+
: {
|
|
89
|
+
schemaVersion: CONTRACT_VERSION,
|
|
90
|
+
projectId: typeof flags.project === "string" ? flags.project : defaultProjectId(root),
|
|
91
|
+
...(typeof flags.name === "string" ? { displayName: flags.name } : {}),
|
|
92
|
+
...(typeof flags.client === "string" ? { client: flags.client } : {}),
|
|
93
|
+
...(typeof flags.environment === "string" ? { environment: flags.environment } : {}),
|
|
94
|
+
...(typeof flags.target === "string" ? { targetScope: flags.target } : {}),
|
|
95
|
+
...(flags.iac === "terraform" ? { iacTool: "terraform" } : {}),
|
|
96
|
+
...(flags["create-repo"] === true ? { createRepository: true } : {}),
|
|
97
|
+
};
|
|
98
|
+
if (!Value.Check(OnboardingConfigV1Schema, config)) {
|
|
99
|
+
throw new ApexError("APEX_VALIDATION", "Onboarding configuration is malformed", EXIT_CODES.validation);
|
|
100
|
+
}
|
|
101
|
+
return config;
|
|
102
|
+
}
|
|
103
|
+
async function configuredProviders(root, flags) {
|
|
104
|
+
const persistedPath = join(root, ".apex", "provider-config.json");
|
|
105
|
+
const explicitPath = typeof flags["provider-config"] === "string" ? resolve(flags["provider-config"]) : undefined;
|
|
106
|
+
let config;
|
|
107
|
+
try {
|
|
108
|
+
config = JSON.parse(await readFile(explicitPath ?? persistedPath, "utf8"));
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
if (error.code === "ENOENT")
|
|
112
|
+
return {};
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
assertSecretFreeConfig(config);
|
|
116
|
+
if (explicitPath !== undefined) {
|
|
117
|
+
await mkdir(join(root, ".apex"), { recursive: true });
|
|
118
|
+
await atomicWriteJson(persistedPath, config);
|
|
119
|
+
}
|
|
120
|
+
const runner = new ProcessRunner();
|
|
121
|
+
let providerRuntime;
|
|
122
|
+
const runtime = async () => (providerRuntime ??= await createFileProviderRuntime(root));
|
|
123
|
+
const currentAuthority = async () => {
|
|
124
|
+
const selection = JSON.parse(await readFile(join(root, ".apex", "config.json"), "utf8"));
|
|
125
|
+
const runDirectory = join(root, ".apex", "projects", selection.projectId, "runs", selection.runId);
|
|
126
|
+
const run = JSON.parse(await readFile(join(runDirectory, "run.json"), "utf8"));
|
|
127
|
+
const journal = new EventJournal(join(runDirectory, "journal"));
|
|
128
|
+
const events = await journal.replay();
|
|
129
|
+
const dependencyRevision = calculateDependencyRevision(run, events);
|
|
130
|
+
let recipientIdentity = "local";
|
|
131
|
+
let previousOwnerEpoch;
|
|
132
|
+
let writerTransferClaimHash;
|
|
133
|
+
try {
|
|
134
|
+
const ownership = await new WriterTransferStore(runDirectory).currentActiveOwnership();
|
|
135
|
+
if (ownership === null)
|
|
136
|
+
return { head: dependencyRevision, dependencyRevision, ownerEpoch: run.ownerEpoch, recipientIdentity };
|
|
137
|
+
if (ownership.ownerEpoch === run.ownerEpoch && typeof ownership.ownerId === "string") {
|
|
138
|
+
recipientIdentity = ownership.ownerId;
|
|
139
|
+
if (typeof ownership.previousOwnerEpoch === "number" &&
|
|
140
|
+
ownership.previousOwnerEpoch + 1 === run.ownerEpoch &&
|
|
141
|
+
typeof ownership.claimHash === "string" &&
|
|
142
|
+
/^[0-9a-f]{64}$/.test(ownership.claimHash)) {
|
|
143
|
+
previousOwnerEpoch = ownership.previousOwnerEpoch;
|
|
144
|
+
writerTransferClaimHash = ownership.claimHash;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
if (error.code !== "ENOENT")
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
head: dependencyRevision,
|
|
154
|
+
dependencyRevision,
|
|
155
|
+
ownerEpoch: run.ownerEpoch,
|
|
156
|
+
...(previousOwnerEpoch === undefined || writerTransferClaimHash === undefined
|
|
157
|
+
? {}
|
|
158
|
+
: { previousOwnerEpoch, writerTransferClaimHash }),
|
|
159
|
+
recipientIdentity,
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
const providers = {};
|
|
163
|
+
if (config.bicep !== undefined) {
|
|
164
|
+
const value = config.bicep;
|
|
165
|
+
for (const key of ["resourceGroup", "deploymentName", "stackName", "templateFile"]) {
|
|
166
|
+
if (typeof value[key] !== "string" || value[key].length === 0)
|
|
167
|
+
throw new ApexError("APEX_USAGE", `Bicep provider config requires ${key}`, EXIT_CODES.usage);
|
|
168
|
+
}
|
|
169
|
+
const localRuntime = await runtime();
|
|
170
|
+
providers.bicep = new NativeBicepProvider({
|
|
171
|
+
runner,
|
|
172
|
+
currentAuthority,
|
|
173
|
+
bindingStore: localRuntime.bindingStores.bicep,
|
|
174
|
+
target: {
|
|
175
|
+
resourceGroup: value.resourceGroup,
|
|
176
|
+
deploymentName: value.deploymentName,
|
|
177
|
+
stackName: value.stackName,
|
|
178
|
+
templateFile: value.templateFile,
|
|
179
|
+
actionOnUnmanage: value.actionOnUnmanage ?? "detachAll",
|
|
180
|
+
denySettingsMode: value.denySettingsMode ?? "denyDelete",
|
|
181
|
+
...(value.ownershipAuthorizesDeleteResources === undefined
|
|
182
|
+
? {}
|
|
183
|
+
: { ownershipAuthorizesDeleteResources: value.ownershipAuthorizesDeleteResources }),
|
|
184
|
+
...(value.dedicatedSandboxResourceGroup === undefined
|
|
185
|
+
? {}
|
|
186
|
+
: { dedicatedSandboxResourceGroup: value.dedicatedSandboxResourceGroup }),
|
|
187
|
+
...(value.allowDeleteAll === undefined ? {} : { allowDeleteAll: value.allowDeleteAll }),
|
|
188
|
+
...(value.parametersFile === undefined ? {} : { parametersFile: value.parametersFile }),
|
|
189
|
+
...(value.cwd === undefined ? {} : { cwd: value.cwd }),
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (config.terraform !== undefined) {
|
|
194
|
+
const value = config.terraform;
|
|
195
|
+
for (const key of ["cwd", "target", "planDirectory", "lockfileHash"]) {
|
|
196
|
+
if (typeof value[key] !== "string" || value[key].length === 0)
|
|
197
|
+
throw new ApexError("APEX_USAGE", `Terraform provider config requires ${key}`, EXIT_CODES.usage);
|
|
198
|
+
}
|
|
199
|
+
const localRuntime = await runtime();
|
|
200
|
+
const terraformRoot = resolve(root, value.cwd);
|
|
201
|
+
const actualLockfileHash = await hashTerraformLockFile(terraformRoot);
|
|
202
|
+
if (actualLockfileHash !== value.lockfileHash) {
|
|
203
|
+
throw new ApexError("APEX_STALE", `Terraform lockfileHash is stale: expected ${value.lockfileHash}, found ${actualLockfileHash}`, EXIT_CODES.stale);
|
|
204
|
+
}
|
|
205
|
+
const configHash = async () => {
|
|
206
|
+
const actual = await hashTerraformConfiguration(terraformRoot);
|
|
207
|
+
if (value.configHash !== undefined && value.configHash !== actual) {
|
|
208
|
+
throw new ApexError("APEX_STALE", `Terraform configHash is stale: expected ${value.configHash}, found ${actual}`, EXIT_CODES.stale);
|
|
209
|
+
}
|
|
210
|
+
return actual;
|
|
211
|
+
};
|
|
212
|
+
providers.terraform = new NativeTerraformProvider({
|
|
213
|
+
runner,
|
|
214
|
+
currentAuthority,
|
|
215
|
+
bindingStore: localRuntime.bindingStores.terraform,
|
|
216
|
+
artifactStore: localRuntime.artifactStore,
|
|
217
|
+
keyProvider: localRuntime.keyProvider,
|
|
218
|
+
target: {
|
|
219
|
+
cwd: value.cwd,
|
|
220
|
+
target: value.target,
|
|
221
|
+
lockfileHash: actualLockfileHash,
|
|
222
|
+
configHash,
|
|
223
|
+
planPath: (request, operation) => join(value.planDirectory, `${request.runId}-${operation}.tfplan`),
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
return providers;
|
|
228
|
+
}
|
|
229
|
+
function assertSecretFreeConfig(value, path = "provider-config") {
|
|
230
|
+
if (Array.isArray(value)) {
|
|
231
|
+
value.forEach((item, index) => assertSecretFreeConfig(item, `${path}[${index}]`));
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (value === null || typeof value !== "object")
|
|
235
|
+
return;
|
|
236
|
+
for (const [key, item] of Object.entries(value)) {
|
|
237
|
+
if (/secret|password|token|credential|api[-_]?key|private[-_]?key|access[-_]?key/i.test(key)) {
|
|
238
|
+
throw new ApexError("APEX_VALIDATION", `Provider config must not contain secret key '${path}.${key}'`, EXIT_CODES.validation);
|
|
239
|
+
}
|
|
240
|
+
assertSecretFreeConfig(item, `${path}.${key}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function files(flags) {
|
|
244
|
+
const value = flags.file;
|
|
245
|
+
if (typeof value === "string")
|
|
246
|
+
return [value];
|
|
247
|
+
if (Array.isArray(value) && value.length > 0)
|
|
248
|
+
return value;
|
|
249
|
+
throw new ApexError("APEX_USAGE", "Missing --file", EXIT_CODES.usage);
|
|
250
|
+
}
|
|
251
|
+
async function evaluateQuality(root, flags) {
|
|
252
|
+
const assets = await resolveBundledAssets();
|
|
253
|
+
const scorecardPath = typeof flags.scorecard === "string" ? resolve(flags.scorecard) : join(assets.config, "quality-scorecard.v1.json");
|
|
254
|
+
const measurementPath = resolve(required(flags, "measurements"));
|
|
255
|
+
const scorecard = JSON.parse(await readFile(scorecardPath, "utf8"));
|
|
256
|
+
const measurementInput = JSON.parse(await readFile(measurementPath, "utf8"));
|
|
257
|
+
const inputMeasurements = Array.isArray(measurementInput)
|
|
258
|
+
? measurementInput
|
|
259
|
+
: measurementInput !== null && typeof measurementInput === "object"
|
|
260
|
+
? measurementInput.measurements
|
|
261
|
+
: undefined;
|
|
262
|
+
if (inputMeasurements === undefined)
|
|
263
|
+
throw new ApexError("APEX_USAGE", "Measurements file must be an array or contain measurements[]", EXIT_CODES.usage);
|
|
264
|
+
const measurements = inputMeasurements
|
|
265
|
+
.map((measurement) => ({
|
|
266
|
+
metric: measurement.metric,
|
|
267
|
+
scenario: measurement.scenario,
|
|
268
|
+
...(measurement.value === undefined ? {} : { value: measurement.value }),
|
|
269
|
+
samples: measurement.samples,
|
|
270
|
+
evidenceRefs: [
|
|
271
|
+
...new Set((measurement.evidenceRefs ?? measurement.provenance?.inputReportHashes ?? []).filter((reference) => typeof reference === "string")),
|
|
272
|
+
].sort(),
|
|
273
|
+
}))
|
|
274
|
+
.sort((left, right) => `${left.metric}\u0000${left.scenario}`.localeCompare(`${right.metric}\u0000${right.scenario}`));
|
|
275
|
+
const measurementSet = { schemaVersion: "1.0.0", measurements };
|
|
276
|
+
const measurementRegistry = new ValidatorRegistry();
|
|
277
|
+
measurementRegistry.register("quality-measurements", QualityMeasurementsV1Schema);
|
|
278
|
+
const measurementValidation = measurementRegistry.validate("quality-measurements", measurementSet);
|
|
279
|
+
if (!measurementValidation.valid)
|
|
280
|
+
throw new ApexError("APEX_VALIDATION", "Quality measurements validation failed", EXIT_CODES.validation, measurementValidation.issues);
|
|
281
|
+
const keys = measurements.map(({ metric, scenario }) => `${metric}\u0000${scenario}`);
|
|
282
|
+
if (new Set(keys).size !== keys.length)
|
|
283
|
+
throw new ApexError("APEX_VALIDATION", "Quality measurements contain duplicate metric/scenario pairs", EXIT_CODES.validation);
|
|
284
|
+
const evaluations = evaluateQualityScorecard(scorecard, measurements);
|
|
285
|
+
const artifact = {
|
|
286
|
+
schemaVersion: "1.0.0",
|
|
287
|
+
scorecardHash: sha256Json(scorecard),
|
|
288
|
+
measurementsHash: sha256Json(measurementSet),
|
|
289
|
+
status: evaluations.some(({ decision }) => decision === "fail") ||
|
|
290
|
+
!evaluations.some(({ decision }) => decision === "pass")
|
|
291
|
+
? "fail"
|
|
292
|
+
: "pass",
|
|
293
|
+
evaluations,
|
|
294
|
+
};
|
|
295
|
+
const outputDirectory = join(root, ".apex", "quality");
|
|
296
|
+
await mkdir(outputDirectory, { recursive: true });
|
|
297
|
+
await atomicWriteJson(join(outputDirectory, "measurements.json"), measurementSet);
|
|
298
|
+
await atomicWriteJson(join(outputDirectory, "evaluation.json"), artifact);
|
|
299
|
+
await writeFile(join(outputDirectory, "evaluation.md"), `${renderQualityScorecardEvaluation(scorecard, measurements)}\n`, "utf8");
|
|
300
|
+
if (artifact.status === "fail")
|
|
301
|
+
throw new ApexError("APEX_VALIDATION", "Quality scorecard evaluation failed", EXIT_CODES.validation, artifact);
|
|
302
|
+
return artifact;
|
|
303
|
+
}
|
|
304
|
+
async function qualityStatus(root) {
|
|
305
|
+
try {
|
|
306
|
+
return JSON.parse(await readFile(join(root, ".apex", "quality", "evaluation.json"), "utf8"));
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
if (error.code === "ENOENT")
|
|
310
|
+
throw new ApexError("APEX_VALIDATION", "No quality evaluation is available", EXIT_CODES.validation);
|
|
311
|
+
throw error;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
export async function execute(argv, root = process.cwd(), options = {}) {
|
|
315
|
+
const { words, flags } = parse(argv);
|
|
316
|
+
const command = words.join(" ");
|
|
317
|
+
const runner = new ProcessRunner();
|
|
318
|
+
const service = new ApexService(root, {
|
|
319
|
+
...options,
|
|
320
|
+
providers: { ...options.providers, ...(await configuredProviders(root, flags)) },
|
|
321
|
+
azureAuthStatus: options.azureAuthStatus ??
|
|
322
|
+
(async (live) => {
|
|
323
|
+
if (!live || command !== "setup")
|
|
324
|
+
return { authenticated: false, detail: "not-checked; run setup --live" };
|
|
325
|
+
try {
|
|
326
|
+
const result = await runner.run({
|
|
327
|
+
executable: "az",
|
|
328
|
+
args: ["account", "show", "--output", "json"],
|
|
329
|
+
timeoutMs: 15_000,
|
|
330
|
+
maxOutputBytes: 64 * 1024,
|
|
331
|
+
});
|
|
332
|
+
const account = JSON.parse(result.stdout);
|
|
333
|
+
return {
|
|
334
|
+
authenticated: typeof account.id === "string",
|
|
335
|
+
detail: typeof account.tenantId === "string" ? `tenant:${account.tenantId}` : "authenticated",
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
return { authenticated: false, detail: "Azure CLI is not authenticated" };
|
|
340
|
+
}
|
|
341
|
+
}),
|
|
342
|
+
});
|
|
343
|
+
switch (command) {
|
|
344
|
+
case "version": {
|
|
345
|
+
const assets = await resolveBundledAssets();
|
|
346
|
+
return {
|
|
347
|
+
version: APEX_VERSION,
|
|
348
|
+
bundleVersion: assets.manifest.sources.customizations,
|
|
349
|
+
configVersion: assets.manifest.sources.config,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
case "init":
|
|
353
|
+
return service.init({
|
|
354
|
+
projectId: required(flags, "project"),
|
|
355
|
+
...(typeof flags.name === "string" ? { displayName: flags.name } : {}),
|
|
356
|
+
...(typeof flags.environment === "string" ? { environment: flags.environment } : {}),
|
|
357
|
+
...(typeof flags.target === "string" ? { targetScope: flags.target } : {}),
|
|
358
|
+
iacTool: flags.iac === "terraform" ? "terraform" : "bicep",
|
|
359
|
+
clientId: clientId(flags),
|
|
360
|
+
...(typeof flags["customizations-source"] === "string"
|
|
361
|
+
? { customizationsSource: flags["customizations-source"] }
|
|
362
|
+
: {}),
|
|
363
|
+
});
|
|
364
|
+
case "bootstrap": {
|
|
365
|
+
confirmed(flags, "bootstrap");
|
|
366
|
+
const config = await onboardingConfig(flags, root);
|
|
367
|
+
if (typeof flags.client === "string" && config.client !== undefined && flags.client !== config.client) {
|
|
368
|
+
throw new ApexError("APEX_USAGE", "--client conflicts with the onboarding configuration", EXIT_CODES.usage);
|
|
369
|
+
}
|
|
370
|
+
return service.bootstrap({
|
|
371
|
+
projectId: config.projectId,
|
|
372
|
+
...(config.displayName === undefined ? {} : { displayName: config.displayName }),
|
|
373
|
+
...(config.environment === undefined ? {} : { environment: config.environment }),
|
|
374
|
+
...(config.targetScope === undefined ? {} : { targetScope: config.targetScope }),
|
|
375
|
+
...(config.iacTool === undefined ? {} : { iacTool: config.iacTool }),
|
|
376
|
+
clientId: config.client ?? clientId(flags),
|
|
377
|
+
...(config.createRepository === undefined ? {} : { createRepository: config.createRepository }),
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
case "profile status":
|
|
381
|
+
profileClientId(flags);
|
|
382
|
+
return service.profileStatus();
|
|
383
|
+
case "profile install":
|
|
384
|
+
confirmed(flags, "profile install");
|
|
385
|
+
profileClientId(flags);
|
|
386
|
+
return service.profileInstall();
|
|
387
|
+
case "profile update":
|
|
388
|
+
confirmed(flags, "profile update");
|
|
389
|
+
profileClientId(flags);
|
|
390
|
+
return service.profileUpdate();
|
|
391
|
+
case "profile uninstall":
|
|
392
|
+
confirmed(flags, "profile uninstall");
|
|
393
|
+
profileClientId(flags);
|
|
394
|
+
return service.profileUninstall();
|
|
395
|
+
case "update":
|
|
396
|
+
return service.update(typeof flags["customizations-source"] === "string" ? flags["customizations-source"] : undefined);
|
|
397
|
+
case "setup":
|
|
398
|
+
return service.setup(flags.live === true);
|
|
399
|
+
case "doctor":
|
|
400
|
+
return service.doctor(flags.fix === true, flags.yes === true, false);
|
|
401
|
+
case "capability list":
|
|
402
|
+
return service.capabilityList(typeof flags.manifest === "string" ? flags.manifest : undefined);
|
|
403
|
+
case "capability status":
|
|
404
|
+
return service.capabilityStatus(required(flags, "pack"), typeof flags.manifest === "string" ? flags.manifest : undefined);
|
|
405
|
+
case "capability install":
|
|
406
|
+
confirmed(flags, "capability install");
|
|
407
|
+
return service.capabilityInstall(required(flags, "pack"), typeof flags.manifest === "string" ? flags.manifest : undefined, { cacheDeno: flags.cache === true });
|
|
408
|
+
case "capability update":
|
|
409
|
+
confirmed(flags, "capability update");
|
|
410
|
+
return service.capabilityUpdate(required(flags, "pack"), typeof flags.manifest === "string" ? flags.manifest : undefined, { cacheDeno: flags.cache === true });
|
|
411
|
+
case "capability rollback":
|
|
412
|
+
confirmed(flags, "capability rollback");
|
|
413
|
+
return service.capabilityRollback(required(flags, "pack"), typeof flags.manifest === "string" ? flags.manifest : undefined);
|
|
414
|
+
case "capability verify":
|
|
415
|
+
return service.capabilityVerify(required(flags, "pack"), typeof flags.manifest === "string" ? flags.manifest : undefined);
|
|
416
|
+
case "capability uninstall":
|
|
417
|
+
confirmed(flags, "capability uninstall");
|
|
418
|
+
return service.capabilityUninstall(required(flags, "pack"), typeof flags.manifest === "string" ? flags.manifest : undefined);
|
|
419
|
+
case "project list":
|
|
420
|
+
return service.listProjects();
|
|
421
|
+
case "project create":
|
|
422
|
+
return service.createProject({
|
|
423
|
+
projectId: required(flags, "project"),
|
|
424
|
+
...(typeof flags.name === "string" ? { displayName: flags.name } : {}),
|
|
425
|
+
...(typeof flags.environment === "string" ? { environment: flags.environment } : {}),
|
|
426
|
+
...(typeof flags.target === "string" ? { targetScope: flags.target } : {}),
|
|
427
|
+
iacTool: flags.iac === "terraform" ? "terraform" : "bicep",
|
|
428
|
+
});
|
|
429
|
+
case "project use":
|
|
430
|
+
return service.use(required(flags, "project"), typeof flags.run === "string" ? flags.run : undefined);
|
|
431
|
+
case "project show":
|
|
432
|
+
return service.show(typeof flags.project === "string" ? flags.project : undefined);
|
|
433
|
+
case "project search":
|
|
434
|
+
return service.search(required(flags, "query"));
|
|
435
|
+
case "project history":
|
|
436
|
+
return service.history(typeof flags.limit === "string" ? Number(flags.limit) : undefined);
|
|
437
|
+
case "project promote":
|
|
438
|
+
return service.promote(required(flags, "environment"), required(flags, "target"));
|
|
439
|
+
case "state transfer-export": {
|
|
440
|
+
confirmed(flags, "state transfer-export");
|
|
441
|
+
const ttlSeconds = Number(required(flags, "ttl-seconds"));
|
|
442
|
+
if (!Number.isInteger(ttlSeconds) || ttlSeconds <= 0) {
|
|
443
|
+
throw new ApexError("APEX_USAGE", "--ttl-seconds must be a positive integer", EXIT_CODES.usage);
|
|
444
|
+
}
|
|
445
|
+
return exportStateTransfer(root, required(flags, "file"), {
|
|
446
|
+
claimHash: required(flags, "claim"),
|
|
447
|
+
recipient: required(flags, "recipient"),
|
|
448
|
+
ttlMs: ttlSeconds * 1_000,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
case "state transfer-import": {
|
|
452
|
+
confirmed(flags, "state transfer-import");
|
|
453
|
+
return importStateTransfer(root, JSON.parse(await readFile(required(flags, "file"), "utf8")), required(flags, "recipient"));
|
|
454
|
+
}
|
|
455
|
+
case "provider transfer-export": {
|
|
456
|
+
confirmed(flags, "provider transfer-export");
|
|
457
|
+
const ttlSeconds = Number(required(flags, "ttl-seconds"));
|
|
458
|
+
if (!Number.isInteger(ttlSeconds) || ttlSeconds <= 0) {
|
|
459
|
+
throw new ApexError("APEX_USAGE", "--ttl-seconds must be a positive integer", EXIT_CODES.usage);
|
|
460
|
+
}
|
|
461
|
+
const provider = required(flags, "provider");
|
|
462
|
+
if (provider !== "bicep" && provider !== "terraform") {
|
|
463
|
+
throw new ApexError("APEX_USAGE", "--provider must be bicep or terraform", EXIT_CODES.usage);
|
|
464
|
+
}
|
|
465
|
+
return exportProviderTransfer(root, required(flags, "file"), {
|
|
466
|
+
previewHash: required(flags, "preview"),
|
|
467
|
+
provider,
|
|
468
|
+
recipient: required(flags, "recipient"),
|
|
469
|
+
ttlMs: ttlSeconds * 1_000,
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
case "provider transfer-import": {
|
|
473
|
+
confirmed(flags, "provider transfer-import");
|
|
474
|
+
return importProviderTransfer(root, JSON.parse(await readFile(required(flags, "file"), "utf8")), required(flags, "recipient"));
|
|
475
|
+
}
|
|
476
|
+
case "status":
|
|
477
|
+
return service.status();
|
|
478
|
+
case "task next":
|
|
479
|
+
return service.nextTask();
|
|
480
|
+
case "task context":
|
|
481
|
+
return service.taskContext(required(flags, "task"));
|
|
482
|
+
case "task complete": {
|
|
483
|
+
const paths = files(flags);
|
|
484
|
+
if (paths.length > 1) {
|
|
485
|
+
const outputs = await Promise.all(paths.map(async (path) => JSON.parse(await readFile(path, "utf8"))));
|
|
486
|
+
return service.completeTaskOutputs(required(flags, "task"), outputs);
|
|
487
|
+
}
|
|
488
|
+
return service.completeTask(required(flags, "task"), {
|
|
489
|
+
kind: required(flags, "kind"),
|
|
490
|
+
value: JSON.parse(await readFile(paths[0], "utf8")),
|
|
491
|
+
...(typeof flags.summary === "string" ? { summary: flags.summary } : {}),
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
case "task complete-bundle": {
|
|
495
|
+
const bundle = (await inputJson(flags));
|
|
496
|
+
const outputs = Array.isArray(bundle) ? bundle : bundle.outputs;
|
|
497
|
+
if (!Array.isArray(outputs))
|
|
498
|
+
throw new ApexError("APEX_USAGE", "Bundle file must contain outputs[]", EXIT_CODES.usage);
|
|
499
|
+
const taskId = Array.isArray(bundle) ? required(flags, "task") : (bundle.taskId ?? required(flags, "task"));
|
|
500
|
+
return service.completeTaskOutputs(taskId, outputs);
|
|
501
|
+
}
|
|
502
|
+
case "task cancel":
|
|
503
|
+
return service.cancelTask(required(flags, "task"));
|
|
504
|
+
case "task stage-file":
|
|
505
|
+
return service.stageFile(required(flags, "task"), required(flags, "path"), await readFile(required(flags, "file")), typeof flags.sha === "string" ? flags.sha : undefined);
|
|
506
|
+
case "task generate-iac":
|
|
507
|
+
return service.generateIac(required(flags, "task"));
|
|
508
|
+
case "review resolve":
|
|
509
|
+
return service.resolveReview(JSON.parse(await readFile(required(flags, "file"), "utf8")));
|
|
510
|
+
case "gate decide": {
|
|
511
|
+
const mechanism = flags.mechanism ?? "tty";
|
|
512
|
+
if (mechanism !== "tty") {
|
|
513
|
+
throw new ApexError("APEX_USAGE", "--mechanism must be tty", EXIT_CODES.usage);
|
|
514
|
+
}
|
|
515
|
+
if (flags.recipient === true || Array.isArray(flags.recipient) || flags.recipient === "") {
|
|
516
|
+
throw new ApexError("APEX_USAGE", "--recipient must be a nonempty identity", EXIT_CODES.usage);
|
|
517
|
+
}
|
|
518
|
+
return service.decideGateNumber(Number(required(flags, "gate")), required(flags, "decision"), required(flags, "actor"), typeof flags.recipient === "string" ? { recipientIdentity: flags.recipient } : {});
|
|
519
|
+
}
|
|
520
|
+
case "validate":
|
|
521
|
+
return service.validate();
|
|
522
|
+
case "preview":
|
|
523
|
+
if (flags.recipient === true || Array.isArray(flags.recipient) || flags.recipient === "") {
|
|
524
|
+
throw new ApexError("APEX_USAGE", "--recipient must be a nonempty identity", EXIT_CODES.usage);
|
|
525
|
+
}
|
|
526
|
+
return service.preview({
|
|
527
|
+
operation: required(flags, "operation"),
|
|
528
|
+
provider: required(flags, "provider"),
|
|
529
|
+
...(typeof flags.recipient === "string" && flags.recipient.length > 0
|
|
530
|
+
? { recipientIdentity: flags.recipient }
|
|
531
|
+
: {}),
|
|
532
|
+
});
|
|
533
|
+
case "approval show":
|
|
534
|
+
return service.currentApproval();
|
|
535
|
+
case "deploy":
|
|
536
|
+
return service.deploy(typeof flags.preview === "string" ? flags.preview : undefined);
|
|
537
|
+
case "reconcile":
|
|
538
|
+
return service.reconcile();
|
|
539
|
+
case "inventory":
|
|
540
|
+
return service.inventory();
|
|
541
|
+
case "diagnose":
|
|
542
|
+
return service.diagnose();
|
|
543
|
+
case "render":
|
|
544
|
+
return service.render(required(flags, "kind"));
|
|
545
|
+
case "promote":
|
|
546
|
+
return service.promote(required(flags, "environment"), required(flags, "target"));
|
|
547
|
+
case "customizations rollback":
|
|
548
|
+
return service.rollbackCustomizations();
|
|
549
|
+
case "customizations uninstall":
|
|
550
|
+
return service.uninstallCustomizations();
|
|
551
|
+
case "customizations reinstall":
|
|
552
|
+
return service.reinstallCustomizations(typeof flags["customizations-source"] === "string" ? flags["customizations-source"] : undefined);
|
|
553
|
+
case "writer transfer-create":
|
|
554
|
+
return service.createWriterTransfer({
|
|
555
|
+
repository: required(flags, "repo"),
|
|
556
|
+
branch: required(flags, "branch"),
|
|
557
|
+
commit: required(flags, "commit"),
|
|
558
|
+
workflowId: required(flags, "workflow"),
|
|
559
|
+
sender: required(flags, "sender"),
|
|
560
|
+
recipient: required(flags, "recipient"),
|
|
561
|
+
...(typeof flags.environment === "string" ? { approvalEnvironment: flags.environment } : {}),
|
|
562
|
+
currentHead: required(flags, "head"),
|
|
563
|
+
ttlMs: Number(required(flags, "ttl")),
|
|
564
|
+
});
|
|
565
|
+
case "writer transfer-accept":
|
|
566
|
+
return service.acceptWriterTransfer(required(flags, "claim"), required(flags, "recipient"), required(flags, "head"));
|
|
567
|
+
case "writer show":
|
|
568
|
+
return service.currentWriter();
|
|
569
|
+
case "evidence accept":
|
|
570
|
+
return service.acceptEvidence({
|
|
571
|
+
kind: required(flags, "kind"),
|
|
572
|
+
contentType: required(flags, "content-type"),
|
|
573
|
+
...(typeof flags.file === "string"
|
|
574
|
+
? { file: flags.file }
|
|
575
|
+
: { value: JSON.parse(required(flags, "value")) }),
|
|
576
|
+
required: flags.required === true,
|
|
577
|
+
});
|
|
578
|
+
case "telemetry consent":
|
|
579
|
+
return service.setTelemetryConsent(required(flags, "value") === "true");
|
|
580
|
+
case "telemetry export":
|
|
581
|
+
return service.exportTelemetry();
|
|
582
|
+
case "telemetry delete":
|
|
583
|
+
return service.deleteTelemetry();
|
|
584
|
+
case "cache status":
|
|
585
|
+
return service.cacheStatus();
|
|
586
|
+
case "cache clear":
|
|
587
|
+
return service.clearCache();
|
|
588
|
+
case "quality evaluate":
|
|
589
|
+
return evaluateQuality(root, flags);
|
|
590
|
+
case "quality status":
|
|
591
|
+
return qualityStatus(root);
|
|
592
|
+
case "quality observe":
|
|
593
|
+
return service.improvementObserve((await inputJson(flags)));
|
|
594
|
+
case "quality scan":
|
|
595
|
+
return service.improvementScan();
|
|
596
|
+
case "quality observations":
|
|
597
|
+
return service.improvementObservations();
|
|
598
|
+
case "quality proposals":
|
|
599
|
+
return service.improvementProposals();
|
|
600
|
+
case "quality decide":
|
|
601
|
+
confirmed(flags, "quality decide");
|
|
602
|
+
return service.improvementDecide({
|
|
603
|
+
proposalId: required(flags, "proposal"),
|
|
604
|
+
actor: required(flags, "actor"),
|
|
605
|
+
decision: required(flags, "decision"),
|
|
606
|
+
rationale: required(flags, "rationale"),
|
|
607
|
+
...(typeof flags["external-ref"] === "string" ? { externalRef: flags["external-ref"] } : {}),
|
|
608
|
+
});
|
|
609
|
+
case "quality delete-observation":
|
|
610
|
+
confirmed(flags, "quality delete-observation");
|
|
611
|
+
return service.improvementDeleteObservation(required(flags, "observation"));
|
|
612
|
+
case "quality prune":
|
|
613
|
+
confirmed(flags, "quality prune");
|
|
614
|
+
return service.improvementPrune();
|
|
615
|
+
case "mcp serve":
|
|
616
|
+
await serveMcp(service);
|
|
617
|
+
return undefined;
|
|
618
|
+
default:
|
|
619
|
+
throw new ApexError("APEX_USAGE", `Unknown command: ${command || "<none>"}`, EXIT_CODES.usage);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
async function main() {
|
|
623
|
+
const json = process.argv.includes("--json");
|
|
624
|
+
try {
|
|
625
|
+
const result = await execute(process.argv.slice(2));
|
|
626
|
+
if (result !== undefined)
|
|
627
|
+
process.stdout.write(json
|
|
628
|
+
? `${JSON.stringify({ ok: true, result })}\n`
|
|
629
|
+
: `${typeof result === "string" ? result : JSON.stringify(result, null, 2)}\n`);
|
|
630
|
+
}
|
|
631
|
+
catch (error) {
|
|
632
|
+
const normalized = normalizeError(error);
|
|
633
|
+
const value = {
|
|
634
|
+
ok: false,
|
|
635
|
+
error: { code: normalized.code, message: normalized.message, details: normalized.details },
|
|
636
|
+
};
|
|
637
|
+
process.stderr.write(json ? `${JSON.stringify(value)}\n` : `${normalized.code}: ${normalized.message}\n`);
|
|
638
|
+
process.exitCode = normalized.exitCode;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (process.argv[1] !== undefined && (await realpath(process.argv[1])) === (await realpath(new URL(import.meta.url))))
|
|
642
|
+
await main();
|
|
643
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EventV1, RunConfigV1 } from "@apexops/contracts";
|
|
2
|
+
type DependencyRevisionRun = Pick<RunConfigV1, "projectId" | "runId" | "targetScope" | "iacTool" | "runtimeLockHash">;
|
|
3
|
+
export declare function dependencyRevision(run: DependencyRevisionRun, events: readonly EventV1[]): string;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=dependency-revision.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { sha256Json } from "@apexops/kernel";
|
|
2
|
+
export function dependencyRevision(run, events) {
|
|
3
|
+
const artifacts = events.reduce((current, event) => {
|
|
4
|
+
if (event.type !== "task.completed")
|
|
5
|
+
return current;
|
|
6
|
+
const hashes = event.payload.artifactHashes ?? {};
|
|
7
|
+
for (const [kind, hash] of Object.entries(hashes))
|
|
8
|
+
if (typeof hash === "string")
|
|
9
|
+
current[kind] = hash;
|
|
10
|
+
return current;
|
|
11
|
+
}, {});
|
|
12
|
+
return sha256Json({
|
|
13
|
+
projectId: run.projectId,
|
|
14
|
+
runId: run.runId,
|
|
15
|
+
targetScope: run.targetScope,
|
|
16
|
+
iacTool: run.iacTool,
|
|
17
|
+
runtimeLockHash: run.runtimeLockHash,
|
|
18
|
+
artifacts,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=dependency-revision.js.map
|