@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/errors.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const EXIT_CODES: {
|
|
2
|
+
readonly success: 0;
|
|
3
|
+
readonly usage: 2;
|
|
4
|
+
readonly notFound: 3;
|
|
5
|
+
readonly conflict: 4;
|
|
6
|
+
readonly validation: 5;
|
|
7
|
+
readonly stale: 6;
|
|
8
|
+
readonly authorization: 7;
|
|
9
|
+
readonly internal: 10;
|
|
10
|
+
};
|
|
11
|
+
export type ApexErrorCode = "APEX_USAGE" | "APEX_NOT_FOUND" | "APEX_CONFLICT" | "APEX_VALIDATION" | "APEX_STALE" | "APEX_AUTHORIZATION" | "APEX_INTERNAL";
|
|
12
|
+
export declare class ApexError extends Error {
|
|
13
|
+
readonly code: ApexErrorCode;
|
|
14
|
+
readonly exitCode: number;
|
|
15
|
+
readonly details?: unknown;
|
|
16
|
+
constructor(code: ApexErrorCode, message: string, exitCode: number, details?: unknown, options?: ErrorOptions);
|
|
17
|
+
}
|
|
18
|
+
export declare function normalizeError(error: unknown): ApexError;
|
|
19
|
+
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const EXIT_CODES = {
|
|
2
|
+
success: 0,
|
|
3
|
+
usage: 2,
|
|
4
|
+
notFound: 3,
|
|
5
|
+
conflict: 4,
|
|
6
|
+
validation: 5,
|
|
7
|
+
stale: 6,
|
|
8
|
+
authorization: 7,
|
|
9
|
+
internal: 10,
|
|
10
|
+
};
|
|
11
|
+
export class ApexError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
exitCode;
|
|
14
|
+
details;
|
|
15
|
+
constructor(code, message, exitCode, details, options) {
|
|
16
|
+
super(message, options);
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.exitCode = exitCode;
|
|
19
|
+
this.details = details;
|
|
20
|
+
this.name = "ApexError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function normalizeError(error) {
|
|
24
|
+
if (error instanceof ApexError)
|
|
25
|
+
return error;
|
|
26
|
+
if (error instanceof Error && /expired|stale/i.test(error.message)) {
|
|
27
|
+
return new ApexError("APEX_STALE", error.message, EXIT_CODES.stale, undefined, { cause: error });
|
|
28
|
+
}
|
|
29
|
+
if (error instanceof Error && error.code === "ENOENT") {
|
|
30
|
+
return new ApexError("APEX_NOT_FOUND", error.message, EXIT_CODES.notFound, undefined, { cause: error });
|
|
31
|
+
}
|
|
32
|
+
return new ApexError("APEX_INTERNAL", error instanceof Error ? error.message : String(error), EXIT_CODES.internal, undefined, { cause: error });
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=errors.js.map
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { ApexService } from "./service.js";
|
|
3
|
+
export declare function createMcpServer(service: ApexService): McpServer;
|
|
4
|
+
export declare function serveMcp(service: ApexService): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { ApexService, SUPPORTED_ARTIFACT_KINDS } from "./service.js";
|
|
5
|
+
import { APEX_VERSION } from "./version.js";
|
|
6
|
+
const artifactKind = z.enum(SUPPORTED_ARTIFACT_KINDS);
|
|
7
|
+
const taskOutput = z.object({ kind: artifactKind, value: z.unknown(), summary: z.string().optional() });
|
|
8
|
+
const uniqueStrings = z
|
|
9
|
+
.array(z.string().min(1))
|
|
10
|
+
.min(1)
|
|
11
|
+
.refine((values) => new Set(values).size === values.length);
|
|
12
|
+
const inputValue = z.union([
|
|
13
|
+
z.string().min(1),
|
|
14
|
+
uniqueStrings,
|
|
15
|
+
z.object({ kind: z.literal("deferred"), owner: z.string().min(1) }).strict(),
|
|
16
|
+
z.object({ kind: z.literal("unknown") }).strict(),
|
|
17
|
+
z
|
|
18
|
+
.object({
|
|
19
|
+
kind: z.literal("budget"),
|
|
20
|
+
amount: z.number().nonnegative(),
|
|
21
|
+
currency: z.string().regex(/^[A-Z]{3}$/),
|
|
22
|
+
cadence: z.literal("monthly"),
|
|
23
|
+
})
|
|
24
|
+
.strict(),
|
|
25
|
+
z
|
|
26
|
+
.object({
|
|
27
|
+
kind: z.literal("recovery"),
|
|
28
|
+
rtoMinutes: z.number().int().nonnegative(),
|
|
29
|
+
rpoMinutes: z.number().int().nonnegative(),
|
|
30
|
+
})
|
|
31
|
+
.strict(),
|
|
32
|
+
z
|
|
33
|
+
.object({
|
|
34
|
+
kind: z.literal("data-classification"),
|
|
35
|
+
classification: z.enum(["public", "internal", "confidential", "restricted"]),
|
|
36
|
+
})
|
|
37
|
+
.strict(),
|
|
38
|
+
z.object({ kind: z.literal("compliance"), scopes: uniqueStrings }).strict(),
|
|
39
|
+
]);
|
|
40
|
+
const inputSubmission = z
|
|
41
|
+
.object({
|
|
42
|
+
schemaVersion: z.literal("1.0.0"),
|
|
43
|
+
requestId: z.string().min(1),
|
|
44
|
+
expectedHead: z.string().regex(/^[0-9a-f]{64}$/),
|
|
45
|
+
ownerEpoch: z.number().int().positive(),
|
|
46
|
+
answers: z
|
|
47
|
+
.array(z
|
|
48
|
+
.object({
|
|
49
|
+
questionId: z.string().min(1),
|
|
50
|
+
value: inputValue,
|
|
51
|
+
})
|
|
52
|
+
.strict())
|
|
53
|
+
.min(1),
|
|
54
|
+
})
|
|
55
|
+
.strict();
|
|
56
|
+
const normalizeOutputs = (outputs) => outputs.map(({ kind, value, summary }) => ({
|
|
57
|
+
kind,
|
|
58
|
+
value,
|
|
59
|
+
...(summary === undefined ? {} : { summary }),
|
|
60
|
+
}));
|
|
61
|
+
export function createMcpServer(service) {
|
|
62
|
+
const server = new McpServer({ name: "apex", version: APEX_VERSION });
|
|
63
|
+
const result = (value) => ({
|
|
64
|
+
content: [{ type: "text", text: JSON.stringify(value) }],
|
|
65
|
+
structuredContent: value,
|
|
66
|
+
});
|
|
67
|
+
server.registerTool("status", { description: "Read selected APEX run status" }, async () => result(await service.status()));
|
|
68
|
+
server.registerTool("capabilityList", { description: "Read capability pack availability" }, async () => result(await service.capabilityList()));
|
|
69
|
+
server.registerTool("capabilityStatus", { description: "Read one capability pack status", inputSchema: { pack: z.string() } }, async ({ pack }) => result(await service.capabilityStatus(pack)));
|
|
70
|
+
server.registerTool("nextTask", {
|
|
71
|
+
description: "Get the next workflow result. Handle needs_input before requesting context; only status=task returns a task.taskId.",
|
|
72
|
+
}, async () => result(await service.nextTask()));
|
|
73
|
+
server.registerTool("taskContext", {
|
|
74
|
+
description: "Read context only for the exact task.taskId returned by nextTask with status=task.",
|
|
75
|
+
inputSchema: { taskId: z.string() },
|
|
76
|
+
}, async ({ taskId }) => result(await service.taskContext(taskId)));
|
|
77
|
+
server.registerTool("recordInput", { description: "Record answers for the exact pending kernel input request", inputSchema: inputSubmission }, async (input) => result(await service.recordInput(input)));
|
|
78
|
+
server.registerTool("stageArtifact", {
|
|
79
|
+
inputSchema: {
|
|
80
|
+
taskId: z.string(),
|
|
81
|
+
kind: artifactKind.optional(),
|
|
82
|
+
value: z.unknown().optional(),
|
|
83
|
+
summary: z.string().optional(),
|
|
84
|
+
outputs: z.array(taskOutput).optional(),
|
|
85
|
+
},
|
|
86
|
+
}, async ({ taskId, kind, value, summary, outputs }) => {
|
|
87
|
+
if (outputs !== undefined)
|
|
88
|
+
return result(await Promise.all(normalizeOutputs(outputs).map((output) => service.stageArtifact(taskId, output))));
|
|
89
|
+
if (kind === undefined)
|
|
90
|
+
throw new Error("stageArtifact requires kind/value or outputs[]");
|
|
91
|
+
return result(await service.stageArtifact(taskId, { kind, value, ...(summary === undefined ? {} : { summary }) }));
|
|
92
|
+
});
|
|
93
|
+
server.registerTool("stageFile", {
|
|
94
|
+
inputSchema: {
|
|
95
|
+
taskId: z.string(),
|
|
96
|
+
path: z.string(),
|
|
97
|
+
content: z.string(),
|
|
98
|
+
expectedSha: z
|
|
99
|
+
.string()
|
|
100
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
101
|
+
.optional(),
|
|
102
|
+
},
|
|
103
|
+
}, async ({ taskId, path, content, expectedSha }) => result(await service.stageFile(taskId, path, content, expectedSha)));
|
|
104
|
+
server.registerTool("generateIac", {
|
|
105
|
+
inputSchema: {
|
|
106
|
+
taskId: z.string(),
|
|
107
|
+
existingResources: z.array(z.string()).optional(),
|
|
108
|
+
azurermProviderConstraint: z.string().optional(),
|
|
109
|
+
azapiProviderConstraint: z.string().optional(),
|
|
110
|
+
lockFileContent: z.string().optional(),
|
|
111
|
+
},
|
|
112
|
+
}, async ({ taskId, existingResources, azurermProviderConstraint, azapiProviderConstraint, lockFileContent }) => result(await service.generateIac(taskId, {
|
|
113
|
+
...(existingResources === undefined ? {} : { existingResources }),
|
|
114
|
+
...(azurermProviderConstraint === undefined ? {} : { azurermProviderConstraint }),
|
|
115
|
+
...(azapiProviderConstraint === undefined ? {} : { azapiProviderConstraint }),
|
|
116
|
+
...(lockFileContent === undefined ? {} : { lockFileContent }),
|
|
117
|
+
})));
|
|
118
|
+
server.registerTool("validateTask", {
|
|
119
|
+
inputSchema: {
|
|
120
|
+
taskId: z.string(),
|
|
121
|
+
kind: artifactKind.optional(),
|
|
122
|
+
value: z.unknown().optional(),
|
|
123
|
+
summary: z.string().optional(),
|
|
124
|
+
outputs: z.array(taskOutput).optional(),
|
|
125
|
+
},
|
|
126
|
+
}, async ({ taskId, kind, value, summary, outputs }) => result(await service.validateTask(taskId, outputs === undefined
|
|
127
|
+
? kind === undefined
|
|
128
|
+
? undefined
|
|
129
|
+
: { kind, value, ...(summary === undefined ? {} : { summary }) }
|
|
130
|
+
: normalizeOutputs(outputs))));
|
|
131
|
+
server.registerTool("completeTask", {
|
|
132
|
+
description: "Complete a task atomically. Supply outputs[] for every task with multiple required output kinds.",
|
|
133
|
+
inputSchema: {
|
|
134
|
+
taskId: z.string(),
|
|
135
|
+
kind: artifactKind.optional(),
|
|
136
|
+
value: z.unknown().optional(),
|
|
137
|
+
summary: z.string().optional(),
|
|
138
|
+
outputs: z.array(taskOutput).optional(),
|
|
139
|
+
},
|
|
140
|
+
}, async ({ taskId, kind, value, summary, outputs }) => {
|
|
141
|
+
if (outputs !== undefined)
|
|
142
|
+
return result(await service.completeTaskOutputs(taskId, normalizeOutputs(outputs)));
|
|
143
|
+
if (kind === undefined)
|
|
144
|
+
throw new Error("completeTask requires kind/value or outputs[]");
|
|
145
|
+
const context = await service.taskContext(taskId);
|
|
146
|
+
if (context.task.allowedOutputKinds.length > 1) {
|
|
147
|
+
throw new Error("completeTask requires outputs[] when the task has multiple required output kinds");
|
|
148
|
+
}
|
|
149
|
+
return result(await service.completeTask(taskId, { kind, value, ...(summary === undefined ? {} : { summary }) }));
|
|
150
|
+
});
|
|
151
|
+
server.registerTool("preview", { description: "Read the current operator-created deployment preview" }, async () => result(await service.currentPreview()));
|
|
152
|
+
server.registerTool("reconcile", {}, async () => result(await service.reconcile()));
|
|
153
|
+
server.registerTool("inventory", {}, async () => result(await service.inventory()));
|
|
154
|
+
server.registerTool("diagnose", {}, async () => result(await service.diagnose()));
|
|
155
|
+
server.registerTool("improvementObserve", {
|
|
156
|
+
description: "Submit one bounded redacted observation for the selected run",
|
|
157
|
+
inputSchema: {
|
|
158
|
+
taskId: z.string().optional(),
|
|
159
|
+
observedAt: z.string().datetime().optional(),
|
|
160
|
+
source: z.enum([
|
|
161
|
+
"task-completion",
|
|
162
|
+
"deterministic-test",
|
|
163
|
+
"validation-failure",
|
|
164
|
+
"capability-execution",
|
|
165
|
+
"cache-check",
|
|
166
|
+
"explicit-correction",
|
|
167
|
+
]),
|
|
168
|
+
category: z.enum([
|
|
169
|
+
"correctness",
|
|
170
|
+
"security",
|
|
171
|
+
"reliability",
|
|
172
|
+
"performance",
|
|
173
|
+
"usability",
|
|
174
|
+
"documentation",
|
|
175
|
+
"capability-gap",
|
|
176
|
+
]),
|
|
177
|
+
severity: z.enum(["critical", "high", "medium", "low", "info"]),
|
|
178
|
+
statement: z.string().min(1).max(1024),
|
|
179
|
+
evidenceRefs: z
|
|
180
|
+
.array(z.string().regex(/^[0-9a-f]{64}$/))
|
|
181
|
+
.min(1)
|
|
182
|
+
.max(32),
|
|
183
|
+
},
|
|
184
|
+
}, async ({ taskId, observedAt, ...input }) => result(await service.improvementObserve({
|
|
185
|
+
...input,
|
|
186
|
+
...(taskId === undefined ? {} : { taskId }),
|
|
187
|
+
...(observedAt === undefined ? {} : { observedAt }),
|
|
188
|
+
})));
|
|
189
|
+
server.registerTool("improvementObservations", { description: "Read bounded observations" }, async () => result(await service.improvementObservations()));
|
|
190
|
+
server.registerTool("improvementProposals", { description: "Read inert improvement proposals" }, async () => result(await service.improvementProposals()));
|
|
191
|
+
server.registerTool("render", { inputSchema: { kind: z.enum(["status", "requirements", "preview", "approval", "inventory"]) } }, async ({ kind }) => result(await service.render(kind)));
|
|
192
|
+
server.registerTool("promote", { inputSchema: { environment: z.string(), target: z.string() } }, async ({ environment, target }) => result(await service.promote(environment, target)));
|
|
193
|
+
server.registerTool("doctor", { inputSchema: { fix: z.boolean().optional(), yes: z.boolean().optional() } }, async ({ fix, yes }) => result(await service.doctor(fix, yes)));
|
|
194
|
+
server.registerTool("submitEvidence", {
|
|
195
|
+
inputSchema: {
|
|
196
|
+
taskId: z.string(),
|
|
197
|
+
kind: z.string(),
|
|
198
|
+
value: z.record(z.string(), z.json()),
|
|
199
|
+
required: z.boolean().optional(),
|
|
200
|
+
},
|
|
201
|
+
}, async ({ taskId, kind, value, required }) => {
|
|
202
|
+
await service.taskContext(taskId);
|
|
203
|
+
return result(await service.acceptEvidence({ kind, contentType: "application/json", value, required: required ?? false }));
|
|
204
|
+
});
|
|
205
|
+
return server;
|
|
206
|
+
}
|
|
207
|
+
export async function serveMcp(service) {
|
|
208
|
+
await createMcpServer(service).connect(new StdioServerTransport());
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { EncryptedPlanArtifactStore, LocalEncryptedPlan, PersistedPreviewBinding, PreviewBindingStore } from "@apexops/capabilities";
|
|
2
|
+
export declare function hashTerraformLockFile(terraformRoot: string): Promise<string>;
|
|
3
|
+
export declare function hashTerraformConfiguration(terraformRoot: string): Promise<string>;
|
|
4
|
+
export declare class FilePreviewBindingStore implements PreviewBindingStore {
|
|
5
|
+
private readonly bindingsRoot;
|
|
6
|
+
private readonly latestRoot;
|
|
7
|
+
private readonly kind;
|
|
8
|
+
constructor(bindingsRoot: string, latestRoot: string, kind: PersistedPreviewBinding["kind"]);
|
|
9
|
+
save(previewHash: string, binding: PersistedPreviewBinding): Promise<void>;
|
|
10
|
+
load(previewHash: string): Promise<PersistedPreviewBinding | undefined>;
|
|
11
|
+
loadLatest(projectId: string, runId: string, operation: "apply" | "destroy"): Promise<PersistedPreviewBinding | undefined>;
|
|
12
|
+
}
|
|
13
|
+
export declare class FileEncryptedPlanArtifactStore implements EncryptedPlanArtifactStore {
|
|
14
|
+
private readonly artifactsRoot;
|
|
15
|
+
constructor(artifactsRoot: string);
|
|
16
|
+
put(reference: string, artifact: LocalEncryptedPlan): Promise<void>;
|
|
17
|
+
get(reference: string): Promise<LocalEncryptedPlan | undefined>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createFileProviderRuntime(workspaceRoot: string): Promise<{
|
|
20
|
+
bindingStores: {
|
|
21
|
+
bicep: FilePreviewBindingStore;
|
|
22
|
+
terraform: FilePreviewBindingStore;
|
|
23
|
+
};
|
|
24
|
+
artifactStore: FileEncryptedPlanArtifactStore;
|
|
25
|
+
keyProvider: () => Promise<Uint8Array>;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=provider-runtime.d.ts.map
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { chmod, lstat, mkdir, readFile, readdir } from "node:fs/promises";
|
|
3
|
+
import { join, relative } from "node:path";
|
|
4
|
+
import { atomicWriteBytes, atomicWriteJson, sha256Bytes, sha256Json } from "@apexops/kernel";
|
|
5
|
+
const HASH_PATTERN = /^[0-9a-f]{64}$/;
|
|
6
|
+
async function ensureDirectory(path, mode) {
|
|
7
|
+
try {
|
|
8
|
+
const existing = await lstat(path);
|
|
9
|
+
if (existing.isSymbolicLink() || !existing.isDirectory()) {
|
|
10
|
+
throw new Error(`Provider runtime directory is not a regular directory: ${path}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (error.code !== "ENOENT")
|
|
15
|
+
throw error;
|
|
16
|
+
await mkdir(path, { mode });
|
|
17
|
+
}
|
|
18
|
+
if (mode !== undefined)
|
|
19
|
+
await chmod(path, mode);
|
|
20
|
+
}
|
|
21
|
+
async function createRuntimeRoot(workspaceRoot) {
|
|
22
|
+
const apexRoot = join(workspaceRoot, ".apex");
|
|
23
|
+
const localRoot = join(apexRoot, "local");
|
|
24
|
+
const runtimeRoot = join(localRoot, "provider-runtime");
|
|
25
|
+
await ensureDirectory(apexRoot);
|
|
26
|
+
await ensureDirectory(localRoot, 0o700);
|
|
27
|
+
await ensureDirectory(runtimeRoot, 0o700);
|
|
28
|
+
return runtimeRoot;
|
|
29
|
+
}
|
|
30
|
+
async function createRuntimeDirectory(runtimeRoot, name) {
|
|
31
|
+
const path = join(runtimeRoot, name);
|
|
32
|
+
await ensureDirectory(path, 0o700);
|
|
33
|
+
return path;
|
|
34
|
+
}
|
|
35
|
+
function requireHash(value, label) {
|
|
36
|
+
if (!HASH_PATTERN.test(value))
|
|
37
|
+
throw new Error(`${label} must be a SHA-256 hash`);
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
function storageKey(value) {
|
|
41
|
+
return sha256Bytes(Buffer.from(value, "utf8"));
|
|
42
|
+
}
|
|
43
|
+
async function readJsonFile(path) {
|
|
44
|
+
try {
|
|
45
|
+
const info = await lstat(path);
|
|
46
|
+
if (info.isSymbolicLink() || !info.isFile())
|
|
47
|
+
throw new Error(`Provider runtime file is not a regular file: ${path}`);
|
|
48
|
+
return JSON.parse(await readFile(path, "utf8"));
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (error.code === "ENOENT")
|
|
52
|
+
return undefined;
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function readRegularFile(path, label) {
|
|
57
|
+
const info = await lstat(path);
|
|
58
|
+
if (info.isSymbolicLink() || !info.isFile())
|
|
59
|
+
throw new Error(`${label} is not a regular file: ${path}`);
|
|
60
|
+
return await readFile(path);
|
|
61
|
+
}
|
|
62
|
+
function isTerraformInputFile(name) {
|
|
63
|
+
return (name === ".terraform.lock.hcl" ||
|
|
64
|
+
name.endsWith(".tf") ||
|
|
65
|
+
name.endsWith(".tf.json") ||
|
|
66
|
+
name.endsWith(".tfvars") ||
|
|
67
|
+
name.endsWith(".tfvars.json"));
|
|
68
|
+
}
|
|
69
|
+
async function terraformInputFiles(root, directory = root) {
|
|
70
|
+
const files = [];
|
|
71
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
72
|
+
const path = join(directory, entry.name);
|
|
73
|
+
if (entry.isSymbolicLink())
|
|
74
|
+
throw new Error(`Terraform configuration contains a symlink: ${path}`);
|
|
75
|
+
if (entry.isDirectory()) {
|
|
76
|
+
if (entry.name !== ".terraform")
|
|
77
|
+
files.push(...(await terraformInputFiles(root, path)));
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (entry.isFile() && isTerraformInputFile(entry.name))
|
|
81
|
+
files.push(path);
|
|
82
|
+
}
|
|
83
|
+
return files.sort((left, right) => relative(root, left).localeCompare(relative(root, right)));
|
|
84
|
+
}
|
|
85
|
+
export async function hashTerraformLockFile(terraformRoot) {
|
|
86
|
+
return sha256Bytes(await readRegularFile(join(terraformRoot, ".terraform.lock.hcl"), "Terraform lock file"));
|
|
87
|
+
}
|
|
88
|
+
export async function hashTerraformConfiguration(terraformRoot) {
|
|
89
|
+
const files = await terraformInputFiles(terraformRoot);
|
|
90
|
+
if (files.length === 0)
|
|
91
|
+
throw new Error(`Terraform configuration has no input files: ${terraformRoot}`);
|
|
92
|
+
return sha256Json(await Promise.all(files.map(async (path) => ({
|
|
93
|
+
path: relative(terraformRoot, path).replaceAll("\\", "/"),
|
|
94
|
+
hash: sha256Bytes(await readRegularFile(path, "Terraform input")),
|
|
95
|
+
}))));
|
|
96
|
+
}
|
|
97
|
+
function requireBinding(value, previewHash) {
|
|
98
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
99
|
+
throw new Error("Persisted preview binding is invalid");
|
|
100
|
+
}
|
|
101
|
+
const binding = value;
|
|
102
|
+
const preview = binding.preview;
|
|
103
|
+
if ((binding.kind !== "bicep" && binding.kind !== "terraform") ||
|
|
104
|
+
preview === null ||
|
|
105
|
+
typeof preview !== "object" ||
|
|
106
|
+
Array.isArray(preview) ||
|
|
107
|
+
preview.previewHash !== previewHash) {
|
|
108
|
+
throw new Error("Persisted preview binding does not match its hash");
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
function requireArtifact(value, reference) {
|
|
113
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
114
|
+
throw new Error("Persisted encrypted plan artifact is invalid");
|
|
115
|
+
}
|
|
116
|
+
const stored = value;
|
|
117
|
+
if (stored.reference !== reference || stored.artifact === null || typeof stored.artifact !== "object") {
|
|
118
|
+
throw new Error("Persisted encrypted plan artifact does not match its reference");
|
|
119
|
+
}
|
|
120
|
+
return stored.artifact;
|
|
121
|
+
}
|
|
122
|
+
export class FilePreviewBindingStore {
|
|
123
|
+
bindingsRoot;
|
|
124
|
+
latestRoot;
|
|
125
|
+
kind;
|
|
126
|
+
constructor(bindingsRoot, latestRoot, kind) {
|
|
127
|
+
this.bindingsRoot = bindingsRoot;
|
|
128
|
+
this.latestRoot = latestRoot;
|
|
129
|
+
this.kind = kind;
|
|
130
|
+
}
|
|
131
|
+
async save(previewHash, binding) {
|
|
132
|
+
requireHash(previewHash, "Preview hash");
|
|
133
|
+
requireBinding(binding, previewHash);
|
|
134
|
+
if (binding.kind !== this.kind)
|
|
135
|
+
throw new Error(`Expected a ${this.kind} preview binding`);
|
|
136
|
+
await atomicWriteJson(join(this.bindingsRoot, `${previewHash}.json`), binding);
|
|
137
|
+
const preview = binding.preview;
|
|
138
|
+
const latestKey = storageKey(JSON.stringify([this.kind, preview.projectId, preview.runId, preview.operation]));
|
|
139
|
+
await atomicWriteJson(join(this.latestRoot, `${latestKey}.json`), { previewHash });
|
|
140
|
+
}
|
|
141
|
+
async load(previewHash) {
|
|
142
|
+
requireHash(previewHash, "Preview hash");
|
|
143
|
+
const value = await readJsonFile(join(this.bindingsRoot, `${previewHash}.json`));
|
|
144
|
+
if (value === undefined)
|
|
145
|
+
return undefined;
|
|
146
|
+
const binding = requireBinding(value, previewHash);
|
|
147
|
+
if (binding.kind !== this.kind)
|
|
148
|
+
throw new Error(`Expected a ${this.kind} preview binding`);
|
|
149
|
+
return binding;
|
|
150
|
+
}
|
|
151
|
+
async loadLatest(projectId, runId, operation) {
|
|
152
|
+
const latestKey = storageKey(JSON.stringify([this.kind, projectId, runId, operation]));
|
|
153
|
+
const value = await readJsonFile(join(this.latestRoot, `${latestKey}.json`));
|
|
154
|
+
if (value === undefined)
|
|
155
|
+
return undefined;
|
|
156
|
+
if (value === null ||
|
|
157
|
+
typeof value !== "object" ||
|
|
158
|
+
Array.isArray(value) ||
|
|
159
|
+
typeof value.previewHash !== "string") {
|
|
160
|
+
throw new Error("Latest preview binding pointer is invalid");
|
|
161
|
+
}
|
|
162
|
+
return await this.load(requireHash(value.previewHash, "Latest preview hash"));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export class FileEncryptedPlanArtifactStore {
|
|
166
|
+
artifactsRoot;
|
|
167
|
+
constructor(artifactsRoot) {
|
|
168
|
+
this.artifactsRoot = artifactsRoot;
|
|
169
|
+
}
|
|
170
|
+
async put(reference, artifact) {
|
|
171
|
+
if (reference.trim().length === 0)
|
|
172
|
+
throw new Error("Encrypted plan reference is required");
|
|
173
|
+
await atomicWriteJson(join(this.artifactsRoot, `${storageKey(reference)}.json`), {
|
|
174
|
+
reference,
|
|
175
|
+
artifact,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
async get(reference) {
|
|
179
|
+
if (reference.trim().length === 0)
|
|
180
|
+
throw new Error("Encrypted plan reference is required");
|
|
181
|
+
const value = await readJsonFile(join(this.artifactsRoot, `${storageKey(reference)}.json`));
|
|
182
|
+
return value === undefined ? undefined : requireArtifact(value, reference);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async function readLocalKey(path) {
|
|
186
|
+
const info = await lstat(path);
|
|
187
|
+
if (info.isSymbolicLink() || !info.isFile())
|
|
188
|
+
throw new Error("Local plan transport key is not a regular file");
|
|
189
|
+
if (process.platform !== "win32" && (info.mode & 0o077) !== 0) {
|
|
190
|
+
throw new Error("Local plan transport key permissions must be 0600");
|
|
191
|
+
}
|
|
192
|
+
const key = await readFile(path);
|
|
193
|
+
if (key.byteLength !== 32)
|
|
194
|
+
throw new Error("Local plan transport key must contain exactly 32 bytes");
|
|
195
|
+
return key;
|
|
196
|
+
}
|
|
197
|
+
async function localKeyProvider(runtimeRoot) {
|
|
198
|
+
const path = join(runtimeRoot, "plan-transport.key");
|
|
199
|
+
try {
|
|
200
|
+
return await readLocalKey(path);
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
if (error.code !== "ENOENT")
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
await atomicWriteBytes(path, randomBytes(32), { refuseOverwrite: true });
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
if (error.code !== "EEXIST")
|
|
211
|
+
throw error;
|
|
212
|
+
}
|
|
213
|
+
return await readLocalKey(path);
|
|
214
|
+
}
|
|
215
|
+
export async function createFileProviderRuntime(workspaceRoot) {
|
|
216
|
+
const runtimeRoot = await createRuntimeRoot(workspaceRoot);
|
|
217
|
+
const bindingsRoot = await createRuntimeDirectory(runtimeRoot, "bindings");
|
|
218
|
+
const latestRoot = await createRuntimeDirectory(runtimeRoot, "latest");
|
|
219
|
+
const artifactsRoot = await createRuntimeDirectory(runtimeRoot, "artifacts");
|
|
220
|
+
return {
|
|
221
|
+
bindingStores: {
|
|
222
|
+
bicep: new FilePreviewBindingStore(bindingsRoot, latestRoot, "bicep"),
|
|
223
|
+
terraform: new FilePreviewBindingStore(bindingsRoot, latestRoot, "terraform"),
|
|
224
|
+
},
|
|
225
|
+
artifactStore: new FileEncryptedPlanArtifactStore(artifactsRoot),
|
|
226
|
+
keyProvider: async () => await localKeyProvider(runtimeRoot),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=provider-runtime.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type EnvelopeBindings } from "@apexops/capabilities";
|
|
2
|
+
export declare const PROVIDER_TRANSFER_KIND = "apex-provider-authority";
|
|
3
|
+
export declare const PROVIDER_TRANSFER_MAX_BUNDLE_BYTES: number;
|
|
4
|
+
export declare const PROVIDER_TRANSFER_MAX_FILE_BYTES: number;
|
|
5
|
+
export type ProviderTransferProvider = "bicep" | "terraform";
|
|
6
|
+
export type ProviderTransferOperation = "apply" | "destroy";
|
|
7
|
+
export interface ProviderTransferBindings extends EnvelopeBindings {
|
|
8
|
+
readonly provider: ProviderTransferProvider;
|
|
9
|
+
readonly operation: ProviderTransferOperation;
|
|
10
|
+
readonly projectId: string;
|
|
11
|
+
readonly runId: string;
|
|
12
|
+
readonly ownerEpoch: number;
|
|
13
|
+
readonly previewHash: string;
|
|
14
|
+
readonly recipient: string;
|
|
15
|
+
readonly authorityExpiresAt: string;
|
|
16
|
+
readonly artifactRef?: string;
|
|
17
|
+
readonly planDigest?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ProviderTransferFile {
|
|
20
|
+
readonly path: string;
|
|
21
|
+
readonly bytes: number;
|
|
22
|
+
readonly sha256: string;
|
|
23
|
+
readonly content: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ProviderTransferBundle {
|
|
26
|
+
readonly implementation: "apex-provider-transfer";
|
|
27
|
+
readonly version: 1;
|
|
28
|
+
readonly bindings: ProviderTransferBindings;
|
|
29
|
+
readonly files: readonly ProviderTransferFile[];
|
|
30
|
+
}
|
|
31
|
+
export interface ProviderTransferExportOptions {
|
|
32
|
+
readonly previewHash: string;
|
|
33
|
+
readonly provider: ProviderTransferProvider;
|
|
34
|
+
readonly recipient: string;
|
|
35
|
+
readonly ttlMs: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function createProviderTransferBundle(root: string, options: ProviderTransferExportOptions, now?: Date): Promise<ProviderTransferBundle>;
|
|
38
|
+
export declare function exportProviderTransfer(root: string, outputPath: string, options: ProviderTransferExportOptions, dependencies?: {
|
|
39
|
+
readonly now?: () => Date;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
path: string;
|
|
42
|
+
sha256: string;
|
|
43
|
+
files: number;
|
|
44
|
+
expiresAt: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare function importProviderTransfer(root: string, envelopeValue: unknown, recipient: string, now?: () => Date): Promise<{
|
|
47
|
+
provider: ProviderTransferProvider;
|
|
48
|
+
operation: ProviderTransferOperation;
|
|
49
|
+
previewHash: string;
|
|
50
|
+
files: number;
|
|
51
|
+
}>;
|
|
52
|
+
//# sourceMappingURL=provider-transfer.d.ts.map
|