@progress/kendo-react-mcp 1.1.2 → 1.1.3
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 +42 -9
- package/package.json +1 -1
- package/proto/service.proto +24 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`,
|
|
2
|
+
var G=Object.defineProperty;var D=(e,t,r)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var h=(e,t,r)=>D(e,typeof t!="symbol"?t+"":t,r);import{McpServer as M}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as O}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as k}from"zod";var A="Kendo UI for React",C="react",f=["ActionSheet","AIPrompt","Animation","AppBar","ArcGauge","AutoComplete","Avatar","Badge","Barcode","BottomNavigation","Breadcrumb","Button","ButtonGroup","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","FontIcon","Form","Gantt","Gauge","General","GridLayout","Hint","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","QRCode","RadialGauge","RadioButton","RadioGroup","RangeSlider","Rating","Ripple","Sankey","Scheduler","ScrollView","Signature","Skeleton","Slider","Sortable","Sparkline","SpeechToTextButton","SplitButton","Splitter","Spreadsheet","StackLayout","Stepper","StockChart","SVGIcon","Switch","TabStrip","TaskBoard","TextArea","TextBox","TileLayout","Timeline","TimePicker","Toolbar","Tooltip","TreeList","TreeView","Typography","Upload","VSCodeExtension","Window"];import{dirname as L,join as U}from"path";import{fileURLToPath as F}from"url";import{readFileSync as R}from"node:fs";import a from"node:fs";import m from"node:path";import _ from"@grpc/proto-loader";import u from"@grpc/grpc-js";var w=["TELERIK_LICENSE","KENDO_UI_LICENSE"],I="TELERIK_LICENSE_PATH",l=(e=>(e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e))(l||{}),E=!1,n=process.env.DEBUG_LOG_FILE,v=!!(n&&typeof n=="string");if(v){let e=m.resolve(n),t=m.dirname(e);if(t!=="."&&t!==process.cwd()&&!a.existsSync(t))try{a.mkdirSync(t,{recursive:!0})}catch(r){console.error("Error creating log directory:",r)}if(!a.existsSync(e))try{a.writeFileSync(e,"")}catch(r){console.error("Error creating log file:",r)}}else E=!1;E=v&&!!n&&a.existsSync(m.resolve(n));function i(...e){if(E&&n){let t=`${new Date().toISOString()}: ${e.join(" ")}
|
|
3
|
+
`,r=m.resolve(n);a.appendFile(r,t,o=>{o&&console.error("Error writing to log file:",o)})}}var s=process.env[I],y=process.env[w[0]]||process.env[w[1]],g=class extends Error{constructor(e){super(e),this.name="LicenseError"}};function P(){if(!s&&!y)throw new g(`No license found. Please set one of the following environment variables: ${w.join(", ")} or ${I}`);let e;if(s)try{e=R(s,"utf8"),i("License key read from file: ",s)}catch{throw new g(`Error reading license file: ${s}. Please verify the file exists and is readable.`)}return y&&(e=y,i("License key read from environment variable.")),e}var S=class{constructor(e,t){h(this,"client");h(this,"isDev");this.contextApiUrl=e,this.protoPath=t;let r=_.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"),i("Using ContextApi URl:",this.contextApiUrl);let o=u.loadPackageDefinition(r);this.client=new o.ContextQueryService(this.contextApiUrl||"contextapi.telerik.com:443",this.isDev?u.credentials.createInsecure():u.credentials.createSsl())}async query(e){let t=this.isDev?"fake_license":P(),r=new u.Metadata;if(t&&typeof t=="string"){t=t.replace(/^\uFEFF/,"");try{r.add("x-license-key",t)}catch(o){return i("Error adding license key to metadata:",o),Promise.reject(new Error(`Failed to use license key: ${o.message}`))}}return t&&typeof t=="string"&&r.add("x-license-key",t),new Promise((o,d)=>{this.client.query(e,r,(c,p)=>{c?d(c):o(p)})})}};var N=U(L(F(import.meta.url)),"../proto/service.proto"),B=new S("contextapi.telerik.com:443",N);async function T(e){return B.query(e)}import V from"fs";import x from"path";import{fileURLToPath as q}from"url";var K=q(import.meta.url),H=x.dirname(K),j=x.resolve(H,"../package.json"),$=JSON.parse(V.readFileSync(j,"utf-8")),b=new M({name:"kendo-and-kendo-resources",version:$.version});b.tool("kendo_react_assistant",`Answers questions and retrieves documentation about Kendo UI for React.
|
|
4
4
|
Use this tool when the user asks about Kendo UI for React features, specific components (e.g., Grid, Chart, Editor), implementation details, or general usage.
|
|
5
5
|
Provide the user's detailed question as the 'query'. If the question pertains to a specific Kendo UI for React component,
|
|
6
6
|
specify its name in the 'component' parameter. This tool can be automatically triggered when the following phrases are detected in the user's input/prompt:
|
|
@@ -12,15 +12,15 @@ specify its name in the 'component' parameter. This tool can be automatically tr
|
|
|
12
12
|
- '@kendo';
|
|
13
13
|
- '@kendoreact';
|
|
14
14
|
- '@ask_kendo';
|
|
15
|
-
- '@help_kendo'.`,{query:
|
|
15
|
+
- '@help_kendo'.`,{query:k.string().describe("The query to search for."),component:k.enum(f).describe("The component to search for. If not specified, you can use General.")},async({query:e,component:t})=>{i("Calling tool: ",JSON.stringify({query:e,component:t})),t==="Grid"&&(t="DataGrid");try{let r=await T({query:e,component:t.toLocaleLowerCase(),lib_name:C,text_matches_count:3,code_matches_count:0,allowed_types:["documentation"]});i("Response from context API: ",JSON.stringify(r));let o=J(),d=r.values.join(`
|
|
16
16
|
|
|
17
|
-
`),d
|
|
17
|
+
`),c=d.trim(),p=[{type:"text",text:d+(c?`
|
|
18
18
|
|
|
19
|
-
`+
|
|
19
|
+
`+o:"")}];return i("Response from tool: ",JSON.stringify(p)),{content:p}}catch(r){throw i("Error calling context API: ",JSON.stringify(r)),r?.code===l.UNAUTHENTICATED?new Error("Error: You are not authenticated. Please verify the Telerik License Key provided is valid."):r?.code===l.RESOURCE_EXHAUSTED?new Error(`Error: You have exceeded the extension quota. Upgrade to subscription licensing in order to unlock full access. Message: ${r.message}.`):r?.code===l.PERMISSION_DENIED?new Error(`Error: You do not have permission to access this resource. Please verify that you have a valid ${A} license key.`):r instanceof g?(i("License error: ",r.message),r):new Error(`Error: An error occurred while calling the service. Please try again later.
|
|
20
20
|
|
|
21
|
-
Error Message: ${
|
|
21
|
+
Error Message: ${r.message}`)}});function J(){return`
|
|
22
22
|
## Available ReactComponent enum values:
|
|
23
|
-
${
|
|
23
|
+
${f.join(", ")}
|
|
24
24
|
|
|
25
25
|
## Rules
|
|
26
26
|
When generating code, explanations, or refactorings, always follow these rules:
|
|
@@ -28,7 +28,6 @@ When generating code, explanations, or refactorings, always follow these rules:
|
|
|
28
28
|
1. Component Awareness
|
|
29
29
|
Whenever a component name is mentioned\u2014regardless of how it's written (all lowercase, all uppercase, mixed case, separate words, or even with typos)\u2014you should always look up the correct example from the corresponding component.
|
|
30
30
|
|
|
31
|
-
|
|
32
31
|
Key points:
|
|
33
32
|
- Match component names case-insensitively and robustly to minor variations
|
|
34
33
|
- If someone refers to a component (e.g., "button", "BUTTON", "BuTtOn"), match it to the correct component (Button)
|
|
@@ -116,4 +115,38 @@ Key points:
|
|
|
116
115
|
Example:
|
|
117
116
|
\u274C Deprecated: selectedField="isSelected" editField="inEdit"
|
|
118
117
|
\u2705 Modern: Use select and edit state properties with proper configuration
|
|
119
|
-
|
|
118
|
+
|
|
119
|
+
5. Smart Grid (AI-Enhanced Grid) Implementation Guidelines
|
|
120
|
+
**CRITICAL: When users ask about ANY of these AI grid terms, ALWAYS provide GridToolbarAIAssistant implementation (not basic Grid):**
|
|
121
|
+
|
|
122
|
+
**Primary AI Grid Trigger Terms (case-insensitive):**
|
|
123
|
+
- smart grid, smartgrid, smart-grid, smart_grid, SMART GRID, SmArt GrId
|
|
124
|
+
- ai grid, aigrid, ai-grid, ai_grid, AI GRID, aI-griD, AIGrid
|
|
125
|
+
- ai enhanced grid, ai-enhanced-grid, ai_enhanced_grid, AI Enhanced Grid
|
|
126
|
+
- ai powered grid, ai-powered-grid, ai_powered_grid, AI Powered Grid
|
|
127
|
+
- intelligent grid, intelligent-grid, intelligent_grid, Intelligent Grid
|
|
128
|
+
- grid with ai, grid-with-ai, grid_with_ai, Grid with AI
|
|
129
|
+
- grid ai assistant, gridaiassistant, grid-ai-assistant, Grid AI Assistant
|
|
130
|
+
- grid toolbar ai assistant, gridtoolbaraiassistant, GridToolbarAIAssistant
|
|
131
|
+
- grid assistant, gridassistant, grid-assistant, Grid Assistant
|
|
132
|
+
|
|
133
|
+
**Additional variations that should trigger AI Grid:**
|
|
134
|
+
- ai enhanced, ai powered, smart, intelligent + grid (any spacing/casing)
|
|
135
|
+
- grid + ai, grid + smart, grid + intelligent (any spacing/casing)
|
|
136
|
+
- Any mention of GridToolbarAIAssistant component specifically
|
|
137
|
+
|
|
138
|
+
**Recognition Rule: If query contains ANY combination of AI/Smart/Intelligent + Grid terms, respond with complete GridToolbarAIAssistant setup.**
|
|
139
|
+
|
|
140
|
+
Example Smart Grid suggestions by domain:
|
|
141
|
+
- Financial: 'Sort by Amount descending', 'Show only failed transactions', 'Filter where currency is USD'
|
|
142
|
+
- Sales: 'Group by region', 'Show top performing products', 'Filter by date range'
|
|
143
|
+
- Inventory: 'Sort by stock level', 'Show out of stock items', 'Group by category'
|
|
144
|
+
- Always include: 'Clear sorting', 'Clear filtering', 'Clear grouping'
|
|
145
|
+
|
|
146
|
+
\u274C Basic Grid: <Grid data={data}><GridColumn field="name" /></Grid>
|
|
147
|
+
\u2705 Smart Grid: Complete AI-enhanced setup with GridToolbarAIAssistant, proper callbacks, reset functionality, and contextual suggestions
|
|
148
|
+
|
|
149
|
+
Important Disclaimer:
|
|
150
|
+
Always include this disclaimer when providing Smart Grid examples:
|
|
151
|
+
"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."
|
|
152
|
+
`}async function W(){let e=new O;i("Starting server..."),await b.connect(e)}W();
|
package/package.json
CHANGED
package/proto/service.proto
CHANGED
|
@@ -27,6 +27,30 @@ message StringArray {
|
|
|
27
27
|
repeated string values = 1;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
message CssSearchRequst {
|
|
31
|
+
string query = 1;
|
|
32
|
+
int32 limit = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message BuildingBlocksSearchRequest {
|
|
36
|
+
string query = 1;
|
|
37
|
+
string lib_name = 2;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message BuildingBlockItem {
|
|
41
|
+
string name = 1;
|
|
42
|
+
string description = 2;
|
|
43
|
+
string code = 3;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message BuildingBlocksSearchResponse {
|
|
47
|
+
repeated BuildingBlockItem items = 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
30
50
|
service ContextQueryService {
|
|
31
51
|
rpc Query(ContextQueryRequest) returns (StringArray);
|
|
52
|
+
rpc IconsSearch(CssSearchRequst) returns (StringArray);
|
|
53
|
+
rpc CssUtilsSearch(CssSearchRequst) returns (StringArray);
|
|
54
|
+
rpc BuildingBlocksSearch(BuildingBlocksSearchRequest) returns (BuildingBlocksSearchResponse);
|
|
32
55
|
}
|
|
56
|
+
|