@apexops/cli 0.10.0-next.5 → 0.11.0-next.1
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/registry.v1.json +1 -62
- package/assets/client-projection-metadata/copilot-cli-agent-tools.json +12 -0
- package/assets/client-projections/github-copilot-cli/.github/copilot/settings.json +13 -0
- package/assets/client-projections/github-copilot-cli/.github/instructions/apex-prompt-authoring.instructions.md +1 -1
- package/assets/client-projections/github-copilot-cli/.github/workflows/governance-policy-baseline.yml +101 -0
- package/assets/client-projections/github-copilot-cli/tools/schemas/governance-baseline.schema.json +118 -0
- package/assets/client-projections/github-copilot-cli/tools/scripts/collect-governance-baseline.ps1 +817 -0
- package/assets/config/capability-packs.v1.json +1 -32
- package/assets/config/governance-reference.v1.json +26379 -0
- package/assets/config/recipe-packs.v1.json +1 -26
- package/assets/config/runtime-bundle.v1.json +7 -7
- package/assets/config/toolchain.v1.json +35 -33
- package/assets/config/workflow.v1.json +103 -72
- package/assets/customizations/.github/agents/apex-codegen.agent.md +8 -22
- package/assets/customizations/.github/agents/apex-validator.agent.md +14 -20
- package/assets/customizations/.github/agents/apex.agent.md +108 -75
- package/assets/customizations/.github/copilot/settings.json +13 -0
- package/assets/customizations/.github/instructions/apex-prompt-authoring.instructions.md +1 -1
- package/assets/customizations/.github/skills/apex-architecture/SKILL.md +62 -18
- package/assets/customizations/.github/skills/apex-artifacts/SKILL.md +28 -6
- package/assets/customizations/.github/skills/apex-azure-adr/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-cloud-migrate/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-compliance/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-compute/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-cost-optimization/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-defaults/references/governance-effects.md +5 -3
- package/assets/customizations/.github/skills/apex-azure-deploy/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-diagnostics/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-governance/SKILL.md +19 -3
- package/assets/customizations/.github/skills/apex-azure-governance/references/evidence-interpretation.md +38 -3
- package/assets/customizations/.github/skills/apex-azure-kusto/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-prepare/SKILL.md +5 -3
- package/assets/customizations/.github/skills/apex-azure-quotas/SKILL.md +6 -2
- package/assets/customizations/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +4 -3
- package/assets/customizations/.github/skills/apex-azure-quotas/references/operational-checklist.md +3 -2
- package/assets/customizations/.github/skills/apex-azure-rbac/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-resources/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-storage/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-azure-validate/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-bicep-patterns/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-codegen/SKILL.md +6 -2
- package/assets/customizations/.github/skills/apex-entra-app-registration/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-mermaid/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-microsoft-docs/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-next/SKILL.md +99 -0
- package/assets/customizations/.github/skills/apex-operations/SKILL.md +46 -16
- package/assets/customizations/.github/skills/apex-planning/SKILL.md +48 -19
- package/assets/customizations/.github/skills/apex-requirements/SKILL.md +61 -26
- package/assets/customizations/.github/skills/apex-terraform-import/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-terraform-patterns/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-terraform-test/SKILL.md +3 -0
- package/assets/customizations/.github/skills/apex-unslop/LICENSE.txt +21 -0
- package/assets/customizations/.github/skills/apex-unslop/SKILL.md +94 -0
- package/assets/customizations/.github/skills/apex-workflow/SKILL.md +15 -5
- package/assets/customizations/.github/workflows/governance-policy-baseline.yml +101 -0
- package/assets/customizations/README.md +8 -9
- package/assets/customizations/manifest.json +167 -209
- package/assets/customizations/tools/schemas/governance-baseline.schema.json +118 -0
- package/assets/customizations/tools/scripts/collect-governance-baseline.ps1 +817 -0
- package/assets/manifest.json +423 -4241
- package/assets/schemas/governance-baseline.schema.json +118 -0
- package/dist/assets.d.ts +18 -2
- package/dist/assets.js +115 -35
- package/dist/bootstrap-wizard.d.ts +37 -0
- package/dist/bootstrap-wizard.js +259 -0
- package/dist/cli.d.ts +17 -2
- package/dist/cli.js +180 -63
- package/dist/dependency-revision.js +8 -0
- package/dist/errors.d.ts +6 -1
- package/dist/errors.js +55 -0
- package/dist/host-profile.d.ts +47 -0
- package/dist/host-profile.js +269 -0
- package/dist/mcp-output-schemas.d.ts +43 -0
- package/dist/mcp-output-schemas.js +279 -0
- package/dist/mcp-tool-effects.d.ts +101 -0
- package/dist/mcp-tool-effects.js +66 -0
- package/dist/mcp.d.ts +50 -3
- package/dist/mcp.js +800 -87
- package/dist/runtime-binding.d.ts +37 -0
- package/dist/runtime-binding.js +131 -0
- package/dist/service.d.ts +643 -38
- package/dist/service.js +4937 -662
- package/dist/state-transfer.js +21 -1
- package/dist/target-scope.d.ts +4 -0
- package/dist/target-scope.js +9 -0
- package/dist/version.d.ts +3 -1
- package/dist/version.js +19 -1
- package/dist/workflow-validators.d.ts +20 -3
- package/dist/workflow-validators.js +408 -67
- package/dist/workspace-root.d.ts +7 -0
- package/dist/workspace-root.js +67 -0
- package/package.json +11 -12
- package/assets/capability-packs/azure-governance-discovery/source/scripts/discover.py +0 -1189
- package/assets/capability-packs/azure-governance-discovery/source/scripts/render_governance.py +0 -676
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-architect.agent.md +0 -91
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-operator.agent.md +0 -75
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-planner.agent.md +0 -88
- package/assets/client-projections/github-copilot-cli/.github/agents/apex-requirements.agent.md +0 -99
- package/assets/client-projections/github-copilot-cli/.github/agents/apex.agent.md +0 -88
- package/assets/client-projections/github-copilot-cli/.github/mcp.json +0 -65
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-architecture/SKILL.md +0 -36
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/SKILL.md +0 -65
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/references/presentation-conventions.md +0 -52
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/references/reference-only-outlines.md +0 -78
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/architecture-assessment.md +0 -35
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/cost-estimate.md +0 -47
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/deployment-summary.md +0 -35
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/governance-constraints.md +0 -35
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/implementation-plan.md +0 -43
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/operations-runbook.md +0 -35
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/requirements.md +0 -42
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/resource-inventory.md +0 -29
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/SKILL.md +0 -52
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-examples.md +0 -38
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-guardrails.md +0 -36
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-quality.md +0 -21
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-record-fields.md +0 -57
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/SKILL.md +0 -55
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +0 -29
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +0 -27
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +0 -26
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +0 -27
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/SKILL.md +0 -58
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +0 -63
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/SKILL.md +0 -36
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/compute-selection.md +0 -26
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/pricing-evidence.md +0 -11
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +0 -44
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/SKILL.md +0 -61
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +0 -61
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/SKILL.md +0 -59
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +0 -29
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +0 -53
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/cost-monitoring.md +0 -47
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/decision-boundaries.md +0 -19
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/governance-effects.md +0 -28
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/naming.md +0 -47
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/network-planning.md +0 -47
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/security-baseline.md +0 -40
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/service-selection.md +0 -51
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/tag-precedence.md +0 -31
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/SKILL.md +0 -50
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/references/operational-checklist.md +0 -26
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +0 -48
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/SKILL.md +0 -60
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +0 -42
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/SKILL.md +0 -52
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/references/evidence-interpretation.md +0 -58
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/references/operational-checklist.md +0 -25
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/SKILL.md +0 -58
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +0 -41
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/references/operational-checklist.md +0 -25
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/SKILL.md +0 -52
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +0 -27
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/references/preparation-lineage.md +0 -36
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/SKILL.md +0 -53
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +0 -48
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/references/operational-checklist.md +0 -23
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/SKILL.md +0 -45
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/references/assignment-intent.md +0 -39
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +0 -50
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/SKILL.md +0 -54
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +0 -49
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/SKILL.md +0 -35
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/security-and-governance.md +0 -12
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +0 -33
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/storage-selection.md +0 -12
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/SKILL.md +0 -49
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/references/preflight-evidence.md +0 -43
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/SKILL.md +0 -41
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +0 -11
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +0 -46
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +0 -74
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +0 -56
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/network-and-observability.md +0 -52
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-codegen/SKILL.md +0 -32
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/SKILL.md +0 -53
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/capability-receipts.md +0 -21
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +0 -36
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +0 -26
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +0 -27
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/SKILL.md +0 -44
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/references/styling.md +0 -33
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/references/syntax.md +0 -99
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-microsoft-docs/SKILL.md +0 -53
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-microsoft-docs/references/research-method.md +0 -91
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-operations/SKILL.md +0 -34
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-planning/SKILL.md +0 -36
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-requirements/SKILL.md +0 -46
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/SKILL.md +0 -47
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/adoption-attestation.md +0 -10
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/import-assessment.md +0 -14
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/import-mapping.md +0 -27
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +0 -12
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/SKILL.md +0 -49
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +0 -20
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +0 -11
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +0 -14
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/network-and-observability.md +0 -12
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +0 -24
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/SKILL.md +0 -45
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/evidence-acceptance.md +0 -10
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +0 -12
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +0 -23
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/test-design.md +0 -13
- package/assets/client-projections/github-copilot-cli/.github/skills/apex-workflow/SKILL.md +0 -37
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-architect.agent.md +0 -100
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-codegen.agent.md +0 -62
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-operator.agent.md +0 -79
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-planner.agent.md +0 -98
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-requirements.agent.md +0 -108
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-reviewer.agent.md +0 -63
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex-validator.agent.md +0 -61
- package/assets/client-projections/github-copilot-vscode/.github/agents/apex.agent.md +0 -107
- package/assets/client-projections/github-copilot-vscode/.github/copilot-instructions.md +0 -13
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-agent-authoring.instructions.md +0 -14
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-artifact-contracts.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-automation.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-azure-yaml.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-bicep.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-code-quality.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-context.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-documentation.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-governance.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-instruction-authoring.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-javascript.instructions.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-json.instructions.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-markdown.instructions.md +0 -13
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-powershell.instructions.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-prompt-authoring.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-python.instructions.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-safe-file-edits.instructions.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-safe-shell.instructions.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-shell.instructions.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-skill-authoring.instructions.md +0 -13
- package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-terraform.instructions.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-architecture/SKILL.md +0 -36
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/SKILL.md +0 -65
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/references/presentation-conventions.md +0 -52
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/references/reference-only-outlines.md +0 -78
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/architecture-assessment.md +0 -35
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/cost-estimate.md +0 -47
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/deployment-summary.md +0 -35
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/governance-constraints.md +0 -35
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/implementation-plan.md +0 -43
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/operations-runbook.md +0 -35
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/requirements.md +0 -42
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/resource-inventory.md +0 -29
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/SKILL.md +0 -52
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-examples.md +0 -38
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-guardrails.md +0 -36
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-quality.md +0 -21
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-record-fields.md +0 -57
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/SKILL.md +0 -55
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +0 -29
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +0 -27
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +0 -26
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +0 -27
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/SKILL.md +0 -58
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +0 -63
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/SKILL.md +0 -36
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/compute-selection.md +0 -26
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/pricing-evidence.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +0 -44
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/SKILL.md +0 -61
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +0 -61
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/SKILL.md +0 -59
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +0 -29
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +0 -53
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/cost-monitoring.md +0 -47
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/decision-boundaries.md +0 -19
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/governance-effects.md +0 -28
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/naming.md +0 -47
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/network-planning.md +0 -47
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/security-baseline.md +0 -40
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/service-selection.md +0 -51
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/tag-precedence.md +0 -31
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/SKILL.md +0 -50
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/references/operational-checklist.md +0 -26
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +0 -48
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/SKILL.md +0 -60
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +0 -42
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/SKILL.md +0 -52
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/references/evidence-interpretation.md +0 -58
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/references/operational-checklist.md +0 -25
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/SKILL.md +0 -58
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +0 -41
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/references/operational-checklist.md +0 -25
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/SKILL.md +0 -52
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +0 -27
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/references/preparation-lineage.md +0 -36
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/SKILL.md +0 -53
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +0 -48
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/references/operational-checklist.md +0 -23
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/SKILL.md +0 -45
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/references/assignment-intent.md +0 -39
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +0 -50
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/SKILL.md +0 -54
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +0 -49
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/SKILL.md +0 -35
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/security-and-governance.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +0 -33
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/storage-selection.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/SKILL.md +0 -49
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/references/operational-checklist.md +0 -24
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/references/preflight-evidence.md +0 -43
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/SKILL.md +0 -41
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +0 -46
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +0 -74
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +0 -56
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/network-and-observability.md +0 -52
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-codegen/SKILL.md +0 -32
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/SKILL.md +0 -53
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/capability-receipts.md +0 -21
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +0 -36
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +0 -26
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +0 -27
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/SKILL.md +0 -44
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/references/styling.md +0 -33
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/references/syntax.md +0 -99
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-microsoft-docs/SKILL.md +0 -53
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-microsoft-docs/references/research-method.md +0 -91
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-operations/SKILL.md +0 -34
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-planning/SKILL.md +0 -36
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-requirements/SKILL.md +0 -46
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/SKILL.md +0 -47
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/adoption-attestation.md +0 -10
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/import-assessment.md +0 -14
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/import-mapping.md +0 -27
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/SKILL.md +0 -49
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +0 -20
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +0 -11
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +0 -14
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/network-and-observability.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +0 -24
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/SKILL.md +0 -45
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/evidence-acceptance.md +0 -10
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +0 -12
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +0 -23
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/test-design.md +0 -13
- package/assets/client-projections/github-copilot-vscode/.github/skills/apex-workflow/SKILL.md +0 -37
- package/assets/client-projections/github-copilot-vscode/.vscode/mcp.json +0 -29
- package/assets/customizations/.github/agents/apex-architect.agent.md +0 -93
- package/assets/customizations/.github/agents/apex-operator.agent.md +0 -72
- package/assets/customizations/.github/agents/apex-planner.agent.md +0 -91
- package/assets/customizations/.github/agents/apex-requirements.agent.md +0 -101
- package/assets/customizations/.github/agents/apex-reviewer.agent.md +0 -60
- package/assets/customizations/.github/mcp.json +0 -65
- package/assets/customizations/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +0 -27
- package/assets/customizations/.vscode/mcp.json +0 -29
- package/dist/azure-mcp-environment.d.ts +0 -2
- package/dist/azure-mcp-environment.js +0 -7
- package/dist/azure-mcp.d.ts +0 -2
- package/dist/azure-mcp.js +0 -21
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { createInterface } from "node:readline/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { stdin, stdout } from "node:process";
|
|
4
|
+
import { isDeepStrictEqual } from "node:util";
|
|
5
|
+
import { ApexService } from "./service.js";
|
|
6
|
+
import { ApexError, EXIT_CODES } from "./errors.js";
|
|
7
|
+
/** An APEX error raised while waiting for an answer, such as a stale workspace after the wait; it ends the wizard. */
|
|
8
|
+
class InterruptedWait extends Error {
|
|
9
|
+
error;
|
|
10
|
+
constructor(error) {
|
|
11
|
+
super(error.message);
|
|
12
|
+
this.error = error;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export async function runBootstrapWizard(root, interaction, serviceAt = (directory) => new ApexService(directory), scope = (_directory, body) => body()) {
|
|
16
|
+
const progress = [];
|
|
17
|
+
const ask = async (question) => {
|
|
18
|
+
const value = (await interaction.ask(question).catch((error) => {
|
|
19
|
+
throw error instanceof ApexError ? new InterruptedWait(error) : error;
|
|
20
|
+
})).trim();
|
|
21
|
+
if (value.toLowerCase() === "cancel")
|
|
22
|
+
throw new Error("BOOTSTRAP_CANCELLED");
|
|
23
|
+
if (value.length > 4096)
|
|
24
|
+
throw new ApexError("APEX_VALIDATION", "Bootstrap answer exceeds the input budget", EXIT_CODES.validation);
|
|
25
|
+
return value;
|
|
26
|
+
};
|
|
27
|
+
const choose = async (question, values, fallback) => {
|
|
28
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
29
|
+
const value = (await ask(question)) || fallback;
|
|
30
|
+
if (value !== undefined && values.includes(value))
|
|
31
|
+
return value;
|
|
32
|
+
interaction.show(`Choose one of: ${values.join(", ")}. Enter cancel to stop.`);
|
|
33
|
+
}
|
|
34
|
+
throw new ApexError("APEX_VALIDATION", "Bootstrap choice remains invalid", EXIT_CODES.validation);
|
|
35
|
+
};
|
|
36
|
+
const confirm = async (question) => (await choose(`${question} [yes/no, default no]: `, ["yes", "no"], "no")) === "yes";
|
|
37
|
+
try {
|
|
38
|
+
interaction.show("APEX repository bootstrap. Enter cancel at any question to stop. Never enter tokens, passwords or client secrets.");
|
|
39
|
+
let directories = [root];
|
|
40
|
+
if (await confirm("Copy one or more independent workloads from a remote COE?")) {
|
|
41
|
+
const repository = await ask("Remote COE HTTPS URL (https://github.com/OWNER/REPO): ");
|
|
42
|
+
const revision = await ask("Exact 40-character source commit: ");
|
|
43
|
+
const catalogPath = (await ask("Catalog directory [archetypes]: ")) || "archetypes";
|
|
44
|
+
const service = serviceAt(root);
|
|
45
|
+
const catalog = await service.listArchetypes(repository, revision, catalogPath);
|
|
46
|
+
interaction.show(catalog.candidates.map(({ selectedPath }, index) => ({ selection: index + 1, path: selectedPath })));
|
|
47
|
+
const selection = await ask("Select workload numbers separated by commas: ");
|
|
48
|
+
if (!/^[1-9][0-9]*(?:\s*,\s*[1-9][0-9]*)*$/.test(selection))
|
|
49
|
+
throw new ApexError("APEX_VALIDATION", "Workload selection must contain exact listed numbers", EXIT_CODES.validation);
|
|
50
|
+
const indexes = selection.split(",").map((value) => Number(value.trim()) - 1);
|
|
51
|
+
if (new Set(indexes).size !== indexes.length ||
|
|
52
|
+
indexes.length > 16 ||
|
|
53
|
+
indexes.some((index) => !catalog.candidates[index]))
|
|
54
|
+
throw new ApexError("APEX_VALIDATION", "Workload selection is duplicated or outside the catalog", EXIT_CODES.validation);
|
|
55
|
+
const selections = [];
|
|
56
|
+
for (const index of indexes) {
|
|
57
|
+
const selectedPath = catalog.candidates[index].selectedPath;
|
|
58
|
+
selections.push({
|
|
59
|
+
selectedPath,
|
|
60
|
+
destination: await ask(`Independent destination folder for ${selectedPath}: `),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const config = { schemaVersion: "1.0.0", repository, revision, selections };
|
|
64
|
+
const plan = await service.planArchetypeBatch(config);
|
|
65
|
+
interaction.show(plan);
|
|
66
|
+
if (!(await confirm("Copy exactly these reviewed files and exclusions?")))
|
|
67
|
+
return { status: "pending", progress, nextAction: "COE copy was not confirmed." };
|
|
68
|
+
const copied = await service.importArchetypeBatch(config, plan.planHash, true);
|
|
69
|
+
progress.push({ directory: root, step: "coe-copy", outcome: copied });
|
|
70
|
+
if (copied.status === "blocked")
|
|
71
|
+
return { status: "blocked", progress, nextAction: copied.nextAction };
|
|
72
|
+
directories = selections.map(({ destination }) => join(root, destination));
|
|
73
|
+
}
|
|
74
|
+
for (const directory of directories) {
|
|
75
|
+
const stopped = await scope(directory, async () => {
|
|
76
|
+
interaction.show({ workspace: directory });
|
|
77
|
+
const createRepository = await confirm("Initialize a local Git repository if none exists here?");
|
|
78
|
+
const config = {
|
|
79
|
+
schemaVersion: "1.0.0",
|
|
80
|
+
client: "github-copilot-cli",
|
|
81
|
+
createRepository,
|
|
82
|
+
};
|
|
83
|
+
const service = serviceAt(directory);
|
|
84
|
+
const plan = await service.planBootstrap(config);
|
|
85
|
+
interaction.show(plan);
|
|
86
|
+
if (plan.status === "blocked")
|
|
87
|
+
return {
|
|
88
|
+
status: "blocked",
|
|
89
|
+
progress,
|
|
90
|
+
nextAction: "Resolve the local bootstrap blockers; existing files were preserved.",
|
|
91
|
+
};
|
|
92
|
+
if (!(await confirm("Install the exact workspace runtime and configure or resume APEX here without creating a project?")))
|
|
93
|
+
return { status: "pending", progress, nextAction: "Workspace setup was not confirmed." };
|
|
94
|
+
if (!isDeepStrictEqual(await service.planBootstrap(config), plan))
|
|
95
|
+
throw new ApexError("APEX_STALE", "The local bootstrap plan changed after it was shown; run the wizard again to review a fresh plan.", EXIT_CODES.stale);
|
|
96
|
+
const initialized = await service.bootstrap({ createRepository, clientId: "github-copilot-cli" });
|
|
97
|
+
progress.push({ directory, step: "local-bootstrap", outcome: initialized });
|
|
98
|
+
if (await confirm("Create a GitHub repository and push this reviewed branch?")) {
|
|
99
|
+
const owner = await ask("Repository owner (user or organization login): ");
|
|
100
|
+
const name = await ask("Repository name: ");
|
|
101
|
+
const visibility = (await choose("Visibility [private/internal/public, default private]: ", ["private", "internal", "public"], "private"));
|
|
102
|
+
const branch = (await ask("Branch to publish [main]: ")) || "main";
|
|
103
|
+
const publishConfig = {
|
|
104
|
+
schemaVersion: "1.0.0",
|
|
105
|
+
owner,
|
|
106
|
+
name,
|
|
107
|
+
visibility,
|
|
108
|
+
branch,
|
|
109
|
+
remote: "origin",
|
|
110
|
+
};
|
|
111
|
+
const publishPlan = await service.planRepositoryPublish(publishConfig);
|
|
112
|
+
interaction.show(publishPlan);
|
|
113
|
+
progress.push({ directory, step: "github-repository-plan", outcome: publishPlan });
|
|
114
|
+
if (publishPlan.status === "pending") {
|
|
115
|
+
if (await confirm(`Create ${publishPlan.repository.fullName} as ${publishPlan.repository.visibility} and push exactly commit ${publishPlan.push.commit} on ${publishPlan.push.branch} without force?`)) {
|
|
116
|
+
const published = await service.publishRepository(publishConfig, publishPlan.planHash, true);
|
|
117
|
+
interaction.show(published);
|
|
118
|
+
progress.push({ directory, step: "github-repository", outcome: published });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const governance = await choose("Governance source [consumer/central/later, default later]: ", ["consumer", "central", "later"], "later");
|
|
123
|
+
if (governance === "consumer") {
|
|
124
|
+
const repository = await ask("Consumer GitHub repository (OWNER/REPOSITORY): ");
|
|
125
|
+
const tenantId = await ask("Azure tenant ID: ");
|
|
126
|
+
const subscriptionId = await ask("Login and standalone collection subscription ID: ");
|
|
127
|
+
const managementGroupId = await ask("Management-group collection ID, or blank for subscription: ");
|
|
128
|
+
const mode = await choose("Identity [reuse/create]: ", ["reuse", "create"]);
|
|
129
|
+
const identity = mode === "reuse"
|
|
130
|
+
? {
|
|
131
|
+
mode,
|
|
132
|
+
clientId: await ask("Approved application client ID: "),
|
|
133
|
+
principalId: await ask("Approved service-principal object ID: "),
|
|
134
|
+
}
|
|
135
|
+
: { mode: "create", displayName: await ask("Proposed dedicated application display name: ") };
|
|
136
|
+
const governanceConfig = {
|
|
137
|
+
schemaVersion: "1.0.0",
|
|
138
|
+
repository,
|
|
139
|
+
tenantId,
|
|
140
|
+
subscriptionId,
|
|
141
|
+
identity,
|
|
142
|
+
...(managementGroupId ? { managementGroupId } : {}),
|
|
143
|
+
};
|
|
144
|
+
const setup = await service.planGovernanceSetup(governanceConfig);
|
|
145
|
+
interaction.show(setup);
|
|
146
|
+
progress.push({ directory, step: "governance-plan", outcome: setup });
|
|
147
|
+
if (identity.mode === "reuse" && setup.status !== "blocked") {
|
|
148
|
+
const provisioning = await service.planGovernanceProvision(governanceConfig);
|
|
149
|
+
interaction.show(provisioning);
|
|
150
|
+
progress.push({ directory, step: "governance-provision-plan", outcome: provisioning });
|
|
151
|
+
if (provisioning.status === "ready" &&
|
|
152
|
+
(await confirm("Create only the listed Azure federation and Reader assignment for this existing identity? GitHub configuration and collection stay unchanged."))) {
|
|
153
|
+
const outcome = await service.provisionGovernance(governanceConfig, provisioning.planHash, true);
|
|
154
|
+
interaction.show(outcome);
|
|
155
|
+
progress.push({ directory, step: "governance-provision", outcome });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
else if (governance === "central") {
|
|
160
|
+
progress.push({
|
|
161
|
+
directory,
|
|
162
|
+
step: "central-baseline-check",
|
|
163
|
+
outcome: {
|
|
164
|
+
status: "pending",
|
|
165
|
+
imported: false,
|
|
166
|
+
nextAction: "APEX will check the reviewed central baseline once the first project and its target are known.",
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
progress.push({
|
|
172
|
+
directory,
|
|
173
|
+
step: "governance",
|
|
174
|
+
outcome: {
|
|
175
|
+
status: "pending",
|
|
176
|
+
source: governance,
|
|
177
|
+
nextAction: governance === "central"
|
|
178
|
+
? "Select and import the current reviewed central baseline using the governance workflow."
|
|
179
|
+
: "Configure governance before planning infrastructure.",
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
return undefined;
|
|
184
|
+
});
|
|
185
|
+
if (stopped !== undefined)
|
|
186
|
+
return stopped;
|
|
187
|
+
}
|
|
188
|
+
const blocked = progress.some(({ outcome }) => outcome !== null && typeof outcome === "object" && "status" in outcome && outcome.status === "blocked");
|
|
189
|
+
return {
|
|
190
|
+
status: blocked ? "blocked" : "pending",
|
|
191
|
+
progress,
|
|
192
|
+
nextAction: "Workspace setup is complete; no project was created. Open APEX to gather details and create the first project. Complete pending governance and client checks. No deployment is authorized.",
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
if (error instanceof InterruptedWait)
|
|
197
|
+
throw error.error;
|
|
198
|
+
return {
|
|
199
|
+
status: error instanceof Error && error.message === "BOOTSTRAP_CANCELLED" ? "cancelled" : "blocked",
|
|
200
|
+
progress,
|
|
201
|
+
nextAction: error instanceof ApexError
|
|
202
|
+
? error.message
|
|
203
|
+
: "Setup stopped; completed steps were preserved. Inspect prerequisites before retrying.",
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Runs the wizard on the terminal, or on `options.interaction` when given, while the command holds the workspace lock
|
|
209
|
+
* of `root` through `service`. Each copied workspace's steps also hold that workspace's own lock. Every question is
|
|
210
|
+
* asked without any of these locks, so MCP calls are not blocked while the wizard waits; if a workspace changed during
|
|
211
|
+
* the wait, the wizard fails with `APEX_STALE` instead of applying the answer.
|
|
212
|
+
*/
|
|
213
|
+
export async function interactiveBootstrap(root, service, options = {}) {
|
|
214
|
+
const services = new Map();
|
|
215
|
+
const serviceAt = (directory) => {
|
|
216
|
+
let current = services.get(directory);
|
|
217
|
+
if (current === undefined) {
|
|
218
|
+
current = options.serviceAt?.(directory) ?? new ApexService(directory);
|
|
219
|
+
services.set(directory, current);
|
|
220
|
+
}
|
|
221
|
+
return current;
|
|
222
|
+
};
|
|
223
|
+
// Workspaces whose locks the wizard holds, outermost first; a question waits without all of them.
|
|
224
|
+
const holders = [service];
|
|
225
|
+
const scope = (directory, body) => {
|
|
226
|
+
if (directory === root)
|
|
227
|
+
return body();
|
|
228
|
+
const workspace = serviceAt(directory);
|
|
229
|
+
return workspace.withWorkspaceWriteLock(async () => {
|
|
230
|
+
holders.push(workspace);
|
|
231
|
+
try {
|
|
232
|
+
return await body();
|
|
233
|
+
}
|
|
234
|
+
finally {
|
|
235
|
+
holders.pop();
|
|
236
|
+
}
|
|
237
|
+
}, undefined, { suspendable: true });
|
|
238
|
+
};
|
|
239
|
+
const outsideLocks = (wait) => holders.reduce((inner, holder) => () => holder.waitOutsideWorkspaceLock(inner), wait)();
|
|
240
|
+
const run = (terminal) => runBootstrapWizard(root, {
|
|
241
|
+
ask: (question) => outsideLocks(() => terminal.ask(question)),
|
|
242
|
+
show: (value) => terminal.show(value),
|
|
243
|
+
}, serviceAt, scope);
|
|
244
|
+
if (options.interaction !== undefined)
|
|
245
|
+
return run(options.interaction);
|
|
246
|
+
if (!stdin.isTTY || !stdout.isTTY)
|
|
247
|
+
throw new ApexError("APEX_USAGE", "bootstrap wizard requires an interactive terminal; use typed plan commands for automation", EXIT_CODES.usage);
|
|
248
|
+
const terminal = createInterface({ input: stdin, output: stdout });
|
|
249
|
+
try {
|
|
250
|
+
return await run({
|
|
251
|
+
ask: (question) => terminal.question(question),
|
|
252
|
+
show: (value) => stdout.write(`${typeof value === "string" ? value : JSON.stringify(value, null, 2)}\n`),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
finally {
|
|
256
|
+
terminal.close();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=bootstrap-wizard.js.map
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { type
|
|
3
|
-
|
|
2
|
+
import { type McpServiceResolver } from "./mcp.js";
|
|
3
|
+
import { ApexService, type ServiceOptions } from "./service.js";
|
|
4
|
+
import { type BootstrapInteraction } from "./bootstrap-wizard.js";
|
|
5
|
+
export { mcpWorkspaceRoot, resolveMcpWorkspace } from "./workspace-root.js";
|
|
6
|
+
type FlagValue = string | string[] | boolean;
|
|
7
|
+
type Flags = Record<string, FlagValue>;
|
|
8
|
+
export declare function createApexService(root: string, flags?: Flags, command?: string, options?: ServiceOptions): Promise<ApexService>;
|
|
9
|
+
/**
|
|
10
|
+
* One service per resolved workspace root. Every service sees the others as pending-review guard peers, so a guarded
|
|
11
|
+
* call aimed at another workspace still fails while any served workspace has a review waiting for its capture.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mcpServiceResolver(defaultService: ApexService, create: (workspaceRoot: string, workspacePath: string) => Promise<ApexService>): McpServiceResolver;
|
|
14
|
+
/** Terminal seams for interactive commands; tests substitute them for a real terminal. */
|
|
15
|
+
export interface CliInteraction {
|
|
16
|
+
bootstrap?: BootstrapInteraction;
|
|
17
|
+
}
|
|
18
|
+
export declare function execute(argv: string[], root?: string, options?: ServiceOptions, interaction?: CliInteraction): Promise<unknown>;
|
|
4
19
|
export declare function formatHumanResult(args: string[], result: unknown): string;
|
|
5
20
|
//# sourceMappingURL=cli.d.ts.map
|