@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.
Files changed (2) hide show
  1. package/dist/index.js +10 -10
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- var P=Object.defineProperty;var U=(e,r,t)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var h=(e,r,t)=>U(e,typeof r!="symbol"?r+"":r,t);import{McpServer as V}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as K}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as D}from"zod";var C="Kendo UI for React",I="react",A=["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 N,join as B}from"path";import{fileURLToPath as M}from"url";import{readFileSync as _}from"node:fs";import s from"node:fs";import m from"node:path";import F from"@grpc/proto-loader";import u from"@grpc/grpc-js";var E=["TELERIK_LICENSE","KENDO_UI_LICENSE"],S="TELERIK_LICENSE_PATH",d=(e=>(e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e))(d||{}),y=!1,n=process.env.DEBUG_LOG_FILE,w=!!(n&&typeof n=="string");if(w){let e=m.resolve(n),r=m.dirname(e);if(r!=="."&&r!==process.cwd()&&!s.existsSync(r))try{s.mkdirSync(r,{recursive:!0})}catch(t){console.error("Error creating log directory:",t)}if(!s.existsSync(e))try{s.writeFileSync(e,"")}catch(t){console.error("Error creating log file:",t)}}else y=!1;y=w&&!!n&&s.existsSync(m.resolve(n));function i(...e){if(y&&n){let r=`${new Date().toISOString()}: ${e.join(" ")}
3
- `,t=m.resolve(n);s.appendFile(t,r,o=>{o&&console.error("Error writing to log file:",o)})}}var l=process.env[S],f=process.env[E[0]]||process.env[E[1]],g=class extends Error{constructor(e){super(e),this.name="LicenseError"}};function L(){if(!l&&!f)throw new g(`No license found. Please set one of the following environment variables: ${E.join(", ")} or ${S}`);let e;if(l)try{e=_(l,"utf8"),i("License key read from file: ",l)}catch{throw new g(`Error reading license file: ${l}. Please verify the file exists and is readable.`)}return f&&(e=f,i("License key read from environment variable.")),e}var T=class{constructor(e,r){h(this,"client");h(this,"isDev");this.contextApiUrl=e,this.protoPath=r;let t=F.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(t);this.client=new o.ContextQueryService(this.contextApiUrl||"contextapi.telerik.com:443",this.isDev?u.credentials.createInsecure():u.credentials.createSsl())}async query(e){let r=this.isDev?"fake_license":L(),t=new u.Metadata;if(r&&typeof r=="string"){r=r.replace(/^\uFEFF/,"");try{t.add("x-license-key",r)}catch(o){return i("Error adding license key to metadata:",o),Promise.reject(new Error(`Failed to use license key: ${o.message}`))}}return r&&typeof r=="string"&&t.add("x-license-key",r),new Promise((o,a)=>{this.client.query(e,t,(c,p)=>{c?a(c):o(p)})})}};var O=B(N(M(import.meta.url)),"../proto/service.proto"),q=new T("contextapi.telerik.com:443",O);async function v(e){return q.query(e)}import $ from"fs";import R from"path";import{fileURLToPath as H}from"url";var x=`
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 k=`
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 G=`
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 j=H(import.meta.url),J=R.dirname(j),Y=R.resolve(J,"../package.json"),z=JSON.parse($.readFileSync(Y,"utf-8")),b=new V({name:"kendo-and-kendo-resources",version:z.version});b.tool("kendo_react_assistant",`Answers questions and retrieves documentation about Kendo UI for React.
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:D.string().describe("The query to search for."),component:D.enum(A).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 v({query:e,component:r.toLocaleLowerCase(),lib_name:I,text_matches_count:3,code_matches_count:0,allowed_types:["documentation"]});i("Response from context API: ",JSON.stringify(t));let o=Q(r.toLowerCase()),a=t.values.join(`
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
- `),c=a.trim(),p=[{type:"text",text:a+(c?`
115
+ `),u=n.trim(),l=[{type:"text",text:n+(u?`
116
116
 
117
- `+o:"")}];return i("Response from tool: ",JSON.stringify(p)),{content:p}}catch(t){throw i("Error calling context API: ",JSON.stringify(t)),t?.code===d.UNAUTHENTICATED?new Error("Error: You are not authenticated. Please verify the Telerik License Key provided is valid."):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 ${C} 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.
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 Q(e){let r=e==="datagrid"?x?.trim():"",t=e==="datagrid"?k?.trim():"",o=e==="editor"?G?.trim():"";return`
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 W(){let e=new K;i("Starting server... "),await b.connect(e)}W();
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.2.6",
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.1",
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": {