feat(scenarios): require environment for scenario runs

- require environmentId when creating runs in API and MCP tools

- pass selected environment data into step execution helpers

- prompt for environment selection before running scenarios in UI
This commit is contained in:
2026-04-11 00:12:21 +03:00
parent d8ea2d0126
commit 56d23f913d
13 changed files with 237 additions and 28 deletions
+6 -2
View File
@@ -670,11 +670,15 @@ export class McpService {
description: "Trigger an immediate run of a scenario by ID",
inputSchema: {
id: z.string().uuid().describe("Scenario ID to run"),
environmentId: z
.string()
.uuid()
.describe("Environment ID to run the scenario in"),
},
},
async ({ id }) => {
async ({ id, environmentId }) => {
try {
const run = await this.scenarioService.createRun(id);
const run = await this.scenarioService.createRun(id, environmentId);
return {
content: [{ type: "text" as const, text: JSON.stringify(run) }],
};