@progress/kendo-react-mcp 1.2.6 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -10
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`,t=
|
|
2
|
+
var D=Object.defineProperty;var b=(e,r,t)=>r in e?D(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var m=(e,r,t)=>b(e,typeof r!="symbol"?r+"":r,t);import{McpServer as q}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as K}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as x}from"zod";var f="Kendo UI for React",y="react",C=["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 B}from"path";import{fileURLToPath as N}from"url";import{loadLicense as R,decodeLicenseKey as P,decodeLicenseEvidence as U}from"@progress/kendo-licensing/utils";import a from"node:fs";import p from"node:path";import _ from"@grpc/proto-loader";import c from"@grpc/grpc-js";var g=class extends Error{constructor(e){super(e),this.name="LicenseError"}};async function F(){let e=R();if(!e.success)throw new g(e.message);return(await P(e.value)).licenses.find(async t=>!!(await U(t)).userId)||e.value}var h=!1,s=process.env.DEBUG_LOG_FILE,A=!!(s&&typeof s=="string");if(A){let e=p.resolve(s),r=p.dirname(e);if(r!=="."&&r!==process.cwd()&&!a.existsSync(r))try{a.mkdirSync(r,{recursive:!0})}catch(t){console.error("Error creating log directory:",t)}if(!a.existsSync(e))try{a.writeFileSync(e,"")}catch(t){console.error("Error creating log file:",t)}}else h=!1;h=A&&!!s&&a.existsSync(p.resolve(s));function i(...e){if(h&&s){let r=`${new Date().toISOString()}: ${e.join(" ")}
|
|
3
|
+
`,t=p.resolve(s);a.appendFile(t,r,o=>{o&&console.error("Error writing to log file:",o)})}}var d=(e=>(e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e))(d||{}),I=class{constructor(e,r){m(this,"client");m(this,"isDev");this.contextApiUrl=e,this.protoPath=r;let t=_.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=c.loadPackageDefinition(t);this.client=new o.ContextQueryService(this.contextApiUrl||"contextapi.telerik.com:443",this.isDev?c.credentials.createInsecure():c.credentials.createSsl())}async query(e){let r=this.isDev?"fake_license":await F(),t=process.env.CONTEXTAPI_API_KEY,o=new c.Metadata;if(r&&typeof r=="string"){r=r.replace(/^\uFEFF/,"");try{o.add("x-license-key",r)}catch(n){return i("Error adding license key to metadata:",n),Promise.reject(new Error(`Failed to use license key: ${n.message}`))}}return t&&typeof t=="string"&&o.add("x-api-key",t),new Promise((n,u)=>{this.client.query(e,o,(l,k)=>{l?u(l):n(k)})})}};var M=B(L(N(import.meta.url)),"../proto/service.proto"),O=new I("contextapi.telerik.com:443",M);async function w(e){return O.query(e)}import V from"fs";import G from"path";import{fileURLToPath as $}from"url";var S=`
|
|
4
4
|
## DataGrid Deprecated Properties Awareness
|
|
5
5
|
For DataGrid component cases, avoid using deprecated properties and always use their modern replacements. The following properties are deprecated and should not be used:
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ Key points:
|
|
|
32
32
|
Example:
|
|
33
33
|
Deprecated: selectedField="isSelected" editField="inEdit"
|
|
34
34
|
Modern: Use select and edit state properties with proper configuration
|
|
35
|
-
`;var
|
|
35
|
+
`;var E=`
|
|
36
36
|
## Smart Grid (AI-Enhanced Grid) Implementation Guidelines
|
|
37
37
|
**CRITICAL: When users ask about ANY of these AI grid terms, ALWAYS provide GridToolbarAIAssistant implementation (not basic Grid):**
|
|
38
38
|
|
|
@@ -66,7 +66,7 @@ Smart Grid: Complete AI-enhanced setup with GridToolbarAIAssistant, proper callb
|
|
|
66
66
|
Important Disclaimer:
|
|
67
67
|
Always include this disclaimer when providing Smart Grid examples:
|
|
68
68
|
"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."
|
|
69
|
-
`;var
|
|
69
|
+
`;var T=`
|
|
70
70
|
## Editor Tools Awareness
|
|
71
71
|
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.
|
|
72
72
|
|
|
@@ -98,7 +98,7 @@ Key points:
|
|
|
98
98
|
Example:
|
|
99
99
|
Correct: tools={[[Bold, Italic, Underline], [AlignLeft, AlignCenter]]}
|
|
100
100
|
Incorrect: tools={[['bold', 'italic', 'underline'], ['alignLeft', 'alignCenter']]}
|
|
101
|
-
`;var
|
|
101
|
+
`;var H=$(import.meta.url),J=G.dirname(H),j=G.resolve(J,"../package.json"),Y=JSON.parse(V.readFileSync(j,"utf-8")),v=new q({name:"kendo-and-kendo-resources",version:Y.version});v.tool("kendo_react_assistant",`Answers questions and retrieves documentation about Kendo UI for React.
|
|
102
102
|
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.
|
|
103
103
|
Provide the exact user's question as the 'query'. If the question pertains to a specific Kendo UI for React component,
|
|
104
104
|
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:
|
|
@@ -110,13 +110,13 @@ specify its name in the 'component' parameter. This tool can be automatically tr
|
|
|
110
110
|
- '@kendo';
|
|
111
111
|
- '@kendoreact';
|
|
112
112
|
- '@ask_kendo';
|
|
113
|
-
- '@help_kendo'.`,{query:
|
|
113
|
+
- '@help_kendo'.`,{query:x.string().describe("The query to search for."),component:x.enum(C).describe("The component to search for. If not specified, you can use General.")},async({query:e,component:r})=>{i("Calling tool: ",JSON.stringify({query:e,component:r})),r==="Grid"&&(r="DataGrid");try{let t=await w({query:e,component:r.toLocaleLowerCase(),lib_name:y,text_matches_count:3,code_matches_count:0,allowed_types:["documentation"]});i("Response from context API: ",JSON.stringify(t));let o=z(r.toLowerCase()),n=t.values.join(`
|
|
114
114
|
|
|
115
|
-
`),
|
|
115
|
+
`),u=n.trim(),l=[{type:"text",text:n+(u?`
|
|
116
116
|
|
|
117
|
-
`+o:"")}];return i("Response from tool: ",JSON.stringify(
|
|
117
|
+
`+o:"")}];return i("Response from tool: ",JSON.stringify(l)),{content:l}}catch(t){throw i("Error calling context API: ",JSON.stringify(t)),t?.code===d.UNAUTHENTICATED?new Error(`Error: You are not authenticated. Message: ${t.message}.`):t?.code===d.RESOURCE_EXHAUSTED?new Error(`Error: You have exceeded the extension quota. Upgrade to subscription licensing in order to unlock full access. Message: ${t.message}.`):t?.code===d.PERMISSION_DENIED?new Error(`Error: You do not have permission to access this resource. Please verify that you have a valid ${f} license key.`):t instanceof g?(i("License error: ",t.message),t):new Error(`Error: An error occurred while calling the service. Please try again later.
|
|
118
118
|
|
|
119
|
-
Error Message: ${t.message}`)}});function
|
|
119
|
+
Error Message: ${t.message}`)}});function z(e){let r=e==="datagrid"?S?.trim():"",t=e==="datagrid"?E?.trim():"",o=e==="editor"?T?.trim():"";return`
|
|
120
120
|
# Kendo UI for React Assistant Guidelines
|
|
121
121
|
|
|
122
122
|
## Documentation References
|
|
@@ -152,4 +152,4 @@ ${r}
|
|
|
152
152
|
${t}
|
|
153
153
|
|
|
154
154
|
${o}`:""}
|
|
155
|
-
`}async function
|
|
155
|
+
`}async function X(){let e=new K;i("Starting server... "),await v.connect(e)}X();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"license": "See LICENSE.md",
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
"!**/*.tsbuildinfo"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@grpc/grpc-js": "^1.14.
|
|
27
|
+
"@grpc/grpc-js": "^1.14.3",
|
|
28
28
|
"@grpc/proto-loader": "^0.8.0",
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
30
|
+
"@progress/kendo-licensing": "^1.8.0",
|
|
30
31
|
"tslib": "^2.3.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|