@clipform/mcp-server 1.4.0 → 1.5.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/dist/__tests__/config-sync.test.js +8 -27
- package/dist/__tests__/config-sync.test.js.map +1 -1
- package/dist/lib/config.d.ts +9 -11
- package/dist/lib/config.js +3 -336
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/schemas.d.ts +3 -3
- package/dist/lib/schemas.js +24 -6
- package/dist/lib/schemas.js.map +1 -1
- package/dist/server.js +7 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/create-form.js +4 -3
- package/dist/tools/create-form.js.map +1 -1
- package/dist/tools/list-compositions.js +6 -2
- package/dist/tools/list-compositions.js.map +1 -1
- package/dist/tools/render-composition.js +7 -5
- package/dist/tools/render-composition.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,35 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Verifies that the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* This test runs in CI and will fail if the config package changes
|
|
6
|
-
* without the MCP server's inlined copy being updated.
|
|
2
|
+
* Verifies that the MCP server's config re-exports match @vid-master/config.
|
|
3
|
+
* This ensures the re-export path is working correctly.
|
|
7
4
|
*/
|
|
8
5
|
import { describe, it, expect } from "vitest";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { NODE_TYPES as SOURCE_NODE_TYPES, CONTACT_FIELDS as SOURCE_CONTACT_FIELDS, } from "@vid-master/config";
|
|
7
|
+
import { NODE_TYPES as MCP_NODE_TYPES, CONTACT_FIELDS as MCP_CONTACT_FIELDS, } from "../lib/config.js";
|
|
11
8
|
describe("config-sync", () => {
|
|
12
|
-
it("
|
|
13
|
-
|
|
14
|
-
.filter(([, def]) => def.is_active && !def.is_system)
|
|
15
|
-
.map(([type]) => type);
|
|
16
|
-
const inlinedTypes = Object.keys(INLINED_ANSWER_TYPES);
|
|
17
|
-
// Same set of type keys
|
|
18
|
-
expect(inlinedTypes.sort()).toEqual(sourceActiveTypes.sort());
|
|
19
|
-
// Each inlined type matches the source on the fields the MCP server uses
|
|
20
|
-
for (const type of inlinedTypes) {
|
|
21
|
-
const source = SOURCE_ANSWER_TYPES[type];
|
|
22
|
-
const inlined = INLINED_ANSWER_TYPES[type];
|
|
23
|
-
expect(inlined.label).toBe(source.label);
|
|
24
|
-
expect(inlined.description).toBe(source.description);
|
|
25
|
-
expect(inlined.is_active).toBe(source.is_active);
|
|
26
|
-
expect(inlined.is_system).toBe(source.is_system);
|
|
27
|
-
expect(inlined.has_options).toBe(source.has_options);
|
|
28
|
-
expect(inlined.config_schema).toEqual(source.config_schema);
|
|
29
|
-
}
|
|
9
|
+
it("NODE_TYPES re-export matches @vid-master/config", () => {
|
|
10
|
+
expect(MCP_NODE_TYPES).toBe(SOURCE_NODE_TYPES);
|
|
30
11
|
});
|
|
31
|
-
it("
|
|
32
|
-
expect(
|
|
12
|
+
it("CONTACT_FIELDS re-export matches @vid-master/config", () => {
|
|
13
|
+
expect(MCP_CONTACT_FIELDS).toBe(SOURCE_CONTACT_FIELDS);
|
|
33
14
|
});
|
|
34
15
|
});
|
|
35
16
|
//# sourceMappingURL=config-sync.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-sync.test.js","sourceRoot":"","sources":["../../src/__tests__/config-sync.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config-sync.test.js","sourceRoot":"","sources":["../../src/__tests__/config-sync.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,UAAU,IAAI,iBAAiB,EAC/B,cAAc,IAAI,qBAAqB,GACxC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,cAAc,IAAI,kBAAkB,GACrC,MAAM,kBAAkB,CAAC;AAE1B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* the MCP server actually references.
|
|
5
|
-
*
|
|
6
|
-
* Keep in sync with packages/config/ — verified by config-sync.test.ts.
|
|
2
|
+
* Re-export from @vid-master/config — single source of truth.
|
|
3
|
+
* The MCP server uses NODE_TYPES and CONTACT_FIELDS directly.
|
|
7
4
|
*/
|
|
8
|
-
export
|
|
5
|
+
export { NODE_TYPES, CONTACT_FIELDS } from "@vid-master/config";
|
|
6
|
+
export type NodeTypeDefinition = {
|
|
9
7
|
label: string;
|
|
10
8
|
description: string;
|
|
11
9
|
is_active: boolean;
|
|
12
10
|
is_system: boolean;
|
|
13
11
|
has_options: boolean;
|
|
12
|
+
min_options?: number;
|
|
13
|
+
max_options?: number;
|
|
14
14
|
max_option_length?: number;
|
|
15
15
|
config_schema: Record<string, unknown> | null;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
16
|
+
};
|
|
17
|
+
export type ContactFieldDefinition = {
|
|
18
18
|
id: string;
|
|
19
19
|
label: string;
|
|
20
20
|
type: string;
|
|
21
21
|
placeholder: string;
|
|
22
22
|
order: number;
|
|
23
|
-
}
|
|
24
|
-
export declare const ANSWER_TYPES: Record<string, AnswerTypeDefinition>;
|
|
25
|
-
export declare const CONTACT_FIELDS: ContactFieldDefinition[];
|
|
23
|
+
};
|
package/dist/lib/config.js
CHANGED
|
@@ -1,339 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* the MCP server actually references.
|
|
5
|
-
*
|
|
6
|
-
* Keep in sync with packages/config/ — verified by config-sync.test.ts.
|
|
2
|
+
* Re-export from @vid-master/config — single source of truth.
|
|
3
|
+
* The MCP server uses NODE_TYPES and CONTACT_FIELDS directly.
|
|
7
4
|
*/
|
|
8
|
-
export
|
|
9
|
-
choice: {
|
|
10
|
-
label: "Multiple Choice",
|
|
11
|
-
description: "Single or multiple choice questions with predefined options",
|
|
12
|
-
is_active: true,
|
|
13
|
-
is_system: false,
|
|
14
|
-
has_options: true,
|
|
15
|
-
max_option_length: 36,
|
|
16
|
-
config_schema: {
|
|
17
|
-
type: "object",
|
|
18
|
-
properties: {
|
|
19
|
-
choice: {
|
|
20
|
-
type: "object",
|
|
21
|
-
properties: {
|
|
22
|
-
enable_branching: {
|
|
23
|
-
type: "boolean",
|
|
24
|
-
label: "Enable branching logic",
|
|
25
|
-
default: true,
|
|
26
|
-
description: "Allow each option to have its own logic path. When disabled, all options share a single jump action.",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
selection_mode: {
|
|
31
|
-
enum: ["single", "multiple"],
|
|
32
|
-
type: "string",
|
|
33
|
-
label: "Selection mode",
|
|
34
|
-
default: "single",
|
|
35
|
-
description: "Allow single or multiple selections",
|
|
36
|
-
},
|
|
37
|
-
allow_text_response: {
|
|
38
|
-
type: "boolean",
|
|
39
|
-
label: "Allow text response",
|
|
40
|
-
default: false,
|
|
41
|
-
description: "Allow free-text response in addition to options (single choice only)",
|
|
42
|
-
},
|
|
43
|
-
randomise_options: {
|
|
44
|
-
type: "boolean",
|
|
45
|
-
label: "Randomise options",
|
|
46
|
-
default: false,
|
|
47
|
-
description: "Show options in random order",
|
|
48
|
-
},
|
|
49
|
-
show_option_count: {
|
|
50
|
-
type: "boolean",
|
|
51
|
-
label: "Show option count",
|
|
52
|
-
default: false,
|
|
53
|
-
description: "Display number of options",
|
|
54
|
-
},
|
|
55
|
-
content_media_type: {
|
|
56
|
-
enum: ["upload", "recorded"],
|
|
57
|
-
type: "string",
|
|
58
|
-
label: "Content media type",
|
|
59
|
-
description: "How the question media was provided",
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
open: {
|
|
65
|
-
label: "Open Ended",
|
|
66
|
-
description: "Free-form text responses from users",
|
|
67
|
-
is_active: true,
|
|
68
|
-
is_system: false,
|
|
69
|
-
has_options: false,
|
|
70
|
-
config_schema: {
|
|
71
|
-
type: "object",
|
|
72
|
-
properties: {
|
|
73
|
-
formats: {
|
|
74
|
-
type: "array",
|
|
75
|
-
items: {
|
|
76
|
-
type: "object",
|
|
77
|
-
properties: {
|
|
78
|
-
format: {
|
|
79
|
-
enum: ["text", "audio", "video"],
|
|
80
|
-
type: "string",
|
|
81
|
-
},
|
|
82
|
-
order: { type: "number" },
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
label: "Allowed response formats",
|
|
86
|
-
description: "Which formats the user can respond with, in display order",
|
|
87
|
-
},
|
|
88
|
-
content_media_type: {
|
|
89
|
-
enum: ["upload", "recorded"],
|
|
90
|
-
type: "string",
|
|
91
|
-
label: "Content media type",
|
|
92
|
-
description: "How the question media was provided",
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
contact: {
|
|
98
|
-
label: "Contact Form",
|
|
99
|
-
description: "Collect standardized contact information (name, email, phone, company)",
|
|
100
|
-
is_active: true,
|
|
101
|
-
is_system: false,
|
|
102
|
-
has_options: false,
|
|
103
|
-
config_schema: {
|
|
104
|
-
type: "object",
|
|
105
|
-
properties: {
|
|
106
|
-
title: { type: "string" },
|
|
107
|
-
fields: {
|
|
108
|
-
type: "array",
|
|
109
|
-
items: {
|
|
110
|
-
type: "object",
|
|
111
|
-
required: ["id", "required"],
|
|
112
|
-
properties: {
|
|
113
|
-
id: { type: "string" },
|
|
114
|
-
type: {
|
|
115
|
-
enum: ["text", "textarea", "email", "tel", "url"],
|
|
116
|
-
type: "string",
|
|
117
|
-
},
|
|
118
|
-
label: { type: "string" },
|
|
119
|
-
order: { type: "number" },
|
|
120
|
-
required: { type: "boolean", default: true },
|
|
121
|
-
is_custom: { type: "boolean", default: false },
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
description: { type: "string" },
|
|
126
|
-
consent_items: {
|
|
127
|
-
type: "array",
|
|
128
|
-
items: {
|
|
129
|
-
type: "object",
|
|
130
|
-
properties: {
|
|
131
|
-
id: { type: "string" },
|
|
132
|
-
label: { type: "string" },
|
|
133
|
-
order: { type: "number" },
|
|
134
|
-
required: { type: "boolean" },
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
binary: {
|
|
142
|
-
label: "Binary",
|
|
143
|
-
description: "Two-option choice - yes/no, true/false, or this vs that",
|
|
144
|
-
is_active: true,
|
|
145
|
-
is_system: false,
|
|
146
|
-
has_options: true,
|
|
147
|
-
max_option_length: 12,
|
|
148
|
-
config_schema: {
|
|
149
|
-
type: "object",
|
|
150
|
-
properties: {
|
|
151
|
-
choice: {
|
|
152
|
-
type: "object",
|
|
153
|
-
properties: {
|
|
154
|
-
enable_branching: {
|
|
155
|
-
type: "boolean",
|
|
156
|
-
label: "Enable branching logic",
|
|
157
|
-
default: true,
|
|
158
|
-
description: "Allow each option to have its own logic path.",
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
content_media_type: {
|
|
163
|
-
enum: ["upload", "recorded"],
|
|
164
|
-
type: "string",
|
|
165
|
-
label: "Content media type",
|
|
166
|
-
description: "How the question media was provided",
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
button: {
|
|
172
|
-
label: "Button",
|
|
173
|
-
description: "Simple button for acknowledgment or navigation",
|
|
174
|
-
is_active: true,
|
|
175
|
-
is_system: false,
|
|
176
|
-
has_options: true,
|
|
177
|
-
max_option_length: 28,
|
|
178
|
-
config_schema: {
|
|
179
|
-
type: "object",
|
|
180
|
-
properties: {
|
|
181
|
-
button_text: {
|
|
182
|
-
type: "string",
|
|
183
|
-
label: "Button text",
|
|
184
|
-
default: "Continue",
|
|
185
|
-
},
|
|
186
|
-
button_style: {
|
|
187
|
-
enum: ["primary", "secondary", "outline"],
|
|
188
|
-
type: "string",
|
|
189
|
-
label: "Button style",
|
|
190
|
-
default: "primary",
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
external_link: {
|
|
196
|
-
label: "External Link",
|
|
197
|
-
description: "Redirect users to an external URL",
|
|
198
|
-
is_active: true,
|
|
199
|
-
is_system: false,
|
|
200
|
-
has_options: false,
|
|
201
|
-
config_schema: {
|
|
202
|
-
type: "object",
|
|
203
|
-
properties: {
|
|
204
|
-
links: {
|
|
205
|
-
type: "array",
|
|
206
|
-
items: {
|
|
207
|
-
type: "object",
|
|
208
|
-
required: ["id", "url"],
|
|
209
|
-
properties: {
|
|
210
|
-
id: { type: "string" },
|
|
211
|
-
url: {
|
|
212
|
-
type: "string",
|
|
213
|
-
label: "URL",
|
|
214
|
-
placeholder: "https://example.com",
|
|
215
|
-
},
|
|
216
|
-
title: { type: "string", label: "Heading" },
|
|
217
|
-
description: { type: "string", label: "Description" },
|
|
218
|
-
order: { type: "number", label: "Sort order" },
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
label: "Links",
|
|
222
|
-
minItems: 1,
|
|
223
|
-
},
|
|
224
|
-
auto_redirect: {
|
|
225
|
-
type: "boolean",
|
|
226
|
-
label: "Auto-redirect",
|
|
227
|
-
default: false,
|
|
228
|
-
description: "Automatically redirect to the URL instead of showing a button",
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
end_screen: {
|
|
234
|
-
label: "End Screen",
|
|
235
|
-
description: "Final screen shown when form is completed",
|
|
236
|
-
is_active: true,
|
|
237
|
-
is_system: false,
|
|
238
|
-
has_options: false,
|
|
239
|
-
config_schema: {
|
|
240
|
-
type: "object",
|
|
241
|
-
properties: {
|
|
242
|
-
title: {
|
|
243
|
-
type: "string",
|
|
244
|
-
label: "Title",
|
|
245
|
-
default: "Thank you!",
|
|
246
|
-
description: "Heading shown on completion",
|
|
247
|
-
},
|
|
248
|
-
message: {
|
|
249
|
-
type: "string",
|
|
250
|
-
label: "Message",
|
|
251
|
-
default: "Your response has been submitted.",
|
|
252
|
-
description: "Message shown on completion",
|
|
253
|
-
},
|
|
254
|
-
show_score: {
|
|
255
|
-
type: "boolean",
|
|
256
|
-
label: "Show score",
|
|
257
|
-
default: false,
|
|
258
|
-
description: "Display score on the end screen (e.g. \"You scored 4 out of 5\")",
|
|
259
|
-
},
|
|
260
|
-
icon: {
|
|
261
|
-
type: "string",
|
|
262
|
-
label: "Icon",
|
|
263
|
-
enum: ["tick", "trophy", "star", "crown", "party", "none"],
|
|
264
|
-
default: "tick",
|
|
265
|
-
description: "Icon shown above the title",
|
|
266
|
-
},
|
|
267
|
-
show_share_button: {
|
|
268
|
-
type: "boolean",
|
|
269
|
-
label: "Show share button",
|
|
270
|
-
default: false,
|
|
271
|
-
description: "Show a share button above the CTA",
|
|
272
|
-
},
|
|
273
|
-
cta_type: {
|
|
274
|
-
type: "string",
|
|
275
|
-
label: "CTA type",
|
|
276
|
-
enum: ["none", "restart", "external_link"],
|
|
277
|
-
default: "none",
|
|
278
|
-
description: "Primary call-to-action button type",
|
|
279
|
-
},
|
|
280
|
-
cta_text: {
|
|
281
|
-
type: "string",
|
|
282
|
-
label: "CTA button text",
|
|
283
|
-
default: "Continue",
|
|
284
|
-
description: "Button label for the CTA",
|
|
285
|
-
},
|
|
286
|
-
cta_url: {
|
|
287
|
-
type: "string",
|
|
288
|
-
label: "CTA URL",
|
|
289
|
-
format: "uri",
|
|
290
|
-
description: "URL to open (only for external_link CTA type)",
|
|
291
|
-
placeholder: "https://example.com",
|
|
292
|
-
},
|
|
293
|
-
score_ranges: {
|
|
294
|
-
type: "array",
|
|
295
|
-
label: "Score-based content",
|
|
296
|
-
description: "Show different content based on cumulative score. First matching range wins.",
|
|
297
|
-
items: {
|
|
298
|
-
type: "object",
|
|
299
|
-
required: ["min", "max", "title"],
|
|
300
|
-
properties: {
|
|
301
|
-
min: { type: "integer", label: "Minimum score (inclusive)" },
|
|
302
|
-
max: { type: "integer", label: "Maximum score (inclusive)" },
|
|
303
|
-
title: { type: "string", label: "Title" },
|
|
304
|
-
message: { type: "string", label: "Message" },
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
scoring_results: {
|
|
309
|
-
type: "array",
|
|
310
|
-
label: "Category-based results",
|
|
311
|
-
description: "Results keyed by scoring category. The winning category (highest non-knocked-out score) determines which result is shown.",
|
|
312
|
-
items: {
|
|
313
|
-
type: "object",
|
|
314
|
-
required: ["category", "title"],
|
|
315
|
-
properties: {
|
|
316
|
-
category: { type: "string", label: "Category key (must match keys used in option scores)" },
|
|
317
|
-
title: { type: "string", label: "Title" },
|
|
318
|
-
message: { type: "string", label: "Message" },
|
|
319
|
-
cta_url: { type: "string", label: "CTA URL", format: "uri" },
|
|
320
|
-
cta_text: { type: "string", label: "CTA button text" },
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
},
|
|
324
|
-
},
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
};
|
|
328
|
-
export const CONTACT_FIELDS = [
|
|
329
|
-
{ id: "first_name", label: "First Name", type: "text", placeholder: "Enter first name", order: 1 },
|
|
330
|
-
{ id: "last_name", label: "Last Name", type: "text", placeholder: "Enter last name", order: 2 },
|
|
331
|
-
{ id: "email", label: "Email Address", type: "email", placeholder: "you@example.com", order: 3 },
|
|
332
|
-
{ id: "phone", label: "Phone Number", type: "tel", placeholder: "(555) 123-4567", order: 4 },
|
|
333
|
-
{ id: "company", label: "Company", type: "text", placeholder: "Company name", order: 5 },
|
|
334
|
-
{ id: "job_title", label: "Job Title", type: "text", placeholder: "Your role", order: 6 },
|
|
335
|
-
{ id: "website", label: "Website", type: "url", placeholder: "https://example.com", order: 7 },
|
|
336
|
-
{ id: "linkedin", label: "LinkedIn Profile", type: "url", placeholder: "https://linkedin.com/in/username", order: 8 },
|
|
337
|
-
{ id: "message", label: "Message", type: "textarea", placeholder: "Your message...", order: 9 },
|
|
338
|
-
];
|
|
5
|
+
export { NODE_TYPES, CONTACT_FIELDS } from "@vid-master/config";
|
|
339
6
|
//# sourceMappingURL=config.js.map
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/lib/schemas.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
export declare const QUESTION_TYPES: [string, ...string[]];
|
|
4
4
|
/** Contact field IDs derived from the config package */
|
|
5
5
|
export declare const CONTACT_FIELD_IDS: string[];
|
|
6
|
-
/** Per-type description including config hints, auto-generated from
|
|
6
|
+
/** Per-type description including config hints, auto-generated from NODE_TYPES */
|
|
7
7
|
export declare const QUESTION_TYPES_DESCRIPTION: string;
|
|
8
8
|
/** Aggregate config description for Zod .describe() on the config field */
|
|
9
9
|
export declare const CONFIG_DESCRIPTION: string;
|
|
@@ -41,8 +41,8 @@ export declare const QuestionSchema: z.ZodObject<{
|
|
|
41
41
|
}>, "many">>;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
43
|
type: string;
|
|
44
|
-
required: boolean;
|
|
45
44
|
prompt: string;
|
|
45
|
+
required: boolean;
|
|
46
46
|
options?: {
|
|
47
47
|
content: string;
|
|
48
48
|
score?: number | undefined;
|
|
@@ -53,12 +53,12 @@ export declare const QuestionSchema: z.ZodObject<{
|
|
|
53
53
|
}, {
|
|
54
54
|
type: string;
|
|
55
55
|
prompt: string;
|
|
56
|
-
required?: boolean | undefined;
|
|
57
56
|
options?: {
|
|
58
57
|
content: string;
|
|
59
58
|
score?: number | undefined;
|
|
60
59
|
scores?: Record<string, number> | undefined;
|
|
61
60
|
}[] | undefined;
|
|
62
61
|
label?: string | undefined;
|
|
62
|
+
required?: boolean | undefined;
|
|
63
63
|
config?: Record<string, unknown> | undefined;
|
|
64
64
|
}>;
|
package/dist/lib/schemas.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { NODE_TYPES, CONTACT_FIELDS } from "./config.js";
|
|
3
3
|
// --- Derived constants (zero hardcoded type lists) ---
|
|
4
4
|
/** Active, non-system question types — the only types the MCP server exposes */
|
|
5
|
-
export const QUESTION_TYPES = Object.entries(
|
|
5
|
+
export const QUESTION_TYPES = Object.entries(NODE_TYPES)
|
|
6
6
|
.filter(([, def]) => def.is_active && !def.is_system)
|
|
7
7
|
.map(([type]) => type); // tuple for z.enum
|
|
8
8
|
/** Contact field IDs derived from the config package */
|
|
@@ -70,11 +70,11 @@ function generateConfigSummary(configSchema, typeKey) {
|
|
|
70
70
|
}
|
|
71
71
|
return parts.length > 0 ? `Config: ${parts.join(", ")}` : "";
|
|
72
72
|
}
|
|
73
|
-
/** Per-type description including config hints, auto-generated from
|
|
73
|
+
/** Per-type description including config hints, auto-generated from NODE_TYPES */
|
|
74
74
|
export const QUESTION_TYPES_DESCRIPTION = (() => {
|
|
75
75
|
const lines = ["Question types:"];
|
|
76
76
|
for (const type of QUESTION_TYPES) {
|
|
77
|
-
const def =
|
|
77
|
+
const def = NODE_TYPES[type];
|
|
78
78
|
let line = `- ${type}: ${def.description || def.label}`;
|
|
79
79
|
if (def.has_options) {
|
|
80
80
|
line += " (supports options array)";
|
|
@@ -91,7 +91,7 @@ export const QUESTION_TYPES_DESCRIPTION = (() => {
|
|
|
91
91
|
export const CONFIG_DESCRIPTION = (() => {
|
|
92
92
|
const lines = ["Type-specific configuration. Per-type keys:"];
|
|
93
93
|
for (const type of QUESTION_TYPES) {
|
|
94
|
-
const def =
|
|
94
|
+
const def = NODE_TYPES[type];
|
|
95
95
|
const summary = generateConfigSummary(def.config_schema, type);
|
|
96
96
|
if (summary) {
|
|
97
97
|
lines.push(` ${type}: ${summary}`);
|
|
@@ -105,6 +105,24 @@ export const OptionSchema = z.object({
|
|
|
105
105
|
score: z.number().optional().describe("Score value for this option (for scored quizzes)"),
|
|
106
106
|
scores: z.record(z.number()).optional().describe("Category-based scores keyed by category name (for personality/category quizzes)"),
|
|
107
107
|
});
|
|
108
|
+
/** Build options description from config - which types need options, min counts, max lengths */
|
|
109
|
+
const OPTIONS_DESCRIPTION = (() => {
|
|
110
|
+
const hints = ["Answer options."];
|
|
111
|
+
for (const type of QUESTION_TYPES) {
|
|
112
|
+
const def = NODE_TYPES[type];
|
|
113
|
+
if (!def.has_options)
|
|
114
|
+
continue;
|
|
115
|
+
const parts = [`${type}: required`];
|
|
116
|
+
if (def.min_options !== undefined)
|
|
117
|
+
parts.push(`min ${def.min_options}`);
|
|
118
|
+
if (def.max_options !== undefined)
|
|
119
|
+
parts.push(`max ${def.max_options}`);
|
|
120
|
+
if (def.max_option_length !== undefined)
|
|
121
|
+
parts.push(`content max ${def.max_option_length} chars`);
|
|
122
|
+
hints.push(parts.join(", "));
|
|
123
|
+
}
|
|
124
|
+
return hints.join(" ");
|
|
125
|
+
})();
|
|
108
126
|
export const QuestionSchema = z.object({
|
|
109
127
|
type: z.enum(QUESTION_TYPES),
|
|
110
128
|
prompt: z.string().describe("The question text shown to the respondent"),
|
|
@@ -117,6 +135,6 @@ export const QuestionSchema = z.object({
|
|
|
117
135
|
options: z
|
|
118
136
|
.array(OptionSchema)
|
|
119
137
|
.optional()
|
|
120
|
-
.describe(
|
|
138
|
+
.describe(OPTIONS_DESCRIPTION),
|
|
121
139
|
});
|
|
122
140
|
//# sourceMappingURL=schemas.js.map
|
package/dist/lib/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/lib/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/lib/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEzD,wDAAwD;AAExD,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,UAAiC,CAAC;KAC5E,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;KACpD,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAA0B,CAAC,CAAC,mBAAmB;AAEtE,wDAAwD;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC,GAAG,CACjD,CAAC,CAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAC5B,CAAC;AAEF,6CAA6C;AAE7C;;;GAGG;AACH,SAAS,qBAAqB,CAC5B,YAAiB,EACjB,OAAgB;IAEhB,IAAI,CAAC,YAAY,EAAE,UAAU;QAAE,OAAO,EAAE,CAAC;IAEzC,MAAM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WAAW,EAAE,CAAC,CAAC;QACxE,IAAI,GAAG,CAAC,iBAAiB,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,iBAAiB,QAAQ,CAAC,CAAC;QAClG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACxE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oFAAoF,CAAC;IAC3H,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CAAC,kBAAkB,CAAC;IAC/B,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,YAAY,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CAAC,mBAAmB,CAAC;CACjC,CAAC,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -19,6 +19,9 @@ import { registerLogGenerationTool } from "./tools/log-generation.js";
|
|
|
19
19
|
// Content research tools
|
|
20
20
|
import { registerSearchNewsTool } from "./tools/search-news.js";
|
|
21
21
|
// Creative tools
|
|
22
|
+
import { registerGenerateTtsTool } from "./tools/generate-tts.js";
|
|
23
|
+
import { registerGenerateSlideshowTool } from "./tools/generate-slideshow.js";
|
|
24
|
+
import { registerSearchMediaTool } from "./tools/search-media.js";
|
|
22
25
|
import { registerRenderCompositionTool } from "./tools/render-composition.js";
|
|
23
26
|
import { registerSearchMusicTool } from "./tools/search-music.js";
|
|
24
27
|
import { registerListCompositionsTool } from "./tools/list-compositions.js";
|
|
@@ -28,7 +31,7 @@ import { registerPrompts } from "./prompts.js";
|
|
|
28
31
|
export function createServer() {
|
|
29
32
|
const server = new McpServer({
|
|
30
33
|
name: "clipform-mcp-server",
|
|
31
|
-
version: "1.
|
|
34
|
+
version: "1.5.1",
|
|
32
35
|
});
|
|
33
36
|
// Form CRUD
|
|
34
37
|
registerCreateFormTool(server);
|
|
@@ -50,6 +53,9 @@ export function createServer() {
|
|
|
50
53
|
// Content research
|
|
51
54
|
registerSearchNewsTool(server);
|
|
52
55
|
// Creative tools
|
|
56
|
+
registerGenerateTtsTool(server);
|
|
57
|
+
registerGenerateSlideshowTool(server);
|
|
58
|
+
registerSearchMediaTool(server);
|
|
53
59
|
registerRenderCompositionTool(server);
|
|
54
60
|
registerSearchMusicTool(server);
|
|
55
61
|
registerListCompositionsTool(server);
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,kBAAkB;AAClB,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,sBAAsB;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC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,CAAC,MAAM,CAAC,CAAC;IACrC,+BAA+B,CAAC,MAAM,CAAC,CAAC;IAExC,gBAAgB;IAChB,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAElC,mBAAmB;IACnB,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE/B,iBAAiB;IACjB,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChC,6BAA6B,CAAC,MAAM,CAAC,CAAC;IACtC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChC,6BAA6B,CAAC,MAAM,CAAC,CAAC;IACtC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChC,4BAA4B,CAAC,MAAM,CAAC,CAAC;IACrC,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE/B,UAAU;IACV,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -134,10 +134,11 @@ Example: A form that asks a question, collects contact info, then finishes:
|
|
|
134
134
|
`Questions: ${questions.length}`,
|
|
135
135
|
`Edit Token: ${editToken}`,
|
|
136
136
|
``,
|
|
137
|
-
`
|
|
138
|
-
`
|
|
137
|
+
`FORM URL (share this with respondents): ${data.viewer_url}`,
|
|
138
|
+
`CLAIM URL (transfer ownership to your account): ${data.claim_url}`,
|
|
139
139
|
``,
|
|
140
|
-
`IMPORTANT:
|
|
140
|
+
`IMPORTANT: Always show the user the exact URLs above — do not rewrite or modify them.`,
|
|
141
|
+
`Save the edit_token — you need it for all subsequent operations.`,
|
|
141
142
|
`The token expires when the user claims the form via the claim URL.`,
|
|
142
143
|
].join("\n"));
|
|
143
144
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-form.js","sourceRoot":"","sources":["../../src/tools/create-form.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EA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CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;4BACrE,KAAK,EAAE,SAAS;yBACjB,CAAC,CAAC;wBACH,SAAS;oBACX,CAAC;gBACH,CAAC;gBACD,4DAA4D;YAC9D,CAAC;YAED,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,UAAU,MAAM,YAAY,EAAE;gBAC5D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;gBACrB,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;YAEH,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;gBAClB,OAAO,WAAW,CAAC,2BAA2B,CAAC,CAAC,MAAM,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;QAED,sBAAsB;QACtB,MAAM,OAAO,CAAC,UAAU,MAAM,EAAE,EAAE;YAChC,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;YAC5B,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QAEH,OAAO,UAAU,CACf;YACE,4BAA4B;YAC5B,EAAE;YACF,UAAU,KAAK,EAAE;YACjB,cAAc,SAAS,CAAC,MAAM,EAAE;YAChC,eAAe,SAAS,EAAE;YAC1B,EAAE;YACF,2CAA2C,IAAI,CAAC,UAAU,EAAE;YAC5D,mDAAmD,IAAI,CAAC,SAAS,EAAE;YACnE,EAAE;YACF,uFAAuF;YACvF,kEAAkE;YAClE,oEAAoE;SACrE,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -2,15 +2,19 @@ import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
|
2
2
|
export function registerListCompositionsTool(server) {
|
|
3
3
|
server.registerTool("clipform_list_compositions", {
|
|
4
4
|
title: "List Compositions",
|
|
5
|
-
description: `List all available Remotion compositions and their expected props schemas.
|
|
5
|
+
description: `List all available Remotion compositions and their expected props schemas. Only available when the Remotion render service is running (local development). Use clipform_render_composition to render them.`,
|
|
6
6
|
inputSchema: {},
|
|
7
7
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
8
8
|
}, async () => {
|
|
9
9
|
const result = await callInternalApi("/internal/creative/compositions", {
|
|
10
10
|
method: "GET",
|
|
11
11
|
});
|
|
12
|
-
if (!result.ok)
|
|
12
|
+
if (!result.ok) {
|
|
13
|
+
if (result.status === 0 || result.status === 404) {
|
|
14
|
+
return errorResult("Remotion compositions are not available on this server. Use clipform_generate_slideshow for video generation instead.");
|
|
15
|
+
}
|
|
13
16
|
return errorResult(result.error);
|
|
17
|
+
}
|
|
14
18
|
const compositions = result.data.compositions;
|
|
15
19
|
if (!compositions.length)
|
|
16
20
|
return textResult("No compositions found.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-compositions.js","sourceRoot":"","sources":["../../src/tools/list-compositions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,YAAY,CACjB,4BAA4B,EAC5B;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"list-compositions.js","sourceRoot":"","sources":["../../src/tools/list-compositions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,YAAY,CACjB,4BAA4B,EAC5B;QACE,KAAK,EAAE,mBAAmB;QAC1B,W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CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC/E,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -3,14 +3,12 @@ import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
|
3
3
|
export function registerRenderCompositionTool(server) {
|
|
4
4
|
server.registerTool("clipform_render_composition", {
|
|
5
5
|
title: "Render Composition",
|
|
6
|
-
description: `Render a Remotion composition to MP4, PNG, or GIF.
|
|
6
|
+
description: `Render a Remotion composition to MP4, PNG, or GIF. Only available when the Remotion render service is running (local development). For production video generation, use clipform_generate_slideshow instead.
|
|
7
7
|
|
|
8
8
|
Output formats:
|
|
9
9
|
- mp4: Video file (H.264 codec, best for social media)
|
|
10
10
|
- png: Still image (single frame)
|
|
11
|
-
- gif: Animated GIF (looping)
|
|
12
|
-
|
|
13
|
-
The render runs server-side and returns the output file path.`,
|
|
11
|
+
- gif: Animated GIF (looping)`,
|
|
14
12
|
inputSchema: {
|
|
15
13
|
compositionId: z.string().describe("The composition ID (e.g. 'ScorecardQuiz', 'ShortFormQuiz', 'PresenterDirected')"),
|
|
16
14
|
outputFormat: z.enum(["mp4", "png", "gif"]).default("mp4").describe("Output format (default: mp4)"),
|
|
@@ -25,8 +23,12 @@ The render runs server-side and returns the output file path.`,
|
|
|
25
23
|
inputProps: inputProps ?? {},
|
|
26
24
|
},
|
|
27
25
|
});
|
|
28
|
-
if (!result.ok)
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
if (result.status === 0 || result.status === 404) {
|
|
28
|
+
return errorResult("Remotion rendering is not available on this server. Use clipform_generate_slideshow for video generation instead.");
|
|
29
|
+
}
|
|
29
30
|
return errorResult(result.error);
|
|
31
|
+
}
|
|
30
32
|
const data = result.data;
|
|
31
33
|
return textResult([
|
|
32
34
|
`Render complete.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-composition.js","sourceRoot":"","sources":["../../src/tools/render-composition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,MAAM,CAAC,YAAY,CACjB,6BAA6B,EAC7B;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"render-composition.js","sourceRoot":"","sources":["../../src/tools/render-composition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,MAAM,CAAC,YAAY,CACjB,6BAA6B,EAC7B;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE;;;;;8BAKW;QACxB,WAAW,EAAE;YACX,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iFAAiF,CAAC;YACrH,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,8BAA8B,CAAC;YACnG,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;SACjH;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eA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