feat(scenarios): overhaul export/import with multi-entity YAML format

- export now accepts includeEnvironment and credentialIds query params
- output is a YAML stream with comment-delimited environment, credential, and scenario sections
- scenario entity includes credentials array with alias mappings
- import accepts both old single-object and new array format, upserts envs/creds before linking
- new ExportScenarioModal with env and per-credential checkboxes replaces direct download
This commit is contained in:
2026-04-15 00:35:14 +03:00
parent a779ab4667
commit f268d0e3eb
10 changed files with 489 additions and 29 deletions
+6 -4
View File
@@ -965,7 +965,10 @@ export class McpService {
},
async ({ id }) => {
try {
const exported = await this.scenarioService.exportScenario(id);
const exported = await this.scenarioService.exportScenario(id, {
includeEnvironment: false,
credentialIds: [],
});
return {
content: [
{ type: "text" as const, text: JSON.stringify(exported) },
@@ -1010,11 +1013,10 @@ export class McpService {
async ({ name, description, steps }) => {
try {
const scenario = await this.scenarioService.importScenario({
kind: "scenario",
name,
description,
steps: steps as Parameters<
typeof this.scenarioService.importScenario
>[0]["steps"],
steps: steps as { title: string | null; execCode: string | null }[],
});
return {
content: [