@jay-framework/webmcp-plugin 0.22.2 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.client.js +6 -12
- package/dist/index.js +6 -12
- package/package.json +5 -5
package/dist/index.client.js
CHANGED
|
@@ -42,17 +42,13 @@ function setElementValue(element, value) {
|
|
|
42
42
|
}
|
|
43
43
|
function getValueEventTypes(registeredEvents) {
|
|
44
44
|
const result = [];
|
|
45
|
-
if (registeredEvents.includes("input"))
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
result.push("change");
|
|
49
|
-
if (result.length > 0)
|
|
50
|
-
return result;
|
|
45
|
+
if (registeredEvents.includes("input")) result.push("input");
|
|
46
|
+
if (registeredEvents.includes("change")) result.push("change");
|
|
47
|
+
if (result.length > 0) return result;
|
|
51
48
|
return registeredEvents.length > 0 ? [registeredEvents[0]] : ["input"];
|
|
52
49
|
}
|
|
53
50
|
function getSelectOptions(element) {
|
|
54
|
-
if (!(element instanceof HTMLSelectElement))
|
|
55
|
-
return void 0;
|
|
51
|
+
if (!(element instanceof HTMLSelectElement)) return void 0;
|
|
56
52
|
const options = [];
|
|
57
53
|
for (const opt of Array.from(element.options)) {
|
|
58
54
|
options.push(opt.value);
|
|
@@ -191,8 +187,7 @@ function buildSemanticTools(automation) {
|
|
|
191
187
|
}
|
|
192
188
|
function makeSemanticTool(group, automation) {
|
|
193
189
|
const sample = group.items[0];
|
|
194
|
-
if (!sample)
|
|
195
|
-
return null;
|
|
190
|
+
if (!sample) return null;
|
|
196
191
|
const elementType = sample.element.constructor.name;
|
|
197
192
|
const isFillable = FILLABLE_TYPES.has(elementType);
|
|
198
193
|
const isSelect = elementType === "HTMLSelectElement";
|
|
@@ -238,8 +233,7 @@ function makeSemanticTool(group, automation) {
|
|
|
238
233
|
try {
|
|
239
234
|
if (isFillable) {
|
|
240
235
|
const instance = automation.getInteraction(coord);
|
|
241
|
-
if (!instance)
|
|
242
|
-
return errorResult(`Element not found: ${coord.join("/")}`);
|
|
236
|
+
if (!instance) return errorResult(`Element not found: ${coord.join("/")}`);
|
|
243
237
|
setElementValue(instance.element, params.value);
|
|
244
238
|
for (const evt of getValueEventTypes(instance.events)) {
|
|
245
239
|
automation.triggerEvent(evt, coord);
|
package/dist/index.js
CHANGED
|
@@ -43,17 +43,13 @@ function setElementValue(element, value) {
|
|
|
43
43
|
}
|
|
44
44
|
function getValueEventTypes(registeredEvents) {
|
|
45
45
|
const result = [];
|
|
46
|
-
if (registeredEvents.includes("input"))
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
result.push("change");
|
|
50
|
-
if (result.length > 0)
|
|
51
|
-
return result;
|
|
46
|
+
if (registeredEvents.includes("input")) result.push("input");
|
|
47
|
+
if (registeredEvents.includes("change")) result.push("change");
|
|
48
|
+
if (result.length > 0) return result;
|
|
52
49
|
return registeredEvents.length > 0 ? [registeredEvents[0]] : ["input"];
|
|
53
50
|
}
|
|
54
51
|
function getSelectOptions(element) {
|
|
55
|
-
if (!(element instanceof HTMLSelectElement))
|
|
56
|
-
return void 0;
|
|
52
|
+
if (!(element instanceof HTMLSelectElement)) return void 0;
|
|
57
53
|
const options = [];
|
|
58
54
|
for (const opt of Array.from(element.options)) {
|
|
59
55
|
options.push(opt.value);
|
|
@@ -192,8 +188,7 @@ function buildSemanticTools(automation) {
|
|
|
192
188
|
}
|
|
193
189
|
function makeSemanticTool(group, automation) {
|
|
194
190
|
const sample = group.items[0];
|
|
195
|
-
if (!sample)
|
|
196
|
-
return null;
|
|
191
|
+
if (!sample) return null;
|
|
197
192
|
const elementType = sample.element.constructor.name;
|
|
198
193
|
const isFillable = FILLABLE_TYPES.has(elementType);
|
|
199
194
|
const isSelect = elementType === "HTMLSelectElement";
|
|
@@ -239,8 +234,7 @@ function makeSemanticTool(group, automation) {
|
|
|
239
234
|
try {
|
|
240
235
|
if (isFillable) {
|
|
241
236
|
const instance = automation.getInteraction(coord);
|
|
242
|
-
if (!instance)
|
|
243
|
-
return errorResult(`Element not found: ${coord.join("/")}`);
|
|
237
|
+
if (!instance) return errorResult(`Element not found: ${coord.join("/")}`);
|
|
244
238
|
setElementValue(instance.element, params.value);
|
|
245
239
|
for (const evt of getValueEventTypes(instance.events)) {
|
|
246
240
|
automation.triggerEvent(evt, coord);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/webmcp-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "WebMCP plugin for jay-stack — automatically exposes page interactions as WebMCP tools, resources, and prompts",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"test:watch": "vitest"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@jay-framework/fullstack-component": "^0.
|
|
32
|
-
"@jay-framework/runtime-automation": "^0.
|
|
31
|
+
"@jay-framework/fullstack-component": "^0.23.1",
|
|
32
|
+
"@jay-framework/runtime-automation": "^0.23.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@jay-framework/compiler-jay-stack": "^0.
|
|
36
|
-
"@jay-framework/dev-environment": "^0.
|
|
35
|
+
"@jay-framework/compiler-jay-stack": "^0.23.1",
|
|
36
|
+
"@jay-framework/dev-environment": "^0.23.1",
|
|
37
37
|
"@types/node": "^20.11.5",
|
|
38
38
|
"rimraf": "^5.0.5",
|
|
39
39
|
"tsup": "^8.0.1",
|