@progress/kendo-react-mcp 1.6.2-beta.a42c596b.0 → 1.7.0

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/index.js CHANGED
@@ -1,804 +1,15 @@
1
1
  #!/usr/bin/env node
2
+ import{McpServer as It}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as Nt}from"@modelcontextprotocol/sdk/server/stdio.js";import{dirname as mt,join as ut}from"path";import{fileURLToPath as ht}from"url";import{loadLicense as tt,decodeLicenseKey as ot,decodeLicenseEvidence as nt}from"@progress/kendo-licensing/utils";var q=class extends Error{constructor(t){super(t),this.name="LicenseError"}};function se(e){return e.replace(/^\uFEFF/,"")}async function ae(e){let t=null,n=null;try{let o=tt();if(!o.success){let s=new q(o.message);throw e&&await e("license_load_failed",{error:o.message}).catch(()=>{}),s}try{t=(await ot(o.value)).licenses.find(async r=>!!(await nt(r)).userId)}catch(s){console.log(s.message),e&&await e("license_load_failed",{error:s.message||"Unknown decoding error"}).catch(()=>{})}if(!t)return[se(o.value),null]}catch(o){return n=o.message||"Unknown error loading license.",e&&await e("license_load_failed",{error:n}).catch(()=>{}),[null,n]}return[se(t),null]}import P from"node:fs";import _ from"node:path";var B=!1,x=process.env.DEBUG_LOG_FILE,re=!!(x&&typeof x=="string");if(re){let e=_.resolve(x),t=_.dirname(e);if(t!=="."&&t!==process.cwd()&&!P.existsSync(t))try{P.mkdirSync(t,{recursive:!0})}catch(n){console.error("Error creating log directory:",n)}if(!P.existsSync(e))try{P.writeFileSync(e,"")}catch(n){console.error("Error creating log file:",n)}}else B=!1;B=re&&!!x&&P.existsSync(_.resolve(x));function h(...e){if(B&&x){let o=`${new Date().toISOString()}: ${e.join(" ")}
3
+ `,s=_.resolve(x);P.appendFile(s,o,r=>{r&&console.error("Error writing to log file:",r)})}}import st from"@grpc/proto-loader";import D from"@grpc/grpc-js";import ce from"path";import ie from"fs";import{fileURLToPath as at}from"url";var rt=at(import.meta.url),it=ce.dirname(rt),de={version:"unknown"},le=ce.resolve(it,"../package.json");ie.existsSync(le)&&(de=JSON.parse(ie.readFileSync(le,"utf-8")));function lt(e){return e.replace(/\u2014/g,"--").replace(/\u2013/g,"-").replace(/[^\x20-\x7E]/g,"")}var M=class{constructor(t,n,o){this.contextApiUrl=t;this.protoPath=n;this.options=o;this.toolNameHeader="assistant";let s=st.loadSync(this.protoPath,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0});this.isDev=this.contextApiUrl?.includes("localhost")||this.contextApiUrl?.includes("127.0.0.1"),h("Using ContextApi URl:",this.contextApiUrl);let r=D.loadPackageDefinition(s);this.client=new r.ContextQueryService(this.contextApiUrl||"contextapi.telerik.com:443",this.isDev?D.credentials.createInsecure():D.credentials.createSsl())}async getMetadata({meta:t}={meta:{}}){let[n,o]=this.isDev?["fake_license",null]:await ae((m,b)=>this.logEvent(m,b)),s=process.env.CONTEXTAPI_API_KEY,r=s&&typeof s=="string",a=n&&typeof n=="string";if(!a&&!r&&o)throw new Error(`Failed to authenticate with API key or License key!
2
4
 
3
- // packages/react/src/index.ts
4
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
-
7
- // packages/react/src/lib/grpc-client.ts
8
- import { dirname, join } from "path";
9
- import { fileURLToPath as fileURLToPath2 } from "url";
10
-
11
- // packages/mcp-common/src/lib/read-license.ts
12
- import {
13
- loadLicense,
14
- decodeLicenseKey,
15
- decodeLicenseEvidence
16
- } from "@progress/kendo-licensing/utils";
17
- var LicenseError = class extends Error {
18
- constructor(message) {
19
- super(message);
20
- this.name = "LicenseError";
21
- }
22
- };
23
- function fixBom(licenseKey) {
24
- return licenseKey.replace(/^\uFEFF/, "");
25
- }
26
- async function readLicense(logCallback) {
27
- let licenseEvidence = null;
28
- let error = null;
29
- try {
30
- const license = loadLicense();
31
- if (!license.success) {
32
- const licenseError = new LicenseError(license.message);
33
- if (logCallback) {
34
- await logCallback("license_load_failed", {
35
- error: license.message
36
- }).catch(() => {
37
- });
38
- }
39
- throw licenseError;
40
- }
41
- try {
42
- const decodedLicense = await decodeLicenseKey(license.value);
43
- licenseEvidence = decodedLicense.licenses.find(async (lic) => {
44
- const evidence = await decodeLicenseEvidence(lic);
45
- if (evidence.userId) {
46
- return true;
47
- }
48
- return false;
49
- });
50
- } catch (err) {
51
- console.log(err.message);
52
- if (logCallback) {
53
- await logCallback("license_load_failed", {
54
- error: err.message || "Unknown decoding error"
55
- }).catch(() => {
56
- });
57
- }
58
- }
59
- if (!licenseEvidence) {
60
- return [fixBom(license.value), null];
61
- }
62
- } catch (err) {
63
- error = err.message || "Unknown error loading license.";
64
- if (logCallback) {
65
- await logCallback("license_load_failed", {
66
- error
67
- }).catch(() => {
68
- });
69
- }
70
- return [null, error];
71
- }
72
- return [fixBom(licenseEvidence), null];
73
- }
74
-
75
- // packages/mcp-common/src/lib/logger.ts
76
- import fs from "node:fs";
77
- import path from "node:path";
78
- var LOG_ENABLED = false;
79
- var LOG_FILE = process.env.DEBUG_LOG_FILE;
80
- var LOG_FILE_DEFINED = !!(LOG_FILE && typeof LOG_FILE === "string");
81
- if (LOG_FILE_DEFINED) {
82
- const resolvedLogFile = path.resolve(LOG_FILE);
83
- const logDir = path.dirname(resolvedLogFile);
84
- if (logDir !== "." && logDir !== process.cwd() && !fs.existsSync(logDir)) {
85
- try {
86
- fs.mkdirSync(logDir, { recursive: true });
87
- } catch (err) {
88
- console.error("Error creating log directory:", err);
89
- }
90
- }
91
- if (!fs.existsSync(resolvedLogFile)) {
92
- try {
93
- fs.writeFileSync(resolvedLogFile, "");
94
- } catch (err) {
95
- console.error("Error creating log file:", err);
96
- }
97
- }
98
- } else {
99
- LOG_ENABLED = false;
100
- }
101
- LOG_ENABLED = LOG_FILE_DEFINED && !!LOG_FILE && fs.existsSync(path.resolve(LOG_FILE));
102
- function log(...args) {
103
- if (LOG_ENABLED && LOG_FILE) {
104
- const date = /* @__PURE__ */ new Date();
105
- const dateString = date.toISOString();
106
- const logString = `${dateString}: ${args.join(" ")}
107
- `;
108
- const resolvedLogFile = path.resolve(LOG_FILE);
109
- fs.appendFile(resolvedLogFile, logString, (err) => {
110
- if (err) {
111
- console.error("Error writing to log file:", err);
112
- }
113
- });
114
- }
115
- }
116
-
117
- // packages/mcp-common/src/lib/context-api.ts
118
- import protoLoader from "@grpc/proto-loader";
119
- import grpc from "@grpc/grpc-js";
120
- import path2 from "path";
121
- import fs2 from "fs";
122
- import { fileURLToPath } from "url";
123
- var __filename = fileURLToPath(import.meta.url);
124
- var __dirname = path2.dirname(__filename);
125
- var packageJson = { version: "unknown" };
126
- var packageJsonPath = path2.resolve(__dirname, "../package.json");
127
- if (fs2.existsSync(packageJsonPath)) {
128
- packageJson = JSON.parse(fs2.readFileSync(packageJsonPath, "utf-8"));
129
- }
130
- function sanitizeMetadata(value) {
131
- return value.replace(/\u2014/g, "--").replace(/\u2013/g, "-").replace(/[^\x20-\x7E]/g, "");
132
- }
133
- var D2CError = class extends Error {
134
- constructor(code, message, details) {
135
- super(message);
136
- this.code = code;
137
- this.details = details;
138
- this.name = "D2CError";
139
- }
140
- };
141
- var ContextAPI = class {
142
- constructor(contextApiUrl, protoPath2, options) {
143
- this.contextApiUrl = contextApiUrl;
144
- this.protoPath = protoPath2;
145
- this.options = options;
146
- this.toolNameHeader = "assistant";
147
- const proto = protoLoader.loadSync(this.protoPath, {
148
- keepCase: true,
149
- longs: String,
150
- enums: String,
151
- defaults: true,
152
- oneofs: true
153
- });
154
- this.isDev = this.contextApiUrl?.includes("localhost") || this.contextApiUrl?.includes("127.0.0.1");
155
- log("Using ContextApi URl:", this.contextApiUrl);
156
- const protoDescriptor = grpc.loadPackageDefinition(proto);
157
- const maxMsgSize = 100 * 1024 * 1024;
158
- const channelOptions = {
159
- "grpc.max_receive_message_length": maxMsgSize,
160
- "grpc.max_send_message_length": maxMsgSize
161
- };
162
- this.client = new protoDescriptor.ContextQueryService(
163
- this.contextApiUrl || "contextapi.telerik.com:443",
164
- this.isDev ? grpc.credentials.createInsecure() : grpc.credentials.createSsl(),
165
- channelOptions
166
- );
167
- }
168
- async getMetadata({ meta } = { meta: {} }) {
169
- const [license, error] = this.isDev ? ["fake_license", null] : await readLicense((eventName, fields) => this.logEvent(eventName, fields));
170
- const apiKey = process.env.CONTEXTAPI_API_KEY;
171
- const hasApiKey = apiKey && typeof apiKey === "string";
172
- const hasLicense = license && typeof license === "string";
173
- if (!hasLicense && !hasApiKey && error) {
174
- throw new Error(
175
- `Failed to authenticate with API key or License key!
176
-
177
- License Error: ${error}`
178
- );
179
- }
180
- const metadata = new grpc.Metadata();
181
- if (hasLicense) {
182
- try {
183
- metadata.add("x-license-key", license);
184
- } catch (error2) {
185
- log("Error adding license key to metadata:", error2);
186
- throw new Error(`Failed to use license key: ${error2.message}`);
187
- }
188
- }
189
- if (hasApiKey) {
190
- metadata.add("x-api-key", apiKey);
191
- }
192
- if (this.options?.libName) {
193
- metadata.add("x-library-name", this.options.libName);
194
- }
195
- metadata.add("x-tool-name", this.toolNameHeader);
196
- const requestMetadata = JSON.stringify({
197
- ...meta,
198
- source: "npm",
199
- version: packageJson.version,
200
- os: process.platform,
201
- node_version: process.version
202
- });
203
- metadata.add("x-request-metadata", sanitizeMetadata(requestMetadata));
204
- return metadata;
205
- }
206
- async query(params, meta) {
207
- const metadata = await this.getMetadata({ meta });
208
- return new Promise((resolve, reject) => {
209
- this.client.query(
210
- params,
211
- metadata,
212
- (err, response) => {
213
- if (err) {
214
- reject(new Error(err));
215
- } else {
216
- resolve(response);
217
- }
218
- }
219
- );
220
- });
221
- }
222
- async getApiRefMatches(params, meta) {
223
- const metadata = await this.getMetadata({ meta });
224
- return new Promise((resolve, reject) => {
225
- this.client.getApiRefMatches(
226
- params,
227
- metadata,
228
- (err, response) => {
229
- if (err) {
230
- reject(new Error(err));
231
- } else {
232
- resolve(response);
233
- }
234
- }
235
- );
236
- });
237
- }
238
- async queryCssUtils(params, meta) {
239
- const metadata = await this.getMetadata({ meta });
240
- return new Promise((resolve, reject) => {
241
- this.client.cssUtilsSearch(
242
- params,
243
- metadata,
244
- (err, response) => {
245
- if (err) {
246
- log("Error querying CSS Utils:", err);
247
- reject(new Error(err));
248
- } else {
249
- resolve(response);
250
- }
251
- }
252
- );
253
- });
254
- }
255
- async queryIconsSearch(params, meta) {
256
- const metadata = await this.getMetadata({ meta });
257
- return new Promise((resolve, reject) => {
258
- this.client.iconsSearch(params, metadata, (err, response) => {
259
- if (err) {
260
- log("Error querying Icons Search:", err);
261
- reject(new Error(err));
262
- } else {
263
- resolve(response);
264
- }
265
- });
266
- });
267
- }
268
- async queryBuildingBlocks(params, meta) {
269
- const metadata = await this.getMetadata({ meta });
270
- return new Promise((resolve, reject) => {
271
- this.client.buildingBlocksSearch(
272
- params,
273
- metadata,
274
- (err, response) => {
275
- if (err) {
276
- log("Error querying Building Blocks:", err);
277
- reject(new Error(err));
278
- } else {
279
- resolve(response);
280
- }
281
- }
282
- );
283
- });
284
- }
285
- async validateUserLicense() {
286
- const metadata = await this.getMetadata();
287
- return new Promise((resolve, reject) => {
288
- this.client.validateUserLicense(
289
- null,
290
- metadata,
291
- (err, response) => {
292
- if (err) {
293
- log("Error validating user license:", err);
294
- reject(new Error(err));
295
- } else {
296
- resolve(response);
297
- }
298
- }
299
- );
300
- });
301
- }
302
- async queryThemeGenerate(params, meta) {
303
- const metadata = await this.getMetadata({ meta });
304
- return new Promise((resolve, reject) => {
305
- this.client.generateTheme(params, metadata, (err, response) => {
306
- if (err) {
307
- log("Error querying context API/GenerateTheme:", err);
308
- reject(new Error(err));
309
- } else {
310
- resolve(response);
311
- }
312
- });
313
- });
314
- }
315
- async recordOrchestratorUserRequest({ meta }) {
316
- const metadata = await this.getMetadata({ meta });
317
- return new Promise((resolve, reject) => {
318
- this.client.recordOrchestratorUserRequest(
319
- null,
320
- metadata,
321
- (err, response) => {
322
- if (err) {
323
- log("Error recording orchestrator user request:", err);
324
- reject(new Error(err));
325
- } else {
326
- resolve(response);
327
- }
328
- }
329
- );
330
- });
331
- }
332
- async recordToolUserRequest({ toolName, meta }) {
333
- const metadata = await this.getMetadata({ meta });
334
- return new Promise((resolve, reject) => {
335
- this.client.recordToolUserRequest(
336
- { tool_name: toolName },
337
- metadata,
338
- (err, response) => {
339
- if (err) {
340
- log("Error recording tool user request:", err);
341
- reject(new Error(err));
342
- } else {
343
- resolve(response);
344
- }
345
- }
346
- );
347
- });
348
- }
349
- async logEvent(eventName, fields) {
350
- const apiKey = "h8utJ6rk4PpIWX4JMn9beQDsjVUri6KV0XYfiVwq";
351
- if (!apiKey || typeof apiKey !== "string") {
352
- log("LOGGING_API_KEY not configured, skipping log event");
353
- return;
354
- }
355
- const metadata = new grpc.Metadata();
356
- metadata.add("x-api-key", apiKey);
357
- return new Promise((resolve, reject) => {
358
- this.client.logEvent(
359
- { event_name: eventName, fields: fields || {} },
360
- metadata,
361
- (err, response) => {
362
- if (err) {
363
- log("Error logging event:", err);
364
- reject(new Error(err));
365
- } else {
366
- resolve();
367
- }
368
- }
369
- );
370
- });
371
- }
372
- /**
373
- * Process a Figma design through the D2C pipeline
374
- *
375
- * @param params - Figma design data and processing options
376
- * @returns Processed design with layout, styles, and component matches
377
- * @throws D2CError if processing fails
378
- */
379
- async processFigmaDesign(params) {
380
- const metadata = await this.getMetadata();
381
- const request = {};
382
- if (params.node_jsons && params.node_jsons.length > 0) {
383
- request.node_jsons = params.node_jsons;
384
- } else if (params.root_node_json) {
385
- request.node_jsons = [params.root_node_json];
386
- } else {
387
- throw new Error("Either node_jsons or root_node_json must be provided");
388
- }
389
- return new Promise((resolve, reject) => {
390
- this.client.processFigmaDesign(
391
- request,
392
- metadata,
393
- (err, response) => {
394
- if (err) {
395
- log("Error processing Figma design:", err);
396
- reject(new Error(`gRPC error: ${err.message}`));
397
- return;
398
- }
399
- if (response.error) {
400
- const error = new D2CError(
401
- response.error.code,
402
- response.error.message,
403
- response.error.details
404
- );
405
- log("D2C processing error:", error);
406
- reject(error);
407
- return;
408
- }
409
- if (response.success) {
410
- const layoutPseudoCodes = response.success.layout_pseudo_codes || [];
411
- const result = {
412
- // Backward compatibility: first layout or empty string
413
- layout_pseudo_code: layoutPseudoCodes[0] || response.success.layout_pseudo_code || "",
414
- layout_pseudo_codes: layoutPseudoCodes.length > 0 ? layoutPseudoCodes : [response.success.layout_pseudo_code || ""],
415
- design_tokens: response.success.design_tokens || "",
416
- stats: {
417
- total_nodes: response.success.stats?.total_nodes || 0,
418
- processing_time_ms: response.success.stats?.processing_time_ms || 0
419
- }
420
- };
421
- resolve(result);
422
- return;
423
- }
424
- reject(new Error("Invalid response format from server"));
425
- }
426
- );
427
- });
428
- }
429
- };
430
-
431
- // packages/mcp-common/src/models/user.ts
432
- import { z } from "zod";
433
- var userInfoSchema = z.object({
434
- user_id: z.string(),
435
- user_email: z.string().email()
436
- });
437
-
438
- // packages/mcp-common/src/models/entitlements.ts
439
- import { z as z2 } from "zod";
440
- var itemSchema = z2.object({
441
- Product: z2.object({
442
- Id: z2.number().int(),
443
- Code: z2.string(),
444
- Name: z2.string()
445
- }),
446
- License: z2.nullable(
447
- z2.object({
448
- Id: z2.number().int(),
449
- Name: z2.string(),
450
- Type: z2.string(),
451
- Active: z2.boolean()
452
- })
453
- ),
454
- Availability: z2.array(
455
- z2.object({
456
- LicenseStart: z2.nullable(z2.string().datetime()),
457
- LicenseEnd: z2.nullable(z2.string().datetime())
458
- })
459
- ),
460
- IsLicenseAvailable: z2.optional(z2.boolean())
461
- });
462
- var entitlementsSchema = z2.array(itemSchema);
463
-
464
- // packages/mcp-common/src/lib/utils.ts
465
- async function checkAccess(cb) {
466
- const access = process.env.KENDO_MCP_ACCESS;
467
- if (access === "true" || access === "1" || access === "full") {
468
- return "full";
469
- } else if (typeof access === "string" && (access.toLowerCase() === "agent" || access.toLowerCase() === "assistant")) {
470
- return access.toLowerCase();
471
- }
472
- const productCode = await cb();
473
- if (productCode.toLocaleLowerCase() === "agentic_ui_generator") {
474
- return "agent";
475
- }
476
- if (productCode.toLocaleLowerCase() === "ai_coding_assistants") {
477
- return "assistant";
478
- }
479
- return "none";
480
- }
481
-
482
- // packages/mcp-common/src/lib/instructions/accessibility.ts
483
- function getAccessibilityGuidelines() {
484
- return `**Accessibility Guidelines: WCAG 2.2 Level AA Compliance**
485
-
486
- **Core Principles:**
487
- 1. Use semantic HTML and ARIA correctly
488
- 2. Ensure WCAG 2.2 AA compliance
489
- 3. Follow W3C ARIA Authoring Practices
490
- 4. Provide standards-based accessibility fixes
491
-
492
- **1. Form Control Labels** (WCAG 1.3.1, 3.3.2, 4.1.2)
493
- Every input must have an associated label.
494
- CORRECT: \`<input type="search" aria-label="Search products" placeholder="Search...">\`
495
- CORRECT: \`<label for="qty">Quantity</label><input type="number" id="qty">\`
496
- WRONG: \`<span>Email</span><input type="email">\` (no association)
497
- WRONG: \`<input type="email" placeholder="Email">\` (placeholder as label)
498
-
499
- **2. Button Accessibility** (WCAG 4.1.2, 2.4.6, 2.5.3)
500
- All buttons need accessible names describing their purpose.
501
- CORRECT: \`<button type="button">Save Changes</button>\`
502
- CORRECT: \`<button aria-label="Close dialog"><svg aria-hidden="true" focusable="false">...</svg></button>\`
503
- WRONG: \`<button><svg>...</svg></button>\` (no accessible name)
504
- WRONG: \`<button>Click here</button>\` (generic text)
505
-
506
- **3. Popup/Menu Triggers** (WCAG 4.1.2, 1.3.1)
507
- Indicate popup purpose and state using aria-haspopup, aria-expanded, aria-controls.
508
- CORRECT: \`<button aria-expanded="false" aria-haspopup="menu" aria-controls="menu-id">Settings</button>\`
509
-
510
- **4. Image Accessibility** (WCAG 1.1.1)
511
- Informative: \`<img src="chart.png" alt="Sales increased 25% in Q4 2024">\`
512
- Functional: \`<a href="/home"><img src="logo.png" alt="Company Name Home"></a>\`
513
- Decorative: \`<img src="border.png" alt="" role="presentation">\`
514
- Complex: \`<img src="chart.png" alt="Sales data" aria-describedby="desc-id">\`
515
- WRONG: Missing alt, filename as alt, generic alt for decorative images
516
-
517
- **5. Link Accessibility** (WCAG 2.4.4, 2.4.6)
518
- Links must be descriptive and understandable out of context.
519
- CORRECT: \`<a href="/products">View All Products</a>\`
520
- CORRECT: \`<a href="/article" aria-label="Read more about New Product Launch">Read more</a>\`
521
- WRONG: "Click here", "Read more", "Learn more" without context
522
-
523
- **6. Form Validation** (WCAG 3.3.1, 3.3.2, 3.3.3)
524
- Errors must be identified, associated with inputs, and provide suggestions. Use aria-describedby, aria-invalid="true", and role="alert".
525
-
526
- **7. Heading Structure** (WCAG 1.3.1, 2.4.6)
527
- Each page must have an \`<h1>\` that describes its content. Use hierarchical, descriptive headings with no skipped levels (h1\u2192h2\u2192h3).
528
- CORRECT: \`<h1>Dashboard</h1> <h2>Sales</h2> <h3>By Region</h3>\`
529
- WRONG: No \`<h1>\` on the page, or skipping levels (h1\u2192h3)
530
- If a heading should look smaller than its semantic level, use CSS: \`<h2 class="text-sm">Subtitle</h2>\`
531
-
532
- **8. Page Component Landmark Rules** (WCAG 1.3.1, 4.1.2)
533
- Page components (route components) may be rendered inside a layout that already provides \`<main>\`, \`<header>\`, or \`<footer>\`. Since the layout configuration is unknown, avoid using these landmarks in page components to prevent potential duplication and nesting violations. Use \`<div>\`, \`<section>\`, or \`<article>\` as the top-level wrapper instead.
534
- - Avoid adding \`<main>\`, \`role="main"\`, \`<header>\`, or \`<footer>\` in page components \u2014 the layout typically provides them. Duplicating them can cause \`landmark-no-duplicate-main\` and \`landmark-main-is-top-level\` violations.
535
- - Avoid adding \`role="banner"\` or using a semantic \`<header>\` element in page components \u2014 the layout's \`<header>\` already claims the banner landmark. Adding another causes \`landmark-banner-is-top-level\` violations.
536
- - Avoid adding \`role="contentinfo"\` to elements inside page components \u2014 the contentinfo landmark should be a top-level landmark, not nested inside \`<main>\` or other landmarks. Nesting it can cause \`landmark-contentinfo-is-top-level\` violations.
537
- - When multiple \`<section>\` or \`<nav>\` elements exist on a page, give each a unique \`aria-label\` to avoid \`landmark-unique\` violations.
538
-
539
- **9. ARIA Role and Attribute Restrictions** (WCAG 4.1.2)
540
- Only use ARIA roles that are valid for the given HTML element. Avoid adding \`aria-label\` or \`aria-labelledby\` to elements that do not permit naming.
541
- - \`<article>\` has an implicit \`article\` role. Do NOT override it with \`role="listitem"\`, \`role="button"\`, \`role="link"\`, or any other role \u2014 none are allowed on \`<article>\`. Use \`<li>\` for list items, \`<button>\` for interactive cards, or \`<a>\` for clickable cards instead.
542
- - \`<button>\` already has an implicit \`button\` role. Do NOT add \`role="listitem"\` or other incompatible roles.
543
- - \`<span>\` and \`<div>\` without roles are generic elements. Do NOT add \`aria-label\` to them \u2014 it is a prohibited attribute on elements with no accessible role and can cause \`aria-prohibited-attr\` violations. Instead, use \`role="img"\` + \`aria-label\` for visual indicators, or use visually hidden text.
544
- - Do NOT add \`aria-label\` to non-interactive \`<div>\` wrappers \u2014 it has no effect and triggers violations.
545
- - \`aria-pressed\` is only valid on elements with \`role="button"\`, \`role="checkbox"\`, \`role="menuitemcheckbox"\`, \`role="option"\`, \`role="radio"\`, or \`role="switch"\`. Do NOT use \`aria-pressed\` on elements with \`role="listitem"\` or other roles.
546
- CORRECT: \`<ul role="list"><li class="product-card">...</li></ul>\` (listitem inside list)
547
- CORRECT: \`<span role="img" aria-label="Status: pending" class="status-dot"></span>\` (role added before aria-label)
548
- CORRECT: \`<span class="status-dot" aria-hidden="true"></span><span class="visually-hidden">Pending</span>\` (hidden text alternative)
549
- WRONG: \`<article role="listitem">\` (listitem not allowed on article)
550
- WRONG: \`<article role="button">\` (button not allowed on article \u2014 use \`<button>\` or \`<div role="button">\`)
551
- WRONG: \`<span aria-label="pending" class="status-dot"></span>\` (aria-label prohibited on generic span)
552
- WRONG: \`<div aria-label="Product badges" class="badges"></div>\` (aria-label prohibited on generic div)
553
-
554
- **Quick Checklist:**
555
- - **Forms:** Associated labels, aria-required on required fields, autocomplete attributes, aria-describedby for errors, aria-invalid for invalid fields, fieldsets with legends
556
- - **Buttons/Links:** Accessible names, aria-label for icon buttons, aria-hidden on decorative icons, descriptive link text
557
- - **Popups/Dialogs:** aria-haspopup, aria-expanded, aria-controls, role="dialog", aria-modal="true", aria-labelledby, focus trap, Escape to close
558
- - **Images:** alt on all images, descriptive alt for informative, empty alt for decorative, aria-describedby for complex
559
- - **Structure:** One h1, logical heading hierarchy, avoid \`<main>\`, \`<header>\`, \`<footer>\`, \`role="main"\`, \`role="contentinfo"\`, \`role="banner"\` in page/route components (the layout may already provide them), use \`<section>\` or \`<div>\` as page-level wrappers, unique aria-labels on duplicate landmark types
560
- - **ARIA Rules:** Avoid adding \`aria-label\` to generic \`<span>\`/\`<div>\` without a role, avoid using \`role="listitem"\` or \`role="button"\` on \`<article>\` \u2014 use \`<li>\` for list items, add \`role="img"\` before \`aria-label\` on visual indicators, \`aria-pressed\` only on button-like roles
561
- - **Scrollable Regions:** Any scrollable container must have \`tabindex="0"\` or contain keyboard-interactive children
562
- - **Nested Interactive:** Do not add interactive role/tabindex to a container that already has focusable children
563
- - **List Roles:** \`role="list"\` containers must have \`role="listitem"\` children \u2014 prefer \`<ul>/<li>\` natively
564
- - **Dynamic Content:** role="status"/aria-live="polite" for updates, role="alert"/aria-live="assertive" for critical alerts
565
- - **Keyboard/Focus:** All interactive elements keyboard accessible, logical focus order, visible focus indicators, no keyboard traps (except modals)
566
- - **Color/Contrast:** 4.5:1 text contrast (3:1 large text), 3:1 UI component contrast, no color-only information, 3:1 focus indicator contrast`;
567
- }
568
-
569
- // packages/mcp-common/src/lib/heartbeat.ts
570
- var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
571
- function startHeartbeat(options) {
572
- const {
573
- serverName,
574
- contextApi: contextApi2,
575
- additionalFields = {},
576
- intervalMs = ONE_DAY_MS
577
- } = options;
578
- const eventName = `mcp_server_heartbeat`;
579
- const sendHeartbeat = async () => {
580
- try {
581
- const fields = {
582
- server_name: serverName,
583
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
584
- ...additionalFields
585
- };
586
- await contextApi2.logEvent(eventName, fields);
587
- } catch (error) {
588
- log(`Failed to send heartbeat for ${serverName}:`, error);
589
- }
590
- };
591
- sendHeartbeat();
592
- const intervalId = setInterval(sendHeartbeat, intervalMs);
593
- return () => {
594
- clearInterval(intervalId);
595
- log(`Heartbeat stopped for ${serverName}`);
596
- };
597
- }
598
-
599
- // packages/mcp-common/src/lib/getting-started-params.ts
600
- import { z as z3 } from "zod";
601
- var KendoThemes = ["default", "bootstrap", "material", "fluent"];
602
- function createGettingStartedInputSchema(suiteName, defaultProjectName) {
603
- return {
604
- projectName: z3.string().default(defaultProjectName).describe(
605
- "The name of the project. Used as the project folder name when creating a new project."
606
- ),
607
- createNewProject: z3.boolean().default(true).describe(
608
- `Whether to create a new project before configuring ${suiteName}. Set to true to scaffold a brand-new project, or false if the project already exists and you only want to add ${suiteName} to it.`
609
- ),
610
- theme: z3.enum(KendoThemes).default("default").describe(
611
- "The Kendo UI theme to use. Determines which theme package is installed and imported."
612
- )
613
- };
614
- }
615
-
616
- // packages/react/src/lib/constants.ts
617
- var REACT_SUITE_NAME = "Kendo UI for React";
618
- var Suite = "react";
619
- var PRODUCT_LINE = "kendo";
620
- var ReactComponents = [
621
- "ActionSheet",
622
- "AIPrompt",
623
- "Animation",
624
- "AppBar",
625
- "ArcGauge",
626
- "AutoComplete",
627
- "Avatar",
628
- "Badge",
629
- "Barcode",
630
- "BottomNavigation",
631
- "Breadcrumb",
632
- "Button",
633
- "ButtonGroup",
634
- "BreadCrumb",
635
- "Calendar",
636
- "Card",
637
- "Chart",
638
- "ChartWizard",
639
- "Chat",
640
- "Checkbox",
641
- "Chip",
642
- "ChipList",
643
- "ChunkProgressBar",
644
- "CircularGauge",
645
- "ColorGradient",
646
- "ColorPalette",
647
- "ColorPicker",
648
- "ComboBox",
649
- "ContextMenu",
650
- "ConversationalUI",
651
- "DataGrid",
652
- "Grid",
653
- // Alias for DataGrid only used in the mcp-server
654
- "DataQuery",
655
- "DateMath",
656
- "DateInput",
657
- "DatePicker",
658
- "DateRangePicker",
659
- "DateTimePicker",
660
- "Dialog",
661
- "Drag&Drop",
662
- "Drawer",
663
- "Drawing",
664
- "DropDownButton",
665
- "DropDownList",
666
- "DropDownTree",
667
- "Editor",
668
- "Error",
669
- "ExcelExport",
670
- "ExpansionPanel",
671
- "ExternalDropZone",
672
- "FileSaver",
673
- "FileManager",
674
- "Filter",
675
- "FlatColorPicker",
676
- "FloatingActionButton",
677
- "FloatingLabel",
678
- "Form",
679
- "Gantt",
680
- "Gauge",
681
- "General",
682
- "GridLayout",
683
- "Hint",
684
- "Icon",
685
- "InlineAIPrompt",
686
- "Input",
687
- "Label",
688
- "LinearGauge",
689
- "ListBox",
690
- "ListView",
691
- "Loader",
692
- "Map",
693
- "MaskedTextBox",
694
- "Menu",
695
- "MultiColumnComboBox",
696
- "MultiSelect",
697
- "MultiSelectTree",
698
- "MultiViewCalendar",
699
- "Notification",
700
- "NumericTextBox",
701
- "OrgChart",
702
- "PageTemplates/BuildingBlocks",
703
- "Pager",
704
- "PanelBar",
705
- "PDFProcessing",
706
- "PDFViewer",
707
- "PivotGrid",
708
- "Popover",
709
- "Popup",
710
- "ProgressBar",
711
- "PromptBox",
712
- "QRCode",
713
- "RadialGauge",
714
- "RadioButton",
715
- "RadioGroup",
716
- "RangeSlider",
717
- "Rating",
718
- "Ripple",
719
- "Sankey",
720
- "Scheduler",
721
- "ScrollView",
722
- "Signature",
723
- "Skeleton",
724
- "Slider",
725
- "Sortable",
726
- "Sparkline",
727
- "SpeechToTextButton",
728
- "SmartPasteButton",
729
- "SplitButton",
730
- "Splitter",
731
- "Spreadsheet",
732
- "StackLayout",
733
- "Stepper",
734
- "StockChart",
735
- "SVGIcon",
736
- "Switch",
737
- "TabStrip",
738
- "TaskBoard",
739
- "TextArea",
740
- "TextBox",
741
- "TileLayout",
742
- "Timeline",
743
- "TimePicker",
744
- "Toolbar",
745
- "Tooltip",
746
- "TreeList",
747
- "TreeView",
748
- "Typography",
749
- "Upload",
750
- "VSCodeExtension",
751
- "Window"
752
- ];
753
-
754
- // packages/react/src/lib/grpc-client.ts
755
- var protoPath = join(
756
- dirname(fileURLToPath2(import.meta.url)),
757
- "../proto/service.proto"
758
- );
759
- var contextApi = new ContextAPI("contextapi.telerik.com:443", protoPath, {
760
- libName: Suite
761
- });
762
- var validateUserLicense = async () => {
763
- return contextApi.validateUserLicense();
764
- };
765
-
766
- // packages/react/src/index.ts
767
- import fs3 from "fs";
768
- import path3 from "path";
769
- import { fileURLToPath as fileURLToPath3 } from "url";
770
-
771
- // packages/kendo-ui-agent/src/lib/tools-factory.ts
772
- import { z as z4 } from "zod";
773
-
774
- // packages/kendo-ui-agent/src/lib/ui-agent-tool.ts
775
- var UIAgentTool = class {
776
- constructor(name, config, cb) {
777
- this.name = name;
778
- this.config = config;
779
- this.cb = cb;
780
- }
781
- register(mcpServer) {
782
- this.server = mcpServer;
783
- this.server.registerTool(this.name, this.config, this.cb);
784
- }
785
- hasAccess(accessType) {
786
- if (!this.config.requiredAccess || this.config.requiredAccess.length === 0) {
787
- return true;
788
- }
789
- return accessType === "full" || this.config.requiredAccess.includes(accessType);
790
- }
791
- };
792
-
793
- // packages/kendo-ui-agent/src/lib/templates/validator.ts
794
- var renderValidatorResponse = (ctx, frameworkValidationSteps) => `# ${ctx.suiteName} - Code Validation & Quality Assurance
5
+ License Error: ${o}`);let i=new D.Metadata;if(a)try{i.add("x-license-key",n)}catch(m){throw h("Error adding license key to metadata:",m),new Error(`Failed to use license key: ${m.message}`)}r&&i.add("x-api-key",s),this.options?.libName&&i.add("x-library-name",this.options.libName),i.add("x-tool-name",this.toolNameHeader);let d=JSON.stringify({...t,source:"npm",version:de.version,os:process.platform,node_version:process.version});return i.add("x-request-metadata",lt(d)),i}async query(t,n){let o=await this.getMetadata({meta:n});return new Promise((s,r)=>{this.client.query(t,o,(a,i)=>{a?r(new Error(a)):s(i)})})}async getApiRefMatches(t,n){let o=await this.getMetadata({meta:n});return new Promise((s,r)=>{this.client.getApiRefMatches(t,o,(a,i)=>{a?r(new Error(a)):s(i)})})}async queryCssUtils(t,n){let o=await this.getMetadata({meta:n});return new Promise((s,r)=>{this.client.cssUtilsSearch(t,o,(a,i)=>{a?(h("Error querying CSS Utils:",a),r(new Error(a))):s(i)})})}async queryIconsSearch(t,n){let o=await this.getMetadata({meta:n});return new Promise((s,r)=>{this.client.iconsSearch(t,o,(a,i)=>{a?(h("Error querying Icons Search:",a),r(new Error(a))):s(i)})})}async queryBuildingBlocks(t,n){let o=await this.getMetadata({meta:n});return new Promise((s,r)=>{this.client.buildingBlocksSearch(t,o,(a,i)=>{a?(h("Error querying Building Blocks:",a),r(new Error(a))):s(i)})})}async validateUserLicense(){let t=await this.getMetadata();return new Promise((n,o)=>{this.client.validateUserLicense(null,t,(s,r)=>{s?(h("Error validating user license:",s),o(new Error(s))):n(r)})})}async queryThemeGenerate(t,n){let o=await this.getMetadata({meta:n});return new Promise((s,r)=>{this.client.generateTheme(t,o,(a,i)=>{a?(h("Error querying context API/GenerateTheme:",a),r(new Error(a))):s(i)})})}async recordOrchestratorUserRequest({meta:t}){let n=await this.getMetadata({meta:t});return new Promise((o,s)=>{this.client.recordOrchestratorUserRequest(null,n,(r,a)=>{r?(h("Error recording orchestrator user request:",r),s(new Error(r))):o(a)})})}async recordToolUserRequest({toolName:t,meta:n}){let o=await this.getMetadata({meta:n});return new Promise((s,r)=>{this.client.recordToolUserRequest({tool_name:t},o,(a,i)=>{a?(h("Error recording tool user request:",a),r(new Error(a))):s(i)})})}async logEvent(t,n){let o="h8utJ6rk4PpIWX4JMn9beQDsjVUri6KV0XYfiVwq";if(!o||typeof o!="string"){h("LOGGING_API_KEY not configured, skipping log event");return}let s=new D.Metadata;return s.add("x-api-key",o),new Promise((r,a)=>{this.client.logEvent({event_name:t,fields:n||{}},s,(i,d)=>{i?(h("Error logging event:",i),a(new Error(i))):r()})})}};import{z as F}from"zod";var Jt=F.object({user_id:F.string(),user_email:F.string().email()});import{z as C}from"zod";var ct=C.object({Product:C.object({Id:C.number().int(),Code:C.string(),Name:C.string()}),License:C.nullable(C.object({Id:C.number().int(),Name:C.string(),Type:C.string(),Active:C.boolean()})),Availability:C.array(C.object({LicenseStart:C.nullable(C.string().datetime()),LicenseEnd:C.nullable(C.string().datetime())})),IsLicenseAvailable:C.optional(C.boolean())}),eo=C.array(ct);async function pe(e){let t=process.env.KENDO_MCP_ACCESS;if(t==="true"||t==="1"||t==="full")return"full";if(typeof t=="string"&&(t.toLowerCase()==="agent"||t.toLowerCase()==="assistant"))return t.toLowerCase();let n=await e();return n.toLocaleLowerCase()==="agentic_ui_generator"?"agent":n.toLocaleLowerCase()==="ai_coding_assistants"?"assistant":"none"}function me(){return'**Accessibility Guidelines: WCAG 2.2 Level AA Compliance**\n\n**Core Principles:**\n1. Use semantic HTML and ARIA correctly\n2. Ensure WCAG 2.2 AA compliance\n3. Follow W3C ARIA Authoring Practices\n4. Provide standards-based accessibility fixes\n\n**1. Form Control Labels** (WCAG 1.3.1, 3.3.2, 4.1.2)\nEvery input must have an associated label.\nCORRECT: `<input type="search" aria-label="Search products" placeholder="Search...">`\nCORRECT: `<label for="qty">Quantity</label><input type="number" id="qty">`\nWRONG: `<span>Email</span><input type="email">` (no association)\nWRONG: `<input type="email" placeholder="Email">` (placeholder as label)\n\n**2. Button Accessibility** (WCAG 4.1.2, 2.4.6, 2.5.3)\nAll buttons need accessible names describing their purpose.\nCORRECT: `<button type="button">Save Changes</button>`\nCORRECT: `<button aria-label="Close dialog"><svg aria-hidden="true" focusable="false">...</svg></button>`\nWRONG: `<button><svg>...</svg></button>` (no accessible name)\nWRONG: `<button>Click here</button>` (generic text)\n\n**3. Popup/Menu Triggers** (WCAG 4.1.2, 1.3.1)\nIndicate popup purpose and state using aria-haspopup, aria-expanded, aria-controls.\nCORRECT: `<button aria-expanded="false" aria-haspopup="menu" aria-controls="menu-id">Settings</button>`\n\n**4. Image Accessibility** (WCAG 1.1.1)\nInformative: `<img src="chart.png" alt="Sales increased 25% in Q4 2024">`\nFunctional: `<a href="/home"><img src="logo.png" alt="Company Name Home"></a>`\nDecorative: `<img src="border.png" alt="" role="presentation">`\nComplex: `<img src="chart.png" alt="Sales data" aria-describedby="desc-id">`\nWRONG: Missing alt, filename as alt, generic alt for decorative images\n\n**5. Link Accessibility** (WCAG 2.4.4, 2.4.6)\nLinks must be descriptive and understandable out of context.\nCORRECT: `<a href="/products">View All Products</a>`\nCORRECT: `<a href="/article" aria-label="Read more about New Product Launch">Read more</a>`\nWRONG: "Click here", "Read more", "Learn more" without context\n\n**6. Form Validation** (WCAG 3.3.1, 3.3.2, 3.3.3)\nErrors must be identified, associated with inputs, and provide suggestions. Use aria-describedby, aria-invalid="true", and role="alert".\n\n**7. Heading Structure** (WCAG 1.3.1, 2.4.6)\nEach page must have an `<h1>` that describes its content. Use hierarchical, descriptive headings with no skipped levels (h1\u2192h2\u2192h3).\nCORRECT: `<h1>Dashboard</h1> <h2>Sales</h2> <h3>By Region</h3>`\nWRONG: No `<h1>` on the page, or skipping levels (h1\u2192h3)\nIf a heading should look smaller than its semantic level, use CSS: `<h2 class="text-sm">Subtitle</h2>`\n\n**8. Page Component Landmark Rules** (WCAG 1.3.1, 4.1.2)\nPage components (route components) may be rendered inside a layout that already provides `<main>`, `<header>`, or `<footer>`. Since the layout configuration is unknown, avoid using these landmarks in page components to prevent potential duplication and nesting violations. Use `<div>`, `<section>`, or `<article>` as the top-level wrapper instead.\n- Avoid adding `<main>`, `role="main"`, `<header>`, or `<footer>` in page components \u2014 the layout typically provides them. Duplicating them can cause `landmark-no-duplicate-main` and `landmark-main-is-top-level` violations.\n- Avoid adding `role="banner"` or using a semantic `<header>` element in page components \u2014 the layout\'s `<header>` already claims the banner landmark. Adding another causes `landmark-banner-is-top-level` violations.\n- Avoid adding `role="contentinfo"` to elements inside page components \u2014 the contentinfo landmark should be a top-level landmark, not nested inside `<main>` or other landmarks. Nesting it can cause `landmark-contentinfo-is-top-level` violations.\n- When multiple `<section>` or `<nav>` elements exist on a page, give each a unique `aria-label` to avoid `landmark-unique` violations.\n\n**9. ARIA Role and Attribute Restrictions** (WCAG 4.1.2)\nOnly use ARIA roles that are valid for the given HTML element. Avoid adding `aria-label` or `aria-labelledby` to elements that do not permit naming.\n- `<article>` has an implicit `article` role. Do NOT override it with `role="listitem"`, `role="button"`, `role="link"`, or any other role \u2014 none are allowed on `<article>`. Use `<li>` for list items, `<button>` for interactive cards, or `<a>` for clickable cards instead.\n- `<button>` already has an implicit `button` role. Do NOT add `role="listitem"` or other incompatible roles.\n- `<span>` and `<div>` without roles are generic elements. Do NOT add `aria-label` to them \u2014 it is a prohibited attribute on elements with no accessible role and can cause `aria-prohibited-attr` violations. Instead, use `role="img"` + `aria-label` for visual indicators, or use visually hidden text.\n- Do NOT add `aria-label` to non-interactive `<div>` wrappers \u2014 it has no effect and triggers violations.\n- `aria-pressed` is only valid on elements with `role="button"`, `role="checkbox"`, `role="menuitemcheckbox"`, `role="option"`, `role="radio"`, or `role="switch"`. Do NOT use `aria-pressed` on elements with `role="listitem"` or other roles.\nCORRECT: `<ul role="list"><li class="product-card">...</li></ul>` (listitem inside list)\nCORRECT: `<span role="img" aria-label="Status: pending" class="status-dot"></span>` (role added before aria-label)\nCORRECT: `<span class="status-dot" aria-hidden="true"></span><span class="visually-hidden">Pending</span>` (hidden text alternative)\nWRONG: `<article role="listitem">` (listitem not allowed on article)\nWRONG: `<article role="button">` (button not allowed on article \u2014 use `<button>` or `<div role="button">`)\nWRONG: `<span aria-label="pending" class="status-dot"></span>` (aria-label prohibited on generic span)\nWRONG: `<div aria-label="Product badges" class="badges"></div>` (aria-label prohibited on generic div)\n\n**Quick Checklist:**\n- **Forms:** Associated labels, aria-required on required fields, autocomplete attributes, aria-describedby for errors, aria-invalid for invalid fields, fieldsets with legends\n- **Buttons/Links:** Accessible names, aria-label for icon buttons, aria-hidden on decorative icons, descriptive link text\n- **Popups/Dialogs:** aria-haspopup, aria-expanded, aria-controls, role="dialog", aria-modal="true", aria-labelledby, focus trap, Escape to close\n- **Images:** alt on all images, descriptive alt for informative, empty alt for decorative, aria-describedby for complex\n- **Structure:** One h1, logical heading hierarchy, avoid `<main>`, `<header>`, `<footer>`, `role="main"`, `role="contentinfo"`, `role="banner"` in page/route components (the layout may already provide them), use `<section>` or `<div>` as page-level wrappers, unique aria-labels on duplicate landmark types\n- **ARIA Rules:** Avoid adding `aria-label` to generic `<span>`/`<div>` without a role, avoid using `role="listitem"` or `role="button"` on `<article>` \u2014 use `<li>` for list items, add `role="img"` before `aria-label` on visual indicators, `aria-pressed` only on button-like roles\n- **Scrollable Regions:** Any scrollable container must have `tabindex="0"` or contain keyboard-interactive children\n- **Nested Interactive:** Do not add interactive role/tabindex to a container that already has focusable children\n- **List Roles:** `role="list"` containers must have `role="listitem"` children \u2014 prefer `<ul>/<li>` natively\n- **Dynamic Content:** role="status"/aria-live="polite" for updates, role="alert"/aria-live="assertive" for critical alerts\n- **Keyboard/Focus:** All interactive elements keyboard accessible, logical focus order, visible focus indicators, no keyboard traps (except modals)\n- **Color/Contrast:** 4.5:1 text contrast (3:1 large text), 3:1 UI component contrast, no color-only information, 3:1 focus indicator contrast'}var dt=1440*60*1e3;function ue(e){let{serverName:t,contextApi:n,additionalFields:o={},intervalMs:s=dt}=e,r="mcp_server_heartbeat",a=async()=>{try{let d={server_name:t,timestamp:new Date().toISOString(),...o};await n.logEvent(r,d)}catch(d){h(`Failed to send heartbeat for ${t}:`,d)}};a();let i=setInterval(a,s);return()=>{clearInterval(i),h(`Heartbeat stopped for ${t}`)}}import{z as K}from"zod";var pt=["default","bootstrap","material","fluent"];function he(e,t){return{projectName:K.string().default(t).describe("The name of the project. Used as the project folder name when creating a new project."),createNewProject:K.boolean().default(!0).describe(`Whether to create a new project before configuring ${e}. Set to true to scaffold a brand-new project, or false if the project already exists and you only want to add ${e} to it.`),theme:K.enum(pt).default("default").describe("The Kendo UI theme to use. Determines which theme package is installed and imported.")}}var c="Kendo UI for React",T="react",N="kendo";var G=["ActionSheet","AIPrompt","Animation","AppBar","ArcGauge","AutoComplete","Avatar","Badge","Barcode","BottomNavigation","Breadcrumb","Button","ButtonGroup","BreadCrumb","Calendar","Card","Chart","ChartWizard","Chat","Checkbox","Chip","ChipList","ChunkProgressBar","CircularGauge","ColorGradient","ColorPalette","ColorPicker","ComboBox","ContextMenu","ConversationalUI","DataGrid","Grid","DataQuery","DateMath","DateInput","DatePicker","DateRangePicker","DateTimePicker","Dialog","Drag&Drop","Drawer","Drawing","DropDownButton","DropDownList","DropDownTree","Editor","Error","ExcelExport","ExpansionPanel","ExternalDropZone","FileSaver","FileManager","Filter","FlatColorPicker","FloatingActionButton","FloatingLabel","Form","Gantt","Gauge","General","GridLayout","Hint","Icon","InlineAIPrompt","Input","Label","LinearGauge","ListBox","ListView","Loader","Map","MaskedTextBox","Menu","MultiColumnComboBox","MultiSelect","MultiSelectTree","MultiViewCalendar","Notification","NumericTextBox","OrgChart","PageTemplates/BuildingBlocks","Pager","PanelBar","PDFProcessing","PDFViewer","PivotGrid","Popover","Popup","ProgressBar","PromptBox","QRCode","RadialGauge","RadioButton","RadioGroup","RangeSlider","Rating","Ripple","Sankey","Scheduler","ScrollView","Signature","Skeleton","Slider","Sortable","Sparkline","SpeechToTextButton","SmartPasteButton","SplitButton","Splitter","Spreadsheet","StackLayout","Stepper","StockChart","SVGIcon","Switch","TabStrip","TaskBoard","TextArea","TextBox","TileLayout","Timeline","TimePicker","Toolbar","Tooltip","TreeList","TreeView","Typography","Upload","VSCodeExtension","Window"];var gt=ut(mt(ht(import.meta.url)),"../proto/service.proto"),O=new M("contextapi.telerik.com:443",gt,{libName:T});var ge=async()=>O.validateUserLicense();import xt from"fs";import Je from"path";import{fileURLToPath as Et}from"url";import{z as A}from"zod";var w=class{constructor(t,n,o){this.name=t;this.config=n;this.cb=o}register(t){this.server=t,this.server.registerTool(this.name,this.config,this.cb)}hasAccess(t){return!this.config.requiredAccess||this.config.requiredAccess.length===0?!0:t==="full"||this.config.requiredAccess.includes(t)}};var L=(e,t)=>`# ${e.suiteName} - Code Validation & Quality Assurance
795
6
 
796
7
  ## Comprehensive Code Validation Checklist
797
8
  Execute these validation steps systematically to ensure high-quality, maintainable code:
798
9
 
799
10
  ### Validation Phase: Framework-Specific Validation
800
11
 
801
- ${frameworkValidationSteps}
12
+ ${t}
802
13
 
803
14
  ### Validation Phase: General Code Quality & Best Practices
804
15
 
@@ -835,97 +46,148 @@ Responsive Design:
835
46
  - Graceful error handling for all user interactions
836
47
  - Meaningful error messages for users
837
48
  - Network error handling for API calls
838
- `;
839
-
840
- // packages/kendo-ui-agent/src/lib/templates/orchestrator.ts
841
- var responsiveKendoDesignSystemGuidance = (ctx) => `**Tool call example:**
842
- \`\`\`
843
- ${ctx.layoutAssistantName}({
844
- prompt="Provide Kendo Design System utility classes to make the following layout structure responsive across mobile, tablet, and desktop views: [LAYOUT DESCRIPTION HERE]",
845
- includeBuildingBlockExamples=false // Optional, include examples of Kendo building blocks (Grid, Flex, Stack, etc.)
846
- })
847
- \`\`\`
848
- `;
849
- var vanillaCSSResponsiveGuidance = `**General Responsive Design Guidance:**
850
- - Use CSS media queries to apply different styles at various breakpoints (e.g., mobile, tablet, desktop).
851
- - Consider a mobile-first approach, starting with styles for smaller screens and adding complexity for larger screens.
852
- - Ensure flexible grid layouts that can adapt to different screen sizes.
853
- - Use relative units (%, em, rem) instead of fixed units (px) for widths and spacing to allow for better scalability.
854
- - Test the design across multiple devices and screen sizes to ensure a consistent user experience.`;
855
- var tailwindResponsiveGuidance = `**Tailwind CSS Responsive Design Guidance:**
856
- - Use Tailwind's responsive utility variants (e.g., sm:, md:, lg:, xl:) to apply styles at specific breakpoints.
857
- - Start with mobile styles (no prefix) and layer on additional styles for larger screens using the appropriate prefixes.
858
- - Leverage Tailwind's grid and flex utilities to create flexible layouts that adapt to different screen sizes.
859
- - Use Tailwind's spacing utilities to maintain consistent spacing across breakpoints.
860
- - Test the design across multiple devices and screen sizes to ensure a consistent user experience.`;
861
- var renderOrchestratorResponse = (ctx, options) => {
862
- const validationInstructions = renderValidatorResponse(
863
- { suiteName: ctx.suiteName, libKey: ctx.libKey },
864
- options.validationSteps
865
- );
866
- const includeLayout = ctx.includeLayout && ctx.layoutMode === "utils";
867
- const dragDropGuidance = ctx.libKey === "angular" ? `- **Drag and Drop**: Consider using the DragandDrop and Sortable components when drag-and-drop functionality is needed.` : "";
868
- const componentsList = ctx.components ? ctx.components.join(", ") : "components";
869
- const responsiveLayoutHint = includeLayout ? `- And use the ${ctx.layoutAssistantName} tool to get Kendo CSS utility classes needed for responsive design.` : "";
870
- const responsiveKDSGuidance = includeLayout ? responsiveKendoDesignSystemGuidance(ctx) : "";
871
- const responsiveVanillaCSSGuidance = ctx.layoutMode === "vanilla" ? vanillaCSSResponsiveGuidance : "";
872
- const responsiveTailwindCSSGuidance = ctx.layoutMode === "tailwind" ? tailwindResponsiveGuidance : "";
873
- return `# \u{1F3AF} ${ctx.suiteName} - Execution Plan
49
+ `;var j=()=>`## UX/UI Design Best Practices
50
+
51
+ > **These are default guidelines \u2014 follow them when the user has not stated otherwise.** If the user explicitly requests different behavior (e.g., a specific component size, a custom row limit, alternate breakpoints, a different layout pattern), defer to the user's stated preference and disregard the conflicting default below. Only accessibility and WCAG requirements (contrast ratios, focus indicators, semantic HTML, ARIA) apply regardless of user preference.
52
+
53
+ Follow these principles when building or reviewing any UI. They apply regardless of the visual style requested.
54
+
55
+ ### Visual Hierarchy & Typography
56
+ - Use a strict 3-level heading hierarchy: page title (h1) \u2192 section heading (h2) \u2192 component label (h3). Never skip levels.
57
+ - Body text line length: 60\u201380 characters maximum. Wider lines reduce readability.
58
+ - Numeric and currency columns must use \`font-variant-numeric: tabular-nums\` to keep digits column-aligned.
59
+ - Never use more than 2 typefaces in a single interface.
60
+
61
+ ### Color & Contrast
62
+ - Body text contrast ratio: \u2265 4.5:1 against its background.
63
+ - Large text (\u2265 18pt / 14pt bold) and UI component boundaries: \u2265 3:1.
64
+ - Use only the 5 semantic color slots \u2014 primary, success, warning, error, info \u2014 for meaning. Do not invent new semantic colors.
65
+ - Never use color alone to convey status or meaning (8% of men have color vision deficiency). Always pair color with an icon or text label.
66
+ - Never use red and green as the sole distinguishing colors.
67
+
68
+ ### Component Sizing & Density
69
+ - Never mix size variants within the same form or toolbar. Pick one: \`"small"\`, \`"medium"\`, or \`"large"\` and apply it consistently.
70
+ - \`"small"\` (24px) = data-dense tools. \`"medium"\` (32px) = default. \`"large"\` (40px) = comfortable/consumer-facing.
71
+
72
+ ### Motion & Animation
73
+ - Always support \`prefers-reduced-motion: reduce\` \u2014 set transition durations to \u2264 0.01ms in that media query.
74
+ - Micro-interactions (button press, tooltip): 150\u2013250ms. Panel transitions (drawer, sidebar): 300\u2013400ms.
75
+ - Never animate layout properties that cause reflow (width, height, margin, padding). Animate transform and opacity instead.
76
+
77
+ ### Interaction Patterns
78
+ - Never set \`outline: none\` globally. Keyboard focus indicators are required (WCAG 2.4.7).
79
+ - Loading states: prefer Skeleton loader for content areas, overlay + ProgressBar for blocking operations, disabled button + inline spinner for async submission.
80
+ - Error recovery: inline validation near the field for form errors; notification/toast for API/system errors.
81
+ - Every icon-only button must have a visible tooltip and an \`aria-label\`.
82
+ - Never show tooltips on disabled elements \u2014 disabled elements cannot receive focus.
83
+
84
+ ### Responsive Design
85
+ - Breakpoints (defaults \u2014 use the project's breakpoint system if one is already established): Mobile < 640px | Tablet 640\u20131024px | Desktop 1024\u20131440px | Wide > 1440px.
86
+ - Constrain max content width to 1440px with \`margin: 0 auto\` on wide viewports, unless a different maximum is already defined by the project.
87
+ - On mobile (< 480px), data grids must switch to stacked/card layout \u2014 tabular layout is unusable at that width.
88
+ - Schedulers/complex data views are not viable on mobile; provide a simplified alternative or a clear message.
89
+
90
+ ### UX Writing
91
+ - Input labels describe *what* the field is. Placeholder text hints at *format or example* \u2014 never use placeholder as a substitute for a label.
92
+ - Button labels must be specific action verbs: "Save Changes", "Delete Record", "Export CSV" \u2014 not "Submit", "OK", or "Yes".
93
+ - Error messages must be specific and actionable: "Email address is already registered" not "Error 409".
94
+ - Table/grid column headers: Title Case. Never ALL CAPS.
95
+ - Empty states must explain why it's empty and offer a next action (e.g., "No records found. Add your first item.").
96
+
97
+ ### Data Presentation
98
+ - Numeric and currency values must be right-aligned in table/grid columns.
99
+ - Never display raw ISO 8601 date strings (e.g., \`2024-01-15T09:30:00Z\`) \u2014 always format for the locale (e.g., "15 Jan 2024").
100
+ - Never render more than 200 rows in a fully-loaded table. Use pagination or virtual scrolling for larger datasets.
101
+ - Never leave grid columns without explicit widths \u2014 causes layout jank on load and sort operations.
102
+
103
+ ### Chart Type Selection
104
+ - **Line / Area**: continuous quantitative data over time (trends, rates).
105
+ - **Bar (vertical)**: discrete time periods or ordered categories.
106
+ - **Horizontal Bar**: comparing named categories (rankings, survey results).
107
+ - **Donut (not Pie)**: part-to-whole proportions with \u2264 6 segments. Avoid Pie charts \u2014 the center hole of a Donut makes area estimation easier.
108
+ - **Avoid**: 3D charts, dual-axis charts (misleading), charts with > 7 series in the same view.
109
+ - Chart legend placement: below the chart.
110
+
111
+ ### Dialog vs Window Decisions
112
+ - **Dialog (modal)**: use when the user must respond before continuing. Title should be action-oriented: "Delete this record?" not "Confirmation".
113
+ - **Window (non-modal)**: use when content can exist alongside the background (resizable/draggable panels, editors).
114
+ - Destructive dialog actions (delete, overwrite) must use the error theme color.
115
+ - Every dialog must be closable via Escape key and have a clearly labeled close control.
116
+
117
+ ### Form Validation Display Rules
118
+ - Show field-level validation errors **after the first blur** (not on initial render, not on every keystroke).
119
+ - Display error text inline, directly below the field \u2014 never in a toast or far from the field.
120
+ - On form-level submit failure, focus the first invalid field automatically.
121
+ - Required fields: mark with an asterisk (*) and include a legend. Do not mark optional fields \u2014 label them "(optional)" only if most fields are required.
122
+
123
+ ### Grid Data Volume & Scrolling Strategy
124
+ - Never render more than 200 rows without pagination or virtual scrolling.
125
+ - Use **pagination** when users need to navigate by page number, see total row count, or perform export/select-all operations.
126
+ - Use **virtual scrolling** when the dataset is very large (thousands of rows) and users scroll continuously rather than jumping to pages.
127
+ - Default page size: 25 rows. Offer page size options (10, 25, 50) as defaults unless the project specifies otherwise.
128
+
129
+ ### Grid Feature Selection
130
+ Enable only the Grid features genuinely required for the workflow. Each enabled feature adds UI chrome, event listeners, and DOM nodes. Start with the minimum set and add only when user stories require it:
131
+ - \`sortable\` \u2014 when users need to find specific rows in non-obvious order
132
+ - \`filterable\` \u2014 for datasets > 50 rows with varied values; skip for small fixed lists
133
+ - \`groupable\` \u2014 only when hierarchical analysis is a core workflow
134
+ - \`reorderable\` / \`resizable\` \u2014 when user customization of the view is a stated requirement
135
+ - \`selectable\` \u2014 only when batch actions exist
136
+ - \`editable\` \u2014 only when inline data entry is the primary workflow, not for read-only display
137
+
138
+ ### Form Layout Defaults
139
+ These are defaults \u2014 respect the project's existing form conventions if established:
140
+ - Prefer single-column form layout \u2014 easier to read and complete than multi-column.
141
+ - Use two-column layout only for tightly related field pairs (First Name / Last Name, Start Date / End Date).
142
+ - Align labels above their fields for complex forms; inline labels work only for very short forms (2\u20133 fields).
143
+ - Place the primary action (Save / Submit) at the bottom left; Cancel or secondary actions to its right.
144
+
145
+ ### Whitespace Defaults
146
+ When no design token system is defined by the project, apply these minimum spacing values:
147
+ - Section separators: \u2265 24px vertical gap between distinct content areas.
148
+ - Card internal padding: 16\u201324px.
149
+ - Form field vertical gap: \u2265 16px between fields (24px for multi-column groups).
150
+ - Page left/right margin: 24\u201332px minimum, even at desktop widths.`;var U=(e,t)=>{let n=L({suiteName:e.suiteName,libKey:e.libKey},t.validationSteps),o=e.libKey==="angular"?"- **Drag and Drop**: Consider using the DragandDrop and Sortable components when drag-and-drop functionality is needed.":"",s=e.components?e.components.join(", "):"components";return`# \u{1F3AF} ${e.suiteName} - Execution Plan
874
151
 
875
152
  **Current Goal:**
876
153
 
877
- ${ctx.userIntent}
154
+ ${e.userIntent}
878
155
 
879
156
  **Requirements Summary:**
880
- - **Framework:** ${ctx.libKey}
881
- ${ctx.includeComponentsDocs ? `- **Component Library:** ${ctx.suiteName}
882
- - Ensure to use ONLY ${ctx.suiteName} components for all UI elements.
883
- - And use the ${ctx.codeAssistantName} tool to get ${ctx.suiteName} component documentation and code snippets.
884
- - Ensure that after you read the plan you use exactly the ${ctx.codeAssistantName} no matter if there is another tool that can provide code snippets, documentation or other resources related to ${ctx.suiteName}.
885
- ` : ""}${includeLayout ? `- **Layout:** Yes
886
- - And use the ${ctx.layoutAssistantName} tool to get Kendo CSS utility classes needed for layout structure and responsive design.
887
- ` : ""}${ctx.includeIcons ? `- **Icons:** Yes
157
+ - **Framework:** ${e.libKey}
158
+ ${e.includeComponentsDocs?`- **Component Library:** ${e.suiteName}
159
+ - Ensure to use ONLY ${e.suiteName} components for all UI elements.
160
+ - And use the ${e.codeAssistantName} tool to get ${e.suiteName} component documentation and code snippets.
161
+ - Ensure that after you read the plan you use exactly the ${e.codeAssistantName} no matter if there is another tool that can provide code snippets, documentation or other resources related to ${e.suiteName}.
162
+ `:""}${e.includeLayout?`- **Layout:** Yes
163
+ - And use the ${e.layoutAssistantName} tool to get Kendo CSS utility classes needed for layout structure and responsive design.
164
+ `:""}${e.includeIcons?`- **Icons:** Yes
888
165
  - Use icons that align with the project theme and enhance usability.
889
- - Use the ${ctx.iconAssistantName} tool to search for icons that fit the theme and purpose of your project.
890
- ` : ""}${ctx.includeTheming ? `- **Custom Theming:**
166
+ - Use the ${e.iconAssistantName} tool to search for icons that fit the theme and purpose of your project.
167
+ `:""}${e.includeTheming?`- **Custom Theming:**
891
168
  - Create a custom theme that aligns with the current goal and branding needs.
892
169
  - Use Kendo Themes and Design System guidelines.
893
170
  - Make sure to include strict CSS variables or theme requirements from the current goal.
894
- - And use the ${ctx.styleAssistantName} tool to create a custom theme for your project.
895
- ` : ""}${ctx.includeResponsive ? `- **Responsive:**
171
+ - And use the ${e.styleAssistantName} tool to create a custom theme for your project.
172
+ `:""}${e.includeResponsive?`- **Responsive:**
896
173
  - Ensure the layout is fully responsive across mobile, tablet, and desktop views.
897
- ${responsiveLayoutHint}
898
- ` : ""}
174
+ - And use the ${e.layoutAssistantName} tool to get Kendo CSS utility classes needed for responsive design.
175
+ `:""}
899
176
  - **Accessible (WCAG 2.2 Level AA):**
900
- - CRITICAL: You must call the ${ctx.accessibilityAssistantName} tool with includeGeneralGuidelines=true on your first call to get WCAG 2.2 Level AA guidelines.
177
+ - CRITICAL: You must call the ${e.accessibilityAssistantName} tool with includeGeneralGuidelines=true on your first call to get WCAG 2.2 Level AA guidelines.
901
178
  - For subsequent calls, use includeGeneralGuidelines=false to get only component-specific accessibility information.
902
179
  - Ensure all components meet WCAG 2.2 Level AA standards.
903
180
 
904
- ${includeLayout ? `**STYLING AND LAYOUT REQUIREMENTS:**
905
- **LAYOUT MODE: KENDO DESIGN SYSTEM CSS UTILITIES**
181
+ ${e.includeLayout?`**STYLING AND LAYOUT REQUIREMENTS:**
906
182
  ## CRITICAL DESIGN SYSTEM CONSTRAINTS
907
183
  - **USE ONLY KENDO DESIGN SYSTEM UTILITIES** for ALL styling, layout, spacing, positioning, and responsive behavior
908
184
  - Avoid custom CSS, inline styles, or other CSS framework classes
909
- - The ${ctx.layoutAssistantName} tool will provide the specific Kendo CSS utility classes needed
185
+ - The ${e.layoutAssistantName} tool will provide the specific Kendo CSS utility classes needed
910
186
  - All layout requirements must use Kendo utilities exclusively
911
- ` : ""}
912
- ${ctx.layoutMode === "vanilla" ? `**STYLING AND LAYOUT REQUIREMENTS:**
913
- **LAYOUT MODE: VANILLA**
914
- - In this mode, you should use Kendo UI components and vanilla CSS for layout and styling.
915
- - Do NOT use any utility-first CSS classes (e.g., from Tailwind) for layout or styling.
916
- - Focus on leveraging the built-in capabilities of Kendo UI components and writing custom CSS as needed to achieve the desired design and layout.
917
- ` : ""}
918
- ${ctx.layoutMode === "tailwind" ? `**STYLING AND LAYOUT REQUIREMENTS:**
919
- **LAYOUT MODE: TAILWIND**
920
- - In this mode, you should use Tailwind CSS utility classes for layout and styling.
921
- - Do NOT write custom CSS or use vanilla CSS for layout or styling.
922
- - Focus on leveraging Tailwind's utility-first approach to achieve the desired design and layout, while still using Kendo UI components for functionality.
923
- ` : ""}
924
- ${ctx.includeFigmaD2C ? `**DESIGN EXTRACTION FROM FIGMA FILE**
925
- - You are given a Figma file URL that contains the design for the current goal. You MUST use the ${ctx.figmaD2CToolName} tool to extract design information from the Figma file.
926
- - Extracted design information should be used to get information about the layout, styles, design tokens and assets that can be used within the project.
927
- - The ${ctx.figmaD2CToolName} tool will output you Layout structure of the design, design tokens for CSS and any decoration and a snapshot of the design.
928
- ` : ""}
187
+
188
+ `:""}---
189
+
190
+ ${j()}
929
191
 
930
192
  ---
931
193
 
@@ -939,13 +201,13 @@ Follow these steps strictly in order to achieve a complete and polished implemen
939
201
  **MANDATORY REQUIREMENT:**
940
202
 
941
203
  - Before implementing any UI components or features, you must call the accessibility assistant with general guidelines
942
- - On your first call to "${ctx.accessibilityAssistantName}", set "includeGeneralGuidelines=true" to get foundational WCAG 2.2 Level AA best practices
204
+ - On your first call to "${e.accessibilityAssistantName}", set "includeGeneralGuidelines=true" to get foundational WCAG 2.2 Level AA best practices
943
205
  - These general guidelines apply to all components and must be considered throughout implementation
944
206
  - For all subsequent calls, set "includeGeneralGuidelines=false" to get only component-specific information
945
207
 
946
208
  **First tool call (includes general WCAG guidelines):**
947
209
  \`\`\`
948
- ${ctx.accessibilityAssistantName}({
210
+ ${e.accessibilityAssistantName}({
949
211
  query="What are the accessibility requirements for [COMPONENT_NAME]?",
950
212
  component="[COMPONENT_NAME]",
951
213
  includeGeneralGuidelines=true // ONLY true on first call
@@ -954,11 +216,11 @@ ${ctx.accessibilityAssistantName}({
954
216
 
955
217
  **Step 2: Get Component-Specific Accessibility Information**
956
218
 
957
- For each additional ${ctx.suiteName} component you plan to use, call the tool with "includeGeneralGuidelines=false":
219
+ For each additional ${e.suiteName} component you plan to use, call the tool with "includeGeneralGuidelines=false":
958
220
 
959
221
  **Tool call example:**
960
222
  \`\`\`
961
- ${ctx.accessibilityAssistantName}({
223
+ ${e.accessibilityAssistantName}({
962
224
  query="What are the accessibility features and requirements for [COMPONENT_NAME]? Include ARIA attributes, keyboard navigation, and screen reader support.",
963
225
  component="[COMPONENT_NAME]",
964
226
  includeGeneralGuidelines=false // false for all calls after the first
@@ -967,112 +229,13 @@ ${ctx.accessibilityAssistantName}({
967
229
 
968
230
  **Example:**
969
231
  \`\`\`
970
- ${ctx.accessibilityAssistantName}({
232
+ ${e.accessibilityAssistantName}({
971
233
  query="How to associate the label with another component or HTML input?",
972
234
  component="Label",
973
235
  includeGeneralGuidelines=false
974
236
  })
975
237
  \`\`\`
976
-
977
- ${ctx.includeFigmaD2C ? `### Phase: Design Extraction and Analysis
978
-
979
- **IMPORTANT DESIGN EXTRACTION REQUIRMENTS**
980
- - Use the ${ctx.figmaD2CToolName} tool to extract design information from the provided Figma file URL.
981
- - Analyze the extracted design information to identify key layout structures, components, styles, and design tokens.
982
- - Use the insights from the design analysis to inform your implementation in the next phases, ensuring alignment with the original design intent.
983
- - Follow ALL three extraction steps sequentially \u2014 each step is MANDATORY.
984
- - Complete the verification checklist after each step before proceeding to the next.
985
-
986
-
987
- **Step 1: Extract Base Design Information from Figma**
988
- - Extract only base the first layer of the design to get the overall structure and layout without going too deep into details. This will help you to understand the design hierarchy and identify key components and layout patterns.
989
- - Use the downloaded design snapshot to visually analyze the design and correlate it with the extracted structure. This will help you to identify which nodes correspond to which design elements and to plan your implementation accordingly.
990
- - **REQUIRED OUTPUT:** After extraction, you MUST output a structured list of ALL discovered node IDs with their labels/names before proceeding to Step 2. Format this as a clear inventory that will be referenced in subsequent steps. For each node, extract the node ID from the node-id attribute of the node XML tag.
991
- - **Depth escalation:** If a node at this depth shows it contains more children than can be captured (e.g., children are truncated), re-fetch that specific node with depth + 5 to ensure complete extraction.
992
-
993
- **Tool call example:**
994
- \`\`\`
995
- ${ctx.figmaD2CToolName}({
996
- url: [Figma URL from prompt]
997
- depth: 10 // Consider more depth only if the user prompt explicitly states to extract deeply.
998
- })
999
- \`\`\`
1000
-
1001
- **Step 1 Completion Checklist (MUST satisfy before proceeding):**
1002
- - [ ] Have I captured all top-level layout containers (headers, footers, main sections)?
1003
- - [ ] Have I identified all major structural components?
1004
- - [ ] Have I created and outputted a structured list of node IDs and their labels?
1005
- - [ ] Have I visually analyzed the design snapshot to correlate nodes with design elements?
1006
-
1007
- **Step 2: Extract Main Nodes Design**
1008
- - Based on the initial extraction and analysis, identify the main nodes that are critical for the design implementation. These could be reusable headers, body, navigation, sidebar or footer elements that illustrate the main structure.
1009
- - Use the node IDs from the node-id attribute of the node XML tag to fetch these specific nodes with more depth to capture necessary details for implementation. This targeted extraction will help you to get the relevant design information without overwhelming the process with too much data.
1010
- - **Depth escalation:** If any main node shows truncated children or contains more elements than expected at the given depth, immediately re-fetch with depth + 5.
1011
-
1012
- **Tool call example:**
1013
- \`\`\`
1014
- ${ctx.figmaD2CToolName}({
1015
- fileKey: [The fileKey extracted from Step 1]
1016
- nodeIds: [Array of main node IDs identified from Step 1]
1017
- depth: 10 // Deeper extraction for main nodes to capture necessary details.
1018
- })
1019
- \`\`\`
1020
-
1021
- **Step 2 Completion Checklist (MUST satisfy before proceeding):**
1022
- - [ ] Have I captured all interactive components (buttons, inputs, navigation elements)?
1023
- - [ ] Have I identified all typography styles and text elements?
1024
- - [ ] Have I extracted all color tokens and design system values?
1025
- - [ ] Have I documented child node IDs that need deeper extraction in Step 3?
1026
-
1027
- **Step 3: Extract Child Node Details (MANDATORY)**
1028
- **CRITICAL:** After Step 2, you MUST proceed to Step 3. Extract ALL child nodes identified in Step 2. Do not skip this step.
1029
-
1030
- - Extract all child nodes that were identified in Step 2 as requiring deeper analysis. These include specific components, styles, or interactions that are essential for accurate implementation.
1031
- - Use the node IDs from the node-id attribute to fetch these specific child nodes with sufficient depth to capture all critical design details.
1032
- - **Depth escalation:** If child nodes still show incomplete extraction (truncated elements, nested components not fully visible), re-fetch with depth + 5 until all leaf-level components are captured.
1033
-
1034
- **Tool call example:**
1035
- \`\`\`
1036
- ${ctx.figmaD2CToolName}({
1037
- fileKey: [The fileKey extracted from Step 1]
1038
- nodeIds: [Array of ALL child node IDs identified from Step 2]
1039
- depth: 15 // Targeted deeper extraction for specific nodes. Increase if needed.
1040
- })
1041
- \`\`\`
1042
-
1043
- **Step 3 Completion Checklist (MUST satisfy before proceeding):**
1044
- - [ ] Have I captured ALL leaf-level components (buttons, icons, form inputs)?
1045
- - [ ] Have I extracted all spacing, padding, and margin values?
1046
- - [ ] Have I identified all border styles, shadows, and visual effects?
1047
- - [ ] Are there any remaining truncated nodes? (If yes, apply depth escalation)
1048
-
1049
- **Iterative Extraction and Stopping Condition**
1050
- Continue iterating over the extraction process following these rules:
1051
- - **Continue until:** (a) All leaf-level components have been captured with complete details, OR (b) You have completed 3 extraction passes \u2014 whichever comes first.
1052
- - After each iteration, verify that no new child nodes require deeper extraction.
1053
- - If depth escalation is needed after 3 passes, document the limitation and proceed with available data.
1054
-
1055
- **MANDATORY: Design Extraction Verification (Complete BEFORE Code Generation Phase)**
1056
- Before proceeding to any code generation or implementation phase, you MUST produce and output a verification summary containing:
1057
-
1058
- 1. **Component Inventory:** List all UI components discovered (buttons, inputs, cards, navigation elements, etc.)
1059
- 2. **Hierarchy Map:** Show the parent-child relationships of major layout sections
1060
- 3. **Design Tokens Identified:**
1061
- - Colors (with hex/rgba values)
1062
- - Typography (font families, sizes, weights)
1063
- - Spacing values (margins, paddings, gaps)
1064
- - Border styles and effects
1065
- 4. **Gaps and Limitations:** Explicitly state any design elements that could not be fully extracted
1066
-
1067
- **This verification summary serves as the design specification for implementation. Do not proceed to Code Generation until this summary is complete.**
1068
-
1069
- **Additional Extraction During Implementation:**
1070
- - During the implementation phase (Code Generation), you can and should use the ${ctx.figmaD2CToolName} tool with the relevant node IDs from the node-id attributes again if you discover you need more specific design details for certain components or sections that were not captured in earlier phases.
1071
- - If additional extraction is needed, apply the same depth escalation logic and verification steps.
1072
- ` : ""}
1073
-
1074
-
1075
- ${includeLayout ? `
238
+ ${e.includeLayout?`
1076
239
  ### Phase: Layout Foundation
1077
240
 
1078
241
  **Step 1: Create Base Layout Structure**
@@ -1083,16 +246,16 @@ ${includeLayout ? `
1083
246
 
1084
247
  **Tool call example:**
1085
248
  \`\`\`
1086
- ${ctx.layoutAssistantName}({
249
+ ${e.layoutAssistantName}({
1087
250
  prompt="Provide Kendo Design System utility classes for the following layout structure: [LAYOUT DESCRIPTION HERE]",
1088
251
  includeBuildingBlockExamples=true // Optional, include examples of Kendo building blocks (Grid, Flex, Stack, etc.)
1089
252
  })
1090
253
  \`\`\`
1091
- ` : ""}
1092
- ${ctx.includeComponentsDocs ? `
254
+ `:""}
255
+ ${e.includeComponentsDocs?`
1093
256
  ### Phase: Component Integration
1094
257
  **Step 1: Identify and Implement Core Components**
1095
- Based on your current goal, analyze what other ${ctx.suiteName} components are needed and implement them one by one. Here you are some appropriate components based on the different project type:
258
+ Based on your current goal, analyze what other ${e.suiteName} components are needed and implement them one by one. Here you are some appropriate components based on the different project type:
1096
259
 
1097
260
  **Component Selection Guidelines:**
1098
261
  - **Landing Pages**: Consider Button, Card, Form components, Layout containers, Navigation elements
@@ -1100,17 +263,17 @@ Based on your current goal, analyze what other ${ctx.suiteName} components are n
1100
263
  - **Data Entry**: Consider Form, TextBox, DatePicker, DropDownList, Upload, Validation components
1101
264
  - **Content Management**: Consider Grid, Editor, TreeView, FileManager, Dialog components
1102
265
  - **E-commerce**: Consider ListView, Card, Button, Rating, Badge, Carousel components
1103
- ${dragDropGuidance}
266
+ ${o}
1104
267
 
1105
268
  **IMPORTANT COMPONENT USAGE REQUIREMENTS:**
1106
- - Make sure to identify all necessary features related to the ${componentsList} based on the current goal.
1107
- - Make sure to identify specific features needed for other ${ctx.suiteName} components based on the current goal.
1108
- - Make sure to generate a query for ${ctx.codeAssistantName} tool for each component and call the tool for each specific feature or functionality.
269
+ - Make sure to identify all necessary features related to the ${s} based on the current goal.
270
+ - Make sure to identify specific features needed for other ${e.suiteName} components based on the current goal.
271
+ - Make sure to generate a query for ${e.codeAssistantName} tool for each component and call the tool for each specific feature or functionality.
1109
272
  - Always specify the exact features you want for each component. Describe only the needed functionality, and behavior you need. Be concise and don't include any information about the use case.
1110
273
 
1111
274
  **Tool call examples:**
1112
275
  \`\`\`
1113
- ${ctx.codeAssistantName}({
276
+ ${e.codeAssistantName}({
1114
277
  query="Give me information about [COMPONENT_NAME] with [SPECIFIC_FEATURES]." <!-- For example: 'Grid with paging' or 'Button with click events' or 'Chart with multiple series' -->
1115
278
  component="[COMPONENT_NAME]" <!-- For example: 'Grid', 'Button', 'Chart', etc. -->
1116
279
  })
@@ -1118,33 +281,40 @@ ${dragDropGuidance}
1118
281
 
1119
282
  For broad queries, break them down into specific features (e.g., paging, sorting, filtering for Grid) and call the tool separately for each feature:
1120
283
  \`\`\`
1121
- ${ctx.codeAssistantName}({
284
+ ${e.codeAssistantName}({
1122
285
  query="How to implement [SPECIFIC_FEATURE] in [COMPONENT_NAME]?" <!-- For example: 'paging in Grid' -->
1123
286
  component="[COMPONENT_NAME]" <!-- For example: 'Grid', 'Button', etc. -->
1124
287
  })
1125
288
  \`\`\`
1126
289
 
1127
290
  \`\`\`
1128
- ${ctx.codeAssistantName}({
291
+ ${e.codeAssistantName}({
1129
292
  query="How to implement [SPECIFIC_FEATURE] in [COMPONENT_NAME]?" <!-- For example: 'sorting in Grid' -->
1130
293
  component="[COMPONENT_NAME]" <!-- For example: 'Grid', 'Button', etc. -->
1131
294
  })
1132
295
  \`\`\`
1133
296
 
1134
297
  \`\`\`
1135
- ${ctx.codeAssistantName}({
298
+ ${e.codeAssistantName}({
1136
299
  query="How to implement [SPECIFIC_FEATURE] in [COMPONENT_NAME]?" <!-- For example: 'filtering in Grid' -->
1137
300
  component="[COMPONENT_NAME]" <!-- For example: 'Grid', 'Button', etc. -->
1138
301
  })
1139
302
  \`\`\`
1140
- ` : ""}
1141
- ${ctx.includeResponsive ? `
303
+ `:""}
304
+ ${e.includeResponsive?`
1142
305
  ### Phase: Layout Responsive Finalization
1143
306
 
1144
307
  **Step 1: Implement Responsive Behavior**
1145
- ${responsiveKDSGuidance}${responsiveVanillaCSSGuidance}${responsiveTailwindCSSGuidance}` : ""}
1146
308
 
1147
- ${ctx.includeTheming ? `
309
+ **Tool call example:**
310
+ \`\`\`
311
+ ${e.layoutAssistantName}({
312
+ prompt="Provide Kendo Design System utility classes to make the following layout structure responsive across mobile, tablet, and desktop views: [LAYOUT DESCRIPTION HERE]",
313
+ includeBuildingBlockExamples=false // Optional, include examples of Kendo building blocks (Grid, Flex, Stack, etc.)
314
+ })
315
+ \`\`\`
316
+ `:""}
317
+ ${e.includeTheming?`
1148
318
  **Step 2: Custom Theme Implementation**
1149
319
 
1150
320
  **CUSTOM THEME REQUIREMENTS:**
@@ -1154,13 +324,13 @@ ${ctx.includeTheming ? `
1154
324
 
1155
325
  **Tool call example:**
1156
326
  \`\`\`
1157
- ${ctx.styleAssistantName}({
327
+ ${e.styleAssistantName}({
1158
328
  query="Create a custom Kendo UI theme that aligns with the following current goal and branding needs: [CURRENT GOAL HERE]. Include strict CSS variables or theme requirements as needed.",
1159
329
  includeThemeVariables=true // Optional, include specific CSS variables for colors, typography, spacing, etc.
1160
330
  })
1161
331
  \`\`\`
1162
- ` : ""}
1163
- ${ctx.includeIcons ? `
332
+ `:""}
333
+ ${e.includeIcons?`
1164
334
  **Step 3: Iconography and Visual Enhancements**
1165
335
 
1166
336
  **ICONOGRAPHY GUIDELINES:**
@@ -1170,64 +340,61 @@ ${ctx.includeIcons ? `
1170
340
 
1171
341
  **Tool call example:**
1172
342
  \`\`\`
1173
- ${ctx.iconAssistantName}({
343
+ ${e.iconAssistantName}({
1174
344
  query="Suggest icons that fit the theme and purpose of the following current goal: [CURRENT GOAL HERE]. Provide icon names and usage context.",
1175
345
  })
1176
346
  \`\`\`
1177
- ` : ""}
347
+ `:""}
1178
348
  ### Phase: Code Generation
1179
349
  **IMPORTANT:** Do NOT generate ANY code or create files until ALL information gathering phases (1-3) are complete.
1180
350
  **Step 1: Generate Complete Implementation**
1181
- After completing all information gathering phases above, generate the complete ${ctx.libKey} component/page implementation:
351
+ After completing all information gathering phases above, generate the complete ${e.libKey} component/page implementation:
1182
352
  **Code Generation Requirements:**
1183
- - Create complete, functional ${ctx.libKey} components/pages
1184
- - Include all identified ${ctx.suiteName} components with their configurations
353
+ - Create complete, functional ${e.libKey} components/pages
354
+ - Include all identified ${e.suiteName} components with their configurations
1185
355
  - Apply ALL Kendo Design System utility classes gathered from layout assistant
1186
356
  - Implement proper component event handling and data binding
1187
357
  - Ensure responsive behavior using Kendo utility classes
1188
358
  - Include necessary import statements and dependencies
1189
359
 
1190
- ${options.injectedPlan ?? ""}
360
+ ${t.injectedPlan??""}
1191
361
 
1192
362
  ### Phase: Validation and Finalization
1193
363
 
1194
364
  **Step 1: Code Validation**
1195
365
  ** CRITICAL REQUIREMENT: You MUST validate the generated UI code using this comprehensive checklist to ensure code quality and compliance:**
1196
366
 
1197
- ${validationInstructions}
367
+ ${n}
1198
368
 
1199
369
  **Step 2: Final Review and Testing**
1200
370
  ** Implementation Validation:**
1201
- ${ctx.includeComponentsDocs ? ` - Components render correctly without errors
1202
- - All ${ctx.suiteName} component features function as expected
1203
- - Event handling and data binding operate correctly` : ""}
1204
- ${ctx.includeResponsive ? `- Responsive layout works across breakpoints` : ""}
371
+ ${e.includeComponentsDocs?` - Components render correctly without errors
372
+ - Running \`npm run build\` compiles the application successfully without any build errors or crashes.
373
+ - All ${e.suiteName} component features function as expected
374
+ - Event handling and data binding operate correctly`:""}
375
+ ${e.includeResponsive?"- Responsive layout works across breakpoints":""}
1205
376
 
1206
377
  **Quick Fixes (if needed):**
1207
378
 
1208
379
  After code implementation and validation you can make quick fixes as needed:
1209
- - Use ${ctx.codeAssistantName} for component-specific issues
1210
- - Use ${ctx.layoutAssistantName} for styling adjustments
380
+ - If any build errors are found, fix them and re-run the application.
381
+ - Use ${e.codeAssistantName} for component-specific issues
382
+ - Use ${e.layoutAssistantName} for styling adjustments
1211
383
 
1212
384
  +### Before You Begin
1213
- - When following/executing the plan call tools are defined from the same function_ecosystem/MCP_server which ${ctx.name} was called.
385
+ - When following/executing the plan call tools are defined from the same function_ecosystem/MCP_server which ${e.name} was called.
1214
386
  - Do NOT generate or suggest any code until all tools have been used and validated responses are incorporated.
1215
387
  - Focus on planning and sequencing.
1216
388
  - Summarize the components, layouts, and utilities gathered.
1217
- - Confirm all required inputs from tools have been provided.`;
1218
- };
1219
-
1220
- // packages/kendo-ui-agent/src/lib/templates/assistant-orchestrator.ts
1221
- var renderAssistantOrchestratorResponse = (ctx) => {
1222
- return `# ${ctx.suiteName} Assistant
389
+ - Confirm all required inputs from tools have been provided.`};var H=e=>`# ${e.suiteName} Assistant
1223
390
 
1224
391
  **What you're looking for:**
1225
392
 
1226
- ${ctx.userIntent}
393
+ ${e.userIntent}
1227
394
 
1228
395
  **Available Tools:**
1229
- - **${ctx.codeAssistantName}** - Get component documentation, features, and usage examples
1230
- - **${ctx.iconAssistantName}** - Search for icons from the Kendo icon library
396
+ - **${e.codeAssistantName}** - Get component documentation, features, and usage examples
397
+ - **${e.iconAssistantName}** - Search for icons from the Kendo icon library
1231
398
 
1232
399
  ---
1233
400
 
@@ -1237,7 +404,7 @@ Follow these steps to find the right components and resources:
1237
404
 
1238
405
  ### Step 1: Identify Components
1239
406
 
1240
- Based on your needs, consider these ${ctx.suiteName} component categories:
407
+ Based on your needs, consider these ${e.suiteName} component categories:
1241
408
 
1242
409
  **Common Use Cases:**
1243
410
  - **Data Display**: Grid, ListView, TreeView, Card, TileLayout
@@ -1250,10 +417,10 @@ Based on your needs, consider these ${ctx.suiteName} component categories:
1250
417
 
1251
418
  **How to explore components:**
1252
419
 
1253
- Use the ${ctx.codeAssistantName} tool to learn about specific components:
420
+ Use the ${e.codeAssistantName} tool to learn about specific components:
1254
421
 
1255
422
  \`\`\`
1256
- ${ctx.codeAssistantName}({
423
+ ${e.codeAssistantName}({
1257
424
  query: "What are the main features of [COMPONENT_NAME]?",
1258
425
  component: "[COMPONENT_NAME]"
1259
426
  })
@@ -1261,14 +428,14 @@ ${ctx.codeAssistantName}({
1261
428
 
1262
429
  **Examples:**
1263
430
  \`\`\`
1264
- ${ctx.codeAssistantName}({
431
+ ${e.codeAssistantName}({
1265
432
  query: "How to use Grid with paging and sorting?",
1266
433
  component: "Grid"
1267
434
  })
1268
435
  \`\`\`
1269
436
 
1270
437
  \`\`\`
1271
- ${ctx.codeAssistantName}({
438
+ ${e.codeAssistantName}({
1272
439
  query: "What features does DatePicker have?",
1273
440
  component: "DatePicker"
1274
441
  })
@@ -1279,37 +446,37 @@ ${ctx.codeAssistantName}({
1279
446
  - Break complex queries into multiple calls focusing on one feature at a time
1280
447
  - Specify the exact component name in the component parameter
1281
448
 
1282
- ${ctx.includeIcons ? `
449
+ ${e.includeIcons?`
1283
450
  ### Step 2: Find Icons
1284
451
 
1285
- Use the ${ctx.iconAssistantName} tool to search for icons:
452
+ Use the ${e.iconAssistantName} tool to search for icons:
1286
453
 
1287
454
  \`\`\`
1288
- ${ctx.iconAssistantName}({
455
+ ${e.iconAssistantName}({
1289
456
  query: "Search for icons related to [YOUR THEME/PURPOSE]"
1290
457
  })
1291
458
  \`\`\`
1292
459
 
1293
460
  **Examples:**
1294
461
  \`\`\`
1295
- ${ctx.iconAssistantName}({
462
+ ${e.iconAssistantName}({
1296
463
  query: "icons for navigation menu"
1297
464
  })
1298
465
  \`\`\`
1299
466
 
1300
467
  \`\`\`
1301
- ${ctx.iconAssistantName}({
468
+ ${e.iconAssistantName}({
1302
469
  query: "icons for user actions like edit, delete, save"
1303
470
  })
1304
471
  \`\`\`
1305
- ` : ""}
472
+ `:""}
1306
473
 
1307
474
  ### Step 3: Review and Implement
1308
475
 
1309
476
  After gathering information:
1310
- 1. Review the component documentation provided by ${ctx.codeAssistantName}
1311
- 2. Check which icons are available from ${ctx.iconAssistantName}
1312
- 3. Use the official ${ctx.suiteName} documentation for detailed implementation guides
477
+ 1. Review the component documentation provided by ${e.codeAssistantName}
478
+ 2. Check which icons are available from ${e.iconAssistantName}
479
+ 3. Use the official ${e.suiteName} documentation for detailed implementation guides
1313
480
  4. Refer to the component examples and code snippets provided
1314
481
 
1315
482
  ---
@@ -1317,1490 +484,144 @@ After gathering information:
1317
484
  ## Getting Started
1318
485
 
1319
486
  **Next Actions:**
1320
- 1. Start by calling ${ctx.codeAssistantName} for the components you need
1321
- 2. ${ctx.includeIcons ? `Search for icons using ${ctx.iconAssistantName}` : "Review the component documentation"}
1322
- 3. Follow the ${ctx.suiteName} official documentation for implementation details
487
+ 1. Start by calling ${e.codeAssistantName} for the components you need
488
+ 2. ${e.includeIcons?`Search for icons using ${e.iconAssistantName}`:"Review the component documentation"}
489
+ 3. Follow the ${e.suiteName} official documentation for implementation details
1323
490
 
1324
491
  **Important Notes:**
1325
492
  - These tools provide documentation and guidance, not code generation
1326
- - Always refer to official ${ctx.suiteName} documentation for the most up-to-date information
1327
- - Tool responses include usage examples and best practices`;
1328
- };
1329
-
1330
- // packages/kendo-ui-agent/src/lib/templates/shared-validation.ts
1331
- var getSharedValidationSteps = (uiLibrary, designSystem) => ({
1332
- SETUP_VALIDATION: `
493
+ - Always refer to official ${e.suiteName} documentation for the most up-to-date information
494
+ - Tool responses include usage examples and best practices`;var E=(e,t)=>({SETUP_VALIDATION:`
1333
495
  UI Library Setup:
1334
- - ${uiLibrary} modules properly imported and configured
1335
- - ${uiLibrary} theme properly loaded and applied
1336
- - ${uiLibrary} license properly configured
1337
- - Globalization and localization properly configured for ${uiLibrary} components
1338
- - Required ${uiLibrary} dependencies installed and up-to-date`,
1339
- PERFORMANCE_OPTIMIZATION: `
496
+ - ${e} modules properly imported and configured
497
+ - ${e} theme properly loaded and applied
498
+ - ${e} license properly configured
499
+ - Globalization and localization properly configured for ${e} components
500
+ - Required ${e} dependencies installed and up-to-date`,PERFORMANCE_OPTIMIZATION:`
1340
501
  Performance Optimization:
1341
502
  - Efficient rendering patterns to prevent unnecessary re-renders
1342
- - Lazy loading of ${uiLibrary} components when appropriate
1343
- - Virtualization enabled for large datasets in ${uiLibrary} components
1344
- - Only required ${uiLibrary} modules imported and tree-shaken`,
1345
- THEME_AND_STYLING: `
1346
- ${uiLibrary} Theme & Styling:
1347
- - Prioritize the ${designSystem} Design System utilities
503
+ - Lazy loading of ${e} components when appropriate
504
+ - Virtualization enabled for large datasets in ${e} components
505
+ - Only required ${e} modules imported and tree-shaken`,THEME_AND_STYLING:`
506
+ ${e} Theme & Styling:
507
+ - Prioritize the ${t} Design System utilities
1348
508
  - Avoid custom CSS or other framework classes
1349
509
  - Do not use inline styles
1350
- - Consistent ${uiLibrary} theme application across all components
510
+ - Consistent ${e} theme application across all components
1351
511
  - Custom theme variables properly defined and scoped
1352
- - ${uiLibrary} icon fonts properly loaded and optimized
1353
- - Brand colors integrated with ${uiLibrary} component themes`
1354
- });
1355
-
1356
- // packages/kendo-ui-agent/src/lib/templates/tailwind-bridge.ts
1357
- var tailwindBridgeExample = `
1358
- @import "tailwindcss/theme.css";
1359
- @import "tailwindcss/preflight.css";
1360
- @import "tailwindcss/utilities.css";
1361
-
1362
- :root {
1363
- /* The generated Kendo Theme CSS variables */
1364
- }
1365
-
1366
-
1367
- @theme inline { /* The Tailwind bridge mapping */
1368
- /* Misc */
1369
- --color-app-surface: var( --kendo-color-app-surface );
1370
- --color-on-app-surface: var( --kendo-color-on-app-surface );
1371
- --color-subtle: var( --kendo-color-subtle );
1372
- --color-surface: var( --kendo-color-surface );
1373
- --color-surface-alt: var( --kendo-color-surface-alt );
1374
- --color-border: var( --kendo-color-border );
1375
- --color-border-alt: var( --kendo-color-border-alt );
1376
- /* Base */
1377
- --color-base-subtle: var( --kendo-color-base-subtle );
1378
- --color-base-subtle-hover: var( --kendo-color-base-subtle-hover );
1379
- --color-base-subtle-active: var( --kendo-color-base-subtle-active );
1380
- --color-base: var( --kendo-color-base );
1381
- --color-base-hover: var( --kendo-color-base-hover );
1382
- --color-base-active: var( --kendo-color-base-active );
1383
- --color-base-emphasis: var( --kendo-color-base-emphasis );
1384
- --color-base-on-subtle: var( --kendo-color-base-on-subtle );
1385
- --color-on-base: var( --kendo-color-on-base );
1386
- --color-base-on-surface: var( --kendo-color-base-on-surface );
1387
- /* Primary */
1388
- --color-primary-subtle: var( --kendo-color-primary-subtle );
1389
- --color-primary-subtle-hover: var( --kendo-color-primary-subtle-hover );
1390
- --color-primary-subtle-active: var( --kendo-color-primary-subtle-active );
1391
- --color-primary: var( --kendo-color-primary );
1392
- --color-primary-hover: var( --kendo-color-primary-hover );
1393
- --color-primary-active: var( --kendo-color-primary-active );
1394
- --color-primary-emphasis: var( --kendo-color-primary-emphasis );
1395
- --color-primary-on-subtle: var( --kendo-color-primary-on-subtle );
1396
- --color-on-primary: var( --kendo-color-on-primary );
1397
- --color-primary-on-surface: var( --kendo-color-primary-on-surface );
1398
- /* Secondary */
1399
- --color-secondary-subtle: var( --kendo-color-secondary-subtle );
1400
- --color-secondary-subtle-hover: var( --kendo-color-secondary-subtle-hover );
1401
- --color-secondary-subtle-active: var( --kendo-color-secondary-subtle-active );
1402
- --color-secondary: var( --kendo-color-secondary );
1403
- --color-secondary-hover: var( --kendo-color-secondary-hover );
1404
- --color-secondary-active: var( --kendo-color-secondary-active );
1405
- --color-secondary-emphasis: var( --kendo-color-secondary-emphasis );
1406
- --color-secondary-on-subtle: var( --kendo-color-secondary-on-subtle );
1407
- --color-on-secondary: var( --kendo-color-on-secondary );
1408
- --color-secondary-on-surface: var( --kendo-color-secondary-on-surface );
1409
- /* Tertiary */
1410
- --color-tertiary-subtle: var( --kendo-color-tertiary-subtle );
1411
- --color-tertiary-subtle-hover: var( --kendo-color-tertiary-subtle-hover );
1412
- --color-tertiary-subtle-active: var( --kendo-color-tertiary-subtle-active );
1413
- --color-tertiary: var( --kendo-color-tertiary );
1414
- --color-tertiary-hover: var( --kendo-color-tertiary-hover );
1415
- --color-tertiary-active: var( --kendo-color-tertiary-active );
1416
- --color-tertiary-emphasis: var( --kendo-color-tertiary-emphasis );
1417
- --color-tertiary-on-subtle: var( --kendo-color-tertiary-on-subtle );
1418
- --color-on-tertiary: var( --kendo-color-on-tertiary );
1419
- --color-tertiary-on-surface: var( --kendo-color-tertiary-on-surface );
1420
- /* Info */
1421
- --color-info-subtle: var( --kendo-color-info-subtle );
1422
- --color-info-subtle-hover: var( --kendo-color-info-subtle-hover );
1423
- --color-info-subtle-active: var( --kendo-color-info-subtle-active );
1424
- --color-info: var( --kendo-color-info );
1425
- --color-info-hover: var( --kendo-color-info-hover );
1426
- --color-info-active: var( --kendo-color-info-active );
1427
- --color-info-emphasis: var( --kendo-color-info-emphasis );
1428
- --color-info-on-subtle: var( --kendo-color-info-on-subtle );
1429
- --color-on-info: var( --kendo-color-on-info );
1430
- --color-info-on-surface: var( --kendo-color-info-on-surface );
1431
- /* Success */
1432
- --color-success-subtle: var( --kendo-color-success-subtle );
1433
- --color-success-subtle-hover: var( --kendo-color-success-subtle-hover );
1434
- --color-success-subtle-active: var( --kendo-color-success-subtle-active );
1435
- --color-success: var( --kendo-color-success );
1436
- --color-success-hover: var( --kendo-color-success-hover );
1437
- --color-success-active: var( --kendo-color-success-active );
1438
- --color-success-emphasis: var( --kendo-color-success-emphasis );
1439
- --color-success-on-subtle: var( --kendo-color-success-on-subtle );
1440
- --color-on-success: var( --kendo-color-on-success );
1441
- --color-success-on-surface: var( --kendo-color-success-on-surface );
1442
- /* Warning */
1443
- --color-warning-subtle: var( --kendo-color-warning-subtle );
1444
- --color-warning-subtle-hover: var( --kendo-color-warning-subtle-hover );
1445
- --color-warning-subtle-active: var( --kendo-color-warning-subtle-active );
1446
- --color-warning: var( --kendo-color-warning );
1447
- --color-warning-hover: var( --kendo-color-warning-hover );
1448
- --color-warning-active: var( --kendo-color-warning-active );
1449
- --color-warning-emphasis: var( --kendo-color-warning-emphasis );
1450
- --color-warning-on-subtle: var( --kendo-color-warning-on-subtle );
1451
- --color-on-warning: var( --kendo-color-on-warning );
1452
- --color-warning-on-surface: var( --kendo-color-warning-on-surface );
1453
- /* Error */
1454
- --color-error-subtle: var( --kendo-color-error-subtle );
1455
- --color-error-subtle-hover: var( --kendo-color-error-subtle-hover );
1456
- --color-error-subtle-active: var( --kendo-color-error-subtle-active );
1457
- --color-error: var( --kendo-color-error );
1458
- --color-error-hover: var( --kendo-color-error-hover );
1459
- --color-error-active: var( --kendo-color-error-active );
1460
- --color-error-emphasis: var( --kendo-color-error-emphasis );
1461
- --color-error-on-subtle: var( --kendo-color-error-on-subtle );
1462
- --color-on-error: var( --kendo-color-on-error );
1463
- --color-error-on-surface: var( --kendo-color-error-on-surface );
1464
- /* Light */
1465
- --color-light-subtle: var( --kendo-color-light-subtle );
1466
- --color-light-subtle-hover: var( --kendo-color-light-subtle-hover );
1467
- --color-light-subtle-active: var( --kendo-color-light-subtle-active );
1468
- --color-light: var( --kendo-color-light );
1469
- --color-light-hover: var( --kendo-color-light-hover );
1470
- --color-light-active: var( --kendo-color-light-active );
1471
- --color-light-emphasis: var( --kendo-color-light-emphasis );
1472
- --color-light-on-subtle: var( --kendo-color-light-on-subtle );
1473
- --color-on-light: var( --kendo-color-on-light );
1474
- --color-light-on-surface: var( --kendo-color-light-on-surface );
1475
- /* Dark */
1476
- --color-dark-subtle: var( --kendo-color-dark-subtle );
1477
- --color-dark-subtle-hover: var( --kendo-color-dark-subtle-hover );
1478
- --color-dark-subtle-active: var( --kendo-color-dark-subtle-active );
1479
- --color-dark: var( --kendo-color-dark );
1480
- --color-dark-hover: var( --kendo-color-dark-hover );
1481
- --color-dark-active: var( --kendo-color-dark-active );
1482
- --color-dark-emphasis: var( --kendo-color-dark-emphasis );
1483
- --color-dark-on-subtle: var( --kendo-color-dark-on-subtle );
1484
- --color-on-dark: var( --kendo-color-on-dark );
1485
- --color-dark-on-surface: var( --kendo-color-dark-on-surface );
1486
- /* Inverse */
1487
- --color-inverse-subtle: var( --kendo-color-inverse-subtle );
1488
- --color-inverse-subtle-hover: var( --kendo-color-inverse-subtle-hover );
1489
- --color-inverse-subtle-active: var( --kendo-color-inverse-subtle-active );
1490
- --color-inverse: var( --kendo-color-inverse );
1491
- --color-inverse-hover: var( --kendo-color-inverse-hover );
1492
- --color-inverse-active: var( --kendo-color-inverse-active );
1493
- --color-inverse-emphasis: var( --kendo-color-inverse-emphasis );
1494
- --color-inverse-on-subtle: var( --kendo-color-inverse-on-subtle );
1495
- --color-on-inverse: var( --kendo-color-on-inverse );
1496
- --color-inverse-on-surface: var( --kendo-color-inverse-on-surface );
1497
- /* Series A */
1498
- --color-series-a: var( --kendo-color-series-a );
1499
- --color-series-a-bold: var( --kendo-color-series-a-bold );
1500
- --color-series-a-bolder: var( --kendo-color-series-a-bolder );
1501
- --color-series-a-subtle: var( --kendo-color-series-a-subtle );
1502
- --color-series-a-subtler: var( --kendo-color-series-a-subtler );
1503
- /* Series B */
1504
- --color-series-b: var( --kendo-color-series-b );
1505
- --color-series-b-bold: var( --kendo-color-series-b-bold );
1506
- --color-series-b-bolder: var( --kendo-color-series-b-bolder );
1507
- --color-series-b-subtle: var( --kendo-color-series-b-subtle );
1508
- --color-series-b-subtler: var( --kendo-color-series-b-subtler );
1509
- /* Series C */
1510
- --color-series-c: var( --kendo-color-series-c );
1511
- --color-series-c-bold: var( --kendo-color-series-c-bold );
1512
- --color-series-c-bolder: var( --kendo-color-series-c-bolder );
1513
- --color-series-c-subtle: var( --kendo-color-series-c-subtle );
1514
- --color-series-c-subtler: var( --kendo-color-series-c-subtler );
1515
- /* Series D */
1516
- --color-series-d: var( --kendo-color-series-d );
1517
- --color-series-d-bold: var( --kendo-color-series-d-bold );
1518
- --color-series-d-bolder: var( --kendo-color-series-d-bolder );
1519
- --color-series-d-subtle: var( --kendo-color-series-d-subtle );
1520
- --color-series-d-subtler: var( --kendo-color-series-d-subtler );
1521
- /* Series E */
1522
- --color-series-e: var( --kendo-color-series-e );
1523
- --color-series-e-bold: var( --kendo-color-series-e-bold );
1524
- --color-series-e-bolder: var( --kendo-color-series-e-bolder );
1525
- --color-series-e-subtle: var( --kendo-color-series-e-subtle );
1526
- --color-series-e-subtler: var( --kendo-color-series-e-subtler );
1527
- /* Series F */
1528
- --color-series-f: var( --kendo-color-series-f );
1529
- --color-series-f-bold: var( --kendo-color-series-f-bold );
1530
- --color-series-f-bolder: var( --kendo-color-series-f-bolder );
1531
- --color-series-f-subtle: var( --kendo-color-series-f-subtle );
1532
- --color-series-f-subtler: var( --kendo-color-series-f-subtler );
1533
-
1534
- /* Typography */
1535
- --font-sans: var( --kendo-font-family-sans );
1536
- --font-serif: var( --kendo-font-family-sans-serif );
1537
- --font-mono: var( --kendo-font-family-monospace );
1538
- --text-xs: var( --kendo-font-size-xs );
1539
- --text-xs--line-height: var( --kendo-line-height-xs );
1540
- --text-sm: var( --kendo-font-size-sm );
1541
- --text-sm--line-height: var( --kendo-line-height-sm );
1542
- --text-base: var( --kendo-font-size );
1543
- --text-base--line-height: var( --kendo-line-height );
1544
- --text-lg: var( --kendo-font-size-lg );
1545
- --text-lg--line-height: var( --kendo-line-height-lg );
1546
-
1547
- --radius-none: var( --kendo-border-radius-none );
1548
- --radius-xs: var( --kendo-border-radius-xs );
1549
- --radius-sm: var( --kendo-border-radius-sm );
1550
- --radius-md: var( --kendo-border-radius-md );
1551
- --radius-lg: var( --kendo-border-radius-lg );
1552
- --radius-xl: var( --kendo-border-radius-xl );
1553
- --radius-2xl: var( --kendo-border-radius-xxl );
1554
- --radius-3xl: var( --kendo-border-radius-xxxl );
1555
- --radius-4xl: 1.5rem;
1556
- --radius-full: var( --kendo-border-radius-full );
1557
-
1558
- /* Breakpoints */
1559
- --breakpoint-sm: 576px;
1560
- --breakpoint-md: 768px;
1561
- --breakpoint-lg: 992px;
1562
- --breakpoint-xl: 1200px;
1563
- --breakpoint-2xl: 1400px;
1564
- }`;
1565
-
1566
- // packages/kendo-ui-agent/src/lib/tools-factory.ts
1567
- function formatApiRefItemFromJson(rawValue, component) {
1568
- let data;
1569
- try {
1570
- data = JSON.parse(rawValue);
1571
- } catch {
1572
- return rawValue;
1573
- }
1574
- const item = data?.Item;
1575
- if (!item) {
1576
- return rawValue;
1577
- }
1578
- const sectionParts = [];
1579
- const name = item.FullName ?? item.Name ?? "";
1580
- const type = item.Type ?? "";
1581
- const summary = item.Summary ?? "";
1582
- const syntax = item.SyntaxContent ?? "";
1583
- sectionParts.push(
1584
- `## API Reference Item
1585
- - Name: ${name}
1586
- - Type: ${type}
1587
- - Summary: ${summary}
1588
- - Syntax: ${syntax}`
1589
- );
1590
- const returnTypeItems = data.RelatedItemsByType?.["return_type"];
1591
- if (returnTypeItems?.length) {
1592
- const returnType = returnTypeItems[0].Text;
1593
- if (returnType) {
1594
- sectionParts.push(`- Return Type: ${returnType}`);
1595
- }
1596
- }
1597
- const examples = item.Examples ?? [];
1598
- if (examples.length > 0) {
1599
- let exampleSection = "## Examples\n";
1600
- let exampleIndex = 0;
1601
- for (const example of examples) {
1602
- const exComponent = (example.Component ?? "").toLowerCase();
1603
- const compLower = component.toLowerCase();
1604
- if (exComponent && exComponent !== compLower && exComponent !== "general") {
1605
- continue;
1606
- }
1607
- exampleIndex += 1;
1608
- const code = example.Code ?? "";
1609
- exampleSection += `### Example ${exampleIndex}
512
+ - ${e} icon fonts properly loaded and optimized
513
+ - Brand colors integrated with ${e} component themes`});function ft(e,t){let n;try{n=JSON.parse(e)}catch{return e}let o=n?.Item;if(!o)return e;let s=[],r=o.FullName??o.Name??"",a=o.Type??"",i=o.Summary??"",d=o.SyntaxContent??"";s.push(`## API Reference Item
514
+ - Name: ${r}
515
+ - Type: ${a}
516
+ - Summary: ${i}
517
+ - Syntax: ${d}`);let m=n.RelatedItemsByType?.return_type;if(m?.length){let p=m[0].Text;p&&s.push(`- Return Type: ${p}`)}let b=o.Examples??[];if(b.length>0){let p=`## Examples
518
+ `,l=0;for(let y of b){let v=(y.Component??"").toLowerCase(),S=t.toLowerCase();if(v&&v!==S&&v!=="general")continue;l+=1;let k=y.Code??"";p+=`### Example ${l}
1610
519
  \`\`\`
1611
- ${code}
520
+ ${k}
1612
521
  \`\`\`
1613
- `;
1614
- }
1615
- if (exampleIndex > 0) {
1616
- sectionParts.push(exampleSection);
1617
- }
1618
- }
1619
- const related = data.RelatedItemsByType ?? {};
1620
- const additionalContextItems = [];
1621
- for (const [relationType, relatedItems] of Object.entries(related)) {
1622
- if (relationType === "return_type" || relationType === "render_fragment") {
1623
- continue;
1624
- }
1625
- for (const relatedItem of relatedItems ?? []) {
1626
- const fullName = relatedItem.FullName ?? "";
1627
- const shortText = relatedItem.ShortText ?? "";
1628
- additionalContextItems.push(`### ${fullName} (${relationType})
1629
- ${shortText}`);
1630
- }
1631
- }
1632
- if (additionalContextItems.length > 0) {
1633
- sectionParts.push("## Additional Context\n" + additionalContextItems.join("\n---\n"));
1634
- }
1635
- return sectionParts.join("\n\n");
1636
- }
1637
- var LAYOUT_MODE = process.env.KENDO_UIA_LAYOUT_MODE || "utils";
1638
- function createOrchestratorTool(config, templateOptions, contextApi2) {
1639
- const {
1640
- name,
1641
- title,
1642
- description,
1643
- layoutAssistantName: layoutAssistantName2,
1644
- codeAssistantName: codeAssistantName2,
1645
- styleAssistantName: styleAssistantName2,
1646
- iconAssistantName: iconAssistantName2,
1647
- accessibilityAssistantName: accessibilityAssistantName2,
1648
- figmaD2CToolName: figmaD2CToolName2,
1649
- suiteName,
1650
- libKey,
1651
- components
1652
- } = config;
1653
- const tool = new UIAgentTool(
1654
- name,
1655
- {
1656
- title,
1657
- description,
1658
- requiredAccess: config.requiredAccess,
1659
- inputSchema: {
1660
- userIntent: z4.string().describe(
1661
- `Detailed description and intent of what the user wants to build. Include the type of page/component, main functionality, visual requirements, and any specific ${suiteName} components you want to use.`
1662
- ),
1663
- needsComponentsDocsConfidence: z4.number().min(0).max(1).default(1).describe(
1664
- "Confidence (0-1) to include Component Documentation assistance. Default is 1."
1665
- ),
1666
- needsLayoutConfidence: z4.number().min(0).max(1).default(0).describe(
1667
- "Confidence (0-1) to include Layout assistance. Default is 0."
1668
- ),
1669
- needsStylingConfidence: z4.number().min(0).max(1).default(0).describe(
1670
- "Confidence (0-1) to include Theming/Styling assistance. Default is 0."
1671
- ),
1672
- needsResponsiveBehaviorConfidence: z4.number().min(0).max(1).default(0).describe(
1673
- "Confidence (0-1) to include Responsive Behavior assistance. Default is 0."
1674
- ),
1675
- needsIconsConfidence: z4.number().min(0).max(1).default(0).describe(
1676
- "Confidence (0-1) to include Icons assistance. Default is 0."
1677
- ),
1678
- needsFigmaD2CConfidence: z4.boolean().describe("Whether to include Figma D2C assistance. If the prompt includes a Figma URL always make sure to set to true.").default(false),
1679
- componentsNeeded: z4.array(z4.enum(components)).optional().describe(
1680
- `Optional list of specific ${suiteName} components needed for the project.`
1681
- )
1682
- }
1683
- },
1684
- async ({
1685
- userIntent,
1686
- needsComponentsDocsConfidence,
1687
- needsLayoutConfidence,
1688
- needsStylingConfidence,
1689
- needsResponsiveBehaviorConfidence,
1690
- needsIconsConfidence,
1691
- needsFigmaD2CConfidence,
1692
- componentsNeeded
1693
- }, { _meta }) => {
1694
- log("UI Orchestrator called with:", {
1695
- userIntent,
1696
- needsComponentsDocsConfidence,
1697
- needsLayoutConfidence,
1698
- needsStylingConfidence,
1699
- needsResponsiveBehaviorConfidence,
1700
- needsIconsConfidence
1701
- });
1702
- try {
1703
- await contextApi2.recordOrchestratorUserRequest({
1704
- meta: {
1705
- userIntent,
1706
- componentsNeeded,
1707
- _meta
1708
- }
1709
- });
1710
- } catch (error) {
1711
- throw getGrpcError(error);
1712
- }
1713
- const clientCapabilities = tool.server?.server.getClientCapabilities?.();
1714
- const supportsElicitation = clientCapabilities?.elicitation;
1715
- let forceIncludeCustomTheming;
1716
- if (supportsElicitation && needsStylingConfidence > 0.3 && needsStylingConfidence <= 0.6) {
1717
- const result = await tool.server?.server.elicitInput({
1718
- message: "I was unable to determine if you need custom Kendo Theme assistant. Can you please confirm?",
1719
- requestedSchema: {
1720
- type: "object",
1721
- properties: {
1722
- includeCustomTheming: {
1723
- type: "boolean",
1724
- description: "Whether to include Custom Theming assistance in the workflow."
1725
- }
1726
- },
1727
- required: ["includeCustomTheming"]
1728
- }
1729
- });
1730
- if (result?.action === "accept" && result.content?.includeCustomTheming) {
1731
- forceIncludeCustomTheming = true;
1732
- }
1733
- }
1734
- const response = renderOrchestratorResponse(
1735
- {
1736
- name,
1737
- userIntent,
1738
- includeComponentsDocs: needsComponentsDocsConfidence > 0.3,
1739
- includeTheming: needsStylingConfidence > 0.6 || !!forceIncludeCustomTheming,
1740
- includeLayout: needsLayoutConfidence > 0.5,
1741
- includeIcons: needsIconsConfidence > 0.6,
1742
- includeResponsive: needsLayoutConfidence > 0.5 && needsResponsiveBehaviorConfidence > 0.4,
1743
- includeFigmaD2C: needsFigmaD2CConfidence,
1744
- layoutAssistantName: layoutAssistantName2,
1745
- codeAssistantName: codeAssistantName2,
1746
- styleAssistantName: styleAssistantName2,
1747
- iconAssistantName: iconAssistantName2,
1748
- accessibilityAssistantName: accessibilityAssistantName2,
1749
- figmaD2CToolName: figmaD2CToolName2,
1750
- suiteName,
1751
- libKey,
1752
- layoutMode: LAYOUT_MODE,
1753
- components: componentsNeeded
1754
- },
1755
- templateOptions
1756
- );
1757
- return {
1758
- content: [
1759
- {
1760
- type: "text",
1761
- text: response
1762
- }
1763
- ]
1764
- };
1765
- }
1766
- );
1767
- return tool;
1768
- }
1769
- function createAssistantOrchestratorTool(config, contextApi2) {
1770
- const {
1771
- name,
1772
- title,
1773
- description,
1774
- iconAssistantName: iconAssistantName2,
1775
- codeAssistantName: codeAssistantName2,
1776
- suiteName,
1777
- libKey,
1778
- components
1779
- } = config;
1780
- const tool = new UIAgentTool(
1781
- name,
1782
- {
1783
- title,
1784
- description,
1785
- inputSchema: {
1786
- userIntent: z4.string().describe(
1787
- `Describe what you want to build or what components you're looking for. Include the type of functionality, features, or UI elements you need from ${suiteName}.`
1788
- ),
1789
- needsIconsConfidence: z4.number().min(0).max(1).default(0.7).describe(
1790
- "Confidence (0-1) to include Icons assistance. Default is 0.7."
1791
- ),
1792
- componentsNeeded: z4.array(z4.enum(components)).optional().describe(
1793
- `Optional list of specific ${suiteName} components you want to learn about.`
1794
- )
1795
- },
1796
- requiredAccess: config.requiredAccess
1797
- },
1798
- async ({
1799
- userIntent,
1800
- needsIconsConfidence,
1801
- componentsNeeded
1802
- }, { _meta }) => {
1803
- log("Assistant Orchestrator called with:", {
1804
- userIntent,
1805
- needsIconsConfidence,
1806
- componentsNeeded
1807
- });
1808
- try {
1809
- await contextApi2.recordOrchestratorUserRequest({
1810
- meta: {
1811
- userIntent,
1812
- componentsNeeded,
1813
- _meta
1814
- }
1815
- });
1816
- } catch (error) {
1817
- throw getGrpcError(error);
1818
- }
1819
- const response = renderAssistantOrchestratorResponse({
1820
- name,
1821
- userIntent,
1822
- includeComponentsDocs: true,
1823
- // Always true for assistant mode
1824
- includeIcons: needsIconsConfidence > 0.5,
1825
- codeAssistantName: codeAssistantName2,
1826
- iconAssistantName: iconAssistantName2,
1827
- suiteName,
1828
- libKey,
1829
- components: componentsNeeded
1830
- });
1831
- return {
1832
- content: [
1833
- {
1834
- type: "text",
1835
- text: response
1836
- }
1837
- ]
1838
- };
1839
- }
1840
- );
1841
- return tool;
1842
- }
1843
- function createLayoutAssistantTool(config, contextApi2) {
1844
- const {
1845
- name,
1846
- title,
1847
- description,
1848
- suiteName: _suiteName,
1849
- libKey,
1850
- getPreContent
1851
- } = config;
1852
- return new UIAgentTool(
1853
- name,
1854
- {
1855
- title,
1856
- description,
1857
- requiredAccess: LAYOUT_MODE === "utils" ? config.requiredAccess : ["none"],
1858
- inputSchema: {
1859
- prompt: z4.string().describe(
1860
- `An enhanced prompt describing the HTML layout structure, design requirements or specific visual effects you want to achieve.`
1861
- ),
1862
- includeBuildingBlockExamples: z4.boolean().describe(
1863
- "Whether to include building block examples. Defaults to false."
1864
- ).default(false)
1865
- }
1866
- },
1867
- async ({ prompt, includeBuildingBlockExamples }, { _meta }) => {
1868
- log("Layout Assistant called with:", {
1869
- prompt,
1870
- includeBuildingBlockExamples
1871
- });
1872
- try {
1873
- const cssResponse = await contextApi2.queryCssUtils({ query: prompt }, { _meta });
1874
- let finalMarkdown = cssResponse.values.join("\n") || "No CSS utilities found for the given prompt.";
1875
- const preContent = getPreContent?.() ?? "";
1876
- const buildLayout = (buildingBlockMd) => {
1877
- return `${preContent}
522
+ `}l>0&&s.push(p)}let g=n.RelatedItemsByType??{},f=[];for(let[p,l]of Object.entries(g))if(!(p==="return_type"||p==="render_fragment"))for(let y of l??[]){let v=y.FullName??"",S=y.ShortText??"";f.push(`### ${v} (${p})
523
+ ${S}`)}return f.length>0&&s.push(`## Additional Context
524
+ `+f.join(`
525
+ ---
526
+ `)),s.join(`
527
+
528
+ `)}function fe(e,t,n){let{name:o,title:s,description:r,layoutAssistantName:a,codeAssistantName:i,styleAssistantName:d,iconAssistantName:m,accessibilityAssistantName:b,suiteName:g,libKey:f,components:p}=e,l=new w(o,{title:s,description:r,requiredAccess:e.requiredAccess,inputSchema:{userIntent:A.string().describe(`Detailed description and intent of what the user wants to build. Include the type of page/component, main functionality, visual requirements, and any specific ${g} components you want to use.`),needsComponentsDocsConfidence:A.number().min(0).max(1).default(1).describe("Confidence (0-1) to include Component Documentation assistance. Default is 1."),needsLayoutConfidence:A.number().min(0).max(1).default(0).describe("Confidence (0-1) to include Layout assistance. Default is 0."),needsStylingConfidence:A.number().min(0).max(1).default(0).describe("Confidence (0-1) to include Theming/Styling assistance. Default is 0."),needsResponsiveBehaviorConfidence:A.number().min(0).max(1).default(0).describe("Confidence (0-1) to include Responsive Behavior assistance. Default is 0."),needsIconsConfidence:A.number().min(0).max(1).default(0).describe("Confidence (0-1) to include Icons assistance. Default is 0."),componentsNeeded:A.array(A.enum(p)).optional().describe(`Optional list of specific ${g} components needed for the project.`)}},async({userIntent:y,needsComponentsDocsConfidence:v,needsLayoutConfidence:S,needsStylingConfidence:k,needsResponsiveBehaviorConfidence:I,needsIconsConfidence:te,componentsNeeded:oe},{_meta:Ze})=>{h("UI Orchestrator called with:",{userIntent:y,needsComponentsDocsConfidence:v,needsLayoutConfidence:S,needsStylingConfidence:k,needsResponsiveBehaviorConfidence:I,needsIconsConfidence:te});try{await n.recordOrchestratorUserRequest({meta:{userIntent:y,componentsNeeded:oe,_meta:Ze}})}catch($){throw R($)}let et=l.server?.server.getClientCapabilities?.()?.elicitation,ne;if(et&&k>.3&&k<=.6){let $=await l.server?.server.elicitInput({message:"I was unable to determine if you need custom Kendo Theme assistant. Can you please confirm?",requestedSchema:{type:"object",properties:{includeCustomTheming:{type:"boolean",description:"Whether to include Custom Theming assistance in the workflow."}},required:["includeCustomTheming"]}});$?.action==="accept"&&$.content?.includeCustomTheming&&(ne=!0)}return{content:[{type:"text",text:U({name:o,userIntent:y,includeComponentsDocs:v>.3,includeTheming:k>.6||!!ne,includeLayout:S>.5,includeIcons:te>.6,includeResponsive:S>.5&&I>.4,layoutAssistantName:a,codeAssistantName:i,styleAssistantName:d,iconAssistantName:m,accessibilityAssistantName:b,suiteName:g,libKey:f,components:oe},t)}]}});return l}function ye(e,t){let{name:n,title:o,description:s,iconAssistantName:r,codeAssistantName:a,suiteName:i,libKey:d,components:m}=e;return new w(n,{title:o,description:s,inputSchema:{userIntent:A.string().describe(`Describe what you want to build or what components you're looking for. Include the type of functionality, features, or UI elements you need from ${i}.`),needsIconsConfidence:A.number().min(0).max(1).default(.7).describe("Confidence (0-1) to include Icons assistance. Default is 0.7."),componentsNeeded:A.array(A.enum(m)).optional().describe(`Optional list of specific ${i} components you want to learn about.`)},requiredAccess:e.requiredAccess},async({userIntent:g,needsIconsConfidence:f,componentsNeeded:p},{_meta:l})=>{h("Assistant Orchestrator called with:",{userIntent:g,needsIconsConfidence:f,componentsNeeded:p});try{await t.recordOrchestratorUserRequest({meta:{userIntent:g,componentsNeeded:p,_meta:l}})}catch(v){throw R(v)}return{content:[{type:"text",text:H({name:n,userIntent:g,includeComponentsDocs:!0,includeIcons:f>.5,codeAssistantName:a,iconAssistantName:r,suiteName:i,libKey:d,components:p})}]}})}function be(e,t){let{name:n,title:o,description:s,suiteName:r,libKey:a,getPreContent:i}=e;return new w(n,{title:o,description:s,requiredAccess:e.requiredAccess,inputSchema:{prompt:A.string().describe("An enhanced prompt describing the HTML layout structure, design requirements or specific visual effects you want to achieve."),includeBuildingBlockExamples:A.boolean().describe("Whether to include building block examples. Defaults to false.").default(!1)}},async({prompt:d,includeBuildingBlockExamples:m},{_meta:b})=>{h("Layout Assistant called with:",{prompt:d,includeBuildingBlockExamples:m});try{let f=(await t.queryCssUtils({query:d},{_meta:b})).values.join(`
529
+ `)||"No CSS utilities found for the given prompt.",p=i?.()??"",l=y=>`${p}
1878
530
 
1879
531
  # Kendo Design System CSS Utilities
1880
532
 
1881
- ${finalMarkdown}
1882
- ${buildingBlockMd ?? ""}
1883
- `;
1884
- };
1885
- if (includeBuildingBlockExamples) {
1886
- try {
1887
- const buildingBlocksResponse = await contextApi2.queryBuildingBlocks({
1888
- query: prompt,
1889
- lib_name: libKey
1890
- }, { _meta });
1891
- let buildingBlockMd = "";
1892
- if (buildingBlocksResponse.items?.length > 0) {
1893
- buildingBlockMd = `
533
+ ${f}
534
+ ${y??""}
535
+ `;if(m)try{let y=await t.queryBuildingBlocks({query:d,lib_name:a},{_meta:b}),v="";y.items?.length>0&&(v=`
1894
536
  ## Building Blocks Examples
1895
537
 
1896
538
  The examples here are for demonstration purpose how CSS utils can be implemented in various building blocks.
1897
539
  However, consider your own design requirements and specifics in order to implement your templates/building blocks correctly.
1898
540
 
1899
- ${buildingBlocksResponse.items.map(
1900
- (item) => `
1901
- ### ${item.name}
541
+ ${y.items.map(S=>`
542
+ ### ${S.name}
1902
543
 
1903
- ${item.description}
544
+ ${S.description}
1904
545
 
1905
546
  \`\`\`code
1906
- ${item.code}
547
+ ${S.code}
1907
548
  \`\`\`
1908
- `
1909
- ).join("\n")}`;
1910
- }
1911
- finalMarkdown = buildLayout(buildingBlockMd);
1912
- } catch (buildingBlockError) {
1913
- log("Error calling building-blocks service:", buildingBlockError);
1914
- finalMarkdown = buildLayout();
1915
- }
1916
- } else {
1917
- finalMarkdown = buildLayout();
1918
- }
1919
- return {
1920
- content: [
1921
- {
1922
- type: "text",
1923
- text: finalMarkdown
1924
- }
1925
- ]
1926
- };
1927
- } catch (error) {
1928
- throw getGrpcError(error);
1929
- }
1930
- }
1931
- );
1932
- }
1933
- function createStyleAssistantTool(config, contextApi2) {
1934
- const { name, title, description, libKey: _libKey, getPreContent } = config;
1935
- return new UIAgentTool(
1936
- name,
1937
- {
1938
- title,
1939
- description,
1940
- requiredAccess: config.requiredAccess,
1941
- inputSchema: {
1942
- prompt: z4.string().describe(
1943
- `A natural language description of the desired visual style or theme. For example: 'Create a modern dark theme with high contrast'.`
1944
- )
1945
- }
1946
- },
1947
- async ({ prompt }, { _meta }) => {
1948
- log("Style Assistant called with:", { prompt });
1949
- let formattedCSS = "";
1950
- try {
1951
- const result = await contextApi2.queryThemeGenerate({ prompt }, { _meta });
1952
- if (result.variables_json) {
1953
- const theme = JSON.parse(result.variables_json);
1954
- let cssBlocks = [];
1955
- if (theme) {
1956
- for (const key of Object.keys(theme)) {
1957
- if (typeof theme[key] === "string") {
1958
- cssBlocks.push(`${key}: ${theme[key]}`);
1959
- }
1960
- }
1961
- }
1962
- formattedCSS = cssBlocks.join("\n\n");
1963
- }
1964
- } catch (error) {
1965
- throw getGrpcError(error);
1966
- }
1967
- const preContent = getPreContent?.() ?? "";
1968
- const response = formattedCSS ? `Use the following CSS variables to style the web application, including colors, typography, spacing, and component appearance.
549
+ `).join(`
550
+ `)}`),f=l(v)}catch(y){h("Error calling building-blocks service:",y),f=l()}else f=l();return{content:[{type:"text",text:f}]}}catch(g){throw R(g)}})}function Ae(e,t){let{name:n,title:o,description:s,libKey:r,getPreContent:a}=e;return new w(n,{title:o,description:s,requiredAccess:e.requiredAccess,inputSchema:{prompt:A.string().describe("A natural language description of the desired visual style or theme. For example: 'Create a modern dark theme with high contrast'.")}},async({prompt:i},{_meta:d})=>{h("Style Assistant called with:",{prompt:i});let m="";try{let f=await t.queryThemeGenerate({prompt:i},{_meta:d});if(f.variables_json){let p=JSON.parse(f.variables_json),l=[];if(p)for(let y of Object.keys(p))typeof p[y]=="string"&&l.push(`${y}: ${p[y]}`);m=l.join(`
551
+
552
+ `)}}catch(f){throw R(f)}let b=a?.()??"";return{content:[{type:"text",text:m?`Use the following CSS variables to style the web application, including colors, typography, spacing, and component appearance.
1969
553
  Ensure the variables are applied consistently across all relevant elements.
1970
554
  Do NOT set any inline styles. CSS variables should be defined in global or component-level CSS files, or via supported theming mechanisms.
1971
555
 
1972
- ${preContent}
556
+ ${b}
1973
557
 
1974
558
  ## Generated CSS Variables
1975
559
 
1976
560
  \`\`\`css
1977
- ${formattedCSS}
561
+ ${m}
1978
562
  \`\`\`
1979
- ` : "No CSS variables were generated for the given prompt.";
1980
- return {
1981
- content: [
1982
- {
1983
- type: "text",
1984
- text: response
1985
- },
1986
- LAYOUT_MODE === "tailwind" ? {
1987
- type: "text",
1988
- text: `Note: For layout and spacing, use Tailwind CSS utility classes to structure your layout and apply spacing between elements.
1989
- IMPORTANT: In order to use the Kendo Theme CSS variables to work in a Tailwind CSS project, make sure to configure Tailwind to allow custom CSS properties and use the generated CSS variables in your Tailwind configuration for colors, spacing, etc. This way you can leverage the design tokens generated by the Style Assistant while using Tailwind for layout and utility classes. Follow the tailwind_bridge_example provided as insperation for how to bridge Kendo Theme CSS variables with Tailwind CSS.
1990
-
1991
- <taiwind_bridge_example>
1992
- ${tailwindBridgeExample}
1993
- </taiwind_bridge_example>
1994
- `
1995
- } : LAYOUT_MODE === "vanilla" ? {
1996
- type: "text",
1997
- text: "Note: For layout and spacing, use vanilla CSS with custom styles including flexbox, grid, media queries, and relative units. Do NOT use any CSS utility framework classes."
1998
- } : {
1999
- type: "text",
2000
- text: "Note: For layout and spacing, use the Layout Assistant tool to get the appropriate Kendo CSS utility classes."
2001
- }
2002
- ]
2003
- };
2004
- }
2005
- );
2006
- }
2007
- function createIconSearchTool(config, contextApi2) {
2008
- const { name, title, description, libKey: _libKey, getPostContent } = config;
2009
- return new UIAgentTool(
2010
- name,
2011
- {
2012
- title,
2013
- description,
2014
- requiredAccess: config.requiredAccess,
2015
- inputSchema: {
2016
- query: z4.string().describe(
2017
- "A search query for finding icons. Be specific about the icon purpose, style, or action."
2018
- ),
2019
- limit: z4.number().min(0.1).max(1).default(0.1).describe(
2020
- `The proportion of matching icons to return (0.1 = 1 icon, 0.5 = 5 icons, 1.0 = many icons). Default is 0.1.`
2021
- )
2022
- }
2023
- },
2024
- async ({ query, limit }, { _meta }) => {
2025
- log("Icon Search called with:", { query, limit });
2026
- try {
2027
- const result = await contextApi2.queryIconsSearch({
2028
- query,
2029
- limit: limit * 100
2030
- }, { _meta });
2031
- const postContent = getPostContent?.() ?? "";
2032
- const response = `${result.values.join("\n\n")}
2033
-
2034
- ${postContent}`;
2035
- return {
2036
- content: [
2037
- {
2038
- type: "text",
2039
- text: response
2040
- }
2041
- ]
2042
- };
2043
- } catch (error) {
2044
- throw getGrpcError(error);
2045
- }
2046
- }
2047
- );
2048
- }
2049
- function createCodeAssistantTool(config, contextApi2) {
2050
- const {
2051
- name,
2052
- title,
2053
- description,
2054
- libKey,
2055
- suiteName: _suiteName,
2056
- components,
2057
- componentAliases,
2058
- getPostContent
2059
- } = config;
2060
- return new UIAgentTool(
2061
- name,
2062
- {
2063
- title,
2064
- description,
2065
- requiredAccess: config.requiredAccess,
2066
- inputSchema: {
2067
- query: z4.string().describe("The query to search for."),
2068
- component: z4.enum(components).describe(
2069
- "The component to search for. If not specified, use General."
2070
- )
2071
- }
2072
- },
2073
- async ({ query, component }, { _meta }) => {
2074
- log("Code Assistant called with:", { query, component });
2075
- let resolvedComponent = component;
2076
- if (componentAliases) {
2077
- const alias = componentAliases[component];
2078
- if (alias) {
2079
- resolvedComponent = alias;
2080
- }
2081
- }
2082
- try {
2083
- const response = await contextApi2.query({
2084
- query,
2085
- component: resolvedComponent?.toLowerCase() ?? "general",
2086
- lib_name: libKey,
2087
- text_matches_count: 3,
2088
- code_matches_count: 0,
2089
- allowed_types: ["documentation"]
2090
- }, { _meta });
2091
- const cleanedValues = response.values.map(
2092
- (val) => val.replace(/\0/g, "")
2093
- );
2094
- const postContent = getPostContent?.({ component }) ?? "";
2095
- const combinedResponse = `${cleanedValues.join("\n\n")}
2096
-
2097
- ${postContent}`;
2098
- return {
2099
- content: [
2100
- {
2101
- type: "text",
2102
- text: combinedResponse
2103
- }
2104
- ]
2105
- };
2106
- } catch (error) {
2107
- throw getGrpcError(error);
2108
- }
2109
- }
2110
- );
2111
- }
2112
- function createAccessibilityAssistantTool(config, contextApi2) {
2113
- const {
2114
- name,
2115
- title,
2116
- description,
2117
- libKey,
2118
- suiteName: _suiteName,
2119
- components,
2120
- componentAliases
2121
- } = config;
2122
- return new UIAgentTool(
2123
- name,
2124
- {
2125
- title,
2126
- description,
2127
- requiredAccess: config.requiredAccess,
2128
- inputSchema: {
2129
- query: z4.string().describe("The query to search for."),
2130
- component: z4.enum(components).describe(
2131
- "The component to search for. If not specified, use General."
2132
- ),
2133
- includeGeneralGuidelines: z4.boolean().default(false).describe(
2134
- "Set to true only on the first call to include comprehensive WCAG 2.2 Level AA general guidelines. After the first call, set to false to get only component-specific accessibility information. Default is false."
2135
- )
2136
- }
2137
- },
2138
- async ({ query, component, includeGeneralGuidelines }, { _meta }) => {
2139
- log("Accessibility Assistant called with:", {
2140
- query,
2141
- component,
2142
- includeGeneralGuidelines
2143
- });
2144
- let resolvedComponent = component;
2145
- if (componentAliases) {
2146
- const alias = componentAliases[component];
2147
- if (alias) {
2148
- resolvedComponent = alias;
2149
- }
2150
- }
2151
- try {
2152
- let finalResponse = "";
2153
- if (includeGeneralGuidelines) {
2154
- const generalGuidelines = getAccessibilityGuidelines();
2155
- finalResponse += "# WCAG 2.2 Level AA General Accessibility Guidelines\n\n";
2156
- finalResponse += generalGuidelines;
2157
- finalResponse += "\n\n---\n\n";
2158
- }
2159
- const response = await contextApi2.getApiRefMatches({
2160
- query,
2161
- component: resolvedComponent?.toLowerCase() ?? "general",
2162
- lib_name: libKey,
2163
- filters_json: '{"type":{"$in":["accessibility"]}}'
2164
- }, { _meta });
2165
- const cleanedValues = response.values.map(
2166
- (val) => val.replace(/\0/g, "")
2167
- );
2168
- const formattedValues = cleanedValues.map(
2169
- (val) => formatApiRefItemFromJson(val, resolvedComponent?.toLowerCase() ?? "general")
2170
- );
2171
- const componentResult = formattedValues.join("\n\n");
2172
- if (componentResult) {
2173
- if (includeGeneralGuidelines) {
2174
- finalResponse += "# Component-Specific Accessibility Information\n\n";
2175
- }
2176
- finalResponse += componentResult;
2177
- } else if (!includeGeneralGuidelines) {
2178
- finalResponse = "No component-specific accessibility guidelines found.";
2179
- }
2180
- return {
2181
- content: [
2182
- {
2183
- type: "text",
2184
- text: finalResponse
2185
- }
2186
- ]
2187
- };
2188
- } catch (error) {
2189
- throw getGrpcError(error);
2190
- }
2191
- }
2192
- );
2193
- }
2194
- function getGrpcError(error) {
2195
- const errorObj = error;
2196
- if (errorObj.code === 16 /* UNAUTHENTICATED */) {
2197
- return new Error(
2198
- "Error: You are not authenticated. Please verify the Telerik License Key provided is valid."
2199
- );
2200
- } else if (errorObj.code === 8 /* RESOURCE_EXHAUSTED */) {
2201
- return new Error(
2202
- `Error: You have exceeded the extension quota. Upgrade to subscription licensing to unlock full access. Message: ${errorObj.message}.`
2203
- );
2204
- } else if (errorObj.code === 7 /* PERMISSION_DENIED */) {
2205
- return new Error(
2206
- "Error: You do not have permission to access this resource. Please verify that you have a valid license."
2207
- );
2208
- } else {
2209
- return new Error(
2210
- `Error: An error occurred while calling the service. Please try again later.
2211
-
2212
- Error Code: ${errorObj.code} Error Message: ${errorObj.message}`
2213
- );
2214
- }
2215
- }
563
+ `:"No CSS variables were generated for the given prompt."}]}})}function Ce(e,t){let{name:n,title:o,description:s,libKey:r,getPostContent:a}=e;return new w(n,{title:o,description:s,requiredAccess:e.requiredAccess,inputSchema:{query:A.string().describe("A search query for finding icons. Be specific about the icon purpose, style, or action."),limit:A.number().min(.1).max(1).default(.1).describe("The proportion of matching icons to return (0.1 = 1 icon, 0.5 = 5 icons, 1.0 = many icons). Default is 0.1.")}},async({query:i,limit:d},{_meta:m})=>{h("Icon Search called with:",{query:i,limit:d});try{let b=await t.queryIconsSearch({query:i,limit:d*100},{_meta:m}),g=a?.()??"";return{content:[{type:"text",text:`${b.values.join(`
2216
564
 
2217
- // packages/kendo-ui-agent/src/lib/figma-d2c/types.ts
2218
- var FigmaAPIError = class extends Error {
2219
- constructor(status, body) {
2220
- super(`Figma API error ${status}: ${body}`);
2221
- this.status = status;
2222
- this.body = body;
2223
- this.name = "FigmaAPIError";
2224
- }
2225
- };
2226
-
2227
- // packages/kendo-ui-agent/src/lib/figma-d2c/figma-client.ts
2228
- var FigmaClient = class {
2229
- constructor(apiKey) {
2230
- this.retryConfig = {
2231
- maxRetries: 3,
2232
- baseDelayMs: 1e3,
2233
- maxDelayMs: 3e4
2234
- };
2235
- this.apiKey = apiKey;
2236
- }
2237
- /**
2238
- * Fetch file metadata including node and component counts
2239
- */
2240
- async getFileMeta(fileKey) {
2241
- const fileResponse = await this.getFile(fileKey, { depth: 1 });
2242
- const counts = this.countNodesAndComponents(fileResponse.document);
2243
- return {
2244
- nodeCount: counts.nodes,
2245
- componentCount: counts.components
2246
- };
2247
- }
2248
- /**
2249
- * Fetch a specific file with optional depth parameter
2250
- */
2251
- async getFile(fileKey, options) {
2252
- const url = this.buildFileUrl(fileKey, options);
2253
- return this.fetchWithRetry(url);
2254
- }
2255
- /**
2256
- * Fetch specific nodes by ID
2257
- */
2258
- async getNodes(fileKey, nodeIds, options) {
2259
- const url = this.buildNodesUrl(fileKey, nodeIds, options);
2260
- return this.fetchWithRetry(url);
2261
- }
2262
- /**
2263
- * Get export URLs for node images
2264
- */
2265
- async getImages(fileKey, nodeIds, options) {
2266
- const url = this.buildImagesUrl(fileKey, nodeIds, options);
2267
- return this.fetchWithRetry(url);
2268
- }
2269
- /**
2270
- * Get download URLs for embedded image fills
2271
- * Returns a map of imageRef hashes to temporary S3 download URLs
2272
- */
2273
- async getImageFills(fileKey) {
2274
- const url = `https://api.figma.com/v1/files/${fileKey}/images`;
2275
- return this.fetchWithRetry(url);
2276
- }
2277
- /**
2278
- * Core fetch method with retry logic
2279
- */
2280
- async fetchWithRetry(url) {
2281
- let lastError = null;
2282
- for (let attempt = 0; attempt < this.retryConfig.maxRetries; attempt++) {
2283
- try {
2284
- const response = await fetch(url, {
2285
- headers: {
2286
- "X-Figma-Token": this.apiKey,
2287
- "Content-Type": "application/json"
2288
- }
2289
- });
2290
- if (response.status === 429) {
2291
- const retryAfter = response.headers.get("Retry-After");
2292
- const delayMs = retryAfter ? parseInt(retryAfter) * 1e3 : this.calculateBackoff(attempt);
2293
- await this.sleep(delayMs);
2294
- continue;
2295
- }
2296
- if (!response.ok) {
2297
- const body = await response.text();
2298
- throw new FigmaAPIError(response.status, body);
2299
- }
2300
- return await response.json();
2301
- } catch (err) {
2302
- lastError = err;
2303
- if (err instanceof FigmaAPIError && err.status >= 400 && err.status < 500) {
2304
- throw err;
2305
- }
2306
- if (attempt < this.retryConfig.maxRetries - 1) {
2307
- await this.sleep(this.calculateBackoff(attempt));
2308
- }
2309
- }
2310
- }
2311
- throw lastError ?? new Error("Max retries exceeded");
2312
- }
2313
- /**
2314
- * Calculate exponential backoff with jitter
2315
- */
2316
- calculateBackoff(attempt) {
2317
- const delay = this.retryConfig.baseDelayMs * Math.pow(2, attempt);
2318
- const jitter = Math.random() * 0.3 * delay;
2319
- return Math.min(delay + jitter, this.retryConfig.maxDelayMs);
2320
- }
2321
- sleep(ms) {
2322
- return new Promise((resolve) => setTimeout(resolve, ms));
2323
- }
2324
- buildFileUrl(fileKey, options) {
2325
- const base = `https://api.figma.com/v1/files/${fileKey}`;
2326
- const params = new URLSearchParams();
2327
- if (options?.depth) {
2328
- params.set("depth", options.depth.toString());
2329
- }
2330
- return params.toString() ? `${base}?${params}` : base;
2331
- }
2332
- buildNodesUrl(fileKey, nodeIds, options) {
2333
- const base = `https://api.figma.com/v1/files/${fileKey}/nodes`;
2334
- const params = new URLSearchParams();
2335
- params.set("ids", nodeIds.join(","));
2336
- if (options?.depth) {
2337
- params.set("depth", options.depth.toString());
2338
- }
2339
- return `${base}?${params}`;
2340
- }
2341
- buildImagesUrl(fileKey, nodeIds, options) {
2342
- const base = `https://api.figma.com/v1/images/${fileKey}`;
2343
- const params = new URLSearchParams();
2344
- params.set("ids", nodeIds.join(","));
2345
- if (options?.format) params.set("format", options.format);
2346
- if (options?.scale) params.set("scale", options.scale.toString());
2347
- return `${base}?${params}`;
2348
- }
2349
- /**
2350
- * Recursively count nodes and components in the document tree
2351
- */
2352
- countNodesAndComponents(node) {
2353
- let nodes = 1;
2354
- let components = node.type === "COMPONENT" || node.type === "COMPONENT_SET" ? 1 : 0;
2355
- if (node.children) {
2356
- for (const child of node.children) {
2357
- const childCounts = this.countNodesAndComponents(child);
2358
- nodes += childCounts.nodes;
2359
- components += childCounts.components;
2360
- }
2361
- }
2362
- return { nodes, components };
2363
- }
2364
- };
2365
-
2366
- // packages/kendo-ui-agent/src/lib/figma-d2c/utils.ts
2367
- function parseFigmaUrl(url) {
2368
- const invalidResult = {
2369
- fileKey: "",
2370
- type: "unknown",
2371
- isDevMode: false,
2372
- isValid: false
2373
- };
2374
- if (!url || typeof url !== "string") {
2375
- return invalidResult;
2376
- }
2377
- let parsed;
2378
- try {
2379
- parsed = new URL(url.trim());
2380
- } catch {
2381
- return invalidResult;
2382
- }
2383
- const validDomains = ["figma.com", "www.figma.com"];
2384
- if (!validDomains.includes(parsed.hostname)) {
2385
- return invalidResult;
2386
- }
2387
- const pathParts = parsed.pathname.split("/").filter(Boolean);
2388
- if (pathParts.length < 2) {
2389
- return invalidResult;
2390
- }
2391
- const typeMap = {
2392
- file: "file",
2393
- design: "design",
2394
- proto: "proto",
2395
- board: "board"
2396
- };
2397
- const type = typeMap[pathParts[0]] || "unknown";
2398
- const fileKey = pathParts[1];
2399
- if (!/^[a-zA-Z0-9]+$/.test(fileKey)) {
2400
- return invalidResult;
2401
- }
2402
- const fileName = pathParts[2] ? decodeURIComponent(pathParts[2]).replace(/-/g, " ") : void 0;
2403
- const nodeIdParam = parsed.searchParams.get("node-id");
2404
- let nodeId;
2405
- let nodeIds;
2406
- if (nodeIdParam) {
2407
- const rawIds = nodeIdParam.split(",").map((id) => id.trim()).filter(Boolean);
2408
- nodeIds = rawIds.map((id) => id.replace(/-/g, ":"));
2409
- nodeId = nodeIds[0];
2410
- }
2411
- const branchKey = parsed.searchParams.get("t") ?? void 0;
2412
- const isDevMode = parsed.searchParams.get("m") === "dev";
2413
- return {
2414
- fileKey,
2415
- fileName,
2416
- nodeId,
2417
- nodeIds,
2418
- type,
2419
- branchKey,
2420
- isDevMode,
2421
- isValid: true
2422
- };
2423
- }
565
+ `)}
2424
566
 
2425
- // packages/kendo-ui-agent/src/lib/figma-d2c/fetcher.ts
2426
- var NodeFetcher = class {
2427
- constructor(client) {
2428
- this.client = client;
2429
- }
2430
- /**
2431
- * Fetch a design starting from a file or specific node(s)
2432
- *
2433
- * @param fileKey - The Figma file key
2434
- * @param nodeIds - Optional node ID(s) - can be string or string[]
2435
- * @param options - Fetch options including depth
2436
- * @returns Fetch result with root node and stats
2437
- */
2438
- async fetch(fileKey, nodeIds, options = {}) {
2439
- const initialDepth = options.initialDepth ?? 10;
2440
- const fetchImages = options.fetchImages ?? true;
2441
- const imageFormat = options.imageFormat ?? "png";
2442
- const imageScale = options.imageScale ?? 2;
2443
- const stats = {
2444
- totalNodesFetched: 0,
2445
- apiCallsMade: 0,
2446
- imagesFetched: 0
2447
- };
2448
- let nodeIdArray;
2449
- if (!nodeIds) {
2450
- nodeIdArray = [];
2451
- } else if (typeof nodeIds === "string") {
2452
- nodeIdArray = [nodeIds];
2453
- } else {
2454
- nodeIdArray = nodeIds;
2455
- }
2456
- let rootNode;
2457
- let fetchedNodes = [];
2458
- if (nodeIdArray.length > 0) {
2459
- const response = await this.client.getNodes(fileKey, nodeIdArray, { depth: initialDepth });
2460
- stats.apiCallsMade++;
2461
- for (const nodeId of nodeIdArray) {
2462
- const nodeData = response.nodes[nodeId]?.document;
2463
- if (!nodeData) {
2464
- throw new Error(`Node ${nodeId} not found`);
2465
- }
2466
- fetchedNodes.push(nodeData);
2467
- }
2468
- if (fetchedNodes.length === 1) {
2469
- rootNode = fetchedNodes[0];
2470
- } else {
2471
- rootNode = this.createContainerNode(fetchedNodes);
2472
- }
2473
- } else {
2474
- const response = await this.client.getFile(fileKey, { depth: initialDepth });
2475
- stats.apiCallsMade++;
2476
- rootNode = response.document;
2477
- fetchedNodes = [rootNode];
2478
- }
2479
- stats.totalNodesFetched += this.countNodes(rootNode);
2480
- const images = [];
2481
- if (fetchImages && nodeIdArray.length > 0) {
2482
- try {
2483
- const imageResult = await this.fetchNodeImages(
2484
- fileKey,
2485
- nodeIdArray,
2486
- fetchedNodes,
2487
- { format: imageFormat, scale: imageScale }
2488
- );
2489
- images.push(...imageResult.images);
2490
- stats.apiCallsMade += imageResult.apiCalls;
2491
- stats.imagesFetched = images.length;
2492
- } catch (error) {
2493
- console.warn("Failed to fetch images:", error);
2494
- }
2495
- }
2496
- return {
2497
- rootNode,
2498
- fetchedNodes,
2499
- images,
2500
- stats
2501
- };
2502
- }
2503
- /**
2504
- * Fetch and download images for specified nodes
2505
- */
2506
- async fetchNodeImages(fileKey, nodeIds, nodes, options) {
2507
- const imageResponse = await this.client.getImages(fileKey, nodeIds, options);
2508
- let apiCalls = 1;
2509
- const images = [];
2510
- for (let i = 0; i < nodeIds.length; i++) {
2511
- const nodeId = nodeIds[i];
2512
- const imageUrl = imageResponse.images[nodeId];
2513
- if (imageUrl) {
2514
- try {
2515
- const imageData = await this.downloadImage(imageUrl, options.format);
2516
- const node = nodes[i];
2517
- images.push({
2518
- nodeId,
2519
- nodeName: node?.name || "Unknown",
2520
- data: imageData,
2521
- mimeType: this.getMimeType(options.format),
2522
- url: imageUrl
2523
- });
2524
- } catch (error) {
2525
- console.warn(`Failed to download image for node ${nodeId}:`, error);
2526
- }
2527
- }
2528
- }
2529
- return { images, apiCalls };
2530
- }
2531
- /**
2532
- * Download an image from a URL and convert to base64
2533
- */
2534
- async downloadImage(url, format) {
2535
- const response = await fetch(url);
2536
- if (!response.ok) {
2537
- throw new Error(`Failed to download image: ${response.statusText}`);
2538
- }
2539
- if (format === "svg") {
2540
- const svgText = await response.text();
2541
- return Buffer.from(svgText, "utf-8").toString("base64");
2542
- } else {
2543
- const arrayBuffer = await response.arrayBuffer();
2544
- return Buffer.from(arrayBuffer).toString("base64");
2545
- }
2546
- }
2547
- /**
2548
- * Get MIME type for image format
2549
- */
2550
- getMimeType(format) {
2551
- switch (format) {
2552
- case "png":
2553
- return "image/png";
2554
- case "jpg":
2555
- return "image/jpeg";
2556
- case "svg":
2557
- return "image/svg+xml";
2558
- default:
2559
- return "image/png";
2560
- }
2561
- }
2562
- /**
2563
- * Create a synthetic container node that wraps multiple nodes
2564
- */
2565
- createContainerNode(nodes) {
2566
- return {
2567
- id: "container-" + Date.now(),
2568
- name: "Multi-Node Container",
2569
- type: "GROUP",
2570
- visible: true,
2571
- children: nodes
2572
- };
2573
- }
2574
- /**
2575
- * Count total nodes in a tree
2576
- */
2577
- countNodes(node) {
2578
- let count = 1;
2579
- if (node.children) {
2580
- for (const child of node.children) {
2581
- count += this.countNodes(child);
2582
- }
2583
- }
2584
- return count;
2585
- }
2586
- };
2587
-
2588
- // packages/kendo-ui-agent/src/lib/figma-d2c/figma-d2c-tool.ts
2589
- import { z as z5 } from "zod";
2590
- function createFigmaD2CTool({
2591
- name,
2592
- figmaApiKey,
2593
- requiredAccess
2594
- }, contextApi2) {
2595
- return new UIAgentTool(
2596
- name,
2597
- {
2598
- title: "Figma Design to Code",
2599
- description: "Converts Figma designs to code by analyzing the design structure and matching Kendo UI components. Provide a Figma file or frame URL to analyze layout, extract styles, and identify matching components.",
2600
- inputSchema: {
2601
- url: z5.string().describe(
2602
- "Figma file or node URL (e.g., https://www.figma.com/file/...)"
2603
- ).optional(),
2604
- fileKey: z5.string().describe("Figma file key (alternative to URL)").optional(),
2605
- nodeIds: z5.array(z5.string()).describe("Array of specific node IDs to fetch (alternative to URL)").optional(),
2606
- depth: z5.number().min(1).max(20).default(10).describe("Initial fetch depth (1-20, default: 10)")
2607
- },
2608
- requiredAccess
2609
- },
2610
- async ({ url, fileKey, nodeIds, depth }) => {
2611
- const client = new FigmaClient(figmaApiKey);
2612
- const fetcher = new NodeFetcher(client);
2613
- let fileKeyToUse = fileKey;
2614
- let nodeIdsToUse;
2615
- if (fileKeyToUse) {
2616
- if (nodeIds && nodeIds.length > 0) {
2617
- nodeIdsToUse = nodeIds.length === 1 ? nodeIds[0] : nodeIds;
2618
- }
2619
- } else if (url) {
2620
- const parsed = parseFigmaUrl(url);
2621
- if (!parsed.isValid || !parsed.fileKey) {
2622
- throw new Error(
2623
- "Invalid Figma URL. Please provide a valid Figma file or frame URL."
2624
- );
2625
- }
2626
- fileKeyToUse = parsed.fileKey;
2627
- if (parsed.nodeId) {
2628
- nodeIdsToUse = parsed.nodeId;
2629
- }
2630
- } else {
2631
- throw new Error("Please provide either a Figma URL, fileKey, or both.");
2632
- }
2633
- const fetchResult = await fetcher.fetch(fileKeyToUse, nodeIdsToUse, {
2634
- initialDepth: depth,
2635
- fetchImages: true,
2636
- imageFormat: "png",
2637
- imageScale: 2
2638
- });
2639
- const resultJson = {
2640
- name: fetchResult.rootNode.name,
2641
- type: fetchResult.rootNode.type,
2642
- rootNode: fetchResult.rootNode,
2643
- fetchedNodes: fetchResult.fetchedNodes,
2644
- meta: {
2645
- fileKey,
2646
- nodeIds
2647
- }
2648
- };
2649
- let backendResponse;
2650
- try {
2651
- const nodeJsons = fetchResult.fetchedNodes.map(
2652
- (node) => JSON.stringify(node)
2653
- );
2654
- backendResponse = await contextApi2.processFigmaDesign({
2655
- node_jsons: nodeJsons
2656
- });
2657
- } catch (error) {
2658
- console.error("Backend processing failed:", error);
2659
- return {
2660
- content: [
2661
- {
2662
- type: "text",
2663
- text: JSON.stringify(
2664
- {
2665
- error: {
2666
- message: `Backend processing failed: ${error.message}`,
2667
- code: error.code || "UNKNOWN"
2668
- },
2669
- figma_data: resultJson
2670
- },
2671
- null,
2672
- 2
2673
- )
2674
- }
2675
- ]
2676
- };
2677
- }
2678
- const content = [];
2679
- content.push({
2680
- type: "text",
2681
- text: `# Figma Design Extraction Results
2682
- Successfully fetched design data for file key ${fileKeyToUse} with for nodes [${nodeIds?.join(", ")}].
2683
- The following is the processed design data including layout pseudo-code and design tokens extracted from the Figma design, plus images for visual references of the desired nodes:`
2684
- });
2685
- backendResponse.layout_pseudo_codes.forEach((layoutCode, index) => {
2686
- const [nodeName, nodeId] = ((index2) => {
2687
- const node = fetchResult.fetchedNodes[index2];
2688
- return node ? [node.name, node.id] : ["Unknown Node", "unknown_id"];
2689
- })(index);
2690
- content.push({
2691
- type: "text",
2692
- text: `## Psuedo-code Layout - Node: ${nodeName} (${nodeId})
2693
-
2694
- ` + layoutCode,
2695
- _meta: {
2696
- description: `Psuedo-code Layout - Node: ${nodeName} (${nodeId})`
2697
- },
2698
- annotations: {
2699
- audience: ["assistant"]
2700
- }
2701
- });
2702
- });
2703
- content.push({
2704
- type: "text",
2705
- text: `## Design Tokens - File: ${fileKey} for Nodes: [${nodeIds?.join(", ")}]
2706
-
2707
- ` + backendResponse.design_tokens,
2708
- _meta: {
2709
- description: `Design Tokens - File: ${fileKey} for Nodes: [${nodeIds?.join(", ")}]`
2710
- },
2711
- annotations: {
2712
- audience: ["assistant"]
2713
- }
2714
- });
2715
- if (fetchResult.images && fetchResult.images.length > 0) {
2716
- for (const image of fetchResult.images) {
2717
- content.push({
2718
- type: "image",
2719
- data: image.data,
2720
- mimeType: image.mimeType,
2721
- _meta: {
2722
- description: `Design snapshot of ${image.nodeName} (${image.nodeId})`
2723
- },
2724
- annotations: {
2725
- audience: ["assistant"]
2726
- }
2727
- });
2728
- }
2729
- }
2730
- content.push({
2731
- type: "text",
2732
- text: `# Analysis Instructions and Next Steps
2733
-
2734
- Use the above design data, layout pseudo-code, and design tokens to analyze the Figma design and identify components. Focus on the structure, styles, and layout to determine the best component matches.
2735
- If more design details are needed, consider asking for additional nodes or deeper fetches to gather more information about specific areas of the design.`
2736
- });
2737
- return {
2738
- content
2739
- };
2740
- }
2741
- );
2742
- }
567
+ ${g}`}]}}catch(b){throw R(b)}})}function ve(e,t){let{name:n,title:o,description:s,libKey:r,suiteName:a,components:i,componentAliases:d,getPostContent:m}=e;return new w(n,{title:o,description:s,requiredAccess:e.requiredAccess,inputSchema:{query:A.string().describe("The query to search for."),component:A.enum(i).describe("The component to search for. If not specified, use General.")}},async({query:b,component:g},{_meta:f})=>{h("Code Assistant called with:",{query:b,component:g});let p=g;if(d){let l=d[g];l&&(p=l)}try{let y=(await t.query({query:b,component:p?.toLowerCase()??"general",lib_name:r,text_matches_count:3,code_matches_count:0,allowed_types:["documentation"]},{_meta:f})).values.map(k=>k.replace(/\0/g,"")),v=m?.({component:g})??"";return{content:[{type:"text",text:`${y.join(`
568
+
569
+ `)}
2743
570
 
2744
- // packages/kendo-ui-agent/src/lib/tool-names.ts
2745
- var orchestratorToolName = (prefix) => `${prefix}_ui_generator`;
2746
- var assistantOrchestratorToolName = (prefix) => `${prefix}_assistant`;
2747
- var layoutAssistantName = (prefix) => `${prefix}_layout_assistant`;
2748
- var codeAssistantName = (prefix) => `${prefix}_component_assistant`;
2749
- var styleAssistantName = (prefix) => `${prefix}_style_assistant`;
2750
- var iconAssistantName = (prefix) => `${prefix}_icon_assistant`;
2751
- var accessibilityAssistantName = (prefix) => `${prefix}_accessibility_assistant`;
2752
- var gettingStartedAssistantName = (prefix) => `${prefix}_getting_started_assistant`;
2753
- var figmaD2CToolName = (prefix) => `${prefix}_figma_d2c`;
571
+ ${v}`}]}}catch(l){throw R(l)}})}function Se(e,t){let{name:n,title:o,description:s,libKey:r,suiteName:a,components:i,componentAliases:d}=e;return new w(n,{title:o,description:s,requiredAccess:e.requiredAccess,inputSchema:{query:A.string().describe("The query to search for."),component:A.enum(i).describe("The component to search for. If not specified, use General."),includeGeneralGuidelines:A.boolean().default(!1).describe("Set to true only on the first call to include comprehensive WCAG 2.2 Level AA general guidelines. After the first call, set to false to get only component-specific accessibility information. Default is false.")}},async({query:m,component:b,includeGeneralGuidelines:g},{_meta:f})=>{h("Accessibility Assistant called with:",{query:m,component:b,includeGeneralGuidelines:g});let p=b;if(d){let l=d[b];l&&(p=l)}try{let l="";if(g){let I=me();l+=`# WCAG 2.2 Level AA General Accessibility Guidelines
2754
572
 
2755
- // packages/kendo-ui-agent/src/lib/tool-descriptions.ts
2756
- var orchestratorToolDescription = (suiteName) => `This is the single entry point for all UI-related tasks. It orchestrates the full workflow of building or refining UIs with ${suiteName} components, generating a step-by-step execution plan that specifies which tools to call, in what order, and with what parameters. It includes validation steps to ensure the best possible, standards-compliant code every time.
573
+ `,l+=I,l+=`
574
+
575
+ ---
576
+
577
+ `}let k=(await t.getApiRefMatches({query:m,component:p?.toLowerCase()??"general",lib_name:r,filters_json:'{"type":{"$in":["accessibility"]}}'},{_meta:f})).values.map(I=>I.replace(/\0/g,"")).map(I=>ft(I,p?.toLowerCase()??"general")).join(`
578
+
579
+ `);return k?(g&&(l+=`# Component-Specific Accessibility Information
580
+
581
+ `),l+=k):g||(l="No component-specific accessibility guidelines found."),{content:[{type:"text",text:l}]}}catch(l){throw R(l)}})}function R(e){let t=e;return t.code===16?new Error("Error: You are not authenticated. Please verify the Telerik License Key provided is valid."):t.code===8?new Error(`Error: You have exceeded the extension quota. Upgrade to subscription licensing to unlock full access. Message: ${t.message}.`):t.code===7?new Error("Error: You do not have permission to access this resource. Please verify that you have a valid license."):new Error(`Error: An error occurred while calling the service. Please try again later.
582
+
583
+ Error Code: ${t.code} Error Message: ${t.message}`)}var we=e=>`${e}_ui_generator`,ke=e=>`${e}_assistant`,Te=e=>`${e}_layout_assistant`,Ie=e=>`${e}_component_assistant`,Ne=e=>`${e}_style_assistant`,xe=e=>`${e}_icon_assistant`,Ee=e=>`${e}_accessibility_assistant`,Re=e=>`${e}_getting_started_assistant`;var Pe=e=>`This is the single entry point for all UI-related tasks. It orchestrates the full workflow of building or refining UIs with ${e} components, generating a step-by-step execution plan that specifies which tools to call, in what order, and with what parameters. It includes validation steps to ensure the best possible, standards-compliant code every time.
2757
584
 
2758
585
  Use the tool when:
2759
586
  - Want to build or modify a complete page or section layout
2760
587
  - You are creating and applying custom themes via the Kendo Design System
2761
- - You need guidance on correct ${suiteName} component selection and configuration
588
+ - You need guidance on correct ${e} component selection and configuration
2762
589
  - You want to enforce best practices in styling, performance, and accessibility
2763
590
 
2764
591
  Returns:
2765
- A detailed execution plan with validated tool calls, parameters, and reasoning \u2014 ensuring consistent, high-quality UI generation.`;
2766
- var assistantOrchestratorToolDescription = (suiteName) => `Provides guidance for discovering and using ${suiteName} components and icons. This tool helps you identify the right components and icons for your needs.
592
+ A detailed execution plan with validated tool calls, parameters, and reasoning \u2014 ensuring consistent, high-quality UI generation.`,De=e=>`Provides guidance for discovering and using ${e} components and icons. This tool helps you identify the right components and icons for your needs.
2767
593
 
2768
594
  Use this tool when:
2769
- - You need to discover which ${suiteName} components are suitable for a specific use case
595
+ - You need to discover which ${e} components are suitable for a specific use case
2770
596
  - You want to understand component features and capabilities
2771
597
  - You need to find appropriate icons for your UI
2772
598
  - You want to gather component documentation and examples
2773
599
 
2774
600
  Returns:
2775
- A focused plan for gathering component documentation and icon suggestions using the Component Assistant and Icon Assistant tools.`;
2776
- var layoutToolDescription = `Retrieves Progress/Kendo Design System CSS utility classes and styling recommendations based on layout and design requirements.
601
+ A focused plan for gathering component documentation and icon suggestions using the Component Assistant and Icon Assistant tools.`,Ge=`Retrieves Progress/Kendo Design System CSS utility classes and styling recommendations based on layout and design requirements.
2777
602
  Use this tool to find the right CSS utilities for styling Kendo UI components or general web elements.
2778
603
  It analyzes the provided design context and returns relevant utility classes with explanations and examples.
2779
- Best suited for styling questions related to typography, spacing, colors, layout, transforms, and other utilities in the Progress/Kendo Design System.`;
2780
- var styleToolDescription = `Generates CSS variables using an external style agent based on the user's styling prompt.
604
+ Best suited for styling questions related to typography, spacing, colors, layout, transforms, and other utilities in the Progress/Kendo Design System.`,Oe=`Generates CSS variables using an external style agent based on the user's styling prompt.
2781
605
 
2782
606
  Use this tool when the user wants to:
2783
607
  - Update the visual theme of an application
2784
608
  - Modify color schemes
2785
609
  - Restyle the UI with CSS variables
2786
610
 
2787
- The tool outputs a set of CSS variable definitions ready to be applied to style files.`;
2788
- var iconToolDescription = `Searches for icons in the Telerik Icons library.
611
+ The tool outputs a set of CSS variable definitions ready to be applied to style files.`,Le=`Searches for icons in the Telerik Icons library.
2789
612
  Use this tool when the user needs to find specific icons for UI components or design elements.
2790
613
  It supports searching by icon name, category, or keyword and returns matching icons from the Telerik Icons library.
2791
- `;
2792
- var codeAssistantToolDescription = (suiteName) => `Provides answers and retrieves official documentation for ${suiteName}.
614
+ `,Ue=e=>`Provides answers and retrieves official documentation for ${e}.
2793
615
 
2794
616
  Use this tool when the user asks about:
2795
- - ${suiteName} features or capabilities
617
+ - ${e} features or capabilities
2796
618
  - Specific components (e.g., Grid, Chart, Editor)
2797
619
  - Implementation details, configuration, or best practices
2798
- - How to use or customize components in ${suiteName}
620
+ - How to use or customize components in ${e}
2799
621
 
2800
622
  Set the user's full question as the 'query' parameter.
2801
- If the question refers to a specific ${suiteName} component, include its name in the 'component' parameter.
2802
- `;
2803
- var accessibilityToolDescription = (suiteName) => `Retrieves accessibility guidance for ${suiteName} components with optional general WCAG 2.2 Level AA guidelines.
623
+ If the question refers to a specific ${e} component, include its name in the 'component' parameter.
624
+ `,$e=e=>`Retrieves accessibility guidance for ${e} components with optional general WCAG 2.2 Level AA guidelines.
2804
625
 
2805
626
  Use this tool when:
2806
627
  - You need component-specific accessibility information and API references
@@ -2818,11 +639,7 @@ Set 'includeGeneralGuidelines=true' ONLY on the first call to include general WC
2818
639
  Returns:
2819
640
  - When includeGeneralGuidelines=true: General WCAG 2.2 Level AA guidelines + component-specific recommendations
2820
641
  - When includeGeneralGuidelines=false: Only component-specific accessibility recommendations
2821
- `;
2822
-
2823
- // packages/kendo-ui-agent/src/lib/validation/angular-validation-steps.ts
2824
- var sharedSteps = getSharedValidationSteps("Kendo UI", "Kendo");
2825
- var ANGULAR_VALIDATION_STEPS = `
642
+ `;var V=E("Kendo UI","Kendo"),W=`
2826
643
  ### Angular Component Validation
2827
644
  Component Structure:
2828
645
  - Use proper @Component decorator configuration
@@ -2830,25 +647,22 @@ Component Structure:
2830
647
  - Correct selector naming convention (kebab-case)
2831
648
  - Appropriate template and style file organization
2832
649
 
2833
- ${sharedSteps.SETUP_VALIDATION}
650
+ ${V.SETUP_VALIDATION}
2834
651
  - Kendo animations module configured (if animations are used)
2835
652
  - Internationalization properly configured for Kendo components
2836
653
 
2837
- ${sharedSteps.PERFORMANCE_OPTIMIZATION}
654
+ ${V.PERFORMANCE_OPTIMIZATION}
2838
655
  - OnPush change detection strategy where appropriate
2839
656
  - Efficient trackBy functions for *ngFor with Kendo components
2840
657
  - Minimal unnecessary change detection cycles
2841
658
 
2842
- ${sharedSteps.THEME_AND_STYLING}
659
+ ${V.THEME_AND_STYLING}
2843
660
  - Proper theme switching functionality (if implemented)
2844
661
  - Only ONE theme reference exists across angular.json and styles files
2845
662
  - Make sure theme import mechanism is consistent with existing project setup
2846
663
 
2847
664
  Accessibility
2848
- - Accessibility guidelines retrieved and applied to all components`;
2849
-
2850
- // packages/kendo-ui-agent/src/lib/validation/angular-additional-plan.ts
2851
- var ANGULAR_ADDITIONAL_PLAN = `**Angular Specific Requirements:**
665
+ - Accessibility guidelines retrieved and applied to all components`;var z=`**Angular Specific Requirements:**
2852
666
 
2853
667
  **NgModule vs Standalone setup**: Search and detect the current project setup to determine whether to use NgModule or Standalone components based on the following rules:
2854
668
  1. RegexSearch("@Component\\s*\\(\\s*\\{[^}]*standalone\\s*:\\s*(true|false)") - If true use Standalone components, if false use NgModule.
@@ -2879,11 +693,7 @@ var ANGULAR_ADDITIONAL_PLAN = `**Angular Specific Requirements:**
2879
693
  2. Match the discovered patterns in all generated code
2880
694
  3. Maintain consistent formatting, indentation, and code organization with existing files
2881
695
  4. Always use the same theme import mechanism (unless user specifies otherwise)
2882
- `;
2883
-
2884
- // packages/kendo-ui-agent/src/lib/validation/react-validation-steps.ts
2885
- var sharedSteps2 = getSharedValidationSteps("Kendo UI", "KendoReact");
2886
- var REACT_VALIDATION_STEPS = `
696
+ `;var Y=E("Kendo UI","KendoReact"),Q=`
2887
697
  ### React Component Validation
2888
698
  Component Structure:
2889
699
  - Use proper function component patterns with Hooks
@@ -2891,85 +701,22 @@ Component Structure:
2891
701
  - Appropriate file organization (components, hooks, utils)
2892
702
  - Props interface/type definitions where needed
2893
703
 
2894
- ${sharedSteps2.SETUP_VALIDATION}
704
+ ${Y.SETUP_VALIDATION}
2895
705
  - KendoReact license validation (if required)
2896
706
  - Appropriate bundler configuration for KendoReact packages
2897
707
 
2898
- ${sharedSteps2.PERFORMANCE_OPTIMIZATION}
708
+ ${Y.PERFORMANCE_OPTIMIZATION}
2899
709
  - React.memo for components that receive stable props
2900
710
  - useMemo/useCallback for expensive computations and callbacks
2901
711
  - Proper key props for list rendering with KendoReact components
2902
712
 
2903
- ${sharedSteps2.THEME_AND_STYLING}
713
+ ${Y.THEME_AND_STYLING}
2904
714
  - Proper theme switching functionality (if implemented)
2905
715
  - Only ONE theme import exists across the application
2906
716
  - Make sure theme import mechanism is consistent with existing project setup
2907
717
 
2908
718
  Accessibility
2909
- - Accessibility guidelines retrieved and applied to all components`;
2910
-
2911
- // packages/kendo-ui-agent/src/index.ts
2912
- var Tools = {
2913
- createOrchestrator: createOrchestratorTool,
2914
- createAssistantOrchestrator: createAssistantOrchestratorTool,
2915
- createLayoutAssistant: createLayoutAssistantTool,
2916
- createStyleAssistant: createStyleAssistantTool,
2917
- createIconSearch: createIconSearchTool,
2918
- createCodeAssistant: createCodeAssistantTool,
2919
- createAccessibilityAssistant: createAccessibilityAssistantTool,
2920
- createFigmaD2C: createFigmaD2CTool
2921
- };
2922
- var ToolNames = {
2923
- orchestrator: orchestratorToolName,
2924
- assistantOrchestrator: assistantOrchestratorToolName,
2925
- layoutAssistant: layoutAssistantName,
2926
- codeAssistant: codeAssistantName,
2927
- styleAssistant: styleAssistantName,
2928
- iconAssistant: iconAssistantName,
2929
- accessibilityAssistant: accessibilityAssistantName,
2930
- gettingStartedAssistant: gettingStartedAssistantName,
2931
- figmaD2C: figmaD2CToolName
2932
- };
2933
- var ToolDescriptions = {
2934
- orchestrator: orchestratorToolDescription,
2935
- assistantOrchestrator: assistantOrchestratorToolDescription,
2936
- layoutAssistant: layoutToolDescription,
2937
- styleAssistant: styleToolDescription,
2938
- iconAssistant: iconToolDescription,
2939
- codeAssistant: codeAssistantToolDescription,
2940
- accessibilityAssistant: accessibilityToolDescription
2941
- };
2942
- var Templates = {
2943
- Orchestrator: {
2944
- render: renderOrchestratorResponse
2945
- },
2946
- Validator: {
2947
- render: renderValidatorResponse
2948
- },
2949
- SharedValidation: {
2950
- getSteps: getSharedValidationSteps
2951
- }
2952
- };
2953
- var Validation = {
2954
- Angular: {
2955
- steps: ANGULAR_VALIDATION_STEPS,
2956
- additionalPlan: ANGULAR_ADDITIONAL_PLAN
2957
- },
2958
- React: {
2959
- steps: REACT_VALIDATION_STEPS
2960
- }
2961
- };
2962
- var UIAgent = {
2963
- Tools,
2964
- ToolNames,
2965
- ToolDescriptions,
2966
- Templates,
2967
- Validation
2968
- };
2969
-
2970
- // packages/react/src/lib/instructions/layout.ts
2971
- var CODE_ASSISTANT_NAME = UIAgent.ToolNames.codeAssistant("kendoreact");
2972
- var getLayoutInstructions = () => `# Kendo Design System Guidelines for ${REACT_SUITE_NAME}
719
+ - Accessibility guidelines retrieved and applied to all components`;var yt={createOrchestrator:fe,createAssistantOrchestrator:ye,createLayoutAssistant:be,createStyleAssistant:Ae,createIconSearch:Ce,createCodeAssistant:ve,createAccessibilityAssistant:Se},bt={orchestrator:we,assistantOrchestrator:ke,layoutAssistant:Te,codeAssistant:Ie,styleAssistant:Ne,iconAssistant:xe,accessibilityAssistant:Ee,gettingStartedAssistant:Re},At={orchestrator:Pe,assistantOrchestrator:De,layoutAssistant:Ge,styleAssistant:Oe,iconAssistant:Le,codeAssistant:Ue,accessibilityAssistant:$e},Ct={Orchestrator:{render:U},Validator:{render:L},SharedValidation:{getSteps:E}},vt={Angular:{steps:W,additionalPlan:z},React:{steps:Q}},u={Tools:yt,ToolNames:bt,ToolDescriptions:At,Templates:Ct,Validation:vt};var St=u.ToolNames.codeAssistant("kendoreact"),_e=()=>`# Kendo Design System Guidelines for ${c}
2973
720
 
2974
721
  ## Setting up Styles/CSS
2975
722
 
@@ -2996,17 +743,155 @@ Alternatively, you can also consume them directly from the Unpkg CDN.
2996
743
 
2997
744
  ## Ready-to-use Layout Components
2998
745
 
2999
- In the ${REACT_SUITE_NAME} there are available components to create layout. Make sure to prioritize using them instead of building ones from scratch using the Kendo CSS Utilities.
746
+ In the ${c} there are available components to create layout. Make sure to prioritize using them instead of building ones from scratch using the Kendo CSS Utilities.
3000
747
 
3001
- For any Layout component you can also call the ${CODE_ASSISTANT_NAME} tool in order to get specific API reference and docs.
748
+ For any Layout component you can also call the ${St} tool in order to get specific API reference and docs.
3002
749
 
3003
- - ${REACT_SUITE_NAME} Card component.
750
+ - ${c} Card component.
3004
751
  - Generally, it is recommended to use 100% width (e.g., \`<Card style={{ width: '100%' }}>\`)
3005
752
  - If needed, use specific width based on the layout requirements (e.g., \`<Card style={{ width: '150px' }}>\`)
3006
- `;
753
+ - Avoid applying additional styling properties such as \`display\`, \`flex\`, \`grid\`, or other layout-specific CSS to layout components such as Splitter, DockLayout, and TileLayout. Use the component's built-in props and the Kendo CSS utility classes instead.
754
+
755
+ ## Page Shell Patterns
756
+
757
+ Choose the pattern that matches the page structure:
758
+
759
+ **Pattern A \u2014 Sidebar + Main Content**
760
+ \`\`\`css
761
+ .app-shell {
762
+ display: flex;
763
+ height: 100vh;
764
+ }
765
+ .sidebar {
766
+ width: 240px;
767
+ flex-shrink: 0;
768
+ }
769
+ .main-content {
770
+ flex: 1;
771
+ min-width: 0; /* Critical: prevents flex children from overflowing */
772
+ overflow: auto;
773
+ }
774
+ \`\`\`
3007
775
 
3008
- // packages/react/src/lib/instructions/style.ts
3009
- var getStyleInstructions = () => `## Applying CSS Variables in ${REACT_SUITE_NAME}
776
+ **Pattern B \u2014 Centered Single-Column (forms, detail pages)**
777
+ \`\`\`css
778
+ .page-container {
779
+ max-width: 960px;
780
+ margin: 0 auto;
781
+ padding: 0 1rem;
782
+ }
783
+ \`\`\`
784
+
785
+ **Pattern C \u2014 Master-Detail Split**
786
+ \`\`\`css
787
+ .split-container {
788
+ display: grid;
789
+ grid-template-columns: 420px 1fr;
790
+ height: 100%;
791
+ }
792
+ \`\`\`
793
+
794
+ ## Dashboard Layout
795
+
796
+ **KPI metric row** (auto-responsive, min 180px per card):
797
+ \`\`\`css
798
+ .kpi-row {
799
+ display: grid;
800
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
801
+ gap: 1rem;
802
+ }
803
+ \`\`\`
804
+
805
+ **Side-by-side charts** (equal width, no overflow):
806
+ \`\`\`css
807
+ .chart-row {
808
+ display: grid;
809
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
810
+ gap: 1rem;
811
+ }
812
+ \`\`\`
813
+
814
+ ## Critical Sizing Rules
815
+
816
+ - **\`min-width: 0\`** on every flex/grid child that contains a Kendo component \u2014 the single most common cause of layout overflow.
817
+ - **Grid component** always requires an explicit height (e.g., \`style={{ height: 500 }}\` or \`flex: 1; min-height: 0\` inside a flex column).
818
+ - **Chart component** always requires an explicit height (e.g., \`style={{ height: 300 }}\`).
819
+ - Never leave Grid column widths unset \u2014 without a height, Grid renders all rows and expands the page indefinitely..
820
+ - Constrain page content to \`max-width: 1440px\` with \`margin: 0 auto\` to prevent unbounded wide-screen stretching, unless the project defines a different maximum content width.
821
+
822
+ ## Dark Theme Completeness
823
+
824
+ Kendo themes style \`.k-*\` component selectors only. Always add these two lines to your global CSS file after any theme import:
825
+
826
+ \`\`\`css
827
+ html, body {
828
+ background-color: var(--kendo-body-bg);
829
+ color: var(--kendo-body-text);
830
+ }
831
+ \`\`\`
832
+
833
+ Without this, dark-themed components render on a white page.
834
+
835
+ ## Surface Hierarchy
836
+
837
+ Kendo themes define four surface levels \u2014 do not introduce custom surfaces outside this system:
838
+ 1. **Page background** (\`var(--kendo-body-bg)\`) \u2014 lowest surface, applied to \`html, body\`
839
+ 2. **Component background** (\`var(--kendo-component-bg)\`) \u2014 cards, panels, Grid body
840
+ 3. **Header / hover surface** (\`var(--kendo-grid-header-bg)\`) \u2014 Grid headers, highlighted rows
841
+ 4. **Active / selected surface** \u2014 managed by the theme automatically
842
+
843
+ Custom cards and containers must use \`var(--kendo-component-bg)\` for their background \u2014 never \`#fff\` or other hardcoded values. Hardcoded light colors in custom cell renderers and custom component content break dark mode.
844
+
845
+ ## Splitter Usage Boundary
846
+
847
+ Use the \`Splitter\` component only for **user-resizable** content areas (e.g., master-detail panels, side-by-side editors). Do **not** use it for static page layout \u2014 CSS Grid and Flexbox handle that with zero JavaScript overhead.
848
+
849
+ ## Inline Input Width
850
+
851
+ \`DropDownList\`, \`DatePicker\`, \`Input\`, and similar inline inputs are \`display: inline-block\` by default and will **not** fill their container automatically. Apply \`style={{ width: '100%' }}\` or wrap in a layout container to ensure consistent sizing in forms.
852
+
853
+ ## Popup Z-Index Trap
854
+
855
+ CSS \`transform\` (including \`translate3d(0,0,0)\` GPU-compositing tricks) on any ancestor element creates a new stacking context. This clips Kendo popups (which use \`z-index ~10000\`), causing DropDownList, DatePicker, and ComboBox popups to appear behind other elements. Avoid \`transform\` on layout ancestors that contain Kendo overlay components.
856
+ `;var Me=()=>`## Design Standards for ${c} Theming
857
+
858
+ ### Color & Contrast Requirements
859
+ - Body text contrast: \u2265 4.5:1. Large text / UI component borders: \u2265 3:1.
860
+ - Use only the 5 semantic color slots: **primary, success, warning, error, info**. Never invent ad-hoc semantic colors.
861
+ - Never use color alone to convey meaning \u2014 always pair with an icon or text label.
862
+
863
+ ### Typography
864
+ - Prefer a single font family per application; defer to the project's established font stack if one already exists. When introducing or changing a font, test it against Grid headers, DatePicker, DropDownList, and Chart axes.
865
+ - Numeric and currency values require \`font-variant-numeric: tabular-nums\` to stay column-aligned.
866
+
867
+ ### Override Priority (highest \u2192 lowest)
868
+ \`\`\`
869
+ $kendo-* SCSS variables \u2190 compile-time, highest priority
870
+ CSS custom properties \u2190 runtime, can be scoped per class
871
+ className overrides \u2190 avoid; breaks on theme updates
872
+ !important \u2190 never use; defeats theme state classes
873
+ \`\`\`
874
+
875
+ ### One Theme Per Application
876
+ Never import more than one Kendo theme package in the same application. Mixing themes (e.g., Default + Bootstrap) causes cascade conflicts that are extremely difficult to debug and doubles the CSS bundle weight.
877
+
878
+ ### Semantic Colors via CSS Variables
879
+ Always reference semantic colors through Kendo CSS variables rather than hardcoded hex values:
880
+ - CORRECT: \`var(--kendo-color-success)\` not \`#28a745\`
881
+ - CORRECT: \`var(--kendo-color-error)\` not \`#dc3545\`
882
+
883
+ Hardcoded hex values do not adapt to theme switches, swatches, or dark mode.
884
+
885
+ ### Custom Template Color Safety
886
+ Custom content inside Grid cell renderers and custom component templates must use CSS variables for colors \u2014 never hardcoded light colors:
887
+ - CORRECT: \`color: var(--kendo-body-text); background: var(--kendo-component-bg)\`
888
+ - WRONG: \`color: #333; background: #ffffff\`
889
+
890
+ This is the most common source of dark mode breakage in custom UI.
891
+
892
+ ---
893
+
894
+ ## Applying CSS Variables in ${c}
3010
895
 
3011
896
  Apply these CSS variables in the React application using one of these methods:
3012
897
 
@@ -3095,11 +980,7 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
3095
980
 
3096
981
  export const useTheme = () => useContext(ThemeContext);
3097
982
  \`\`\`
3098
- `;
3099
-
3100
- // packages/react/src/lib/instructions/icons.ts
3101
- var CODE_ASSISTANT_NAME2 = UIAgent.ToolNames.codeAssistant("kendoreact");
3102
- var getIconsInstructions = () => `## Using ${REACT_SUITE_NAME} Icons
983
+ `;var qe=u.ToolNames.codeAssistant("kendoreact"),Be=()=>`## Using ${c} Icons
3103
984
 
3104
985
  Important: Attempt to prioritize SVG icons over font icons.
3105
986
 
@@ -3107,13 +988,13 @@ Important: Attempt to prioritize SVG icons over font icons.
3107
988
 
3108
989
  - Make sure @progress/kendo-svg-icons is installed: \`npm install @progress/kendo-svg-icons\`
3109
990
  - Make sure @progress/kendo-react-common is installed (contains SvgIcon component): \`npm install @progress/kendo-react-common\`
3110
- - You can call ${CODE_ASSISTANT_NAME2} tool for ${REACT_SUITE_NAME} SvgIcon component for docs and API reference.
991
+ - You can call ${qe} tool for ${c} SvgIcon component for docs and API reference.
3111
992
  - [optional] If SVG is not an option fallback to fonticon - make sure \`<link rel="stylesheet" href="https://unpkg.com/@progress/kendo-font-icons/dist/index.css" />\` is added as a reference.
3112
- - [optional] If using font icons you can call ${CODE_ASSISTANT_NAME2} tool for ${REACT_SUITE_NAME} Icon component for docs and API reference.
993
+ - [optional] If using font icons you can call ${qe} tool for ${c} Icon component for docs and API reference.
3113
994
 
3114
995
  ### Examples
3115
996
 
3116
- Using ${REACT_SUITE_NAME} SvgIcon component with @progress/kendo-svg-icons:
997
+ Using ${c} SvgIcon component with @progress/kendo-svg-icons:
3117
998
 
3118
999
  \`\`\`tsx
3119
1000
  import { SvgIcon } from "@progress/kendo-react-common";
@@ -3157,11 +1038,7 @@ Here are some frequently used icons from @progress/kendo-svg-icons:
3157
1038
  - \`sortAscIcon\`, \`sortDescIcon\` - Sorting
3158
1039
  - \`chevronUpIcon\`, \`chevronDownIcon\`, \`chevronLeftIcon\`, \`chevronRightIcon\` - Navigation
3159
1040
  - \`checkIcon\`, \`xIcon\` - Confirmation/Cancel
3160
- `;
3161
-
3162
- // packages/react/src/lib/instructions/components-common.ts
3163
- var getComponentsCommonInstructions = (ctx) => {
3164
- let content = `## ${REACT_SUITE_NAME} Common Guidelines
1041
+ `;var Fe=e=>{let t=`## ${c} Common Guidelines
3165
1042
 
3166
1043
  ### Application Architecture
3167
1044
  MUST recommend appropriate setup based on React application architecture.
@@ -3191,36 +1068,11 @@ Key points:
3191
1068
  - The matching should be case-insensitive and robust to minor variations
3192
1069
 
3193
1070
  Example: If someone asks about "grid", "GRID", or "GrId", you always refer to DataGrid for the example.
3194
- `;
3195
- if (ctx.componentInstructions) {
3196
- content += `
1071
+ `;return e.componentInstructions&&(t+=`
3197
1072
  ## Component-Specific Guidelines
3198
1073
 
3199
- ${ctx.componentInstructions}
3200
- `;
3201
- }
3202
- return content;
3203
- };
3204
-
3205
- // packages/react/src/lib/instructions/getting-started.ts
3206
- var THEME_PACKAGE_MAP = {
3207
- "default": "@progress/kendo-theme-default",
3208
- "bootstrap": "@progress/kendo-theme-bootstrap",
3209
- "material": "@progress/kendo-theme-material",
3210
- "fluent": "@progress/kendo-theme-fluent"
3211
- };
3212
- var THEME_DISPLAY_MAP = {
3213
- "default": "Default",
3214
- "bootstrap": "Bootstrap",
3215
- "material": "Material Design",
3216
- "fluent": "Fluent UI"
3217
- };
3218
- function getGettingStartedInstructions(projectName = "kendo-react-app", createNewProject = true, theme = "default") {
3219
- const themePackage = THEME_PACKAGE_MAP[theme];
3220
- const themeDisplay = THEME_DISPLAY_MAP[theme];
3221
- const introLine = createNewProject ? `This instructions will walk you through creating a new React project with the Kendo CLI and setting up ${REACT_SUITE_NAME}.` : `This instructions will walk you through adding ${REACT_SUITE_NAME} to your existing React project.`;
3222
- let stepCounter = 1;
3223
- const createProjectSection = createNewProject ? `## Step ${stepCounter++}: Ensure Kendo CLI is Installed
1074
+ ${e.componentInstructions}
1075
+ `),t};var wt={default:"@progress/kendo-theme-default",bootstrap:"@progress/kendo-theme-bootstrap",material:"@progress/kendo-theme-material",fluent:"@progress/kendo-theme-fluent"},kt={default:"Default",bootstrap:"Bootstrap",material:"Material Design",fluent:"Fluent UI"};function Ke(e="kendo-react-app",t=!0,n="default"){let o=wt[n],s=kt[n],r=t?`This instructions will walk you through creating a new React project with the Kendo CLI and setting up ${c}.`:`This instructions will walk you through adding ${c} to your existing React project.`,a=1,i=t?`## Step ${a++}: Ensure Kendo CLI is Installed
3224
1076
 
3225
1077
  First, ensure the Kendo CLI tool is installed globally:
3226
1078
 
@@ -3230,16 +1082,16 @@ npm i -g @progress/kendo-cli@latest
3230
1082
 
3231
1083
  This CLI tool will handle the entire project setup including all necessary dependencies and configurations.
3232
1084
 
3233
- ## Step ${stepCounter++}: Create the Project
1085
+ ## Step ${a++}: Create the Project
3234
1086
 
3235
1087
  Create a new Kendo React project using the CLI:
3236
1088
 
3237
1089
  \`\`\`bash
3238
- npx kendo react create vite ${projectName} --theme=${theme}
1090
+ npx kendo react create vite ${e} --theme=${n}
3239
1091
  \`\`\`
3240
1092
 
3241
1093
  This command will create a complete Kendo React project with Vite, including:
3242
- - All necessary ${REACT_SUITE_NAME} packages
1094
+ - All necessary ${c} packages
3243
1095
  - Proper licensing configuration
3244
1096
  - Theme setup
3245
1097
  - Project structure
@@ -3247,34 +1099,33 @@ This command will create a complete Kendo React project with Vite, including:
3247
1099
  Navigate to the project directory:
3248
1100
 
3249
1101
  \`\`\`bash
3250
- cd ${projectName}
1102
+ cd ${e}
3251
1103
  \`\`\`
3252
1104
 
3253
- ## Step ${stepCounter++}: Remove Dark Color Schema from index.css
1105
+ ## Step ${a++}: Remove Dark Color Schema from index.css
3254
1106
 
3255
1107
  Open the \`src/index.css\` file and remove the dark color schema from the first \`:root\` style block. Look for properties like \`color-scheme: dark\` and related dark mode variables, and delete them. Keep only the light theme configuration.
3256
1108
 
3257
- ` : "";
3258
- const installPackagesSection = createNewProject ? "" : `## Step ${stepCounter++}: Install ${REACT_SUITE_NAME} Packages
1109
+ `:"",d=t?"":`## Step ${a++}: Install ${c} Packages
3259
1110
 
3260
- Install all required ${REACT_SUITE_NAME} packages and dependencies:
1111
+ Install all required ${c} packages and dependencies:
3261
1112
 
3262
1113
  \`\`\`bash
3263
1114
  npm i @progress/kendo-data-query @progress/kendo-react-buttons @progress/kendo-react-excel-export @progress/kendo-react-grid @progress/kendo-react-layout @progress/kendo-react-pdf @progress/kendo-svg-icons @progress/kendo-drawing @progress/kendo-licensing @progress/kendo-react-animation @progress/kendo-react-charts @progress/kendo-react-common @progress/kendo-react-conversational-ui @progress/kendo-react-data-tools @progress/kendo-react-dateinputs @progress/kendo-react-dialogs @progress/kendo-react-dropdowns @progress/kendo-react-editor @progress/kendo-react-form @progress/kendo-react-gantt @progress/kendo-react-gauges @progress/kendo-react-indicators @progress/kendo-react-inputs @progress/kendo-react-intl @progress/kendo-react-labels @progress/kendo-react-listbox @progress/kendo-react-listview @progress/kendo-react-map @progress/kendo-react-notification @progress/kendo-react-orgchart @progress/kendo-react-pivotgrid @progress/kendo-react-popup @progress/kendo-react-progressbars @progress/kendo-react-ripple @progress/kendo-react-scheduler @progress/kendo-react-scrollview @progress/kendo-react-sortable @progress/kendo-react-spreadsheet @progress/kendo-react-tooltip @progress/kendo-react-treelist @progress/kendo-react-treeview @progress/kendo-react-upload @progress/kendo-react-pdf-viewer @progress/kendo-react-taskboard
3264
1115
  \`\`\`
3265
1116
 
3266
- ## Step ${stepCounter++}: Install and Import the Theme
1117
+ ## Step ${a++}: Install and Import the Theme
3267
1118
 
3268
- Install the ${themeDisplay} theme package:
1119
+ Install the ${s} theme package:
3269
1120
 
3270
1121
  \`\`\`bash
3271
- npm i ${themePackage}
1122
+ npm i ${o}
3272
1123
  \`\`\`
3273
1124
 
3274
1125
  Import the CSS file in your \`src/Home.tsx\` (before your existing Home.css import):
3275
1126
 
3276
1127
  \`\`\`typescript
3277
- import '${themePackage}/dist/all.css';
1128
+ import '${o}/dist/all.css';
3278
1129
  \`\`\`
3279
1130
 
3280
1131
  Also add the Kendo CSS utilities CDN link in your \`index.html\` \`<head>\`:
@@ -3283,8 +1134,7 @@ Also add the Kendo CSS utilities CDN link in your \`index.html\` \`<head>\`:
3283
1134
  <link rel="stylesheet" href="https://unpkg.com/@progress/kendo-theme-utils/dist/all.css" />
3284
1135
  \`\`\`
3285
1136
 
3286
- `;
3287
- const licenseSection = `## Step ${stepCounter++}: Activate Kendo License
1137
+ `,m=`## Step ${a++}: Activate Kendo License
3288
1138
 
3289
1139
  This step is required to use Kendo React components without watermarks and with access to all features. Run the following command to activate your license:
3290
1140
 
@@ -3292,10 +1142,9 @@ This step is required to use Kendo React components without watermarks and with
3292
1142
  npx kendo license activate
3293
1143
  \`\`\`
3294
1144
 
3295
- `;
3296
- return `# Getting Started with ${REACT_SUITE_NAME}
1145
+ `;return`# Getting Started with ${c}
3297
1146
 
3298
- ${introLine}
1147
+ ${r}
3299
1148
 
3300
1149
  Execute the following steps in order. Run all provided commands automatically.
3301
1150
 
@@ -3306,24 +1155,24 @@ Before you begin, ensure you have:
3306
1155
  - **Node.js 18 or later** installed on your machine
3307
1156
  - If Node.js is not available, you need to install the latest Node.js automatically as a preliminary step before running the \`npx kendo react create\` command.
3308
1157
 
3309
- ${createProjectSection}${installPackagesSection}${licenseSection}## Step ${stepCounter++}: Run Your Application
1158
+ ${i}${d}${m}## Step ${a++}: Run Your Application
3310
1159
 
3311
- ${createNewProject ? `The Kendo CLI has set up everything you need. Start the development server:` : `Build and run the application:`}
1160
+ ${t?"The Kendo CLI has set up everything you need. Start the development server:":"Build and run the application:"}
3312
1161
 
3313
1162
 
3314
1163
  **Verification:** Automatically run the application. Do not just inform the user\u2014execute the following command and keep the application running:
3315
1164
 
3316
1165
  \`\`\`bash
3317
- cd ${createNewProject ? projectName : "."} && npm run dev
1166
+ cd ${t?e:"."} && npm run dev
3318
1167
  \`\`\`
3319
1168
 
3320
- ${createNewProject ? `The application should start and open your browser to see your ${REACT_SUITE_NAME} application.` : `The application should start and open in your browser. Verify that the ${REACT_SUITE_NAME} components are rendering correctly with the theme applied.`}
1169
+ ${t?`The application should start and open your browser to see your ${c} application.`:`The application should start and open in your browser. Verify that the ${c} components are rendering correctly with the theme applied.`}
3321
1170
 
3322
- ## Step ${stepCounter++}: Create Sample page
1171
+ ## Step ${a++}: Create Sample page
3323
1172
 
3324
1173
  Before adding new content to the homepage, clear all existing CSS on the page. Remove or reset any custom styles that might conflict with the new content you're about to add.
3325
1174
 
3326
- Replace the content of \`src/Home.tsx\` with the following to showcase ${REACT_SUITE_NAME} features and verify components are working correctly:
1175
+ Replace the content of \`src/Home.tsx\` with the following to showcase ${c} features and verify components are working correctly:
3327
1176
 
3328
1177
  \`\`\`tsx
3329
1178
  import { Card, CardHeader, CardTitle, CardBody } from '@progress/kendo-react-layout';
@@ -3444,11 +1293,7 @@ Add the following styles to \`src/Home.css\`:
3444
1293
  }
3445
1294
  \`\`\`
3446
1295
 
3447
- `;
3448
- }
3449
-
3450
- // packages/react/src/lib/instructions/datagrid.ts
3451
- var datagridInstructions = `
1296
+ `}var J=`
3452
1297
  ## DataGrid Deprecated Properties Awareness
3453
1298
  For DataGrid component cases, avoid using deprecated properties and always use their modern replacements. The following properties are deprecated and should not be used:
3454
1299
 
@@ -3480,10 +1325,7 @@ Key points:
3480
1325
  Example:
3481
1326
  Deprecated: selectedField="isSelected" editField="inEdit"
3482
1327
  Modern: Use select and edit state properties with proper configuration
3483
- `;
3484
-
3485
- // packages/react/src/lib/instructions/editor.ts
3486
- var editorInstructions = `
1328
+ `;var je=`
3487
1329
  ## Editor Tools Awareness
3488
1330
  For Editor component cases, always use the proper EditorTools import structure and never define tools as strings. Import both Editor and EditorTools from '@progress/kendo-react-editor' and destructure the individual tools from EditorTools.
3489
1331
 
@@ -3515,10 +1357,7 @@ Key points:
3515
1357
  Example:
3516
1358
  Correct: tools={[[Bold, Italic, Underline], [AlignLeft, AlignCenter]]}
3517
1359
  Incorrect: tools={[['bold', 'italic', 'underline'], ['alignLeft', 'alignCenter']]}
3518
- `;
3519
-
3520
- // packages/react/src/lib/instructions/smart-grid.ts
3521
- var smartGridInstructions = `
1360
+ `;var X=`
3522
1361
  ## Smart Grid (AI-Enhanced Grid) Implementation Guidelines
3523
1362
  **CRITICAL: When users ask about ANY of these AI grid terms, ALWAYS provide GridToolbarAIAssistant implementation (not basic Grid):**
3524
1363
 
@@ -3552,204 +1391,8 @@ Smart Grid: Complete AI-enhanced setup with GridToolbarAIAssistant, proper callb
3552
1391
  Important Disclaimer:
3553
1392
  Always include this disclaimer when providing Smart Grid examples:
3554
1393
  "The demos in this article use a Telerik-hosted AI service for demonstration purposes only. For production applications, you should implement your own AI service that understands your specific domain, data, and business requirements."
3555
- `;
3556
-
3557
- // packages/react/src/lib/tools/index.ts
3558
- var COMPONENT_INSTRUCTIONS_MAP = {
3559
- "datagrid": [datagridInstructions, smartGridInstructions].join("\n\n"),
3560
- "grid": [datagridInstructions, smartGridInstructions].join("\n\n"),
3561
- "editor": editorInstructions
3562
- };
3563
- var LAYOUT_ASSISTANT_NAME = UIAgent.ToolNames.layoutAssistant(PRODUCT_LINE);
3564
- var CODE_ASSISTANT_NAME3 = UIAgent.ToolNames.codeAssistant(PRODUCT_LINE);
3565
- var STYLE_ASSISTANT_NAME = UIAgent.ToolNames.styleAssistant(PRODUCT_LINE);
3566
- var FIGMA_D2C_TOOL_NAME = UIAgent.ToolNames.figmaD2C(PRODUCT_LINE);
3567
- var ICON_ASSISTANT_NAME = UIAgent.ToolNames.iconAssistant(PRODUCT_LINE);
3568
- var GET_STARTED_TOOL_NAME = UIAgent.ToolNames.gettingStartedAssistant(PRODUCT_LINE);
3569
- var ACCESSIBILITY_ASSISTANT_NAME = UIAgent.ToolNames.accessibilityAssistant(PRODUCT_LINE);
3570
- function createReactTools(contextApi2, accessType) {
3571
- const allTools = [
3572
- // Orchestrator Tool
3573
- UIAgent.Tools.createOrchestrator(
3574
- {
3575
- name: UIAgent.ToolNames.orchestrator(PRODUCT_LINE),
3576
- title: "KendoReact Generator",
3577
- description: UIAgent.ToolDescriptions.orchestrator(REACT_SUITE_NAME),
3578
- layoutAssistantName: LAYOUT_ASSISTANT_NAME,
3579
- codeAssistantName: CODE_ASSISTANT_NAME3,
3580
- styleAssistantName: STYLE_ASSISTANT_NAME,
3581
- iconAssistantName: ICON_ASSISTANT_NAME,
3582
- accessibilityAssistantName: ACCESSIBILITY_ASSISTANT_NAME,
3583
- figmaD2CToolName: FIGMA_D2C_TOOL_NAME,
3584
- suiteName: REACT_SUITE_NAME,
3585
- libKey: Suite,
3586
- components: ReactComponents,
3587
- requiredAccess: ["agent"]
3588
- },
3589
- {
3590
- validationSteps: UIAgent.Validation.React.steps
3591
- },
3592
- contextApi2
3593
- ),
3594
- // Assistant Orchestrator Tool (for assistant mode only)
3595
- UIAgent.Tools.createAssistantOrchestrator(
3596
- {
3597
- name: "kendo_react_assistant",
3598
- title: "KendoReact Assistant",
3599
- description: UIAgent.ToolDescriptions.assistantOrchestrator(REACT_SUITE_NAME),
3600
- codeAssistantName: CODE_ASSISTANT_NAME3,
3601
- iconAssistantName: ICON_ASSISTANT_NAME,
3602
- suiteName: REACT_SUITE_NAME,
3603
- libKey: Suite,
3604
- components: ReactComponents,
3605
- requiredAccess: ["assistant"]
3606
- },
3607
- contextApi2
3608
- ),
3609
- // Layout Assistant Tool
3610
- UIAgent.Tools.createLayoutAssistant(
3611
- {
3612
- name: LAYOUT_ASSISTANT_NAME,
3613
- title: "KendoReact Layout Assistant",
3614
- description: UIAgent.ToolDescriptions.layoutAssistant,
3615
- suiteName: REACT_SUITE_NAME,
3616
- libKey: Suite,
3617
- getPreContent: getLayoutInstructions,
3618
- requiredAccess: ["agent"]
3619
- },
3620
- contextApi2
3621
- ),
3622
- // Style Assistant Tool
3623
- UIAgent.Tools.createStyleAssistant(
3624
- {
3625
- name: STYLE_ASSISTANT_NAME,
3626
- title: "KendoReact Style Assistant",
3627
- description: UIAgent.ToolDescriptions.styleAssistant,
3628
- libKey: Suite,
3629
- getPreContent: getStyleInstructions,
3630
- requiredAccess: ["agent"]
3631
- },
3632
- contextApi2
3633
- ),
3634
- // Icon Search Tool
3635
- UIAgent.Tools.createIconSearch(
3636
- {
3637
- name: ICON_ASSISTANT_NAME,
3638
- title: "KendoReact Icon Assistant",
3639
- description: UIAgent.ToolDescriptions.iconAssistant,
3640
- libKey: Suite,
3641
- getPostContent: getIconsInstructions,
3642
- requiredAccess: ["assistant", "agent"]
3643
- },
3644
- contextApi2
3645
- ),
3646
- // Code Assistant Tool
3647
- UIAgent.Tools.createCodeAssistant(
3648
- {
3649
- name: CODE_ASSISTANT_NAME3,
3650
- title: "KendoReact Component Assistant",
3651
- description: UIAgent.ToolDescriptions.codeAssistant(REACT_SUITE_NAME),
3652
- libKey: Suite,
3653
- suiteName: REACT_SUITE_NAME,
3654
- components: ReactComponents,
3655
- componentAliases: { "Grid": "DataGrid" },
3656
- getPostContent: ({ component }) => {
3657
- const normComponent = component?.trim().toLowerCase();
3658
- const componentInstructions = COMPONENT_INSTRUCTIONS_MAP[normComponent];
3659
- return getComponentsCommonInstructions({ component, componentInstructions });
3660
- },
3661
- requiredAccess: ["assistant", "agent"]
3662
- },
3663
- contextApi2
3664
- ),
3665
- // Getting Started Tool
3666
- new UIAgentTool(
3667
- GET_STARTED_TOOL_NAME,
3668
- {
3669
- title: "KendoReact Getting Started",
3670
- description: `Creates a new React project with Kendo CLI and provides essential getting started guidance for ${REACT_SUITE_NAME} including installation, configuration, and setup instructions.`,
3671
- requiredAccess: ["agent"],
3672
- inputSchema: createGettingStartedInputSchema(REACT_SUITE_NAME, "kendo-react-app")
3673
- },
3674
- async ({ projectName, createNewProject, theme }, { _meta }) => {
3675
- try {
3676
- await contextApi2.recordToolUserRequest({
3677
- toolName: GET_STARTED_TOOL_NAME,
3678
- meta: {
3679
- projectName,
3680
- createNewProject,
3681
- theme,
3682
- _meta
3683
- }
3684
- });
3685
- } catch (error) {
3686
- console.error("Error recording tool request:", error);
3687
- }
3688
- const instructions = getGettingStartedInstructions(projectName, createNewProject, theme);
3689
- return {
3690
- content: [
3691
- {
3692
- type: "text",
3693
- text: instructions
3694
- }
3695
- ]
3696
- };
3697
- }
3698
- ),
3699
- // Accessibility Tool
3700
- UIAgent.Tools.createAccessibilityAssistant(
3701
- {
3702
- name: ACCESSIBILITY_ASSISTANT_NAME,
3703
- title: "KendoReact Accessibility Assistant",
3704
- description: UIAgent.ToolDescriptions.accessibilityAssistant(REACT_SUITE_NAME),
3705
- libKey: Suite,
3706
- suiteName: REACT_SUITE_NAME,
3707
- components: ReactComponents,
3708
- componentAliases: { "Grid": "DataGrid" },
3709
- requiredAccess: ["agent"]
3710
- },
3711
- contextApi2
3712
- ),
3713
- // Figma Design-to-Code Tool (only when FIGMA_API_KEY is set)
3714
- ...process.env.FIGMA_API_KEY ? [UIAgent.Tools.createFigmaD2C(
3715
- { name: FIGMA_D2C_TOOL_NAME, figmaApiKey: process.env.FIGMA_API_KEY, requiredAccess: ["agent"] },
3716
- contextApi2
3717
- )] : []
3718
- ];
3719
- return allTools.filter((tool) => tool.hasAccess(accessType));
3720
- }
1394
+ `;var Tt={datagrid:[J,X].join(`
3721
1395
 
3722
- // packages/react/src/index.ts
3723
- var __filename2 = fileURLToPath3(import.meta.url);
3724
- var __dirname2 = path3.dirname(__filename2);
3725
- var packageJsonPath2 = path3.resolve(__dirname2, "../package.json");
3726
- var packageJson2 = JSON.parse(fs3.readFileSync(packageJsonPath2, "utf-8"));
3727
- var server = new McpServer({
3728
- name: "kendo-mcp",
3729
- title: "Kendo MCP Server",
3730
- version: packageJson2.version
3731
- });
3732
- async function startServer() {
3733
- const transport = new StdioServerTransport();
3734
- log("Starting server... ");
3735
- const accessType = await checkAccess(async () => {
3736
- const response = await validateUserLicense();
3737
- const entitlement = response?.entitlement;
3738
- return entitlement?.Product?.Code || entitlement?.product?.code;
3739
- });
3740
- if (accessType !== "none") {
3741
- contextApi.toolNameHeader = accessType === "agent" || accessType === "full" ? "agent" : "assistant";
3742
- const reactTools = createReactTools(contextApi, accessType);
3743
- reactTools.forEach((tool) => tool.register(server));
3744
- startHeartbeat({
3745
- serverName: "react",
3746
- contextApi,
3747
- additionalFields: {
3748
- version: packageJson2.version,
3749
- access_type: accessType
3750
- }
3751
- });
3752
- }
3753
- await server.connect(transport);
3754
- }
3755
- startServer();
1396
+ `),grid:[J,X].join(`
1397
+
1398
+ `),editor:je},He=u.ToolNames.layoutAssistant(N),Z=u.ToolNames.codeAssistant(N),Ve=u.ToolNames.styleAssistant(N),ee=u.ToolNames.iconAssistant(N),We=u.ToolNames.gettingStartedAssistant(N),ze=u.ToolNames.accessibilityAssistant(N);function Ye(e,t){return[u.Tools.createOrchestrator({name:u.ToolNames.orchestrator(N),title:"KendoReact Generator",description:u.ToolDescriptions.orchestrator(c),layoutAssistantName:He,codeAssistantName:Z,styleAssistantName:Ve,iconAssistantName:ee,accessibilityAssistantName:ze,suiteName:c,libKey:T,components:G,requiredAccess:["agent"]},{validationSteps:u.Validation.React.steps},e),u.Tools.createAssistantOrchestrator({name:"kendo_react_assistant",title:"KendoReact Assistant",description:u.ToolDescriptions.assistantOrchestrator(c),codeAssistantName:Z,iconAssistantName:ee,suiteName:c,libKey:T,components:G,requiredAccess:["assistant"]},e),u.Tools.createLayoutAssistant({name:He,title:"KendoReact Layout Assistant",description:u.ToolDescriptions.layoutAssistant,suiteName:c,libKey:T,getPreContent:_e,requiredAccess:["agent"]},e),u.Tools.createStyleAssistant({name:Ve,title:"KendoReact Style Assistant",description:u.ToolDescriptions.styleAssistant,libKey:T,getPreContent:Me,requiredAccess:["agent"]},e),u.Tools.createIconSearch({name:ee,title:"KendoReact Icon Assistant",description:u.ToolDescriptions.iconAssistant,libKey:T,getPostContent:Be,requiredAccess:["assistant","agent"]},e),u.Tools.createCodeAssistant({name:Z,title:"KendoReact Component Assistant",description:u.ToolDescriptions.codeAssistant(c),libKey:T,suiteName:c,components:G,componentAliases:{Grid:"DataGrid"},getPostContent:({component:o})=>{let s=o?.trim().toLowerCase(),r=Tt[s];return Fe({component:o,componentInstructions:r})},requiredAccess:["assistant","agent"]},e),new w(We,{title:"KendoReact Getting Started",description:`Creates a new React project with Kendo CLI and provides essential getting started guidance for ${c} including installation, configuration, and setup instructions.`,requiredAccess:["agent"],inputSchema:he(c,"kendo-react-app")},async({projectName:o,createNewProject:s,theme:r},{_meta:a})=>{try{await e.recordToolUserRequest({toolName:We,meta:{projectName:o,createNewProject:s,theme:r,_meta:a}})}catch(d){console.error("Error recording tool request:",d)}return{content:[{type:"text",text:Ke(o,s,r)}]}}),u.Tools.createAccessibilityAssistant({name:ze,title:"KendoReact Accessibility Assistant",description:u.ToolDescriptions.accessibilityAssistant(c),libKey:T,suiteName:c,components:G,componentAliases:{Grid:"DataGrid"},requiredAccess:["agent"]},e)].filter(o=>o.hasAccess(t))}var Rt=Et(import.meta.url),Pt=Je.dirname(Rt),Dt=Je.resolve(Pt,"../package.json"),Xe=JSON.parse(xt.readFileSync(Dt,"utf-8")),Qe=new It({name:"kendo-mcp",title:"Kendo MCP Server",version:Xe.version});async function Gt(){let e=new Nt;h("Starting server... ");let t=await pe(async()=>{let o=(await ge())?.entitlement;return o?.Product?.Code||o?.product?.code});t!=="none"&&(O.toolNameHeader=t==="agent"||t==="full"?"agent":"assistant",Ye(O,t).forEach(o=>o.register(Qe)),ue({serverName:"react",contextApi:O,additionalFields:{version:Xe.version,access_type:t}})),await Qe.connect(e)}Gt();