@progress/kendo-react-webmcp 15.0.1-develop.3 → 15.0.1-develop.4
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/WebMcpProvider.js +1 -1
- package/WebMcpProvider.mjs +84 -80
- package/adapters/button.d.ts +1 -1
- package/adapters/button.js +1 -1
- package/adapters/button.mjs +12 -17
- package/adapters/{dashboard.d.ts → checkbox.d.ts} +5 -6
- package/adapters/checkbox.js +8 -0
- package/adapters/checkbox.mjs +60 -0
- package/adapters/dropdowntree.js +1 -1
- package/adapters/dropdowntree.mjs +78 -51
- package/adapters/editor.d.ts +0 -1
- package/adapters/editor.js +1 -1
- package/adapters/editor.mjs +38 -46
- package/adapters/form.d.ts +1 -0
- package/adapters/form.js +3 -3
- package/adapters/form.mjs +75 -49
- package/adapters/gantt.d.ts +2 -0
- package/adapters/gantt.js +1 -1
- package/adapters/gantt.mjs +188 -140
- package/adapters/grid.d.ts +0 -1
- package/adapters/grid.js +1 -1
- package/adapters/grid.mjs +52 -60
- package/adapters/multicolumncombobox.d.ts +20 -0
- package/adapters/multicolumncombobox.js +8 -0
- package/adapters/multicolumncombobox.mjs +75 -0
- package/adapters/multiselect.d.ts +2 -0
- package/adapters/multiselect.js +1 -1
- package/adapters/multiselect.mjs +46 -30
- package/adapters/notification.js +1 -1
- package/adapters/notification.mjs +14 -14
- package/adapters/pivotgrid.js +1 -1
- package/adapters/pivotgrid.mjs +39 -47
- package/adapters/scheduler.js +1 -1
- package/adapters/scheduler.mjs +137 -92
- package/adapters/spreadsheet.js +1 -1
- package/adapters/spreadsheet.mjs +3 -3
- package/adapters/switch.js +1 -1
- package/adapters/switch.mjs +29 -19
- package/adapters/treeview.js +2 -2
- package/adapters/treeview.mjs +79 -113
- package/adapters/window.d.ts +0 -2
- package/adapters/window.js +1 -1
- package/adapters/window.mjs +29 -63
- package/commands/form.d.ts +4 -1
- package/commands/form.js +1 -1
- package/commands/form.mjs +11 -7
- package/commands/gantt.js +1 -1
- package/commands/gantt.mjs +14 -10
- package/commands/grid.d.ts +0 -4
- package/commands/grid.js +1 -1
- package/commands/grid.mjs +18 -24
- package/commands/index.d.ts +0 -1
- package/commands/pivotgrid.d.ts +0 -4
- package/commands/pivotgrid.js +1 -1
- package/commands/pivotgrid.mjs +6 -12
- package/commands/scheduler.d.ts +10 -0
- package/commands/scheduler.js +1 -1
- package/commands/scheduler.mjs +16 -4
- package/commands/window.d.ts +0 -8
- package/commands/window.js +1 -1
- package/commands/window.mjs +8 -18
- package/dist/cdn/js/kendo-react-webmcp.js +1 -1
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/index.js +1 -1
- package/index.mjs +248 -249
- package/package.json +3 -3
- package/schemas/gantt.d.ts +4 -0
- package/schemas/gantt.js +1 -1
- package/schemas/gantt.mjs +93 -8
- package/schemas/scheduler.d.ts +2 -0
- package/schemas/scheduler.js +1 -1
- package/schemas/scheduler.mjs +21 -5
- package/adapters/dashboard.js +0 -8
- package/adapters/dashboard.mjs +0 -41
- package/commands/dashboard.d.ts +0 -19
- package/commands/dashboard.js +0 -8
- package/commands/dashboard.mjs +0 -21
package/WebMcpProvider.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),p=require("@progress/kendo-react-common"),w=require("./adapters/textbox.js"),k=require("./adapters/button.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),p=require("@progress/kendo-react-common"),w=require("./adapters/textbox.js"),k=require("./adapters/button.js"),h=require("./adapters/treeview.js"),v=require("./adapters/chat.js"),P=require("./adapters/form.js"),M=require("./adapters/editor.js"),N=require("./adapters/spreadsheet.js"),D=require("./adapters/scheduler.js"),S=require("./adapters/gantt.js"),T=require("./adapters/grid.js"),B=require("./adapters/treelist.js"),R=require("./adapters/tabstrip.js"),y=require("./adapters/panelbar.js"),C=require("./adapters/stepper.js"),O=require("./adapters/drawer.js"),_=require("./adapters/window.js"),j=require("./adapters/dropdownlist.js"),V=require("./adapters/combobox.js"),E=require("./adapters/multicolumncombobox.js"),W=require("./adapters/autocomplete.js"),L=require("./adapters/multiselect.js"),$=require("./adapters/dropdowntree.js"),z=require("./adapters/datepicker.js"),G=require("./adapters/daterangepicker.js"),F=require("./adapters/timepicker.js"),H=require("./adapters/datetimepicker.js"),I=require("./adapters/calendar.js"),J=require("./adapters/numerictextbox.js"),K=require("./adapters/slider.js"),Q=require("./adapters/rangeslider.js"),U=require("./adapters/checkbox.js"),X=require("./adapters/colorpicker.js"),Y=require("./adapters/switch.js"),Z=require("./adapters/rating.js"),ee=require("./adapters/textarea.js"),te=require("./adapters/maskedtextbox.js"),re=require("./adapters/signature.js"),oe=require("./adapters/upload.js"),ae=require("./adapters/listbox.js"),ie=require("./adapters/listview.js"),ce=require("./adapters/dialog.js"),ne=require("./adapters/menu.js"),se=require("./adapters/scrollview.js"),de=require("./adapters/sortable.js"),pe=require("./adapters/map.js"),ue=require("./adapters/notification.js"),le=require("./adapters/chart.js"),me=require("./adapters/taskboard.js"),Ae=require("./adapters/pivotgrid.js"),qe=require("./adapters/aiprompt.js");function be(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=be(f),ge=new Map([["textbox",w.textBoxAdapter],["button",k.buttonAdapter],["treeview",h.treeViewAdapter],["chat",v.chatAdapter],["form",P.formAdapter],["editor",M.editorAdapter],["spreadsheet",N.spreadsheetAdapter],["scheduler",D.schedulerAdapter],["gantt",S.ganttAdapter],["grid",T.gridAdapter],["treelist",B.treeListAdapter],["tabstrip",R.tabStripAdapter],["panelbar",y.panelBarAdapter],["stepper",C.stepperAdapter],["drawer",O.drawerAdapter],["window",_.windowAdapter],["dropdownlist",j.dropDownListAdapter],["combobox",V.comboBoxAdapter],["multicolumncombobox",E.multiColumnComboBoxAdapter],["autocomplete",W.autoCompleteAdapter],["multiselect",L.multiSelectAdapter],["dropdowntree",$.dropDownTreeAdapter],["datepicker",z.datePickerAdapter],["daterangepicker",G.dateRangePickerAdapter],["timepicker",F.timePickerAdapter],["datetimepicker",H.dateTimePickerAdapter],["calendar",I.calendarAdapter],["numerictextbox",J.numericTextBoxAdapter],["slider",K.sliderAdapter],["rangeslider",Q.rangeSliderAdapter],["colorpicker",X.colorPickerAdapter],["switch",Y.switchAdapter],["checkbox",U.checkboxAdapter],["rating",Z.ratingAdapter],["textarea",ee.textAreaAdapter],["maskedtextbox",te.maskedTextBoxAdapter],["signature",re.signatureAdapter],["upload",oe.uploadAdapter],["listbox",ae.listBoxAdapter],["listview",ie.listViewAdapter],["dialog",ce.dialogAdapter],["menu",ne.menuAdapter],["scrollview",se.scrollViewAdapter],["sortable",de.sortableAdapter],["map",pe.mapAdapter],["notification",ue.notificationAdapter],["chart",le.chartAdapter],["taskboard",me.taskboardAdapter],["pivotgrid",Ae.pivotgridAdapter],["aiprompt",qe.aipromptAdapter]]),xe=({children:e,dataName:r})=>{const t=i.useRef(r);t.current=r;const o=i.useCallback((l,m,A,q)=>{const c=ge.get(l);if(!c)return()=>{};const d=p.getModelContext();if(!d)return()=>{};const a=q,n=(typeof(a==null?void 0:a.dataName)=="string"?a.dataName:void 0)||t.current;if(!n)return()=>{};const b=`${n}_${c.componentSuffix}`,g={dataName:n,groupName:b},x=c.createTools(m,A,g,d);return()=>{x.forEach(s=>s==null?void 0:s.unregister())}},[]),u=i.useMemo(()=>({register:o}),[o]);return i.createElement(p.WebMcpContext.Provider,{value:u},e)};exports.WebMcpProvider=xe;
|
package/WebMcpProvider.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import { getModelContext as
|
|
9
|
+
import { getModelContext as g, WebMcpContext as w } from "@progress/kendo-react-common";
|
|
10
10
|
import { textBoxAdapter as k } from "./adapters/textbox.mjs";
|
|
11
11
|
import { buttonAdapter as h } from "./adapters/button.mjs";
|
|
12
12
|
import { treeViewAdapter as v } from "./adapters/treeview.mjs";
|
|
@@ -16,46 +16,48 @@ import { editorAdapter as B } from "./adapters/editor.mjs";
|
|
|
16
16
|
import { spreadsheetAdapter as D } from "./adapters/spreadsheet.mjs";
|
|
17
17
|
import { schedulerAdapter as M } from "./adapters/scheduler.mjs";
|
|
18
18
|
import { ganttAdapter as T } from "./adapters/gantt.mjs";
|
|
19
|
-
import { gridAdapter as
|
|
20
|
-
import { treeListAdapter as
|
|
21
|
-
import { tabStripAdapter as
|
|
22
|
-
import { panelBarAdapter as
|
|
19
|
+
import { gridAdapter as C } from "./adapters/grid.mjs";
|
|
20
|
+
import { treeListAdapter as R } from "./adapters/treelist.mjs";
|
|
21
|
+
import { tabStripAdapter as S } from "./adapters/tabstrip.mjs";
|
|
22
|
+
import { panelBarAdapter as V } from "./adapters/panelbar.mjs";
|
|
23
23
|
import { stepperAdapter as E } from "./adapters/stepper.mjs";
|
|
24
24
|
import { drawerAdapter as L } from "./adapters/drawer.mjs";
|
|
25
25
|
import { windowAdapter as W } from "./adapters/window.mjs";
|
|
26
26
|
import { dropDownListAdapter as _ } from "./adapters/dropdownlist.mjs";
|
|
27
27
|
import { comboBoxAdapter as $ } from "./adapters/combobox.mjs";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
|
|
28
|
+
import { multiColumnComboBoxAdapter as y } from "./adapters/multicolumncombobox.mjs";
|
|
29
|
+
import { autoCompleteAdapter as G } from "./adapters/autocomplete.mjs";
|
|
30
|
+
import { multiSelectAdapter as j } from "./adapters/multiselect.mjs";
|
|
31
|
+
import { dropDownTreeAdapter as q } from "./adapters/dropdowntree.mjs";
|
|
32
|
+
import { datePickerAdapter as z } from "./adapters/datepicker.mjs";
|
|
33
|
+
import { dateRangePickerAdapter as F } from "./adapters/daterangepicker.mjs";
|
|
34
|
+
import { timePickerAdapter as H } from "./adapters/timepicker.mjs";
|
|
35
|
+
import { dateTimePickerAdapter as I } from "./adapters/datetimepicker.mjs";
|
|
36
|
+
import { calendarAdapter as J } from "./adapters/calendar.mjs";
|
|
37
|
+
import { numericTextBoxAdapter as K } from "./adapters/numerictextbox.mjs";
|
|
38
|
+
import { sliderAdapter as O } from "./adapters/slider.mjs";
|
|
39
|
+
import { rangeSliderAdapter as Q } from "./adapters/rangeslider.mjs";
|
|
40
|
+
import { checkboxAdapter as U } from "./adapters/checkbox.mjs";
|
|
41
|
+
import { colorPickerAdapter as X } from "./adapters/colorpicker.mjs";
|
|
42
|
+
import { switchAdapter as Y } from "./adapters/switch.mjs";
|
|
43
|
+
import { ratingAdapter as Z } from "./adapters/rating.mjs";
|
|
44
|
+
import { textAreaAdapter as rr } from "./adapters/textarea.mjs";
|
|
45
|
+
import { maskedTextBoxAdapter as tr } from "./adapters/maskedtextbox.mjs";
|
|
46
|
+
import { signatureAdapter as er } from "./adapters/signature.mjs";
|
|
47
|
+
import { uploadAdapter as or } from "./adapters/upload.mjs";
|
|
48
|
+
import { listBoxAdapter as mr } from "./adapters/listbox.mjs";
|
|
49
|
+
import { listViewAdapter as pr } from "./adapters/listview.mjs";
|
|
50
|
+
import { dialogAdapter as ar } from "./adapters/dialog.mjs";
|
|
51
|
+
import { menuAdapter as ir } from "./adapters/menu.mjs";
|
|
52
|
+
import { scrollViewAdapter as dr } from "./adapters/scrollview.mjs";
|
|
53
|
+
import { sortableAdapter as fr } from "./adapters/sortable.mjs";
|
|
54
|
+
import { mapAdapter as cr } from "./adapters/map.mjs";
|
|
55
|
+
import { notificationAdapter as nr } from "./adapters/notification.mjs";
|
|
56
|
+
import { chartAdapter as sr } from "./adapters/chart.mjs";
|
|
57
|
+
import { taskboardAdapter as Ar } from "./adapters/taskboard.mjs";
|
|
58
|
+
import { pivotgridAdapter as lr } from "./adapters/pivotgrid.mjs";
|
|
59
|
+
import { aipromptAdapter as ur } from "./adapters/aiprompt.mjs";
|
|
60
|
+
const xr = /* @__PURE__ */ new Map([
|
|
59
61
|
["textbox", k],
|
|
60
62
|
["button", h],
|
|
61
63
|
["treeview", v],
|
|
@@ -65,68 +67,70 @@ const lr = /* @__PURE__ */ new Map([
|
|
|
65
67
|
["spreadsheet", D],
|
|
66
68
|
["scheduler", M],
|
|
67
69
|
["gantt", T],
|
|
68
|
-
["grid",
|
|
69
|
-
["treelist",
|
|
70
|
-
["tabstrip",
|
|
71
|
-
["panelbar",
|
|
70
|
+
["grid", C],
|
|
71
|
+
["treelist", R],
|
|
72
|
+
["tabstrip", S],
|
|
73
|
+
["panelbar", V],
|
|
72
74
|
["stepper", E],
|
|
73
75
|
["drawer", L],
|
|
74
76
|
["window", W],
|
|
75
77
|
["dropdownlist", _],
|
|
76
78
|
["combobox", $],
|
|
77
|
-
["
|
|
78
|
-
["
|
|
79
|
-
["
|
|
80
|
-
["
|
|
81
|
-
["
|
|
82
|
-
["
|
|
83
|
-
["
|
|
84
|
-
["
|
|
85
|
-
["
|
|
86
|
-
["
|
|
87
|
-
["
|
|
88
|
-
["
|
|
89
|
-
["
|
|
90
|
-
["
|
|
91
|
-
["
|
|
92
|
-
["
|
|
93
|
-
["
|
|
94
|
-
["
|
|
95
|
-
["
|
|
96
|
-
["
|
|
97
|
-
["
|
|
98
|
-
["
|
|
99
|
-
["
|
|
100
|
-
["
|
|
101
|
-
["
|
|
102
|
-
["
|
|
103
|
-
["
|
|
104
|
-
["
|
|
105
|
-
["
|
|
106
|
-
["
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
79
|
+
["multicolumncombobox", y],
|
|
80
|
+
["autocomplete", G],
|
|
81
|
+
["multiselect", j],
|
|
82
|
+
["dropdowntree", q],
|
|
83
|
+
["datepicker", z],
|
|
84
|
+
["daterangepicker", F],
|
|
85
|
+
["timepicker", H],
|
|
86
|
+
["datetimepicker", I],
|
|
87
|
+
["calendar", J],
|
|
88
|
+
["numerictextbox", K],
|
|
89
|
+
["slider", O],
|
|
90
|
+
["rangeslider", Q],
|
|
91
|
+
["colorpicker", X],
|
|
92
|
+
["switch", Y],
|
|
93
|
+
["checkbox", U],
|
|
94
|
+
["rating", Z],
|
|
95
|
+
["textarea", rr],
|
|
96
|
+
["maskedtextbox", tr],
|
|
97
|
+
["signature", er],
|
|
98
|
+
["upload", or],
|
|
99
|
+
["listbox", mr],
|
|
100
|
+
["listview", pr],
|
|
101
|
+
["dialog", ar],
|
|
102
|
+
["menu", ir],
|
|
103
|
+
["scrollview", dr],
|
|
104
|
+
["sortable", fr],
|
|
105
|
+
["map", cr],
|
|
106
|
+
["notification", nr],
|
|
107
|
+
["chart", sr],
|
|
108
|
+
["taskboard", Ar],
|
|
109
|
+
["pivotgrid", lr],
|
|
110
|
+
["aiprompt", ur]
|
|
111
|
+
]), ut = ({ children: f, dataName: p }) => {
|
|
112
|
+
const a = t.useRef(p);
|
|
113
|
+
a.current = p;
|
|
110
114
|
const i = t.useCallback(
|
|
111
115
|
(n, s, A, l) => {
|
|
112
|
-
const e =
|
|
116
|
+
const e = xr.get(n);
|
|
113
117
|
if (!e)
|
|
114
118
|
return () => {
|
|
115
119
|
};
|
|
116
|
-
const d =
|
|
120
|
+
const d = g();
|
|
117
121
|
if (!d)
|
|
118
122
|
return () => {
|
|
119
123
|
};
|
|
120
|
-
const r = l, o = (typeof (r == null ? void 0 : r.dataName) == "string" ? r.dataName : void 0) ||
|
|
124
|
+
const r = l, o = (typeof (r == null ? void 0 : r.dataName) == "string" ? r.dataName : void 0) || a.current;
|
|
121
125
|
if (!o)
|
|
122
126
|
return () => {
|
|
123
127
|
};
|
|
124
|
-
const u = `${o}_${e.componentSuffix}`,
|
|
128
|
+
const u = `${o}_${e.componentSuffix}`, x = {
|
|
125
129
|
dataName: o,
|
|
126
130
|
groupName: u
|
|
127
|
-
},
|
|
131
|
+
}, b = e.createTools(s, A, x, d);
|
|
128
132
|
return () => {
|
|
129
|
-
|
|
133
|
+
b.forEach((m) => m == null ? void 0 : m.unregister());
|
|
130
134
|
};
|
|
131
135
|
},
|
|
132
136
|
[]
|
|
@@ -134,5 +138,5 @@ const lr = /* @__PURE__ */ new Map([
|
|
|
134
138
|
return /* @__PURE__ */ t.createElement(w.Provider, { value: c }, f);
|
|
135
139
|
};
|
|
136
140
|
export {
|
|
137
|
-
|
|
141
|
+
ut as WebMcpProvider
|
|
138
142
|
};
|
package/adapters/button.d.ts
CHANGED
package/adapters/button.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../commands/button.js"),f={componentSuffix:"button",createTools(
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../commands/button.js"),f={componentSuffix:"button",createTools(e,s,n,p){const i=[],d=t=>`${n.groupName}_${t}`,u=[{name:"click",description:`Click the ${n.dataName} button.`,commandType:r.ButtonCommands.Click,enabled:!0}],o=s.current.webMcp,a=typeof o=="object"&&o!==null&&typeof o.tools=="function"?o.tools:void 0,b=a?a(u):u,y=async(t,l)=>t!==r.ButtonCommands.Click?{content:[{type:"text",text:`Unknown command: ${t}`}],isError:!0}:s.current.disabled?{content:[{type:"text",text:"Button is disabled."}],isError:!0}:e!=null&&e.click?(e.click(),{content:[{type:"text",text:`Clicked the ${n.dataName} button.`}]}):{content:[{type:"text",text:"Button ref not available."}],isError:!0};for(const t of b){if(!t.enabled)continue;const l=r.getButtonToolSchema(t.commandType),x=t.commandType,m=t.execute;try{i.push(p.registerTool({name:d(t.name),description:t.description,inputSchema:l,execute:m?async c=>await m(c):async c=>y(x,c||{})}))}catch{}}return i}};exports.buttonAdapter=f;
|
package/adapters/button.mjs
CHANGED
|
@@ -5,34 +5,29 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { ButtonCommands as l, getButtonToolSchema as
|
|
9
|
-
const
|
|
8
|
+
import { ButtonCommands as l, getButtonToolSchema as f } from "../commands/button.mjs";
|
|
9
|
+
const C = {
|
|
10
10
|
componentSuffix: "button",
|
|
11
|
-
createTools(
|
|
12
|
-
const s = [],
|
|
11
|
+
createTools(e, r, n, p) {
|
|
12
|
+
const s = [], d = (t) => `${n.groupName}_${t}`, i = [
|
|
13
13
|
{
|
|
14
14
|
name: "click",
|
|
15
|
-
description: `Click the ${
|
|
15
|
+
description: `Click the ${n.dataName} button.`,
|
|
16
16
|
commandType: l.Click,
|
|
17
17
|
enabled: !0
|
|
18
18
|
}
|
|
19
|
-
], o = r.current.webMcp, a = typeof o == "object" && o !== null && typeof o.tools == "function" ? o.tools : void 0,
|
|
20
|
-
|
|
21
|
-
return { content: [{ type: "text", text: `Unknown command: ${t}` }], isError: !0 };
|
|
22
|
-
const e = n == null ? void 0 : n.element;
|
|
23
|
-
return e ? e.disabled || r.current.disabled ? { content: [{ type: "text", text: "Button is disabled." }], isError: !0 } : (e.click(), { content: [{ type: "text", text: `Clicked the ${c.dataName} button.` }] }) : { content: [{ type: "text", text: "Button ref not available." }], isError: !0 };
|
|
24
|
-
};
|
|
25
|
-
for (const t of d) {
|
|
19
|
+
], o = r.current.webMcp, a = typeof o == "object" && o !== null && typeof o.tools == "function" ? o.tools : void 0, x = a ? a(i) : i, b = async (t, u) => t !== l.Click ? { content: [{ type: "text", text: `Unknown command: ${t}` }], isError: !0 } : r.current.disabled ? { content: [{ type: "text", text: "Button is disabled." }], isError: !0 } : e != null && e.click ? (e.click(), { content: [{ type: "text", text: `Clicked the ${n.dataName} button.` }] }) : { content: [{ type: "text", text: "Button ref not available." }], isError: !0 };
|
|
20
|
+
for (const t of x) {
|
|
26
21
|
if (!t.enabled)
|
|
27
22
|
continue;
|
|
28
|
-
const u =
|
|
23
|
+
const u = f(t.commandType), y = t.commandType, m = t.execute;
|
|
29
24
|
try {
|
|
30
25
|
s.push(
|
|
31
|
-
|
|
32
|
-
name:
|
|
26
|
+
p.registerTool({
|
|
27
|
+
name: d(t.name),
|
|
33
28
|
description: t.description,
|
|
34
29
|
inputSchema: u,
|
|
35
|
-
execute: async (
|
|
30
|
+
execute: m ? async (c) => await m(c) : async (c) => b(y, c || {})
|
|
36
31
|
})
|
|
37
32
|
);
|
|
38
33
|
} catch {
|
|
@@ -42,5 +37,5 @@ const k = {
|
|
|
42
37
|
}
|
|
43
38
|
};
|
|
44
39
|
export {
|
|
45
|
-
|
|
40
|
+
C as buttonAdapter
|
|
46
41
|
};
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { ToolAdapter } from '../types';
|
|
9
|
-
interface
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
pdf?: Record<string, unknown>;
|
|
9
|
+
interface CheckboxAdapterProps {
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
value?: boolean;
|
|
12
|
+
onChange?: (event: Record<string, unknown>) => void;
|
|
14
13
|
webMcp?: unknown;
|
|
15
14
|
}
|
|
16
15
|
/** @hidden */
|
|
17
|
-
export declare const
|
|
16
|
+
export declare const checkboxAdapter: ToolAdapter<unknown, CheckboxAdapterProps>;
|
|
18
17
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../commands/checkbox.js"),b={componentSuffix:"checkbox",createTools(h,r,l,k){const i=[],p=e=>`${l.groupName}_${e}`,u=r.current,d=[{name:"toggle",description:`Toggle the ${l.dataName} checkbox.`,commandType:n.CheckBoxCommands.Toggle,enabled:!!u.onChange},{name:"set_value",description:`Set the ${l.dataName} checkbox to a specific checked or unchecked state.`,commandType:n.CheckBoxCommands.SetValue,enabled:!!u.onChange}],c=u.webMcp,m=typeof c=="object"&&c!==null&&typeof c.tools=="function"?c.tools:void 0,x=m?m(d):d,C=async(e,a)=>{var s,g;if(e===n.CheckBoxCommands.Toggle){const t=r.current,o=(g=(s=t.checked)!=null?s:t.value)!=null?g:!1;return t.onChange&&t.onChange({value:!o,syntheticEvent:null,target:h}),{content:[{type:"text",text:`Checkbox toggled to ${o?"unchecked":"checked"}.`}]}}if(e===n.CheckBoxCommands.SetValue){const t=r.current,o=!!a.value;return t.onChange&&t.onChange({value:o,syntheticEvent:null,target:h}),{content:[{type:"text",text:`Checkbox set to ${o?"checked":"unchecked"}.`}]}}return{content:[{type:"text",text:`Unknown command: ${e}`}],isError:!0}};for(const e of x){if(!e.enabled)continue;const a=e.commandType;try{i.push(k.registerTool({name:p(e.name),description:e.description,inputSchema:n.getCheckBoxToolSchema(a),execute:async s=>C(a,s||{})}))}catch{}}return i}};exports.checkboxAdapter=b;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { CheckBoxCommands as s, getCheckBoxToolSchema as b } from "../commands/checkbox.mjs";
|
|
9
|
+
const y = {
|
|
10
|
+
componentSuffix: "checkbox",
|
|
11
|
+
createTools(h, r, l, g) {
|
|
12
|
+
const i = [], x = (e) => `${l.groupName}_${e}`, u = r.current, d = [
|
|
13
|
+
{
|
|
14
|
+
name: "toggle",
|
|
15
|
+
description: `Toggle the ${l.dataName} checkbox.`,
|
|
16
|
+
commandType: s.Toggle,
|
|
17
|
+
enabled: !!u.onChange
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "set_value",
|
|
21
|
+
description: `Set the ${l.dataName} checkbox to a specific checked or unchecked state.`,
|
|
22
|
+
commandType: s.SetValue,
|
|
23
|
+
enabled: !!u.onChange
|
|
24
|
+
}
|
|
25
|
+
], n = u.webMcp, m = typeof n == "object" && n !== null && typeof n.tools == "function" ? n.tools : void 0, k = m ? m(d) : d, C = async (e, c) => {
|
|
26
|
+
var a, p;
|
|
27
|
+
if (e === s.Toggle) {
|
|
28
|
+
const t = r.current, o = (p = (a = t.checked) != null ? a : t.value) != null ? p : !1;
|
|
29
|
+
return t.onChange && t.onChange({ value: !o, syntheticEvent: null, target: h }), {
|
|
30
|
+
content: [{ type: "text", text: `Checkbox toggled to ${o ? "unchecked" : "checked"}.` }]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (e === s.SetValue) {
|
|
34
|
+
const t = r.current, o = !!c.value;
|
|
35
|
+
return t.onChange && t.onChange({ value: o, syntheticEvent: null, target: h }), { content: [{ type: "text", text: `Checkbox set to ${o ? "checked" : "unchecked"}.` }] };
|
|
36
|
+
}
|
|
37
|
+
return { content: [{ type: "text", text: `Unknown command: ${e}` }], isError: !0 };
|
|
38
|
+
};
|
|
39
|
+
for (const e of k) {
|
|
40
|
+
if (!e.enabled)
|
|
41
|
+
continue;
|
|
42
|
+
const c = e.commandType;
|
|
43
|
+
try {
|
|
44
|
+
i.push(
|
|
45
|
+
g.registerTool({
|
|
46
|
+
name: x(e.name),
|
|
47
|
+
description: e.description,
|
|
48
|
+
inputSchema: b(c),
|
|
49
|
+
execute: async (a) => C(c, a || {})
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
} catch {
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return i;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
y as checkboxAdapter
|
|
60
|
+
};
|
package/adapters/dropdowntree.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../commands/dropdowntree.js"),h="DropDownTreeExpand",w="DropDownTreeCollapse";function u(c,n,o,y){for(const s of c)if(typeof s=="object"&&s!==null){const C=s;if(String(C[n])===String(o))return s;const i=C[y];if(Array.isArray(i)){const l=u(i,n,o,y);if(l)return l}}}const S={componentSuffix:"dropdowntree",createTools(c,n,o,y){const s=[],C=a=>`${o.groupName}_${a}`,i=n.current,l=!!i.onChange,D=[{name:"open",description:`Open the ${o.dataName} dropdown tree`,commandType:d.DropDownTreeCommands.Open,enabled:!!i.onOpen},{name:"expand",description:`Expand a node in the ${o.dataName} dropdown tree`,commandType:h,enabled:!!i.onExpandChange},{name:"collapse",description:`Collapse a node in the ${o.dataName} dropdown tree`,commandType:w,enabled:!!i.onExpandChange},{name:"select",description:`Select a node in the ${o.dataName} dropdown tree`,commandType:d.DropDownTreeCommands.SetValue,enabled:l},{name:"clear",description:`Clear the ${o.dataName} dropdown tree selection`,commandType:d.DropDownTreeCommands.Clear,enabled:l},{name:"close",description:`Close the ${o.dataName} dropdown tree`,commandType:d.DropDownTreeCommands.Close,enabled:!0}],x=n.current.webMcp,T=typeof x=="object"&&x!==null&&typeof x.tools=="function"?x.tools:void 0,f=T?T(D):D,g=async(a,t)=>{switch(a){case d.DropDownTreeCommands.Open:{const e=n.current;return e.onOpen&&e.onOpen({syntheticEvent:null,target:c}),{content:[{type:"text",text:"Dropdown tree opened."}]}}case h:{const e=n.current,p=e.dataItemKey||"id",m=e.subItemsField||"items",r=u(e.data||[],p,t.id,m);return e.onExpandChange&&r&&e.onExpandChange({item:r,expanded:!0,syntheticEvent:null,target:c}),{content:[{type:"text",text:r?"Node expanded.":`Node with id "${String(t.id)}" not found.`}]}}case w:{const e=n.current,p=e.dataItemKey||"id",m=e.subItemsField||"items",r=u(e.data||[],p,t.id,m);return e.onExpandChange&&r&&e.onExpandChange({item:r,expanded:!1,syntheticEvent:null,target:c}),{content:[{type:"text",text:r?"Node collapsed.":`Node with id "${String(t.id)}" not found.`}]}}case d.DropDownTreeCommands.SetValue:{const e=n.current,p=e.dataItemKey||"id",m=e.textField||"text",r=e.subItemsField||"items",b=e.data||[],E=u(b,p,t.value,r)||u(b,m,t.value,r);return e.onChange&&e.onChange({value:E||t.value,syntheticEvent:null,target:c}),{content:[{type:"text",text:`Selected "${String(t.value)}".`}]}}case d.DropDownTreeCommands.Close:{const e=n.current;return e.onClose&&e.onClose({syntheticEvent:null,target:c}),{content:[{type:"text",text:"Dropdown tree closed."}]}}case d.DropDownTreeCommands.Clear:{const e=n.current;return e.onChange&&e.onChange({value:null,syntheticEvent:null,target:c}),{content:[{type:"text",text:"Selection cleared."}]}}default:return{content:[{type:"text",text:`Unknown command: ${a}`}],isError:!0}}};for(const a of f){if(!a.enabled)continue;const t=a.commandType,e=t===h||t===w?{type:"object",properties:{id:{type:"string",description:"The data item key of the node to expand/collapse"}},required:["id"]}:d.getDropDownTreeToolSchema(t);try{s.push(y.registerTool({name:C(a.name),description:a.description,inputSchema:e,execute:async p=>g(t,p||{})}))}catch{}}return s}};exports.dropDownTreeAdapter=S;
|
|
@@ -5,102 +5,129 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { DropDownTreeCommands as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
for (const
|
|
12
|
-
if (typeof
|
|
13
|
-
const
|
|
14
|
-
if (String(
|
|
15
|
-
return
|
|
16
|
-
const
|
|
17
|
-
if (Array.isArray(
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
8
|
+
import { DropDownTreeCommands as d, getDropDownTreeToolSchema as N } from "../commands/dropdowntree.mjs";
|
|
9
|
+
const C = "DropDownTreeExpand", w = "DropDownTreeCollapse";
|
|
10
|
+
function m(c, n, o, y) {
|
|
11
|
+
for (const i of c)
|
|
12
|
+
if (typeof i == "object" && i !== null) {
|
|
13
|
+
const x = i;
|
|
14
|
+
if (String(x[n]) === String(o))
|
|
15
|
+
return i;
|
|
16
|
+
const s = x[y];
|
|
17
|
+
if (Array.isArray(s)) {
|
|
18
|
+
const p = m(s, n, o, y);
|
|
19
|
+
if (p)
|
|
20
|
+
return p;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
const v = {
|
|
25
25
|
componentSuffix: "dropdowntree",
|
|
26
|
-
createTools(
|
|
27
|
-
const
|
|
26
|
+
createTools(c, n, o, y) {
|
|
27
|
+
const i = [], x = (r) => `${o.groupName}_${r}`, s = n.current, p = !!s.onChange, f = [
|
|
28
28
|
{
|
|
29
29
|
name: "open",
|
|
30
|
-
description: `Open the ${
|
|
31
|
-
commandType:
|
|
32
|
-
enabled: !!
|
|
30
|
+
description: `Open the ${o.dataName} dropdown tree`,
|
|
31
|
+
commandType: d.Open,
|
|
32
|
+
enabled: !!s.onOpen
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
name: "expand",
|
|
36
|
-
description: `Expand a node in the ${
|
|
37
|
-
commandType:
|
|
38
|
-
enabled: !!
|
|
36
|
+
description: `Expand a node in the ${o.dataName} dropdown tree`,
|
|
37
|
+
commandType: C,
|
|
38
|
+
enabled: !!s.onExpandChange
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "collapse",
|
|
42
|
+
description: `Collapse a node in the ${o.dataName} dropdown tree`,
|
|
43
|
+
commandType: w,
|
|
44
|
+
enabled: !!s.onExpandChange
|
|
39
45
|
},
|
|
40
46
|
{
|
|
41
47
|
name: "select",
|
|
42
|
-
description: `Select a node in the ${
|
|
43
|
-
commandType:
|
|
44
|
-
enabled:
|
|
48
|
+
description: `Select a node in the ${o.dataName} dropdown tree`,
|
|
49
|
+
commandType: d.SetValue,
|
|
50
|
+
enabled: p
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "clear",
|
|
54
|
+
description: `Clear the ${o.dataName} dropdown tree selection`,
|
|
55
|
+
commandType: d.Clear,
|
|
56
|
+
enabled: p
|
|
45
57
|
},
|
|
46
58
|
{
|
|
47
59
|
name: "close",
|
|
48
|
-
description: `Close the ${
|
|
49
|
-
commandType:
|
|
60
|
+
description: `Close the ${o.dataName} dropdown tree`,
|
|
61
|
+
commandType: d.Close,
|
|
50
62
|
enabled: !0
|
|
51
63
|
}
|
|
52
|
-
],
|
|
53
|
-
switch (
|
|
54
|
-
case
|
|
64
|
+
], h = n.current.webMcp, b = typeof h == "object" && h !== null && typeof h.tools == "function" ? h.tools : void 0, E = b ? b(f) : f, g = async (r, t) => {
|
|
65
|
+
switch (r) {
|
|
66
|
+
case d.Open: {
|
|
55
67
|
const e = n.current;
|
|
56
|
-
return e.onOpen && e.onOpen({ syntheticEvent: null, target:
|
|
68
|
+
return e.onOpen && e.onOpen({ syntheticEvent: null, target: c }), { content: [{ type: "text", text: "Dropdown tree opened." }] };
|
|
57
69
|
}
|
|
58
|
-
case
|
|
59
|
-
const e = n.current,
|
|
60
|
-
return e.onExpandChange &&
|
|
70
|
+
case C: {
|
|
71
|
+
const e = n.current, l = e.dataItemKey || "id", u = e.subItemsField || "items", a = m(e.data || [], l, t.id, u);
|
|
72
|
+
return e.onExpandChange && a && e.onExpandChange({ item: a, expanded: !0, syntheticEvent: null, target: c }), {
|
|
61
73
|
content: [
|
|
62
74
|
{
|
|
63
75
|
type: "text",
|
|
64
|
-
text:
|
|
76
|
+
text: a ? "Node expanded." : `Node with id "${String(t.id)}" not found.`
|
|
65
77
|
}
|
|
66
78
|
]
|
|
67
79
|
};
|
|
68
80
|
}
|
|
69
|
-
case
|
|
70
|
-
const e = n.current,
|
|
71
|
-
return e.
|
|
81
|
+
case w: {
|
|
82
|
+
const e = n.current, l = e.dataItemKey || "id", u = e.subItemsField || "items", a = m(e.data || [], l, t.id, u);
|
|
83
|
+
return e.onExpandChange && a && e.onExpandChange({ item: a, expanded: !1, syntheticEvent: null, target: c }), {
|
|
84
|
+
content: [
|
|
85
|
+
{
|
|
86
|
+
type: "text",
|
|
87
|
+
text: a ? "Node collapsed." : `Node with id "${String(t.id)}" not found.`
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
case d.SetValue: {
|
|
93
|
+
const e = n.current, l = e.dataItemKey || "id", u = e.textField || "text", a = e.subItemsField || "items", T = e.data || [], D = m(T, l, t.value, a) || m(T, u, t.value, a);
|
|
94
|
+
return e.onChange && e.onChange({ value: D || t.value, syntheticEvent: null, target: c }), { content: [{ type: "text", text: `Selected "${String(t.value)}".` }] };
|
|
95
|
+
}
|
|
96
|
+
case d.Close: {
|
|
97
|
+
const e = n.current;
|
|
98
|
+
return e.onClose && e.onClose({ syntheticEvent: null, target: c }), { content: [{ type: "text", text: "Dropdown tree closed." }] };
|
|
72
99
|
}
|
|
73
|
-
case
|
|
100
|
+
case d.Clear: {
|
|
74
101
|
const e = n.current;
|
|
75
|
-
return e.
|
|
102
|
+
return e.onChange && e.onChange({ value: null, syntheticEvent: null, target: c }), { content: [{ type: "text", text: "Selection cleared." }] };
|
|
76
103
|
}
|
|
77
104
|
default:
|
|
78
|
-
return { content: [{ type: "text", text: `Unknown command: ${
|
|
105
|
+
return { content: [{ type: "text", text: `Unknown command: ${r}` }], isError: !0 };
|
|
79
106
|
}
|
|
80
107
|
};
|
|
81
|
-
for (const
|
|
82
|
-
if (!
|
|
108
|
+
for (const r of E) {
|
|
109
|
+
if (!r.enabled)
|
|
83
110
|
continue;
|
|
84
|
-
const t =
|
|
111
|
+
const t = r.commandType, e = t === C || t === w ? {
|
|
85
112
|
type: "object",
|
|
86
113
|
properties: {
|
|
87
|
-
id: { type: "string", description: "The data item key of the node to expand" }
|
|
114
|
+
id: { type: "string", description: "The data item key of the node to expand/collapse" }
|
|
88
115
|
},
|
|
89
116
|
required: ["id"]
|
|
90
|
-
} :
|
|
117
|
+
} : N(t);
|
|
91
118
|
try {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
name:
|
|
95
|
-
description:
|
|
119
|
+
i.push(
|
|
120
|
+
y.registerTool({
|
|
121
|
+
name: x(r.name),
|
|
122
|
+
description: r.description,
|
|
96
123
|
inputSchema: e,
|
|
97
|
-
execute: async (
|
|
124
|
+
execute: async (l) => g(t, l || {})
|
|
98
125
|
})
|
|
99
126
|
);
|
|
100
127
|
} catch {
|
|
101
128
|
}
|
|
102
129
|
}
|
|
103
|
-
return
|
|
130
|
+
return i;
|
|
104
131
|
}
|
|
105
132
|
};
|
|
106
133
|
export {
|