@progress/kendo-react-webmcp 15.0.0-develop.2
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/LICENSE.md +11 -0
- package/NOTICE.txt +383 -0
- package/README.md +72 -0
- package/WebMcpProvider.d.ts +49 -0
- package/WebMcpProvider.js +8 -0
- package/WebMcpProvider.mjs +138 -0
- package/adapters/aiprompt.d.ts +15 -0
- package/adapters/aiprompt.js +8 -0
- package/adapters/aiprompt.mjs +63 -0
- package/adapters/autocomplete.d.ts +18 -0
- package/adapters/autocomplete.js +8 -0
- package/adapters/autocomplete.mjs +69 -0
- package/adapters/button.d.ts +18 -0
- package/adapters/button.js +8 -0
- package/adapters/button.mjs +46 -0
- package/adapters/calendar.d.ts +16 -0
- package/adapters/calendar.js +8 -0
- package/adapters/calendar.mjs +61 -0
- package/adapters/chart.d.ts +29 -0
- package/adapters/chart.js +8 -0
- package/adapters/chart.mjs +95 -0
- package/adapters/chat.d.ts +16 -0
- package/adapters/chat.js +8 -0
- package/adapters/chat.mjs +66 -0
- package/adapters/colorpicker.d.ts +16 -0
- package/adapters/colorpicker.js +8 -0
- package/adapters/colorpicker.mjs +60 -0
- package/adapters/combobox.d.ts +20 -0
- package/adapters/combobox.js +8 -0
- package/adapters/combobox.mjs +87 -0
- package/adapters/dashboard.d.ts +18 -0
- package/adapters/dashboard.js +8 -0
- package/adapters/dashboard.mjs +41 -0
- package/adapters/datepicker.d.ts +17 -0
- package/adapters/datepicker.js +8 -0
- package/adapters/datepicker.mjs +59 -0
- package/adapters/daterangepicker.d.ts +19 -0
- package/adapters/daterangepicker.js +8 -0
- package/adapters/daterangepicker.mjs +70 -0
- package/adapters/datetimepicker.d.ts +16 -0
- package/adapters/datetimepicker.js +8 -0
- package/adapters/datetimepicker.mjs +59 -0
- package/adapters/dialog.d.ts +15 -0
- package/adapters/dialog.js +8 -0
- package/adapters/dialog.mjs +58 -0
- package/adapters/drawer.d.ts +33 -0
- package/adapters/drawer.js +8 -0
- package/adapters/drawer.mjs +86 -0
- package/adapters/dropdownlist.d.ts +19 -0
- package/adapters/dropdownlist.js +8 -0
- package/adapters/dropdownlist.mjs +74 -0
- package/adapters/dropdowntree.d.ts +22 -0
- package/adapters/dropdowntree.js +8 -0
- package/adapters/dropdowntree.mjs +108 -0
- package/adapters/editor.d.ts +30 -0
- package/adapters/editor.js +8 -0
- package/adapters/editor.mjs +109 -0
- package/adapters/form.d.ts +20 -0
- package/adapters/form.js +10 -0
- package/adapters/form.mjs +115 -0
- package/adapters/gantt.d.ts +65 -0
- package/adapters/gantt.js +8 -0
- package/adapters/gantt.mjs +370 -0
- package/adapters/grid.d.ts +102 -0
- package/adapters/grid.js +8 -0
- package/adapters/grid.mjs +692 -0
- package/adapters/listbox.d.ts +18 -0
- package/adapters/listbox.js +8 -0
- package/adapters/listbox.mjs +87 -0
- package/adapters/listview.d.ts +22 -0
- package/adapters/listview.js +8 -0
- package/adapters/listview.mjs +80 -0
- package/adapters/map.d.ts +32 -0
- package/adapters/map.js +8 -0
- package/adapters/map.mjs +88 -0
- package/adapters/maskedtextbox.d.ts +17 -0
- package/adapters/maskedtextbox.js +8 -0
- package/adapters/maskedtextbox.mjs +57 -0
- package/adapters/menu.d.ts +16 -0
- package/adapters/menu.js +8 -0
- package/adapters/menu.mjs +50 -0
- package/adapters/multiselect.d.ts +19 -0
- package/adapters/multiselect.js +8 -0
- package/adapters/multiselect.mjs +75 -0
- package/adapters/notification.d.ts +17 -0
- package/adapters/notification.js +8 -0
- package/adapters/notification.mjs +57 -0
- package/adapters/numerictextbox.d.ts +19 -0
- package/adapters/numerictextbox.js +8 -0
- package/adapters/numerictextbox.mjs +78 -0
- package/adapters/panelbar.d.ts +17 -0
- package/adapters/panelbar.js +8 -0
- package/adapters/panelbar.mjs +66 -0
- package/adapters/pivotgrid.d.ts +16 -0
- package/adapters/pivotgrid.js +8 -0
- package/adapters/pivotgrid.mjs +126 -0
- package/adapters/rangeslider.d.ts +21 -0
- package/adapters/rangeslider.js +8 -0
- package/adapters/rangeslider.mjs +55 -0
- package/adapters/rating.d.ts +16 -0
- package/adapters/rating.js +8 -0
- package/adapters/rating.mjs +60 -0
- package/adapters/scheduler.d.ts +45 -0
- package/adapters/scheduler.js +8 -0
- package/adapters/scheduler.mjs +165 -0
- package/adapters/scrollview.d.ts +21 -0
- package/adapters/scrollview.js +8 -0
- package/adapters/scrollview.mjs +74 -0
- package/adapters/signature.d.ts +16 -0
- package/adapters/signature.js +8 -0
- package/adapters/signature.mjs +47 -0
- package/adapters/slider.d.ts +19 -0
- package/adapters/slider.js +8 -0
- package/adapters/slider.mjs +47 -0
- package/adapters/sortable.d.ts +17 -0
- package/adapters/sortable.js +8 -0
- package/adapters/sortable.mjs +67 -0
- package/adapters/spreadsheet.d.ts +32 -0
- package/adapters/spreadsheet.js +8 -0
- package/adapters/spreadsheet.mjs +256 -0
- package/adapters/stepper.d.ts +23 -0
- package/adapters/stepper.js +8 -0
- package/adapters/stepper.mjs +47 -0
- package/adapters/switch.d.ts +17 -0
- package/adapters/switch.js +8 -0
- package/adapters/switch.mjs +48 -0
- package/adapters/tabstrip.d.ts +19 -0
- package/adapters/tabstrip.js +8 -0
- package/adapters/tabstrip.mjs +47 -0
- package/adapters/taskboard.d.ts +20 -0
- package/adapters/taskboard.js +8 -0
- package/adapters/taskboard.mjs +104 -0
- package/adapters/textarea.d.ts +16 -0
- package/adapters/textarea.js +8 -0
- package/adapters/textarea.mjs +57 -0
- package/adapters/textbox.d.ts +19 -0
- package/adapters/textbox.js +8 -0
- package/adapters/textbox.mjs +61 -0
- package/adapters/timepicker.d.ts +16 -0
- package/adapters/timepicker.js +8 -0
- package/adapters/timepicker.mjs +59 -0
- package/adapters/treelist.d.ts +81 -0
- package/adapters/treelist.js +8 -0
- package/adapters/treelist.mjs +403 -0
- package/adapters/treeview.d.ts +25 -0
- package/adapters/treeview.js +9 -0
- package/adapters/treeview.mjs +212 -0
- package/adapters/upload.d.ts +15 -0
- package/adapters/upload.js +8 -0
- package/adapters/upload.mjs +52 -0
- package/adapters/utils.d.ts +16 -0
- package/adapters/utils.js +8 -0
- package/adapters/utils.mjs +25 -0
- package/adapters/window.d.ts +17 -0
- package/adapters/window.js +8 -0
- package/adapters/window.mjs +99 -0
- package/commands/aiprompt.d.ts +30 -0
- package/commands/aiprompt.js +8 -0
- package/commands/aiprompt.mjs +54 -0
- package/commands/autocomplete.d.ts +26 -0
- package/commands/autocomplete.js +8 -0
- package/commands/autocomplete.mjs +36 -0
- package/commands/button.d.ts +19 -0
- package/commands/button.js +8 -0
- package/commands/button.mjs +21 -0
- package/commands/calendar.d.ts +29 -0
- package/commands/calendar.js +8 -0
- package/commands/calendar.mjs +52 -0
- package/commands/chart.d.ts +27 -0
- package/commands/chart.js +8 -0
- package/commands/chart.mjs +43 -0
- package/commands/chat.d.ts +22 -0
- package/commands/chat.js +8 -0
- package/commands/chat.mjs +30 -0
- package/commands/checkbox.d.ts +26 -0
- package/commands/checkbox.js +8 -0
- package/commands/checkbox.mjs +36 -0
- package/commands/colorpicker.d.ts +26 -0
- package/commands/colorpicker.js +8 -0
- package/commands/colorpicker.mjs +36 -0
- package/commands/combobox.d.ts +34 -0
- package/commands/combobox.js +8 -0
- package/commands/combobox.mjs +48 -0
- package/commands/dashboard.d.ts +19 -0
- package/commands/dashboard.js +8 -0
- package/commands/dashboard.mjs +21 -0
- package/commands/datepicker.d.ts +26 -0
- package/commands/datepicker.js +8 -0
- package/commands/datepicker.mjs +36 -0
- package/commands/daterangepicker.d.ts +27 -0
- package/commands/daterangepicker.js +8 -0
- package/commands/daterangepicker.mjs +37 -0
- package/commands/datetimepicker.d.ts +26 -0
- package/commands/datetimepicker.js +8 -0
- package/commands/datetimepicker.mjs +36 -0
- package/commands/dialog.d.ts +23 -0
- package/commands/dialog.js +8 -0
- package/commands/dialog.mjs +25 -0
- package/commands/drawer.d.ts +30 -0
- package/commands/drawer.js +8 -0
- package/commands/drawer.mjs +38 -0
- package/commands/dropdownlist.d.ts +30 -0
- package/commands/dropdownlist.js +8 -0
- package/commands/dropdownlist.mjs +42 -0
- package/commands/dropdowntree.d.ts +34 -0
- package/commands/dropdowntree.js +8 -0
- package/commands/dropdowntree.mjs +48 -0
- package/commands/editor.d.ts +26 -0
- package/commands/editor.js +8 -0
- package/commands/editor.mjs +36 -0
- package/commands/form.d.ts +34 -0
- package/commands/form.js +8 -0
- package/commands/form.mjs +54 -0
- package/commands/gantt.d.ts +119 -0
- package/commands/gantt.js +8 -0
- package/commands/gantt.mjs +156 -0
- package/commands/grid.d.ts +209 -0
- package/commands/grid.js +8 -0
- package/commands/grid.mjs +280 -0
- package/commands/index.d.ts +58 -0
- package/commands/listbox.d.ts +31 -0
- package/commands/listbox.js +8 -0
- package/commands/listbox.mjs +69 -0
- package/commands/listview.d.ts +22 -0
- package/commands/listview.js +8 -0
- package/commands/listview.mjs +29 -0
- package/commands/map.d.ts +43 -0
- package/commands/map.js +8 -0
- package/commands/map.mjs +77 -0
- package/commands/maskedtextbox.d.ts +26 -0
- package/commands/maskedtextbox.js +8 -0
- package/commands/maskedtextbox.mjs +36 -0
- package/commands/menu.d.ts +22 -0
- package/commands/menu.js +8 -0
- package/commands/menu.mjs +30 -0
- package/commands/multicolumncombobox.d.ts +34 -0
- package/commands/multicolumncombobox.js +8 -0
- package/commands/multicolumncombobox.mjs +48 -0
- package/commands/multiselect.d.ts +41 -0
- package/commands/multiselect.js +8 -0
- package/commands/multiselect.mjs +57 -0
- package/commands/notification.d.ts +27 -0
- package/commands/notification.js +8 -0
- package/commands/notification.mjs +46 -0
- package/commands/numerictextbox.d.ts +34 -0
- package/commands/numerictextbox.js +8 -0
- package/commands/numerictextbox.mjs +48 -0
- package/commands/panelbar.d.ts +29 -0
- package/commands/panelbar.js +8 -0
- package/commands/panelbar.mjs +43 -0
- package/commands/pivotgrid.d.ts +56 -0
- package/commands/pivotgrid.js +8 -0
- package/commands/pivotgrid.mjs +87 -0
- package/commands/rangeslider.d.ts +23 -0
- package/commands/rangeslider.js +8 -0
- package/commands/rangeslider.mjs +25 -0
- package/commands/rating.d.ts +26 -0
- package/commands/rating.js +8 -0
- package/commands/rating.mjs +36 -0
- package/commands/scheduler.d.ts +45 -0
- package/commands/scheduler.js +8 -0
- package/commands/scheduler.mjs +59 -0
- package/commands/scrollview.d.ts +30 -0
- package/commands/scrollview.js +8 -0
- package/commands/scrollview.mjs +46 -0
- package/commands/signature.d.ts +19 -0
- package/commands/signature.js +8 -0
- package/commands/signature.mjs +21 -0
- package/commands/slider.d.ts +22 -0
- package/commands/slider.js +8 -0
- package/commands/slider.mjs +24 -0
- package/commands/sortable.d.ts +23 -0
- package/commands/sortable.js +8 -0
- package/commands/sortable.mjs +32 -0
- package/commands/spreadsheet.d.ts +92 -0
- package/commands/spreadsheet.js +8 -0
- package/commands/spreadsheet.mjs +181 -0
- package/commands/stepper.d.ts +22 -0
- package/commands/stepper.js +8 -0
- package/commands/stepper.mjs +35 -0
- package/commands/switch.d.ts +26 -0
- package/commands/switch.js +8 -0
- package/commands/switch.mjs +36 -0
- package/commands/tabstrip.d.ts +23 -0
- package/commands/tabstrip.js +8 -0
- package/commands/tabstrip.mjs +30 -0
- package/commands/taskboard.d.ts +48 -0
- package/commands/taskboard.js +8 -0
- package/commands/taskboard.mjs +90 -0
- package/commands/textarea.d.ts +26 -0
- package/commands/textarea.js +8 -0
- package/commands/textarea.mjs +36 -0
- package/commands/textbox.d.ts +26 -0
- package/commands/textbox.js +8 -0
- package/commands/textbox.mjs +36 -0
- package/commands/timepicker.d.ts +26 -0
- package/commands/timepicker.js +8 -0
- package/commands/timepicker.mjs +36 -0
- package/commands/treelist.d.ts +135 -0
- package/commands/treelist.js +8 -0
- package/commands/treelist.mjs +177 -0
- package/commands/treeview.d.ts +44 -0
- package/commands/treeview.js +8 -0
- package/commands/treeview.mjs +84 -0
- package/commands/upload.d.ts +19 -0
- package/commands/upload.js +8 -0
- package/commands/upload.mjs +21 -0
- package/commands/window.d.ts +35 -0
- package/commands/window.js +8 -0
- package/commands/window.mjs +45 -0
- package/dist/cdn/js/kendo-react-webmcp.js +15 -0
- package/grid-mcp-tools.d.ts +26 -0
- package/grid-mcp-tools.js +8 -0
- package/grid-mcp-tools.mjs +75 -0
- package/index.d.mts +68 -0
- package/index.d.ts +68 -0
- package/index.js +8 -0
- package/index.mjs +308 -0
- package/mcp-types.d.ts +12 -0
- package/package.json +64 -0
- package/schemas/common.d.ts +27 -0
- package/schemas/common.js +8 -0
- package/schemas/common.mjs +113 -0
- package/schemas/gantt.d.ts +10 -0
- package/schemas/gantt.js +8 -0
- package/schemas/gantt.mjs +51 -0
- package/schemas/grid.d.ts +10 -0
- package/schemas/grid.js +8 -0
- package/schemas/grid.mjs +46 -0
- package/schemas/index.d.ts +13 -0
- package/schemas/input.d.ts +19 -0
- package/schemas/input.js +8 -0
- package/schemas/input.mjs +137 -0
- package/schemas/scheduler.d.ts +11 -0
- package/schemas/scheduler.js +8 -0
- package/schemas/scheduler.mjs +58 -0
- package/schemas/table.d.ts +12 -0
- package/schemas/table.js +8 -0
- package/schemas/table.mjs +87 -0
- package/types.d.ts +39 -0
package/adapters/chat.js
ADDED
|
@@ -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 r=require("../commands/chat.js"),x={componentSuffix:"chat",createTools(S,s,c,m){const i=[],l=t=>`${c.groupName}_${t}`,p=s.current,d=[{name:"send_message",description:`Send a message to the ${c.dataName} conversation`,commandType:r.ChatCommands.SendMessage,enabled:!!p.onSendMessage}],o=s.current.webMcp,u=typeof o=="object"&&o!==null&&typeof o.tools=="function"?o.tools:void 0,g=u?u(d):d,h=async(t,a)=>{if(t===r.ChatCommands.SendMessage){const e=a.text;if(!e)return{content:[{type:"text",text:"Missing required argument: text"}],isError:!0};const n=s.current;if(!n.onSendMessage)return{content:[{type:"text",text:"Chat has no onSendMessage handler."}],isError:!0};const y={id:Date.now(),author:{id:n.authorId},text:e,timestamp:new Date};return n.onSendMessage({message:y,nativeEvent:null,target:null,syntheticEvent:null}),{content:[{type:"text",text:`Message sent: "${e}"`}]}}return{content:[{type:"text",text:`Unknown command: ${t}`}],isError:!0}};for(const t of g){if(!t.enabled)continue;const a=r.getChatToolSchema(t.commandType),e=t.commandType;try{i.push(m.registerTool({name:l(t.name),description:t.description,inputSchema:a,execute:async n=>h(e,n||{})}))}catch{}}return i}};exports.chatAdapter=x;
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { ChatCommands as m, getChatToolSchema as y } from "../commands/chat.mjs";
|
|
9
|
+
const S = {
|
|
10
|
+
componentSuffix: "chat",
|
|
11
|
+
createTools(f, s, r, u) {
|
|
12
|
+
const c = [], l = (t) => `${r.groupName}_${t}`, p = s.current, i = [
|
|
13
|
+
{
|
|
14
|
+
name: "send_message",
|
|
15
|
+
description: `Send a message to the ${r.dataName} conversation`,
|
|
16
|
+
commandType: m.SendMessage,
|
|
17
|
+
enabled: !!p.onSendMessage
|
|
18
|
+
}
|
|
19
|
+
], o = s.current.webMcp, d = typeof o == "object" && o !== null && typeof o.tools == "function" ? o.tools : void 0, g = d ? d(i) : i, h = async (t, a) => {
|
|
20
|
+
if (t === m.SendMessage) {
|
|
21
|
+
const e = a.text;
|
|
22
|
+
if (!e)
|
|
23
|
+
return { content: [{ type: "text", text: "Missing required argument: text" }], isError: !0 };
|
|
24
|
+
const n = s.current;
|
|
25
|
+
if (!n.onSendMessage)
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: "text", text: "Chat has no onSendMessage handler." }],
|
|
28
|
+
isError: !0
|
|
29
|
+
};
|
|
30
|
+
const x = {
|
|
31
|
+
id: Date.now(),
|
|
32
|
+
author: { id: n.authorId },
|
|
33
|
+
text: e,
|
|
34
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
35
|
+
};
|
|
36
|
+
return n.onSendMessage({
|
|
37
|
+
message: x,
|
|
38
|
+
nativeEvent: null,
|
|
39
|
+
target: null,
|
|
40
|
+
syntheticEvent: null
|
|
41
|
+
}), { content: [{ type: "text", text: `Message sent: "${e}"` }] };
|
|
42
|
+
}
|
|
43
|
+
return { content: [{ type: "text", text: `Unknown command: ${t}` }], isError: !0 };
|
|
44
|
+
};
|
|
45
|
+
for (const t of g) {
|
|
46
|
+
if (!t.enabled)
|
|
47
|
+
continue;
|
|
48
|
+
const a = y(t.commandType), e = t.commandType;
|
|
49
|
+
try {
|
|
50
|
+
c.push(
|
|
51
|
+
u.registerTool({
|
|
52
|
+
name: l(t.name),
|
|
53
|
+
description: t.description,
|
|
54
|
+
inputSchema: a,
|
|
55
|
+
execute: async (n) => h(e, n || {})
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
} catch {
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return c;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
S as chatAdapter
|
|
66
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { ToolAdapter } from '../types';
|
|
9
|
+
interface ColorPickerAdapterProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
onChange?: (event: Record<string, unknown>) => void;
|
|
12
|
+
webMcp?: unknown;
|
|
13
|
+
}
|
|
14
|
+
/** @hidden */
|
|
15
|
+
export declare const colorPickerAdapter: ToolAdapter<unknown, ColorPickerAdapterProps>;
|
|
16
|
+
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/colorpicker.js"),y={componentSuffix:"colorpicker",createTools(s,c,a,p){const i=[],d=e=>`${a.groupName}_${e}`,l=c.current,u=[{name:"set_value",description:`Set the color in the ${a.dataName} color picker. Use hex format (e.g. #ff0000).`,commandType:n.ColorPickerCommands.SetValue,enabled:!!l.onChange},{name:"clear",description:`Clear the ${a.dataName} color picker.`,commandType:n.ColorPickerCommands.Clear,enabled:!!l.onChange}],r=l.webMcp,m=typeof r=="object"&&r!==null&&typeof r.tools=="function"?r.tools:void 0,C=m?m(u):u,h=async(e,o)=>{switch(e){case n.ColorPickerCommands.SetValue:{const t=c.current;return t.onChange&&t.onChange({value:o.value,syntheticEvent:null,target:s}),{content:[{type:"text",text:`Color set to ${String(o.value)}.`}]}}case n.ColorPickerCommands.Clear:{const t=c.current;return t.onChange&&t.onChange({value:"",syntheticEvent:null,target:s}),{content:[{type:"text",text:"Color cleared."}]}}default:return{content:[{type:"text",text:`Unknown command: ${e}`}],isError:!0}}};for(const e of C){if(!e.enabled)continue;const o=e.commandType;try{i.push(p.registerTool({name:d(e.name),description:e.description,inputSchema:n.getColorPickerToolSchema(o),execute:async t=>h(o,t||{})}))}catch{}}return i}};exports.colorPickerAdapter=y;
|
|
@@ -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 { ColorPickerCommands as c, getColorPickerToolSchema as f } from "../commands/colorpicker.mjs";
|
|
9
|
+
const g = {
|
|
10
|
+
componentSuffix: "colorpicker",
|
|
11
|
+
createTools(s, r, a, p) {
|
|
12
|
+
const i = [], d = (e) => `${a.groupName}_${e}`, l = r.current, u = [
|
|
13
|
+
{
|
|
14
|
+
name: "set_value",
|
|
15
|
+
description: `Set the color in the ${a.dataName} color picker. Use hex format (e.g. #ff0000).`,
|
|
16
|
+
commandType: c.SetValue,
|
|
17
|
+
enabled: !!l.onChange
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "clear",
|
|
21
|
+
description: `Clear the ${a.dataName} color picker.`,
|
|
22
|
+
commandType: c.Clear,
|
|
23
|
+
enabled: !!l.onChange
|
|
24
|
+
}
|
|
25
|
+
], n = l.webMcp, m = typeof n == "object" && n !== null && typeof n.tools == "function" ? n.tools : void 0, C = m ? m(u) : u, h = async (e, o) => {
|
|
26
|
+
switch (e) {
|
|
27
|
+
case c.SetValue: {
|
|
28
|
+
const t = r.current;
|
|
29
|
+
return t.onChange && t.onChange({ value: o.value, syntheticEvent: null, target: s }), { content: [{ type: "text", text: `Color set to ${String(o.value)}.` }] };
|
|
30
|
+
}
|
|
31
|
+
case c.Clear: {
|
|
32
|
+
const t = r.current;
|
|
33
|
+
return t.onChange && t.onChange({ value: "", syntheticEvent: null, target: s }), { content: [{ type: "text", text: "Color cleared." }] };
|
|
34
|
+
}
|
|
35
|
+
default:
|
|
36
|
+
return { content: [{ type: "text", text: `Unknown command: ${e}` }], isError: !0 };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
for (const e of C) {
|
|
40
|
+
if (!e.enabled)
|
|
41
|
+
continue;
|
|
42
|
+
const o = e.commandType;
|
|
43
|
+
try {
|
|
44
|
+
i.push(
|
|
45
|
+
p.registerTool({
|
|
46
|
+
name: d(e.name),
|
|
47
|
+
description: e.description,
|
|
48
|
+
inputSchema: f(o),
|
|
49
|
+
execute: async (t) => h(o, t || {})
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
} catch {
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return i;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
g as colorPickerAdapter
|
|
60
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { ToolAdapter } from '../types';
|
|
9
|
+
interface ComboBoxAdapterProps {
|
|
10
|
+
data?: unknown[];
|
|
11
|
+
textField?: string;
|
|
12
|
+
opened?: boolean;
|
|
13
|
+
onChange?: (event: unknown) => void;
|
|
14
|
+
onOpen?: (event: unknown) => void;
|
|
15
|
+
onClose?: (event: unknown) => void;
|
|
16
|
+
webMcp?: unknown;
|
|
17
|
+
}
|
|
18
|
+
/** @hidden */
|
|
19
|
+
export declare const comboBoxAdapter: ToolAdapter<unknown, ComboBoxAdapterProps>;
|
|
20
|
+
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 o=require("../commands/combobox.js"),b="ComboBoxType",S={componentSuffix:"combobox",createTools(a,l,c,g){const u=[],f=t=>`${c.groupName}_${t}`,i=l.current,p=!!i.onChange,x=[{name:"open",description:`Open the ${c.dataName} combo box popup`,commandType:o.ComboBoxCommands.Open,enabled:!!i.onOpen},{name:"close",description:`Close the ${c.dataName} combo box popup`,commandType:o.ComboBoxCommands.Close,enabled:!!i.onClose},{name:"type",description:`Type text to filter the ${c.dataName} combo box options`,commandType:b,enabled:p},{name:"select",description:`Select an item from the ${c.dataName} combo box`,commandType:o.ComboBoxCommands.SetValue,enabled:p},{name:"clear",description:`Clear the ${c.dataName} combo box selection`,commandType:o.ComboBoxCommands.Clear,enabled:p}],s=l.current.webMcp,C=typeof s=="object"&&s!==null&&typeof s.tools=="function"?s.tools:void 0,T=C?C(x):x,v=async(t,n)=>{const e=l.current;switch(t){case o.ComboBoxCommands.Open:return e.onOpen&&e.onOpen({syntheticEvent:null,target:a}),{content:[{type:"text",text:"Combo box opened."}]};case b:return e.onChange&&e.onChange({value:n.text,syntheticEvent:null,target:a}),{content:[{type:"text",text:`Typed "${String(n.text)}".`}]};case o.ComboBoxCommands.SetValue:{const d=e.data||[],y=e.textField,m=n.value,h=d.find(r=>y&&typeof r=="object"&&r!==null&&r[y]===m?!0:r===m),B=h===void 0?m:h;return e.onChange&&e.onChange({value:B,syntheticEvent:null,target:a}),{content:[{type:"text",text:`Selected "${String(m)}".`}]}}case o.ComboBoxCommands.Clear:return e.onChange&&e.onChange({value:null,syntheticEvent:null,target:a}),{content:[{type:"text",text:"Selection cleared."}]};case o.ComboBoxCommands.Close:return e.onClose&&e.onClose({syntheticEvent:null,target:a}),{content:[{type:"text",text:"Combo box closed."}]};default:return{content:[{type:"text",text:`Unknown command: ${t}`}],isError:!0}}};for(const t of T){if(!t.enabled)continue;const n=t.commandType,e=n===b?{type:"object",properties:{text:{type:"string",description:"Text to type for filtering"}},required:["text"]}:o.getComboBoxToolSchema(n);try{u.push(g.registerTool({name:f(t.name),description:t.description,inputSchema:e,execute:async d=>v(n,d||{})}))}catch{}}return u}};exports.comboBoxAdapter=S;
|
|
@@ -0,0 +1,87 @@
|
|
|
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 { ComboBoxCommands as o, getComboBoxToolSchema as $ } from "../commands/combobox.mjs";
|
|
9
|
+
const x = "ComboBoxType", E = {
|
|
10
|
+
componentSuffix: "combobox",
|
|
11
|
+
createTools(a, p, c, f) {
|
|
12
|
+
const d = [], g = (t) => `${c.groupName}_${t}`, i = p.current, m = !!i.onChange, b = [
|
|
13
|
+
{
|
|
14
|
+
name: "open",
|
|
15
|
+
description: `Open the ${c.dataName} combo box popup`,
|
|
16
|
+
commandType: o.Open,
|
|
17
|
+
enabled: !!i.onOpen
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "close",
|
|
21
|
+
description: `Close the ${c.dataName} combo box popup`,
|
|
22
|
+
commandType: o.Close,
|
|
23
|
+
enabled: !!i.onClose
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "type",
|
|
27
|
+
description: `Type text to filter the ${c.dataName} combo box options`,
|
|
28
|
+
commandType: x,
|
|
29
|
+
enabled: m
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "select",
|
|
33
|
+
description: `Select an item from the ${c.dataName} combo box`,
|
|
34
|
+
commandType: o.SetValue,
|
|
35
|
+
enabled: m
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "clear",
|
|
39
|
+
description: `Clear the ${c.dataName} combo box selection`,
|
|
40
|
+
commandType: o.Clear,
|
|
41
|
+
enabled: m
|
|
42
|
+
}
|
|
43
|
+
], r = p.current.webMcp, y = typeof r == "object" && r !== null && typeof r.tools == "function" ? r.tools : void 0, T = y ? y(b) : b, v = async (t, n) => {
|
|
44
|
+
const e = p.current;
|
|
45
|
+
switch (t) {
|
|
46
|
+
case o.Open:
|
|
47
|
+
return e.onOpen && e.onOpen({ syntheticEvent: null, target: a }), { content: [{ type: "text", text: "Combo box opened." }] };
|
|
48
|
+
case x:
|
|
49
|
+
return e.onChange && e.onChange({ value: n.text, syntheticEvent: null, target: a }), { content: [{ type: "text", text: `Typed "${String(n.text)}".` }] };
|
|
50
|
+
case o.SetValue: {
|
|
51
|
+
const u = e.data || [], C = e.textField, s = n.value, h = u.find((l) => C && typeof l == "object" && l !== null && l[C] === s ? !0 : l === s), S = h === void 0 ? s : h;
|
|
52
|
+
return e.onChange && e.onChange({ value: S, syntheticEvent: null, target: a }), { content: [{ type: "text", text: `Selected "${String(s)}".` }] };
|
|
53
|
+
}
|
|
54
|
+
case o.Clear:
|
|
55
|
+
return e.onChange && e.onChange({ value: null, syntheticEvent: null, target: a }), { content: [{ type: "text", text: "Selection cleared." }] };
|
|
56
|
+
case o.Close:
|
|
57
|
+
return e.onClose && e.onClose({ syntheticEvent: null, target: a }), { content: [{ type: "text", text: "Combo box closed." }] };
|
|
58
|
+
default:
|
|
59
|
+
return { content: [{ type: "text", text: `Unknown command: ${t}` }], isError: !0 };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
for (const t of T) {
|
|
63
|
+
if (!t.enabled)
|
|
64
|
+
continue;
|
|
65
|
+
const n = t.commandType, e = n === x ? {
|
|
66
|
+
type: "object",
|
|
67
|
+
properties: { text: { type: "string", description: "Text to type for filtering" } },
|
|
68
|
+
required: ["text"]
|
|
69
|
+
} : $(n);
|
|
70
|
+
try {
|
|
71
|
+
d.push(
|
|
72
|
+
f.registerTool({
|
|
73
|
+
name: g(t.name),
|
|
74
|
+
description: t.description,
|
|
75
|
+
inputSchema: e,
|
|
76
|
+
execute: async (u) => v(n, u || {})
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return d;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
E as comboBoxAdapter
|
|
87
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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 { ToolAdapter } from '../types';
|
|
9
|
+
interface DashboardAdapterHandle {
|
|
10
|
+
exportAsPdf?: () => void;
|
|
11
|
+
}
|
|
12
|
+
interface DashboardAdapterProps {
|
|
13
|
+
pdf?: Record<string, unknown>;
|
|
14
|
+
webMcp?: unknown;
|
|
15
|
+
}
|
|
16
|
+
/** @hidden */
|
|
17
|
+
export declare const dashboardAdapter: ToolAdapter<DashboardAdapterHandle, DashboardAdapterProps>;
|
|
18
|
+
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/dashboard.js"),y={componentSuffix:"dashboard",createTools(t,r,s,i){const a=[],m=o=>`${s.groupName}_${o}`,u=!!r.current.pdf,c=[{name:"export_pdf",description:`Export the ${s.dataName} dashboard to PDF`,commandType:n.DashboardCommands.ExportPDF,enabled:u}],e=r.current.webMcp,d=typeof e=="object"&&e!==null&&typeof e.tools=="function"?e.tools:void 0,b=d?d(c):c,f=async(o,p)=>o===n.DashboardCommands.ExportPDF?(t!=null&&t.exportAsPdf&&t.exportAsPdf(),{content:[{type:"text",text:"Dashboard PDF export initiated."}]}):{content:[{type:"text",text:`Unknown command: ${o}`}],isError:!0};for(const o of b){if(!o.enabled)continue;const p=n.getDashboardToolSchema(o.commandType),l=o.commandType;try{a.push(i.registerTool({name:m(o.name),description:o.description,inputSchema:p,execute:async x=>f(l,x||{})}))}catch{}}return a}};exports.dashboardAdapter=y;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { DashboardCommands as d, getDashboardToolSchema as y } from "../commands/dashboard.mjs";
|
|
9
|
+
const P = {
|
|
10
|
+
componentSuffix: "dashboard",
|
|
11
|
+
createTools(t, n, r, i) {
|
|
12
|
+
const s = [], m = (o) => `${r.groupName}_${o}`, f = !!n.current.pdf, c = [
|
|
13
|
+
{
|
|
14
|
+
name: "export_pdf",
|
|
15
|
+
description: `Export the ${r.dataName} dashboard to PDF`,
|
|
16
|
+
commandType: d.ExportPDF,
|
|
17
|
+
enabled: f
|
|
18
|
+
}
|
|
19
|
+
], e = n.current.webMcp, a = typeof e == "object" && e !== null && typeof e.tools == "function" ? e.tools : void 0, u = a ? a(c) : c, x = async (o, p) => o === d.ExportPDF ? (t != null && t.exportAsPdf && t.exportAsPdf(), { content: [{ type: "text", text: "Dashboard PDF export initiated." }] }) : { content: [{ type: "text", text: `Unknown command: ${o}` }], isError: !0 };
|
|
20
|
+
for (const o of u) {
|
|
21
|
+
if (!o.enabled)
|
|
22
|
+
continue;
|
|
23
|
+
const p = y(o.commandType), b = o.commandType;
|
|
24
|
+
try {
|
|
25
|
+
s.push(
|
|
26
|
+
i.registerTool({
|
|
27
|
+
name: m(o.name),
|
|
28
|
+
description: o.description,
|
|
29
|
+
inputSchema: p,
|
|
30
|
+
execute: async (l) => x(b, l || {})
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return s;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
P as dashboardAdapter
|
|
41
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { ToolAdapter } from '../types';
|
|
9
|
+
interface DatePickerAdapterProps {
|
|
10
|
+
value?: Date | null;
|
|
11
|
+
format?: string;
|
|
12
|
+
onChange?: (event: Record<string, unknown>) => void;
|
|
13
|
+
webMcp?: unknown;
|
|
14
|
+
}
|
|
15
|
+
/** @hidden */
|
|
16
|
+
export declare const datePickerAdapter: ToolAdapter<unknown, DatePickerAdapterProps>;
|
|
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/datepicker.js"),g={componentSuffix:"datepicker",createTools(i,c,r,p){const l=[],y=e=>`${r.groupName}_${e}`,d=c.current,m=[{name:"set_value",description:`Set the date in the ${r.dataName} date picker. Use ISO 8601 format (YYYY-MM-DD).`,commandType:n.DatePickerCommands.SetValue,enabled:!!d.onChange},{name:"clear",description:`Clear the ${r.dataName} date picker.`,commandType:n.DatePickerCommands.Clear,enabled:!!d.onChange}],a=c.current.webMcp,u=typeof a=="object"&&a!==null&&typeof a.tools=="function"?a.tools:void 0,C=u?u(m):m,h=async(e,s)=>{const t=c.current;switch(e){case n.DatePickerCommands.SetValue:{const o=new Date(s.value);return t.onChange&&t.onChange({value:o,syntheticEvent:null,target:i}),{content:[{type:"text",text:`Date set to ${o.toISOString().slice(0,10)}.`}]}}case n.DatePickerCommands.Clear:return t.onChange&&t.onChange({value:null,syntheticEvent:null,target:i}),{content:[{type:"text",text:"Date cleared."}]};default:return{content:[{type:"text",text:`Unknown command: ${e}`}],isError:!0}}};for(const e of C){if(!e.enabled)continue;const s=n.getDatePickerToolSchema(e.commandType),t=e.commandType;try{l.push(p.registerTool({name:y(e.name),description:e.description,inputSchema:s,execute:async o=>h(t,o||{})}))}catch{}}return l}};exports.datePickerAdapter=g;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { DatePickerCommands as a, getDatePickerToolSchema as g } from "../commands/datepicker.mjs";
|
|
9
|
+
const x = {
|
|
10
|
+
componentSuffix: "datepicker",
|
|
11
|
+
createTools(l, c, r, p) {
|
|
12
|
+
const i = [], h = (e) => `${r.groupName}_${e}`, m = c.current, u = [
|
|
13
|
+
{
|
|
14
|
+
name: "set_value",
|
|
15
|
+
description: `Set the date in the ${r.dataName} date picker. Use ISO 8601 format (YYYY-MM-DD).`,
|
|
16
|
+
commandType: a.SetValue,
|
|
17
|
+
enabled: !!m.onChange
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "clear",
|
|
21
|
+
description: `Clear the ${r.dataName} date picker.`,
|
|
22
|
+
commandType: a.Clear,
|
|
23
|
+
enabled: !!m.onChange
|
|
24
|
+
}
|
|
25
|
+
], n = c.current.webMcp, d = typeof n == "object" && n !== null && typeof n.tools == "function" ? n.tools : void 0, y = d ? d(u) : u, C = async (e, s) => {
|
|
26
|
+
const t = c.current;
|
|
27
|
+
switch (e) {
|
|
28
|
+
case a.SetValue: {
|
|
29
|
+
const o = new Date(s.value);
|
|
30
|
+
return t.onChange && t.onChange({ value: o, syntheticEvent: null, target: l }), { content: [{ type: "text", text: `Date set to ${o.toISOString().slice(0, 10)}.` }] };
|
|
31
|
+
}
|
|
32
|
+
case a.Clear:
|
|
33
|
+
return t.onChange && t.onChange({ value: null, syntheticEvent: null, target: l }), { content: [{ type: "text", text: "Date cleared." }] };
|
|
34
|
+
default:
|
|
35
|
+
return { content: [{ type: "text", text: `Unknown command: ${e}` }], isError: !0 };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
for (const e of y) {
|
|
39
|
+
if (!e.enabled)
|
|
40
|
+
continue;
|
|
41
|
+
const s = g(e.commandType), t = e.commandType;
|
|
42
|
+
try {
|
|
43
|
+
i.push(
|
|
44
|
+
p.registerTool({
|
|
45
|
+
name: h(e.name),
|
|
46
|
+
description: e.description,
|
|
47
|
+
inputSchema: s,
|
|
48
|
+
execute: async (o) => C(t, o || {})
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return i;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
x as datePickerAdapter
|
|
59
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { ToolAdapter } from '../types';
|
|
9
|
+
interface DateRangePickerAdapterProps {
|
|
10
|
+
value?: {
|
|
11
|
+
start: Date | null;
|
|
12
|
+
end: Date | null;
|
|
13
|
+
};
|
|
14
|
+
onChange?: (event: Record<string, unknown>) => void;
|
|
15
|
+
webMcp?: unknown;
|
|
16
|
+
}
|
|
17
|
+
/** @hidden */
|
|
18
|
+
export declare const dateRangePickerAdapter: ToolAdapter<unknown, DateRangePickerAdapterProps>;
|
|
19
|
+
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/daterangepicker.js"),k={componentSuffix:"daterangepicker",createTools(i,r,s,p){const l=[],y=e=>`${s.groupName}_${e}`,d=r.current,u=[{name:"set_value",description:`Set the date range in the ${s.dataName} date range picker. Use ISO 8601 format.`,commandType:n.DateRangePickerCommands.SetValue,enabled:!!d.onChange},{name:"clear",description:`Clear the ${s.dataName} date range picker.`,commandType:n.DateRangePickerCommands.Clear,enabled:!!d.onChange}],a=r.current.webMcp,m=typeof a=="object"&&a!==null&&typeof a.tools=="function"?a.tools:void 0,C=m?m(u):u,h=async(e,o)=>{const t=r.current;switch(e){case n.DateRangePickerCommands.SetValue:{const c=new Date(o.startValue),g=new Date(o.endValue);return t.onChange&&t.onChange({value:{start:c,end:g},syntheticEvent:null,target:i}),{content:[{type:"text",text:`Range set: ${c.toISOString().slice(0,10)} to ${g.toISOString().slice(0,10)}.`}]}}case n.DateRangePickerCommands.Clear:return t.onChange&&t.onChange({value:{start:null,end:null},syntheticEvent:null,target:i}),{content:[{type:"text",text:"Date range cleared."}]};default:return{content:[{type:"text",text:`Unknown command: ${e}`}],isError:!0}}};for(const e of C){if(!e.enabled)continue;const o=n.getDateRangePickerToolSchema(e.commandType),t=e.commandType;try{l.push(p.registerTool({name:y(e.name),description:e.description,inputSchema:o,execute:async c=>h(t,c||{})}))}catch{}}return l}};exports.dateRangePickerAdapter=k;
|
|
@@ -0,0 +1,70 @@
|
|
|
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 { DateRangePickerCommands as c, getDateRangePickerToolSchema as f } from "../commands/daterangepicker.mjs";
|
|
9
|
+
const x = {
|
|
10
|
+
componentSuffix: "daterangepicker",
|
|
11
|
+
createTools(l, r, s, g) {
|
|
12
|
+
const i = [], h = (e) => `${s.groupName}_${e}`, u = r.current, d = [
|
|
13
|
+
{
|
|
14
|
+
name: "set_value",
|
|
15
|
+
description: `Set the date range in the ${s.dataName} date range picker. Use ISO 8601 format.`,
|
|
16
|
+
commandType: c.SetValue,
|
|
17
|
+
enabled: !!u.onChange
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "clear",
|
|
21
|
+
description: `Clear the ${s.dataName} date range picker.`,
|
|
22
|
+
commandType: c.Clear,
|
|
23
|
+
enabled: !!u.onChange
|
|
24
|
+
}
|
|
25
|
+
], n = r.current.webMcp, m = typeof n == "object" && n !== null && typeof n.tools == "function" ? n.tools : void 0, y = m ? m(d) : d, C = async (e, a) => {
|
|
26
|
+
const t = r.current;
|
|
27
|
+
switch (e) {
|
|
28
|
+
case c.SetValue: {
|
|
29
|
+
const o = new Date(a.startValue), p = new Date(a.endValue);
|
|
30
|
+
return t.onChange && t.onChange({ value: { start: o, end: p }, syntheticEvent: null, target: l }), {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: "text",
|
|
34
|
+
text: `Range set: ${o.toISOString().slice(0, 10)} to ${p.toISOString().slice(0, 10)}.`
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
case c.Clear:
|
|
40
|
+
return t.onChange && t.onChange({
|
|
41
|
+
value: { start: null, end: null },
|
|
42
|
+
syntheticEvent: null,
|
|
43
|
+
target: l
|
|
44
|
+
}), { content: [{ type: "text", text: "Date range cleared." }] };
|
|
45
|
+
default:
|
|
46
|
+
return { content: [{ type: "text", text: `Unknown command: ${e}` }], isError: !0 };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
for (const e of y) {
|
|
50
|
+
if (!e.enabled)
|
|
51
|
+
continue;
|
|
52
|
+
const a = f(e.commandType), t = e.commandType;
|
|
53
|
+
try {
|
|
54
|
+
i.push(
|
|
55
|
+
g.registerTool({
|
|
56
|
+
name: h(e.name),
|
|
57
|
+
description: e.description,
|
|
58
|
+
inputSchema: a,
|
|
59
|
+
execute: async (o) => C(t, o || {})
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return i;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
x as dateRangePickerAdapter
|
|
70
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { ToolAdapter } from '../types';
|
|
9
|
+
interface DateTimePickerAdapterProps {
|
|
10
|
+
value?: Date | null;
|
|
11
|
+
onChange?: (event: Record<string, unknown>) => void;
|
|
12
|
+
webMcp?: unknown;
|
|
13
|
+
}
|
|
14
|
+
/** @hidden */
|
|
15
|
+
export declare const dateTimePickerAdapter: ToolAdapter<unknown, DateTimePickerAdapterProps>;
|
|
16
|
+
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/datetimepicker.js"),h={componentSuffix:"datetimepicker",createTools(m,c,r,p){const s=[],y=e=>`${r.groupName}_${e}`,l=c.current,d=[{name:"set_value",description:`Set the date and time in the ${r.dataName} date-time picker. Use ISO 8601 format.`,commandType:n.DateTimePickerCommands.SetValue,enabled:!!l.onChange},{name:"clear",description:`Clear the ${r.dataName} date-time picker.`,commandType:n.DateTimePickerCommands.Clear,enabled:!!l.onChange}],a=c.current.webMcp,u=typeof a=="object"&&a!==null&&typeof a.tools=="function"?a.tools:void 0,C=u?u(d):d,T=async(e,i)=>{const t=c.current;switch(e){case n.DateTimePickerCommands.SetValue:{const o=new Date(i.value);return t.onChange&&t.onChange({value:o,syntheticEvent:null,target:m}),{content:[{type:"text",text:`Date-time set to ${o.toISOString()}.`}]}}case n.DateTimePickerCommands.Clear:return t.onChange&&t.onChange({value:null,syntheticEvent:null,target:m}),{content:[{type:"text",text:"Date-time cleared."}]};default:return{content:[{type:"text",text:`Unknown command: ${e}`}],isError:!0}}};for(const e of C){if(!e.enabled)continue;const i=n.getDateTimePickerToolSchema(e.commandType),t=e.commandType;try{s.push(p.registerTool({name:y(e.name),description:e.description,inputSchema:i,execute:async o=>T(t,o||{})}))}catch{}}return s}};exports.dateTimePickerAdapter=h;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { DateTimePickerCommands as a, getDateTimePickerToolSchema as g } from "../commands/datetimepicker.mjs";
|
|
9
|
+
const T = {
|
|
10
|
+
componentSuffix: "datetimepicker",
|
|
11
|
+
createTools(s, c, r, p) {
|
|
12
|
+
const m = [], h = (e) => `${r.groupName}_${e}`, l = c.current, u = [
|
|
13
|
+
{
|
|
14
|
+
name: "set_value",
|
|
15
|
+
description: `Set the date and time in the ${r.dataName} date-time picker. Use ISO 8601 format.`,
|
|
16
|
+
commandType: a.SetValue,
|
|
17
|
+
enabled: !!l.onChange
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "clear",
|
|
21
|
+
description: `Clear the ${r.dataName} date-time picker.`,
|
|
22
|
+
commandType: a.Clear,
|
|
23
|
+
enabled: !!l.onChange
|
|
24
|
+
}
|
|
25
|
+
], n = c.current.webMcp, d = typeof n == "object" && n !== null && typeof n.tools == "function" ? n.tools : void 0, y = d ? d(u) : u, C = async (e, i) => {
|
|
26
|
+
const t = c.current;
|
|
27
|
+
switch (e) {
|
|
28
|
+
case a.SetValue: {
|
|
29
|
+
const o = new Date(i.value);
|
|
30
|
+
return t.onChange && t.onChange({ value: o, syntheticEvent: null, target: s }), { content: [{ type: "text", text: `Date-time set to ${o.toISOString()}.` }] };
|
|
31
|
+
}
|
|
32
|
+
case a.Clear:
|
|
33
|
+
return t.onChange && t.onChange({ value: null, syntheticEvent: null, target: s }), { content: [{ type: "text", text: "Date-time cleared." }] };
|
|
34
|
+
default:
|
|
35
|
+
return { content: [{ type: "text", text: `Unknown command: ${e}` }], isError: !0 };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
for (const e of y) {
|
|
39
|
+
if (!e.enabled)
|
|
40
|
+
continue;
|
|
41
|
+
const i = g(e.commandType), t = e.commandType;
|
|
42
|
+
try {
|
|
43
|
+
m.push(
|
|
44
|
+
p.registerTool({
|
|
45
|
+
name: h(e.name),
|
|
46
|
+
description: e.description,
|
|
47
|
+
inputSchema: i,
|
|
48
|
+
execute: async (o) => C(t, o || {})
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return m;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
T as dateTimePickerAdapter
|
|
59
|
+
};
|