@kvasar/google-stitch 0.1.7 → 0.1.10
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/SKILL.md +62 -9
- package/src/services/stitch-mcp-client.ts +35 -4
- package/src/tools/apply_design_system.ts +59 -5
- package/src/tools/create_design_system.ts +140 -5
- package/src/tools/create_project.ts +29 -7
- package/src/tools/generate_screen_from_text_tool.ts +123 -33
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/skills/SKILL.md
CHANGED
|
@@ -86,14 +86,40 @@ Always extract:
|
|
|
86
86
|
|
|
87
87
|
- projectId
|
|
88
88
|
- prompt
|
|
89
|
-
- deviceType
|
|
90
|
-
-
|
|
89
|
+
- deviceType (optional)
|
|
90
|
+
- modelId (optional)
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
## Supported device types:
|
|
93
93
|
|
|
94
|
-
-
|
|
94
|
+
- MOBILE
|
|
95
|
+
- DESKTOP
|
|
96
|
+
- TABLET
|
|
97
|
+
- AGNOSTIC
|
|
95
98
|
|
|
96
|
-
|
|
99
|
+
### Preferred default:
|
|
100
|
+
|
|
101
|
+
- DESKTOP
|
|
102
|
+
|
|
103
|
+
#### Supported models:
|
|
104
|
+
|
|
105
|
+
- GEMINI_3_PRO
|
|
106
|
+
- GEMINI_3_FLASH
|
|
107
|
+
- GEMINI_3_1_PRO
|
|
108
|
+
|
|
109
|
+
#### Preferred default:
|
|
110
|
+
|
|
111
|
+
- GEMINI_3_1_PRO
|
|
112
|
+
|
|
113
|
+
Always structure the tool call as:
|
|
114
|
+
|
|
115
|
+
{
|
|
116
|
+
"projectId": "project-id",
|
|
117
|
+
"prompt": "Generate a modern SaaS dashboard with KPI cards and sidebar",
|
|
118
|
+
"deviceType": "DESKTOP",
|
|
119
|
+
"modelId": "GEMINI_3_1_PRO"
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
Never call the tool with only a string prompt.
|
|
97
123
|
|
|
98
124
|
### Screen editing
|
|
99
125
|
|
|
@@ -135,17 +161,44 @@ Recommended defaults:
|
|
|
135
161
|
|
|
136
162
|
For brand consistency and theming:
|
|
137
163
|
|
|
164
|
+
|
|
165
|
+
|
|
138
166
|
- `create_design_system`
|
|
167
|
+
|
|
168
|
+
Examples:
|
|
169
|
+
|
|
170
|
+
- Create a dark mode design system with Inter font and round corners
|
|
171
|
+
- Set up a design system with blue as the primary color
|
|
172
|
+
- Create a brand identity with Geist font and minimal roundness
|
|
173
|
+
|
|
139
174
|
- `update_design_system`
|
|
175
|
+
|
|
176
|
+
Examples:
|
|
177
|
+
|
|
178
|
+
- Update the design system to use dark mode
|
|
179
|
+
- Change the font to Geist in our design system
|
|
180
|
+
- Update the roundness to fully rounded
|
|
181
|
+
|
|
182
|
+
|
|
140
183
|
- `list_design_systems`
|
|
184
|
+
|
|
185
|
+
Examples:
|
|
186
|
+
|
|
187
|
+
- List all design systems in project 12345
|
|
188
|
+
- Show me the available design systems
|
|
189
|
+
- What design systems do I have?
|
|
190
|
+
|
|
191
|
+
|
|
141
192
|
- `apply_design_system`
|
|
142
193
|
|
|
194
|
+
Applies a design system to one or more screens, modifying their appearance to match the system’s tokens (colors, fonts, shapes).
|
|
195
|
+
|
|
143
196
|
Examples:
|
|
144
197
|
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
|
|
198
|
+
- Apply the blue design system to all screens in project 12345
|
|
199
|
+
- Restyle these screens with the brand identity
|
|
200
|
+
- Use design system abc to update my screens
|
|
201
|
+
|
|
149
202
|
|
|
150
203
|
---
|
|
151
204
|
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
3
3
|
|
|
4
|
+
export type DeviceType =
|
|
5
|
+
| "DEVICE_TYPE_UNSPECIFIED"
|
|
6
|
+
| "MOBILE"
|
|
7
|
+
| "DESKTOP"
|
|
8
|
+
| "TABLET"
|
|
9
|
+
| "AGNOSTIC";
|
|
10
|
+
|
|
11
|
+
export type ModelId =
|
|
12
|
+
| "MODEL_ID_UNSPECIFIED"
|
|
13
|
+
| "GEMINI_3_PRO"
|
|
14
|
+
| "GEMINI_3_FLASH"
|
|
15
|
+
| "GEMINI_3_1_PRO";
|
|
16
|
+
|
|
4
17
|
export class StitchMCPClient {
|
|
5
18
|
private client: Client;
|
|
6
19
|
private transport: StreamableHTTPClientTransport;
|
|
@@ -32,13 +45,31 @@ export class StitchMCPClient {
|
|
|
32
45
|
this.connected = true;
|
|
33
46
|
}
|
|
34
47
|
}
|
|
35
|
-
|
|
36
|
-
async generateScreen(prompt: string) {
|
|
48
|
+
async createProject(title?: string) {
|
|
37
49
|
await this.connect();
|
|
38
50
|
|
|
39
51
|
return this.client.callTool({
|
|
40
|
-
name: "
|
|
41
|
-
arguments: {
|
|
52
|
+
name: "create_project",
|
|
53
|
+
arguments: title ? { title } : {},
|
|
42
54
|
});
|
|
43
55
|
}
|
|
56
|
+
|
|
57
|
+
async generateScreen(params: {
|
|
58
|
+
projectId: string;
|
|
59
|
+
prompt: string;
|
|
60
|
+
deviceType?: DeviceType;
|
|
61
|
+
modelId?: ModelId;
|
|
62
|
+
}) {
|
|
63
|
+
await this.connect();
|
|
64
|
+
|
|
65
|
+
return this.client.callTool({
|
|
66
|
+
name: "generate_screen_from_text",
|
|
67
|
+
arguments: {
|
|
68
|
+
projectId: params.projectId,
|
|
69
|
+
prompt: params.prompt,
|
|
70
|
+
deviceType: params.deviceType,
|
|
71
|
+
modelId: params.modelId,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
44
75
|
}
|
|
@@ -1,7 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
type SelectedScreenInstance = {
|
|
2
|
+
id: string;
|
|
3
|
+
sourceScreen: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
type ApplyDesignSystemParams = {
|
|
7
|
+
projectId: string;
|
|
8
|
+
selectedScreenInstances: SelectedScreenInstance[];
|
|
9
|
+
assetId: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const applyDesignSystemTool = (client: any) => ({
|
|
2
13
|
name: "apply_design_system",
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
14
|
+
description:
|
|
15
|
+
"Applies a design system asset to one or more screens, updating colors, fonts, and shapes",
|
|
16
|
+
|
|
17
|
+
parameters: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
projectId: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Required. Project ID without prefix."
|
|
23
|
+
},
|
|
24
|
+
selectedScreenInstances: {
|
|
25
|
+
type: "array",
|
|
26
|
+
description:
|
|
27
|
+
"Required. Screen instances to update from get_project.",
|
|
28
|
+
items: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
id: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description:
|
|
34
|
+
"Required. Screen instance ID (not source screen ID)."
|
|
35
|
+
},
|
|
36
|
+
sourceScreen: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description:
|
|
39
|
+
"Required. Resource name format: projects/{project}/screens/{screen}"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
required: ["id", "sourceScreen"]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
assetId: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description:
|
|
48
|
+
"Required. Design system asset ID without assets/ prefix."
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
required: [
|
|
52
|
+
"projectId",
|
|
53
|
+
"selectedScreenInstances",
|
|
54
|
+
"assetId"
|
|
55
|
+
]
|
|
6
56
|
},
|
|
7
|
-
|
|
57
|
+
|
|
58
|
+
async execute(_: string, params: ApplyDesignSystemParams) {
|
|
59
|
+
return await client.request("apply_design_system", params);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
@@ -1,7 +1,142 @@
|
|
|
1
|
-
|
|
1
|
+
type ColorMode =
|
|
2
|
+
| "COLOR_MODE_UNSPECIFIED"
|
|
3
|
+
| "LIGHT"
|
|
4
|
+
| "DARK";
|
|
5
|
+
|
|
6
|
+
type FontType =
|
|
7
|
+
| "FONT_UNSPECIFIED"
|
|
8
|
+
| "INTER"
|
|
9
|
+
| "DM_SANS"
|
|
10
|
+
| "GEIST";
|
|
11
|
+
|
|
12
|
+
type Roundness =
|
|
13
|
+
| "ROUNDNESS_UNSPECIFIED"
|
|
14
|
+
| "ROUND_FOUR"
|
|
15
|
+
| "ROUND_EIGHT"
|
|
16
|
+
| "ROUND_TWELVE"
|
|
17
|
+
| "ROUND_FULL";
|
|
18
|
+
|
|
19
|
+
type ColorVariant =
|
|
20
|
+
| "COLOR_VARIANT_UNSPECIFIED"
|
|
21
|
+
| "MONOCHROME"
|
|
22
|
+
| "NEUTRAL"
|
|
23
|
+
| "TONAL_SPOT"
|
|
24
|
+
| "VIBRANT"
|
|
25
|
+
| "EXPRESSIVE"
|
|
26
|
+
| "FIDELITY"
|
|
27
|
+
| "CONTENT"
|
|
28
|
+
| "RAINBOW"
|
|
29
|
+
| "FRUIT_SALAD";
|
|
30
|
+
|
|
31
|
+
type DesignTheme = {
|
|
32
|
+
colorMode: ColorMode;
|
|
33
|
+
headlineFont: FontType;
|
|
34
|
+
bodyFont: FontType;
|
|
35
|
+
labelFont?: FontType;
|
|
36
|
+
roundness: Roundness;
|
|
37
|
+
customColor: string;
|
|
38
|
+
colorVariant?: ColorVariant;
|
|
39
|
+
overridePrimaryColor?: string;
|
|
40
|
+
overrideSecondaryColor?: string;
|
|
41
|
+
overrideTertiaryColor?: string;
|
|
42
|
+
overrideNeutralColor?: string;
|
|
43
|
+
designMd?: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
type DesignSystem = {
|
|
47
|
+
displayName: string;
|
|
48
|
+
theme: DesignTheme;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type CreateDesignSystemParams = {
|
|
52
|
+
designSystem: DesignSystem;
|
|
53
|
+
projectId?: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const createDesignSystemTool = (client: any) => ({
|
|
2
57
|
name: "create_design_system",
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
58
|
+
description:
|
|
59
|
+
"Creates a new design system with colors, typography, roundness, and theme tokens for a Stitch project",
|
|
60
|
+
|
|
61
|
+
parameters: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
projectId: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description:
|
|
67
|
+
"Optional. Project ID. If omitted, creates a global design asset."
|
|
68
|
+
},
|
|
69
|
+
designSystem: {
|
|
70
|
+
type: "object",
|
|
71
|
+
description: "Required. Design system definition.",
|
|
72
|
+
properties: {
|
|
73
|
+
displayName: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Required. Display name."
|
|
76
|
+
},
|
|
77
|
+
theme: {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
colorMode: {
|
|
81
|
+
type: "string",
|
|
82
|
+
enum: ["LIGHT", "DARK"]
|
|
83
|
+
},
|
|
84
|
+
headlineFont: {
|
|
85
|
+
type: "string",
|
|
86
|
+
enum: ["INTER", "DM_SANS", "GEIST"]
|
|
87
|
+
},
|
|
88
|
+
bodyFont: {
|
|
89
|
+
type: "string",
|
|
90
|
+
enum: ["INTER", "DM_SANS", "GEIST"]
|
|
91
|
+
},
|
|
92
|
+
labelFont: {
|
|
93
|
+
type: "string",
|
|
94
|
+
enum: ["INTER", "DM_SANS", "GEIST"]
|
|
95
|
+
},
|
|
96
|
+
roundness: {
|
|
97
|
+
type: "string",
|
|
98
|
+
enum: [
|
|
99
|
+
"ROUND_FOUR",
|
|
100
|
+
"ROUND_EIGHT",
|
|
101
|
+
"ROUND_TWELVE",
|
|
102
|
+
"ROUND_FULL"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
customColor: {
|
|
106
|
+
type: "string",
|
|
107
|
+
description: "Hex seed color"
|
|
108
|
+
},
|
|
109
|
+
colorVariant: {
|
|
110
|
+
type: "string",
|
|
111
|
+
enum: [
|
|
112
|
+
"MONOCHROME",
|
|
113
|
+
"NEUTRAL",
|
|
114
|
+
"TONAL_SPOT",
|
|
115
|
+
"VIBRANT",
|
|
116
|
+
"EXPRESSIVE"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
designMd: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "Optional markdown design instructions"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
required: [
|
|
125
|
+
"colorMode",
|
|
126
|
+
"headlineFont",
|
|
127
|
+
"bodyFont",
|
|
128
|
+
"roundness",
|
|
129
|
+
"customColor"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
required: ["displayName", "theme"]
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
required: ["designSystem"]
|
|
6
137
|
},
|
|
7
|
-
|
|
138
|
+
|
|
139
|
+
async execute(_: string, params: CreateDesignSystemParams) {
|
|
140
|
+
return await client.request("create_design_system", params);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Tool: create_project
|
|
3
|
+
* Creates a new Stitch project. A project is a container for UI designs and frontend code.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Type } from "@sinclair/typebox";
|
|
7
|
+
import { StitchMCPClient } from "../services/stitch-mcp-client.js";
|
|
8
|
+
|
|
9
|
+
export interface CreateProjectParams {
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createProjectTool(client: StitchMCPClient) {
|
|
14
|
+
return {
|
|
15
|
+
name: "create_project" as const,
|
|
16
|
+
description: "Creates a new Stitch project. A project is a container for UI designs and frontend code.",
|
|
17
|
+
parameters: Type.Object({
|
|
18
|
+
title: Type.Optional(
|
|
19
|
+
Type.String({ description: "Optional. The title of the project." })
|
|
20
|
+
),
|
|
21
|
+
}),
|
|
22
|
+
async execute(_id: string, params: CreateProjectParams) {
|
|
23
|
+
const result = await client.createProject(params.title);
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DeviceType,
|
|
3
|
+
ModelId,
|
|
4
|
+
StitchMCPClient
|
|
5
|
+
} from "../services/stitch-mcp-client.js";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import os from "node:os";
|
|
2
9
|
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type StitchResponse = {
|
|
11
|
+
screen?: {
|
|
12
|
+
name?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
prompt?: string;
|
|
15
|
+
screenshot?: {
|
|
16
|
+
url?: string;
|
|
17
|
+
bytes?: string;
|
|
18
|
+
};
|
|
19
|
+
htmlCode?: {
|
|
20
|
+
content?: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
};
|
|
23
|
+
deviceType?: DeviceType;
|
|
24
|
+
width?: string;
|
|
25
|
+
height?: string;
|
|
12
26
|
};
|
|
27
|
+
output_components?: Array<{
|
|
28
|
+
text?: string;
|
|
29
|
+
suggestion?: string;
|
|
30
|
+
design?: {
|
|
31
|
+
screenshot?: {
|
|
32
|
+
url?: string;
|
|
33
|
+
bytes?: string;
|
|
34
|
+
};
|
|
35
|
+
htmlCode?: {
|
|
36
|
+
content?: string;
|
|
37
|
+
url?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}>;
|
|
13
41
|
};
|
|
14
42
|
|
|
15
43
|
export function generateScreenFromTextTool(client: StitchMCPClient) {
|
|
@@ -20,38 +48,100 @@ export function generateScreenFromTextTool(client: StitchMCPClient) {
|
|
|
20
48
|
parameters: {
|
|
21
49
|
type: "object",
|
|
22
50
|
properties: {
|
|
51
|
+
projectId: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "Required. Project ID without prefix."
|
|
54
|
+
},
|
|
23
55
|
prompt: {
|
|
24
56
|
type: "string",
|
|
25
57
|
description: "Describe the UI screen to generate"
|
|
58
|
+
},
|
|
59
|
+
deviceType: {
|
|
60
|
+
type: "string",
|
|
61
|
+
enum: [
|
|
62
|
+
"DEVICE_TYPE_UNSPECIFIED",
|
|
63
|
+
"MOBILE",
|
|
64
|
+
"DESKTOP",
|
|
65
|
+
"TABLET",
|
|
66
|
+
"AGNOSTIC"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
modelId: {
|
|
70
|
+
type: "string",
|
|
71
|
+
enum: [
|
|
72
|
+
"MODEL_ID_UNSPECIFIED",
|
|
73
|
+
"GEMINI_3_PRO",
|
|
74
|
+
"GEMINI_3_FLASH",
|
|
75
|
+
"GEMINI_3_1_PRO"
|
|
76
|
+
]
|
|
26
77
|
}
|
|
27
78
|
},
|
|
28
|
-
required: ["prompt"]
|
|
79
|
+
required: ["projectId", "prompt"]
|
|
29
80
|
},
|
|
30
81
|
|
|
31
|
-
async execute(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
82
|
+
async execute(
|
|
83
|
+
_id: string,
|
|
84
|
+
params: {
|
|
85
|
+
projectId: string;
|
|
86
|
+
prompt: string;
|
|
87
|
+
deviceType?: DeviceType;
|
|
88
|
+
modelId?: ModelId;
|
|
89
|
+
}
|
|
90
|
+
) {
|
|
91
|
+
const result = (await client.generateScreen(params)) as StitchResponse;
|
|
92
|
+
|
|
93
|
+
const screen = result.screen;
|
|
94
|
+
const firstComponent = result.output_components?.[0];
|
|
95
|
+
|
|
96
|
+
const imageUrl =
|
|
97
|
+
screen?.screenshot?.url ||
|
|
98
|
+
firstComponent?.design?.screenshot?.url;
|
|
99
|
+
|
|
100
|
+
if (imageUrl) {
|
|
101
|
+
return {
|
|
102
|
+
content: [
|
|
103
|
+
{
|
|
104
|
+
type: "image",
|
|
105
|
+
url: imageUrl,
|
|
106
|
+
caption: screen?.title || "Generated by Google Stitch"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const imageBytes =
|
|
113
|
+
screen?.screenshot?.bytes ||
|
|
114
|
+
firstComponent?.design?.screenshot?.bytes;
|
|
115
|
+
|
|
116
|
+
if (imageBytes) {
|
|
117
|
+
const tempFilePath = path.join(
|
|
118
|
+
os.tmpdir(),
|
|
119
|
+
`stitch-screen-${Date.now()}.png`
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
fs.writeFileSync(
|
|
123
|
+
tempFilePath,
|
|
124
|
+
Buffer.from(imageBytes, "base64")
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
content: [
|
|
129
|
+
{
|
|
130
|
+
type: "image",
|
|
131
|
+
path: tempFilePath,
|
|
132
|
+
caption: screen?.title || "Generated by Google Stitch"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
};
|
|
136
|
+
}
|
|
36
137
|
|
|
37
138
|
const html =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)}</pre>`
|
|
45
|
-
: result.jsx
|
|
46
|
-
? `<pre style="white-space:pre-wrap;padding:16px">${escapeHtml(
|
|
47
|
-
result.jsx
|
|
48
|
-
)}</pre>`
|
|
49
|
-
: `<div style="padding:16px">
|
|
50
|
-
<h3>Screen generated</h3>
|
|
51
|
-
<pre>${escapeHtml(
|
|
52
|
-
JSON.stringify(result, null, 2)
|
|
53
|
-
)}</pre>
|
|
54
|
-
</div>`);
|
|
139
|
+
screen?.htmlCode?.content ||
|
|
140
|
+
firstComponent?.design?.htmlCode?.content ||
|
|
141
|
+
`<div style="padding:16px">
|
|
142
|
+
<h3>${escapeHtml(screen?.title || "Generated screen")}</h3>
|
|
143
|
+
<p>${escapeHtml(firstComponent?.text || "")}</p>
|
|
144
|
+
</div>`;
|
|
55
145
|
|
|
56
146
|
return {
|
|
57
147
|
content: [
|