@apexops/cli 0.10.0-next.0 → 0.10.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.
Files changed (103) hide show
  1. package/assets/client-projection-metadata/copilot-cli-agent-tools.json +8 -0
  2. package/assets/client-projections/github-copilot-cli/.github/agents/apex-architect.agent.md +14 -12
  3. package/assets/client-projections/github-copilot-cli/.github/agents/apex-operator.agent.md +1 -1
  4. package/assets/client-projections/github-copilot-cli/.github/agents/apex-planner.agent.md +12 -11
  5. package/assets/client-projections/github-copilot-cli/.github/agents/apex-requirements.agent.md +16 -7
  6. package/assets/client-projections/github-copilot-cli/.github/agents/apex.agent.md +29 -6
  7. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-agent-authoring.instructions.md +14 -0
  8. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-artifact-contracts.instructions.md +12 -0
  9. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-automation.instructions.md +12 -0
  10. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-azure-yaml.instructions.md +12 -0
  11. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-bicep.instructions.md +12 -0
  12. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-code-quality.instructions.md +12 -0
  13. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-context.instructions.md +12 -0
  14. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-documentation.instructions.md +12 -0
  15. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-governance.instructions.md +12 -0
  16. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-instruction-authoring.instructions.md +12 -0
  17. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-javascript.instructions.md +11 -0
  18. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-json.instructions.md +11 -0
  19. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-markdown.instructions.md +13 -0
  20. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-powershell.instructions.md +11 -0
  21. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-prompt-authoring.instructions.md +12 -0
  22. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-python.instructions.md +11 -0
  23. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-safe-file-edits.instructions.md +11 -0
  24. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-safe-shell.instructions.md +11 -0
  25. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-shell.instructions.md +11 -0
  26. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-skill-authoring.instructions.md +13 -0
  27. package/assets/client-projections/github-copilot-cli/.github/instructions/apex-terraform.instructions.md +12 -0
  28. package/assets/client-projections/github-copilot-cli/.github/mcp.json +5 -1
  29. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-architect.agent.md +14 -12
  30. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-codegen.agent.md +10 -5
  31. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-operator.agent.md +1 -1
  32. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-planner.agent.md +12 -11
  33. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-requirements.agent.md +16 -7
  34. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-reviewer.agent.md +10 -5
  35. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-validator.agent.md +10 -5
  36. package/assets/client-projections/github-copilot-vscode/.github/agents/apex.agent.md +29 -6
  37. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-agent-authoring.instructions.md +14 -0
  38. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-artifact-contracts.instructions.md +12 -0
  39. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-automation.instructions.md +12 -0
  40. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-azure-yaml.instructions.md +12 -0
  41. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-bicep.instructions.md +12 -0
  42. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-code-quality.instructions.md +12 -0
  43. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-context.instructions.md +12 -0
  44. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-documentation.instructions.md +12 -0
  45. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-governance.instructions.md +12 -0
  46. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-instruction-authoring.instructions.md +12 -0
  47. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-javascript.instructions.md +11 -0
  48. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-json.instructions.md +11 -0
  49. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-markdown.instructions.md +13 -0
  50. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-powershell.instructions.md +11 -0
  51. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-prompt-authoring.instructions.md +12 -0
  52. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-python.instructions.md +11 -0
  53. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-safe-file-edits.instructions.md +11 -0
  54. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-safe-shell.instructions.md +11 -0
  55. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-shell.instructions.md +11 -0
  56. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-skill-authoring.instructions.md +13 -0
  57. package/assets/client-projections/github-copilot-vscode/.github/instructions/apex-terraform.instructions.md +12 -0
  58. package/assets/client-projections/github-copilot-vscode/.vscode/mcp.json +8 -0
  59. package/assets/config/runtime-bundle.v1.json +7 -7
  60. package/assets/customizations/.github/agents/apex-architect.agent.md +14 -12
  61. package/assets/customizations/.github/agents/apex-codegen.agent.md +10 -5
  62. package/assets/customizations/.github/agents/apex-operator.agent.md +1 -1
  63. package/assets/customizations/.github/agents/apex-planner.agent.md +12 -11
  64. package/assets/customizations/.github/agents/apex-requirements.agent.md +16 -7
  65. package/assets/customizations/.github/agents/apex-reviewer.agent.md +10 -5
  66. package/assets/customizations/.github/agents/apex-validator.agent.md +10 -5
  67. package/assets/customizations/.github/agents/apex.agent.md +29 -6
  68. package/assets/customizations/.github/instructions/apex-agent-authoring.instructions.md +14 -0
  69. package/assets/customizations/.github/instructions/apex-artifact-contracts.instructions.md +12 -0
  70. package/assets/customizations/.github/instructions/apex-automation.instructions.md +12 -0
  71. package/assets/customizations/.github/instructions/apex-azure-yaml.instructions.md +12 -0
  72. package/assets/customizations/.github/instructions/apex-bicep.instructions.md +12 -0
  73. package/assets/customizations/.github/instructions/apex-code-quality.instructions.md +12 -0
  74. package/assets/customizations/.github/instructions/apex-context.instructions.md +12 -0
  75. package/assets/customizations/.github/instructions/apex-documentation.instructions.md +12 -0
  76. package/assets/customizations/.github/instructions/apex-governance.instructions.md +12 -0
  77. package/assets/customizations/.github/instructions/apex-instruction-authoring.instructions.md +12 -0
  78. package/assets/customizations/.github/instructions/apex-javascript.instructions.md +11 -0
  79. package/assets/customizations/.github/instructions/apex-json.instructions.md +11 -0
  80. package/assets/customizations/.github/instructions/apex-markdown.instructions.md +13 -0
  81. package/assets/customizations/.github/instructions/apex-powershell.instructions.md +11 -0
  82. package/assets/customizations/.github/instructions/apex-prompt-authoring.instructions.md +12 -0
  83. package/assets/customizations/.github/instructions/apex-python.instructions.md +11 -0
  84. package/assets/customizations/.github/instructions/apex-safe-file-edits.instructions.md +11 -0
  85. package/assets/customizations/.github/instructions/apex-safe-shell.instructions.md +11 -0
  86. package/assets/customizations/.github/instructions/apex-shell.instructions.md +11 -0
  87. package/assets/customizations/.github/instructions/apex-skill-authoring.instructions.md +13 -0
  88. package/assets/customizations/.github/instructions/apex-terraform.instructions.md +12 -0
  89. package/assets/customizations/.github/mcp.json +5 -1
  90. package/assets/customizations/.vscode/mcp.json +8 -0
  91. package/assets/customizations/manifest.json +31 -10
  92. package/assets/manifest.json +914 -74
  93. package/dist/azure-mcp-environment.d.ts +2 -0
  94. package/dist/azure-mcp-environment.js +7 -0
  95. package/dist/azure-mcp.d.ts +2 -0
  96. package/dist/azure-mcp.js +21 -0
  97. package/dist/cli.js +3 -0
  98. package/dist/mcp.js +22 -0
  99. package/dist/service.d.ts +4 -0
  100. package/dist/service.js +102 -7
  101. package/dist/version.d.ts +1 -1
  102. package/dist/version.js +1 -1
  103. package/package.json +6 -5
@@ -0,0 +1,2 @@
1
+ export declare function azureMcpEnvironment(environment: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
2
+ //# sourceMappingURL=azure-mcp-environment.d.ts.map
@@ -0,0 +1,7 @@
1
+ export function azureMcpEnvironment(environment) {
2
+ return {
3
+ ...environment,
4
+ DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: environment.DOTNET_SYSTEM_GLOBALIZATION_INVARIANT ?? "1",
5
+ };
6
+ }
7
+ //# sourceMappingURL=azure-mcp-environment.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=azure-mcp.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { spawn } from "node:child_process";
2
+ import { createRequire } from "node:module";
3
+ import process from "node:process";
4
+ import { azureMcpEnvironment } from "./azure-mcp-environment.js";
5
+ const require = createRequire(import.meta.url);
6
+ const azureMcpEntrypoint = require.resolve("@azure/mcp");
7
+ const child = spawn(process.execPath, [azureMcpEntrypoint, "server", "start"], {
8
+ stdio: "inherit",
9
+ env: azureMcpEnvironment(process.env),
10
+ });
11
+ child.on("error", (error) => {
12
+ process.stderr.write(`${error.message}\n`);
13
+ process.exitCode = 1;
14
+ });
15
+ child.on("exit", (code, signal) => {
16
+ if (signal !== null)
17
+ process.kill(process.pid, signal);
18
+ else
19
+ process.exitCode = code ?? 1;
20
+ });
21
+ //# sourceMappingURL=azure-mcp.js.map
package/dist/cli.js CHANGED
@@ -426,6 +426,9 @@ export async function execute(argv, root = process.cwd(), options = {}) {
426
426
  ...(typeof flags.target === "string" ? { targetScope: flags.target } : {}),
427
427
  iacTool: flags.iac === "terraform" ? "terraform" : "bicep",
428
428
  });
429
+ case "project delete":
430
+ confirmed(flags, "project delete");
431
+ return service.deleteProject(required(flags, "project"), true);
429
432
  case "project use":
430
433
  return service.use(required(flags, "project"), typeof flags.run === "string" ? flags.run : undefined);
431
434
  case "project show":
package/dist/mcp.js CHANGED
@@ -53,6 +53,18 @@ const inputSubmission = z
53
53
  .min(1),
54
54
  })
55
55
  .strict();
56
+ const projectCreateInput = z
57
+ .object({
58
+ projectId: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
59
+ displayName: z.string().min(1).max(256),
60
+ environment: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
61
+ targetScope: z.string().min(1).max(1024).optional(),
62
+ iacTool: z.enum(["bicep", "terraform"]),
63
+ })
64
+ .strict();
65
+ const projectIdInput = z.object({ projectId: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/) }).strict();
66
+ const projectUseInput = projectIdInput.extend({ runId: z.string().min(1).optional() });
67
+ const projectDeleteInput = projectIdInput.extend({ confirm: z.literal(true) });
56
68
  const normalizeOutputs = (outputs) => outputs.map(({ kind, value, summary }) => ({
57
69
  kind,
58
70
  value,
@@ -75,6 +87,16 @@ export function createMcpServer(service) {
75
87
  inputSchema: { taskId: z.string() },
76
88
  }, async ({ taskId }) => result(await service.taskContext(taskId)));
77
89
  server.registerTool("recordInput", { description: "Record answers for the exact pending kernel input request", inputSchema: inputSubmission }, async (input) => result(await service.recordInput(input)));
90
+ server.registerTool("projectCreate", {
91
+ description: "Create and select a new project with its initial environment run",
92
+ inputSchema: projectCreateInput,
93
+ }, async (input) => result(await service.createProject(input)));
94
+ server.registerTool("projectList", { description: "List projects in the current workspace" }, async () => result({ projects: await service.listProjects() }));
95
+ server.registerTool("projectUse", { description: "Select an existing project and optionally one of its runs", inputSchema: projectUseInput }, async ({ projectId, runId }) => result(await service.use(projectId, runId)));
96
+ server.registerTool("projectDelete", {
97
+ description: "Delete a project and all of its run-bound state after explicit confirmation",
98
+ inputSchema: projectDeleteInput,
99
+ }, async ({ projectId, confirm }) => result(await service.deleteProject(projectId, confirm)));
78
100
  server.registerTool("stageArtifact", {
79
101
  inputSchema: {
80
102
  taskId: z.string(),
package/dist/service.d.ts CHANGED
@@ -579,6 +579,10 @@ export declare class ApexService {
579
579
  projectId: string;
580
580
  displayName: string;
581
581
  }>>;
582
+ deleteProject(projectId: ProjectId, confirmed: boolean): Promise<{
583
+ deleted: ProjectId;
584
+ selected?: Selection;
585
+ }>;
582
586
  use(projectId: ProjectId, runId?: RunId): Promise<Selection>;
583
587
  show(projectId?: ProjectId): Promise<unknown>;
584
588
  search(term: string, limit?: number): Promise<Array<{
package/dist/service.js CHANGED
@@ -111,7 +111,20 @@ const REQUIREMENTS_INTAKE = [
111
111
  round: "business-discovery",
112
112
  questions: [
113
113
  { id: "workload", prompt: "Briefly describe the workload and its users." },
114
- { id: "industry", prompt: "Which industry or domain does this workload serve?" },
114
+ {
115
+ id: "industry",
116
+ prompt: "Choose the industry or domain that best fits the workload.",
117
+ options: [
118
+ "financial-services",
119
+ "healthcare",
120
+ "retail",
121
+ "public-sector",
122
+ "manufacturing",
123
+ "education",
124
+ "technology",
125
+ "other",
126
+ ],
127
+ },
115
128
  {
116
129
  id: "delivery-scenario",
117
130
  prompt: "Is this a greenfield build, migration, modernization, or extension?",
@@ -139,6 +152,7 @@ const REQUIREMENTS_INTAKE = [
139
152
  {
140
153
  id: "data-sensitivity",
141
154
  prompt: "Choose the data classification or explicitly defer it.",
155
+ options: ["public", "internal", "confidential", "restricted"],
142
156
  valueType: "data-classification",
143
157
  },
144
158
  { id: "iac-preference", prompt: "Choose the preferred infrastructure tool.", options: ["bicep", "terraform"] },
@@ -151,7 +165,22 @@ const REQUIREMENTS_INTAKE = [
151
165
  { id: "prohibited-services", prompt: "List prohibited services or use 'none'." },
152
166
  {
153
167
  id: "service-preferences",
154
- prompt: "State preferred compute, database, integration, and observability services.",
168
+ prompt: "Select preferred Azure services. Select all that apply; architecture chooses the exact combination.",
169
+ options: [
170
+ "app-service",
171
+ "container-apps",
172
+ "azure-functions",
173
+ "aks",
174
+ "azure-sql",
175
+ "azure-cosmos-db",
176
+ "storage",
177
+ "service-bus",
178
+ "event-hubs",
179
+ "api-management",
180
+ "azure-monitor",
181
+ "application-insights",
182
+ ],
183
+ multiSelect: true,
155
184
  },
156
185
  { id: "sku-preferences", prompt: "State required SKUs, tier floors, reservations, or use 'no preference'." },
157
186
  { id: "environment-overrides", prompt: "State environment-specific service or sizing overrides, or 'none'." },
@@ -162,22 +191,49 @@ const REQUIREMENTS_INTAKE = [
162
191
  questions: [
163
192
  {
164
193
  id: "compliance",
165
- prompt: "List compliance and regulatory scopes or explicitly defer them.",
194
+ prompt: "Select applicable compliance and regulatory scopes, or explicitly defer them.",
195
+ options: ["gdpr", "hipaa", "pci-dss", "iso-27001", "soc-2", "other"],
196
+ multiSelect: true,
166
197
  valueType: "compliance",
167
198
  },
168
199
  {
169
200
  id: "security-controls",
170
- prompt: "List required identity, network, encryption, and secret-management controls.",
201
+ prompt: "Select required security controls. The Azure baseline recommends managed identity, private access, Key Vault, and diagnostic logging.",
202
+ options: [
203
+ "managed-identity",
204
+ "private-endpoints",
205
+ "private-dns",
206
+ "disable-public-network-access",
207
+ "key-vault",
208
+ "platform-managed-encryption",
209
+ "customer-managed-keys",
210
+ "diagnostic-logging",
211
+ ],
212
+ multiSelect: true,
213
+ },
214
+ {
215
+ id: "authentication",
216
+ prompt: "Select the required authentication and authorization mechanisms.",
217
+ options: ["microsoft-entra-id", "managed-identity", "external-oidc", "api-key", "anonymous"],
218
+ multiSelect: true,
219
+ },
220
+ {
221
+ id: "region",
222
+ prompt: "Choose the Azure region, or explicitly defer the decision.",
223
+ options: ["swedencentral", "westeurope", "germanywestcentral"],
171
224
  },
172
- { id: "authentication", prompt: "Describe authentication and authorization requirements." },
173
- { id: "region", prompt: "State the required Azure region or use 'deferred: <owner>'." },
174
225
  { id: "availability-recovery", prompt: "State availability, RTO, RPO, backup, and recovery requirements." },
175
226
  {
176
227
  id: "recovery",
177
228
  prompt: "Provide RTO and RPO in whole minutes or explicitly defer them.",
178
229
  valueType: "recovery",
179
230
  },
180
- { id: "operations", prompt: "State monitoring, alerting, support, and operational requirements." },
231
+ {
232
+ id: "operations",
233
+ prompt: "Select operational capabilities required for the workload.",
234
+ options: ["azure-monitor", "application-insights", "log-analytics", "managed-alerts", "24x7-support"],
235
+ multiSelect: true,
236
+ },
181
237
  ],
182
238
  },
183
239
  ];
@@ -536,6 +592,45 @@ export class ApexService {
536
592
  const projects = await Promise.all(names.sort().map(async (projectId) => this.projects.getProject(projectId)));
537
593
  return projects.map(({ projectId, displayName }) => ({ projectId, displayName }));
538
594
  }
595
+ async deleteProject(projectId, confirmed) {
596
+ if (!confirmed)
597
+ throw new ApexError("APEX_USAGE", "project deletion requires explicit confirmation", EXIT_CODES.usage);
598
+ const projects = await this.listProjects();
599
+ if (!projects.some((project) => project.projectId === projectId)) {
600
+ throw new ApexError("APEX_NOT_FOUND", `Project not found: ${projectId}`, EXIT_CODES.notFound);
601
+ }
602
+ if (projects.length <= 1) {
603
+ throw new ApexError("APEX_CONFLICT", "Cannot delete the only project in a workspace", EXIT_CODES.conflict);
604
+ }
605
+ const selection = await this.selection();
606
+ const nextSelection = selection.projectId !== projectId
607
+ ? undefined
608
+ : await (async () => {
609
+ const replacement = projects.find((project) => project.projectId !== projectId);
610
+ const replacementProjectId = replacement.projectId;
611
+ const runId = await this.latestRun(replacementProjectId);
612
+ await this.projects.getRun(replacementProjectId, runId);
613
+ return { projectId: replacementProjectId, runId };
614
+ })();
615
+ const projectDirectory = this.projects.projectDirectory(projectId);
616
+ await this.assertSafeExistingPath(join(this.root, ".apex"), projectDirectory);
617
+ const runDirectory = join(projectDirectory, "runs");
618
+ await this.assertSafeExistingPath(projectDirectory, runDirectory);
619
+ const runIds = await readdir(runDirectory);
620
+ for (const runId of runIds) {
621
+ const workDirectory = join(this.root, ".apex", "work", runId);
622
+ if (await this.pathExistsLstat(workDirectory)) {
623
+ await this.assertSafeExistingPath(join(this.root, ".apex"), workDirectory);
624
+ await rm(workDirectory, { recursive: true, force: true });
625
+ }
626
+ }
627
+ await rm(projectDirectory, { recursive: true, force: true });
628
+ if (nextSelection === undefined)
629
+ return { deleted: projectId };
630
+ await this.writeSelection(nextSelection);
631
+ await this.append(await this.run(nextSelection), "selection.changed", nextSelection);
632
+ return { deleted: projectId, selected: nextSelection };
633
+ }
539
634
  async use(projectId, runId) {
540
635
  await this.projects.getProject(projectId);
541
636
  const selectedRun = runId ?? (await this.latestRun(projectId));
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const APEX_VERSION: "0.10.0-next.0";
1
+ export declare const APEX_VERSION: "0.10.0-next.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const APEX_VERSION = "0.10.0-next.0";
1
+ export const APEX_VERSION = "0.10.0-next.1";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexops/cli",
3
- "version": "0.10.0-next.0",
3
+ "version": "0.10.0-next.1",
4
4
  "description": "Portable no-shell CLI and MCP facade for APEX",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,10 +32,11 @@
32
32
  "assets"
33
33
  ],
34
34
  "dependencies": {
35
- "@apexops/capabilities": "0.10.0-next.0",
36
- "@apexops/contracts": "0.10.0-next.0",
37
- "@apexops/kernel": "0.10.0-next.0",
38
- "@apexops/renderers": "0.10.0-next.0",
35
+ "@apexops/capabilities": "0.10.0-next.1",
36
+ "@apexops/contracts": "0.10.0-next.1",
37
+ "@apexops/kernel": "0.10.0-next.1",
38
+ "@apexops/renderers": "0.10.0-next.1",
39
+ "@azure/mcp": "3.0.0-beta.37",
39
40
  "@hono/node-server": "2.0.11",
40
41
  "@modelcontextprotocol/sdk": "1.29.0",
41
42
  "@sinclair/typebox": "0.34.52",