@attson/atwebpilot-mcp 0.0.30 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +225 -57
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -640,6 +640,27 @@ function capabilityForTool(tool, opts) {
|
|
|
640
640
|
return "read:dom";
|
|
641
641
|
case "screenshot":
|
|
642
642
|
return "read:image";
|
|
643
|
+
// Round 5 — meta / UI helpers
|
|
644
|
+
case "closeTab":
|
|
645
|
+
case "switchToTab":
|
|
646
|
+
return "tab:open";
|
|
647
|
+
case "searchBookmarks":
|
|
648
|
+
case "searchHistory":
|
|
649
|
+
return "read:dom";
|
|
650
|
+
case "downloadImage":
|
|
651
|
+
return "submit:form";
|
|
652
|
+
// writes to user's disk — treat as side-effect
|
|
653
|
+
case "takeSnapshot":
|
|
654
|
+
return "read:dom";
|
|
655
|
+
case "clickByUid":
|
|
656
|
+
return "interact:form";
|
|
657
|
+
case "fillByUid":
|
|
658
|
+
case "fillForm":
|
|
659
|
+
return "interact:form";
|
|
660
|
+
case "highlightElement":
|
|
661
|
+
case "highlightText":
|
|
662
|
+
return "read:dom";
|
|
663
|
+
// visual-only overlay
|
|
643
664
|
default: {
|
|
644
665
|
const _exhaustive = tool;
|
|
645
666
|
throw new Error(`capabilityForTool: unknown tool ${_exhaustive}`);
|
|
@@ -1036,75 +1057,79 @@ var CONTROL_TOOLS = [
|
|
|
1036
1057
|
];
|
|
1037
1058
|
|
|
1038
1059
|
// ../shared/src/llm/builtin-tool-defs.ts
|
|
1060
|
+
var TAB_ID_FIELD = {
|
|
1061
|
+
type: "integer",
|
|
1062
|
+
description: "\u76EE\u6807 tab\u3002\u8981\u64CD\u4F5C\u4E3B\u4F1A\u8BDD tab \u65F6\u6574\u4E2A\u5B57\u6BB5\u4E0D\u8981\u5E26\uFF08\u4E0D\u8981 0 / null\uFF09\uFF1B\u8981\u64CD\u4F5C\u5176\u5B83 tab \u65F6\u5B83\u5FC5\u987B\u5148\u5728 attachedTabs\uFF08\u7528 attachTab \u7533\u8BF7\uFF09"
|
|
1063
|
+
};
|
|
1039
1064
|
var TOOL_DEFS = [
|
|
1040
1065
|
{
|
|
1041
1066
|
name: "snapshotDOM",
|
|
1042
|
-
description: "\
|
|
1067
|
+
description: "[FIRST\xB7LEGACY] \u8FD4\u56DE\u9875\u9762 DOM \u7B80\u5316\u6811\uFF08tag/id/classes/\u76F4\u63A5\u6587\u672C/children\uFF09\u3002\n\u5982\u679C\u4F60\u53EA\u662F\u8981\u627E\u4EA4\u4E92\u5143\u7D20\u5E76\u968F\u540E\u64CD\u4F5C\uFF0C**\u4F18\u5148\u7528 takeSnapshot**\uFF08UID \u7A33\u5B9A\uFF0CclickByUid \u5065\u58EE\uFF09\uFF1B\nsnapshotDOM \u66F4\u9002\u5408\u300C\u6211\u8981\u5206\u6790\u6574\u4E2A\u9875\u9762\u7ED3\u6784\u300D\u8FD9\u79CD\u63A2\u67E5\u7C7B\u9700\u6C42\u3002\n\n\u793A\u4F8B\uFF1A\n- \u770B\u6574\u9875\uFF1A{ }\uFF08\u9ED8\u8BA4 maxDepth=3\uFF09\n- \u770B\u67D0\u533A\u57DF\uFF1A{ root: '.main-content', maxDepth: 5 }\n- \u770B\u5230\u5E95\uFF1A{ maxDepth: 8 }",
|
|
1043
1068
|
input_schema: {
|
|
1044
1069
|
type: "object",
|
|
1045
1070
|
properties: {
|
|
1046
1071
|
maxDepth: { type: "integer", default: 3 },
|
|
1047
1072
|
root: { type: "string", description: "\u53EF\u9009\u7684 CSS \u9009\u62E9\u5668\uFF1B\u627E\u4E0D\u5230\u65F6\u9000\u56DE\u5230 <html>" },
|
|
1048
|
-
tabId:
|
|
1073
|
+
tabId: TAB_ID_FIELD
|
|
1049
1074
|
}
|
|
1050
1075
|
}
|
|
1051
1076
|
},
|
|
1052
1077
|
{
|
|
1053
1078
|
name: "querySelector",
|
|
1054
|
-
description: "\u8FD4\u56DE\u9996\u4E2A\u5339\u914D\u5143\u7D20\u7684\u6D45\u5C42\u6458\u8981 (tag/id/classes/text/attrs)\u3002",
|
|
1079
|
+
description: "[FAST] \u8FD4\u56DE\u9996\u4E2A\u5339\u914D\u5143\u7D20\u7684\u6D45\u5C42\u6458\u8981 (tag/id/classes/text/attrs)\u3002\u4EC5\u63A2\u67E5\u7528\u3002\n\u8981\u540E\u7EED\u70B9\u51FB\u6216\u586B\u503C\uFF0C\u914D\u5408 selector \u76F4\u63A5\u4F20\u7ED9 click / fillInput\uFF0C\u6216\u7528 takeSnapshot \u62FF UID\u3002\n\n\u793A\u4F8B\uFF1A\n- \u627E\u6309\u94AE\uFF1A{ selector: 'button[type=submit]' }\n- \u627E\u8F93\u5165\uFF1A{ selector: 'input[name=email]' }",
|
|
1055
1080
|
input_schema: {
|
|
1056
1081
|
type: "object",
|
|
1057
1082
|
properties: {
|
|
1058
1083
|
selector: { type: "string" },
|
|
1059
1084
|
root: { type: "string" },
|
|
1060
|
-
tabId:
|
|
1085
|
+
tabId: TAB_ID_FIELD
|
|
1061
1086
|
},
|
|
1062
1087
|
required: ["selector"]
|
|
1063
1088
|
}
|
|
1064
1089
|
},
|
|
1065
1090
|
{
|
|
1066
1091
|
name: "querySelectorAll",
|
|
1067
|
-
description: "\u8FD4\u56DE\u6240\u6709\u5339\u914D\u5143\u7D20\u7684\u6D45\u5C42\u6458\u8981\u6570\u7EC4\u3002",
|
|
1092
|
+
description: "[FAST] \u8FD4\u56DE\u6240\u6709\u5339\u914D\u5143\u7D20\u7684\u6D45\u5C42\u6458\u8981\u6570\u7EC4\u3002\n\n\u793A\u4F8B\uFF1A\n- \u6240\u6709\u8BC4\u8BBA\uFF1A{ selector: '.comment-item', limit: 50 }\n- \u6240\u6709\u94FE\u63A5\uFF1A{ selector: 'a[href]', limit: 20 }",
|
|
1068
1093
|
input_schema: {
|
|
1069
1094
|
type: "object",
|
|
1070
1095
|
properties: {
|
|
1071
1096
|
selector: { type: "string" },
|
|
1072
1097
|
root: { type: "string" },
|
|
1073
1098
|
limit: { type: "integer" },
|
|
1074
|
-
tabId:
|
|
1099
|
+
tabId: TAB_ID_FIELD
|
|
1075
1100
|
},
|
|
1076
1101
|
required: ["selector"]
|
|
1077
1102
|
}
|
|
1078
1103
|
},
|
|
1079
1104
|
{
|
|
1080
1105
|
name: "extractText",
|
|
1081
|
-
description: "\u63D0\u53D6\u9009\u62E9\u5668\u547D\u4E2D\
|
|
1106
|
+
description: "[FAST] \u63D0\u53D6\u9009\u62E9\u5668\u547D\u4E2D\u5143\u7D20\u7684\u6587\u672C\u3002single=true \u8FD4\u56DE\u5B57\u7B26\u4E32\uFF0C\u5426\u5219\u8FD4\u56DE\u6570\u7EC4\u3002\n\n\u793A\u4F8B\uFF1A\n- \u63D0\u53D6\u6807\u9898\uFF1A{ selector: 'h1', single: true }\n- \u63D0\u53D6\u6240\u6709\u6BB5\u843D\uFF1A{ selector: 'article p' }",
|
|
1082
1107
|
input_schema: {
|
|
1083
1108
|
type: "object",
|
|
1084
1109
|
properties: {
|
|
1085
1110
|
selector: { type: "string" },
|
|
1086
1111
|
root: { type: "string" },
|
|
1087
1112
|
single: { type: "boolean" },
|
|
1088
|
-
tabId:
|
|
1113
|
+
tabId: TAB_ID_FIELD
|
|
1089
1114
|
},
|
|
1090
1115
|
required: ["selector"]
|
|
1091
1116
|
}
|
|
1092
1117
|
},
|
|
1093
1118
|
{
|
|
1094
1119
|
name: "extractImages",
|
|
1095
|
-
description: "\u5728 root \u8303\u56F4\u5185\u63D0\u53D6\u6240\u6709 <img> \u7684 src/data-src/srcset\uFF1BincludeBg=true \u65F6\u4E5F\u63D0\u53D6\u80CC\u666F\u56FE\u3002\u8FD4\u56DE {url, via}
|
|
1120
|
+
description: "[FAST] \u5728 root \u8303\u56F4\u5185\u63D0\u53D6\u6240\u6709 <img> \u7684 src/data-src/srcset\uFF1BincludeBg=true \u65F6\u4E5F\u63D0\u53D6\u80CC\u666F\u56FE\u3002\u8FD4\u56DE [{url, via}].\n\n\u793A\u4F8B\uFF1A\n- \u5168\u9875\u56FE\uFF1A{ }\uFF08\u9ED8\u8BA4 root=document\uFF09\n- \u5546\u54C1\u4E3B\u56FE\uFF1A{ root: '.product-gallery' }",
|
|
1096
1121
|
input_schema: {
|
|
1097
1122
|
type: "object",
|
|
1098
1123
|
properties: {
|
|
1099
1124
|
root: { type: "string" },
|
|
1100
1125
|
includeBg: { type: "boolean", default: false },
|
|
1101
|
-
tabId:
|
|
1126
|
+
tabId: TAB_ID_FIELD
|
|
1102
1127
|
}
|
|
1103
1128
|
}
|
|
1104
1129
|
},
|
|
1105
1130
|
{
|
|
1106
1131
|
name: "scroll",
|
|
1107
|
-
description: "\u6EDA\u52A8\u9875\u9762\u3002to \u53EF\u4E3A 'bottom'
|
|
1132
|
+
description: "[FLOW] \u6EDA\u52A8\u9875\u9762\u3002to \u53EF\u4E3A 'bottom' / 'top' / number\u3002max \u662F\u6EDA\u52A8\u6B21\u6570\uFF1BuntilSelector \u51FA\u73B0\u65F6\u63D0\u524D\u505C\u3002\n\n\u793A\u4F8B\uFF1A\n- \u89E6\u53D1\u61D2\u52A0\u8F7D\uFF1A{ to: 'bottom', max: 5 }\n- \u6EDA\u5230\u951A\u70B9\uFF1A{ to: 'top' } \u540E\u7528 element.scrollIntoView \u4E5F\u53EF\n- \u7B49\u5F85\u65B0\u5143\u7D20\uFF1A{ to: 'bottom', max: 10, untilSelector: '.item:nth-child(20)' }",
|
|
1108
1133
|
input_schema: {
|
|
1109
1134
|
type: "object",
|
|
1110
1135
|
properties: {
|
|
@@ -1112,195 +1137,197 @@ var TOOL_DEFS = [
|
|
|
1112
1137
|
max: { type: "integer", default: 1 },
|
|
1113
1138
|
intervalMs: { type: "integer", default: 250 },
|
|
1114
1139
|
untilSelector: { type: "string" },
|
|
1115
|
-
tabId:
|
|
1140
|
+
tabId: TAB_ID_FIELD
|
|
1116
1141
|
},
|
|
1117
1142
|
required: ["to"]
|
|
1118
1143
|
}
|
|
1119
1144
|
},
|
|
1120
1145
|
{
|
|
1121
1146
|
name: "waitFor",
|
|
1122
|
-
description: "\u7B49\u5F85\u56FA\u5B9A ms\uFF0C\u6216\u7B49\u5F85\u9009\u62E9\u5668\u51FA\u73B0\uFF08\u5E26 timeoutMs \u515C\u5E95\uFF09\u3002",
|
|
1147
|
+
description: "[FLOW] \u7B49\u5F85\u56FA\u5B9A ms\uFF0C\u6216\u7B49\u5F85\u9009\u62E9\u5668\u51FA\u73B0\uFF08\u5E26 timeoutMs \u515C\u5E95\uFF09\u3002\n\n\u793A\u4F8B\uFF1A\n- \u7B49 500ms\uFF1A{ ms: 500 }\n- \u7B49\u5143\u7D20\u51FA\u73B0\uFF1A{ selector: '.lazy-loaded', timeoutMs: 8000 }",
|
|
1123
1148
|
input_schema: {
|
|
1124
1149
|
type: "object",
|
|
1125
1150
|
properties: {
|
|
1126
1151
|
ms: { type: "integer" },
|
|
1127
1152
|
selector: { type: "string" },
|
|
1128
1153
|
timeoutMs: { type: "integer", default: 5e3 },
|
|
1129
|
-
tabId:
|
|
1154
|
+
tabId: TAB_ID_FIELD
|
|
1130
1155
|
}
|
|
1131
1156
|
}
|
|
1132
1157
|
},
|
|
1133
1158
|
{
|
|
1134
1159
|
name: "click",
|
|
1135
|
-
description: "\u70B9\u51FB\u9009\u62E9\u5668\u547D\u4E2D\u7684\u5143\u7D20\u3002required=false \u65F6\u627E\u4E0D\u5230\u4E0D\u62A5\u9519\u3002\
|
|
1160
|
+
description: "[ACT] \u70B9\u51FB\u9009\u62E9\u5668\u547D\u4E2D\u7684\u5143\u7D20\u3002required=false \u65F6\u627E\u4E0D\u5230\u4E0D\u62A5\u9519\u3002\u4F1A\u7ECF\u8FC7\u5BA1\u9605\uFF08caution\uFF09\u3002\n\u7528 takeSnapshot \u62FF\u5230 UID \u540E\u5EFA\u8BAE\u6539\u7528 clickByUid\uFF0C\u66F4\u7A33\u3002",
|
|
1136
1161
|
input_schema: {
|
|
1137
1162
|
type: "object",
|
|
1138
1163
|
properties: {
|
|
1139
1164
|
selector: { type: "string" },
|
|
1140
1165
|
required: { type: "boolean", default: true },
|
|
1141
|
-
tabId:
|
|
1166
|
+
tabId: TAB_ID_FIELD
|
|
1142
1167
|
},
|
|
1143
1168
|
required: ["selector"]
|
|
1144
1169
|
}
|
|
1145
1170
|
},
|
|
1146
1171
|
{
|
|
1147
1172
|
name: "httpRequest",
|
|
1148
|
-
description: "\u901A\u8FC7\u540E\u53F0\u4EE3\u7406\u53D1\u8BF7\u6C42\u3002withCredentials=true \u65F6\u5E26 cookie\uFF0C\
|
|
1173
|
+
description: "[ACT] \u901A\u8FC7\u540E\u53F0\u4EE3\u7406\u53D1\u8BF7\u6C42\u3002withCredentials=true \u65F6\u5E26 cookie\uFF08dangerous\uFF0C\u8981\u5BA1\u9605\uFF09\uFF1B\u9ED8\u8BA4 omit\u3002\n\n\u793A\u4F8B\uFF1A\n- \u7FFB\u8BC4\u8BBA\u9875\uFF1A{ url: 'https://x.com/api/comments?page=2', withCredentials: false }\n- \u5E26\u767B\u5F55\u6001\u8C03\u5185\u90E8\u63A5\u53E3\uFF1A{ url: '...', withCredentials: true }",
|
|
1149
1174
|
input_schema: {
|
|
1150
1175
|
type: "object",
|
|
1151
1176
|
properties: {
|
|
1177
|
+
method: { type: "string", default: "GET" },
|
|
1152
1178
|
url: { type: "string" },
|
|
1153
|
-
method: { type: "string", enum: ["GET", "POST", "PUT", "DELETE", "PATCH"], default: "GET" },
|
|
1154
1179
|
headers: { type: "object" },
|
|
1155
|
-
body: {
|
|
1180
|
+
body: { description: "any JSON-able value" },
|
|
1156
1181
|
withCredentials: { type: "boolean", default: false },
|
|
1157
|
-
tabId:
|
|
1182
|
+
tabId: TAB_ID_FIELD
|
|
1158
1183
|
},
|
|
1159
1184
|
required: ["url"]
|
|
1160
1185
|
}
|
|
1161
1186
|
},
|
|
1162
1187
|
{
|
|
1163
1188
|
name: "readStorage",
|
|
1164
|
-
description: "\u8BFB localStorage \u6216 sessionStorage \
|
|
1189
|
+
description: "[DANGER] \u8BFB localStorage \u6216 sessionStorage \u6307\u5B9A key\u3002\u9700\u8981\u5BA1\u9605\u3002",
|
|
1165
1190
|
input_schema: {
|
|
1166
1191
|
type: "object",
|
|
1167
1192
|
properties: {
|
|
1168
1193
|
store: { type: "string", enum: ["local", "session"] },
|
|
1169
1194
|
key: { type: "string" },
|
|
1170
|
-
tabId:
|
|
1195
|
+
tabId: TAB_ID_FIELD
|
|
1171
1196
|
},
|
|
1172
1197
|
required: ["store", "key"]
|
|
1173
1198
|
}
|
|
1174
1199
|
},
|
|
1175
1200
|
{
|
|
1176
1201
|
name: "fillInput",
|
|
1177
|
-
description: "\u5F80 input/textarea/contenteditable \u586B\u503C\uFF1B\u89E6\u53D1 input/change \u4E8B\u4EF6\
|
|
1202
|
+
description: "[ACT] \u5F80 input/textarea/contenteditable \u586B\u503C\uFF1B\u89E6\u53D1 input/change \u4E8B\u4EF6\u517C\u5BB9 React/Vue\u3002\n**\u6279\u91CF\u586B\u8868\u8BF7\u7528 fillForm**\uFF08\u66F4\u9AD8\u6548\uFF09\u3002\n\n\u793A\u4F8B\uFF1A\n- \u586B\u90AE\u7BB1\uFF1A{ selector: 'input[name=email]', value: 'a@b.c' }\n- \u4E0D\u6E05\u7A7A\u76F4\u63A5\u8FFD\u52A0\uFF1A{ selector: '.editor', value: 'tail', clear: false }",
|
|
1178
1203
|
input_schema: {
|
|
1179
1204
|
type: "object",
|
|
1180
1205
|
properties: {
|
|
1181
1206
|
selector: { type: "string" },
|
|
1182
1207
|
value: { type: "string" },
|
|
1183
1208
|
clear: { type: "boolean", default: true },
|
|
1184
|
-
tabId:
|
|
1209
|
+
tabId: TAB_ID_FIELD
|
|
1185
1210
|
},
|
|
1186
1211
|
required: ["selector", "value"]
|
|
1187
1212
|
}
|
|
1188
1213
|
},
|
|
1189
1214
|
{
|
|
1190
1215
|
name: "setCheckbox",
|
|
1191
|
-
description: "\u8BBE\u7F6E checkbox \u52FE\u9009\u72B6\u6001\uFF1B\u6D3E\u53D1 change \u4E8B\u4EF6\u3002",
|
|
1216
|
+
description: "[ACT] \u8BBE\u7F6E checkbox \u52FE\u9009\u72B6\u6001\uFF1B\u6D3E\u53D1 change \u4E8B\u4EF6\u3002",
|
|
1192
1217
|
input_schema: {
|
|
1193
1218
|
type: "object",
|
|
1194
1219
|
properties: {
|
|
1195
1220
|
selector: { type: "string" },
|
|
1196
1221
|
checked: { type: "boolean" },
|
|
1197
|
-
tabId:
|
|
1222
|
+
tabId: TAB_ID_FIELD
|
|
1198
1223
|
},
|
|
1199
1224
|
required: ["selector", "checked"]
|
|
1200
1225
|
}
|
|
1201
1226
|
},
|
|
1202
1227
|
{
|
|
1203
1228
|
name: "selectOption",
|
|
1204
|
-
description: "<select> \u5143\u7D20\u6309 value \u6216 label \u9009\u9879\u3002\u540C\u65F6\u7ED9\u4E24\u8005\u65F6\u4F18\u5148 value\u3002",
|
|
1229
|
+
description: "[ACT] <select> \u5143\u7D20\u6309 value \u6216 label \u9009\u9879\u3002\u540C\u65F6\u7ED9\u4E24\u8005\u65F6\u4F18\u5148 value\u3002",
|
|
1205
1230
|
input_schema: {
|
|
1206
1231
|
type: "object",
|
|
1207
1232
|
properties: {
|
|
1208
1233
|
selector: { type: "string" },
|
|
1209
1234
|
value: { type: "string" },
|
|
1210
1235
|
label: { type: "string" },
|
|
1211
|
-
tabId:
|
|
1236
|
+
tabId: TAB_ID_FIELD
|
|
1212
1237
|
},
|
|
1213
1238
|
required: ["selector"]
|
|
1214
1239
|
}
|
|
1215
1240
|
},
|
|
1216
1241
|
{
|
|
1217
1242
|
name: "submitForm",
|
|
1218
|
-
description: "\u63D0\u4EA4 <form>\u3002\u4F1A\u89E6\u53D1\u670D\u52A1\u7AEF\u52A8\u4F5C\uFF08\u4E0B\u5355\u3001\u7559\u8A00\u7B49\uFF09\uFF0C\
|
|
1243
|
+
description: "[CONFIRM\xB7DANGER] \u63D0\u4EA4 <form>\u3002\u4F1A\u89E6\u53D1\u670D\u52A1\u7AEF\u52A8\u4F5C\uFF08\u4E0B\u5355\u3001\u7559\u8A00\u7B49\uFF09\uFF0C\u7528\u6237\u5FC5\u987B\u5BA1\u9605\u3002\n\u8C03\u7528\u524D\u5EFA\u8BAE\u5148\u7528 askUser \u8BA9\u7528\u6237\u6700\u7EC8\u786E\u8BA4\u3002",
|
|
1219
1244
|
input_schema: {
|
|
1220
1245
|
type: "object",
|
|
1221
1246
|
properties: {
|
|
1222
|
-
selector: { type: "string"
|
|
1223
|
-
tabId:
|
|
1224
|
-
}
|
|
1247
|
+
selector: { type: "string" },
|
|
1248
|
+
tabId: TAB_ID_FIELD
|
|
1249
|
+
},
|
|
1250
|
+
required: ["selector"]
|
|
1225
1251
|
}
|
|
1226
1252
|
},
|
|
1227
1253
|
{
|
|
1228
1254
|
name: "hover",
|
|
1229
|
-
description: "\u628A\u9F20\u6807\u60AC\u505C\u5728\u5143\u7D20\u4E0A\uFF08\u89E6\u53D1 mouseenter / mouseover / mousemove\uFF09\u3002",
|
|
1255
|
+
description: "[ACT] \u628A\u9F20\u6807\u60AC\u505C\u5728\u5143\u7D20\u4E0A\uFF08\u89E6\u53D1 mouseenter / mouseover / mousemove\uFF09\u3002",
|
|
1230
1256
|
input_schema: {
|
|
1231
1257
|
type: "object",
|
|
1232
1258
|
properties: {
|
|
1233
1259
|
selector: { type: "string" },
|
|
1234
|
-
tabId:
|
|
1260
|
+
tabId: TAB_ID_FIELD
|
|
1235
1261
|
},
|
|
1236
1262
|
required: ["selector"]
|
|
1237
1263
|
}
|
|
1238
1264
|
},
|
|
1239
1265
|
{
|
|
1240
1266
|
name: "focus",
|
|
1241
|
-
description: "\u628A\u7126\u70B9\u7ED9\u67D0\u5143\u7D20\uFF08\u89E6\u53D1 focus / focusin\uFF09\u3002",
|
|
1267
|
+
description: "[ACT] \u628A\u7126\u70B9\u7ED9\u67D0\u5143\u7D20\uFF08\u89E6\u53D1 focus / focusin\uFF09\u3002",
|
|
1242
1268
|
input_schema: {
|
|
1243
1269
|
type: "object",
|
|
1244
1270
|
properties: {
|
|
1245
1271
|
selector: { type: "string" },
|
|
1246
|
-
tabId:
|
|
1272
|
+
tabId: TAB_ID_FIELD
|
|
1247
1273
|
},
|
|
1248
1274
|
required: ["selector"]
|
|
1249
1275
|
}
|
|
1250
1276
|
},
|
|
1251
1277
|
{
|
|
1252
1278
|
name: "uploadFile",
|
|
1253
|
-
description: "\u628A\u540E\u7AEF\u4EE3\u7406\u62C9\u5230\u7684\u6587\u4EF6\u586B\u5230 <input type=file>\u3002\u67D0\u4E9B\u7AD9\u70B9\u4F1A\u62D2\u7EDD\u5408\u6210 File\
|
|
1279
|
+
description: "[CONFIRM\xB7DANGER] \u628A\u540E\u7AEF\u4EE3\u7406\u62C9\u5230\u7684\u6587\u4EF6\u586B\u5230 <input type=file>\u3002\u67D0\u4E9B\u7AD9\u70B9\u4F1A\u62D2\u7EDD\u5408\u6210 File\u3002",
|
|
1254
1280
|
input_schema: {
|
|
1255
1281
|
type: "object",
|
|
1256
1282
|
properties: {
|
|
1257
1283
|
selector: { type: "string" },
|
|
1258
1284
|
url: { type: "string" },
|
|
1259
1285
|
filename: { type: "string" },
|
|
1260
|
-
|
|
1261
|
-
tabId:
|
|
1286
|
+
mimeType: { type: "string" },
|
|
1287
|
+
tabId: TAB_ID_FIELD
|
|
1262
1288
|
},
|
|
1263
1289
|
required: ["selector", "url"]
|
|
1264
1290
|
}
|
|
1265
1291
|
},
|
|
1266
1292
|
{
|
|
1267
1293
|
name: "getValue",
|
|
1268
|
-
description: "\u8BFB input/select/textarea/contenteditable \u7684\u5F53\u524D\u503C\u3002",
|
|
1294
|
+
description: "[FAST] \u8BFB input/select/textarea/contenteditable \u7684\u5F53\u524D\u503C\u3002",
|
|
1269
1295
|
input_schema: {
|
|
1270
1296
|
type: "object",
|
|
1271
1297
|
properties: {
|
|
1272
1298
|
selector: { type: "string" },
|
|
1273
|
-
tabId:
|
|
1299
|
+
tabId: TAB_ID_FIELD
|
|
1274
1300
|
},
|
|
1275
1301
|
required: ["selector"]
|
|
1276
1302
|
}
|
|
1277
1303
|
},
|
|
1278
1304
|
{
|
|
1279
1305
|
name: "extractFormState",
|
|
1280
|
-
description: "\u628A <form> \u5185\u6240\u6709\u53EF\u586B\u5B57\u6BB5\u8BFB\u6210 {name: value} \u5BF9\u8C61\uFF08radio \u53D6\u9009\u4E2D\u503C\uFF1Bcheckbox \u591A\u9009\u53D6\u6570\u7EC4\uFF09\u3002",
|
|
1306
|
+
description: "[FAST\xB7USE BEFORE FILL] \u628A <form> \u5185\u6240\u6709\u53EF\u586B\u5B57\u6BB5\u8BFB\u6210 {name: value} \u5BF9\u8C61\uFF08radio \u53D6\u9009\u4E2D\u503C\uFF1Bcheckbox \u591A\u9009\u53D6\u6570\u7EC4\uFF09\u3002\n\u586B\u8868\u524D\u5148\u8C03\u4E00\u6B21\uFF0C\u80FD\u7701\u4E0B\u5927\u91CF\u76F2\u586B\u3002",
|
|
1281
1307
|
input_schema: {
|
|
1282
1308
|
type: "object",
|
|
1283
1309
|
properties: {
|
|
1284
|
-
|
|
1285
|
-
tabId:
|
|
1310
|
+
form: { type: "string", description: "\u53EF\u9009\uFF1A<form> \u7684 CSS selector\uFF1B\u7701\u7565=\u7B2C\u4E00\u4E2A form" },
|
|
1311
|
+
tabId: TAB_ID_FIELD
|
|
1286
1312
|
}
|
|
1287
1313
|
}
|
|
1288
1314
|
},
|
|
1289
1315
|
{
|
|
1290
1316
|
name: "runJS",
|
|
1291
|
-
description: "\u5728 MAIN world \u6CE8\u5165\u5E76\u6267\u884C
|
|
1317
|
+
description: "[LAST RESORT\xB7DANGER] \u5728 MAIN world \u6CE8\u5165\u5E76\u6267\u884C async \u51FD\u6570\u4F53\uFF08receives `ctx` = bindings\uFF09\u3002\u5FC5\u987B return \u503C\u3002\n**\u4EC5\u5728\u7ED3\u6784\u5316\u5DE5\u5177\u4E0D\u591F\u7528\u65F6\u4F7F\u7528**\u2014\u2014\u4F1A\u7ECF\u8FC7\u9759\u6001\u626B\u63CF\u4E0E\u4EBA\u5DE5\u5BA1\u9605\u3002",
|
|
1292
1318
|
input_schema: {
|
|
1293
1319
|
type: "object",
|
|
1294
1320
|
properties: {
|
|
1295
1321
|
source: { type: "string", description: "async function body" },
|
|
1296
|
-
tabId:
|
|
1322
|
+
tabId: TAB_ID_FIELD
|
|
1297
1323
|
},
|
|
1298
1324
|
required: ["source"]
|
|
1299
1325
|
}
|
|
1300
1326
|
},
|
|
1327
|
+
// ─── Cross-tab control plane ─────────────────────────────────
|
|
1301
1328
|
{
|
|
1302
1329
|
name: "listTabs",
|
|
1303
|
-
description: "\u5217\u51FA\u6240\u6709\u7A97\u53E3\u7684\u53EF\u8BBF\u95EE tab\uFF1B\u8FD4\u56DE [{tabId, windowId, url, title, attached, isCurrent}]\u3002\
|
|
1330
|
+
description: "[META] \u5217\u51FA\u6240\u6709\u7A97\u53E3\u7684\u53EF\u8BBF\u95EE tab\uFF1B\u8FD4\u56DE [{tabId, windowId, url, title, attached, isCurrent}]\u3002\n\u5728\u4F60\u9700\u8981\u8BC6\u522B / \u627E\u65B0 tab \u65F6\u8C03\u7528\u3002",
|
|
1304
1331
|
input_schema: {
|
|
1305
1332
|
type: "object",
|
|
1306
1333
|
properties: {
|
|
@@ -1310,7 +1337,7 @@ var TOOL_DEFS = [
|
|
|
1310
1337
|
},
|
|
1311
1338
|
{
|
|
1312
1339
|
name: "openTab",
|
|
1313
|
-
description: "\u6253\u5F00\u65B0 tab\uFF0C\u6210\u529F\u540E\u81EA\u52A8\u52A0\u5165\u4F1A\u8BDD attachedTabs\uFF08source=ai-open\uFF09\u3002\u8FD4\u56DE {tabId, url, title}\u3002",
|
|
1340
|
+
description: "[META] \u6253\u5F00\u65B0 tab\uFF0C\u6210\u529F\u540E\u81EA\u52A8\u52A0\u5165\u4F1A\u8BDD attachedTabs\uFF08source=ai-open\uFF09\u3002\u8FD4\u56DE {tabId, url, title}\u3002",
|
|
1314
1341
|
input_schema: {
|
|
1315
1342
|
type: "object",
|
|
1316
1343
|
properties: {
|
|
@@ -1322,7 +1349,7 @@ var TOOL_DEFS = [
|
|
|
1322
1349
|
},
|
|
1323
1350
|
{
|
|
1324
1351
|
name: "attachTab",
|
|
1325
|
-
description: "\u8BF7\u6C42\u628A\
|
|
1352
|
+
description: "[META] \u8BF7\u6C42\u628A\u5DF2\u6253\u5F00\u7684 tab \u7EB3\u5165\u4F1A\u8BDD attachedTabs\uFF1B\u672A\u9884\u6279\u51C6\u65F6\u4F1A\u5411\u7528\u6237\u7D22\u53D6\u5BA1\u6279\u3002",
|
|
1326
1353
|
input_schema: {
|
|
1327
1354
|
type: "object",
|
|
1328
1355
|
properties: {
|
|
@@ -1334,30 +1361,46 @@ var TOOL_DEFS = [
|
|
|
1334
1361
|
},
|
|
1335
1362
|
{
|
|
1336
1363
|
name: "detachTab",
|
|
1337
|
-
description: "\u4ECE\u4F1A\u8BDD attachedTabs \u79FB\u9664
|
|
1364
|
+
description: "[META] \u4ECE\u4F1A\u8BDD attachedTabs \u79FB\u9664 tab\uFF1B\u4E0D\u5173\u95ED\u8BE5 tab\u3002",
|
|
1365
|
+
input_schema: {
|
|
1366
|
+
type: "object",
|
|
1367
|
+
properties: { tabId: { type: "integer" } },
|
|
1368
|
+
required: ["tabId"]
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
name: "closeTab",
|
|
1373
|
+
description: "[META] \u771F\u6B63\u5173\u95ED\u4E00\u4E2A tab\u3002**\u53EA\u80FD\u5173 attachedTabs \u91CC\u7684 tab**\uFF08\u9632\u6B62\u8BEF\u5173\u7528\u6237\u5176\u5B83\u7A97\u53E3\uFF09\u3002",
|
|
1338
1374
|
input_schema: {
|
|
1339
1375
|
type: "object",
|
|
1340
1376
|
properties: { tabId: { type: "integer" } },
|
|
1341
1377
|
required: ["tabId"]
|
|
1342
1378
|
}
|
|
1343
1379
|
},
|
|
1380
|
+
{
|
|
1381
|
+
name: "switchToTab",
|
|
1382
|
+
description: "[META] \u628A Chrome \u524D\u53F0\u5207\u5230\u76EE\u6807 tab\u3002tabId \u5FC5\u987B\u5DF2\u5728 attachedTabs \u6216\u5F53\u524D tab\u3002",
|
|
1383
|
+
input_schema: {
|
|
1384
|
+
type: "object",
|
|
1385
|
+
properties: { tabId: { type: "integer" } },
|
|
1386
|
+
required: ["tabId"]
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
// ─── User-side helpers ───────────────────────────────────────
|
|
1344
1390
|
{
|
|
1345
1391
|
name: "screenshot",
|
|
1346
|
-
description: "\u622A\u5F53\u524D tab \
|
|
1392
|
+
description: "[VISION] \u622A\u5F53\u524D tab \u53EF\u89C1\u533A\u57DF\u4E3A PNG\uFF08\u81EA\u52A8\u4F5C\u4E3A image block \u6CE8\u5165\u4E0B\u8F6E\uFF09\u3002\u7528\u4E8E\u89C6\u89C9\u8C03\u8BD5 selector / \u770B\u56FE\u56DE\u7B54 / \u7559\u8BC1\u636E\u3002\u8FD4\u56DE {ok: true, byteLen}\u3002",
|
|
1347
1393
|
input_schema: {
|
|
1348
1394
|
type: "object",
|
|
1349
1395
|
properties: {
|
|
1350
|
-
selector: {
|
|
1351
|
-
|
|
1352
|
-
description: "\u53EF\u9009\uFF1ACSS selector\u3002\u57FA\u7840\u7248\u65E0\u89C6\u5B83\uFF0C\u59CB\u7EC8\u622A viewport\uFF1B\u4FDD\u7559\u5B57\u6BB5\u4E3A\u672A\u6765\u6269\u5C55\u3002"
|
|
1353
|
-
},
|
|
1354
|
-
tabId: { type: "integer", description: "\u76EE\u6807 tab\uFF1B\u7701\u7565 = \u672C\u4F1A\u8BDD tab" }
|
|
1396
|
+
selector: { type: "string", description: "\u53EF\u9009\uFF1ACSS selector\u3002\u57FA\u7840\u7248\u65E0\u89C6\uFF0C\u59CB\u7EC8\u622A viewport\u3002" },
|
|
1397
|
+
tabId: TAB_ID_FIELD
|
|
1355
1398
|
}
|
|
1356
1399
|
}
|
|
1357
1400
|
},
|
|
1358
1401
|
{
|
|
1359
1402
|
name: "askUser",
|
|
1360
|
-
description: "\u5411\u7528\u6237\u4E3B\u52A8\u5F81\u8BE2\uFF08\u4E0D\u662F\u6267\u884C\u64CD\u4F5C\uFF09\u3002\
|
|
1403
|
+
description: "[ASK] \u5411\u7528\u6237\u4E3B\u52A8\u5F81\u8BE2\uFF08\u4E0D\u662F\u6267\u884C\u64CD\u4F5C\uFF09\u3002\u4EFB\u52A1\u6709\u591A\u4E2A\u5019\u9009 / \u4E8C\u6B21\u786E\u8BA4 / \u7F3A\u5173\u952E\u4FE1\u606F\u65F6\u8C03\u7528\u3002\u8FD4\u56DE {choice} / {value} / {cancelled:true}\u3002\n**\u4EC5\u5728\u4F60\u786E\u5B9E\u5361\u4F4F\u65F6\u624D\u7528**\u2014\u2014\u522B\u7528\u5B83\u505A\u95F2\u804A\u3002",
|
|
1361
1404
|
input_schema: {
|
|
1362
1405
|
type: "object",
|
|
1363
1406
|
properties: {
|
|
@@ -1383,6 +1426,131 @@ var TOOL_DEFS = [
|
|
|
1383
1426
|
},
|
|
1384
1427
|
required: ["prompt", "kind"]
|
|
1385
1428
|
}
|
|
1429
|
+
},
|
|
1430
|
+
// ─── Tier 3 · bookmark / history / downloads ────────────────
|
|
1431
|
+
{
|
|
1432
|
+
name: "searchBookmarks",
|
|
1433
|
+
description: "[META] \u641C\u7D22\u6D4F\u89C8\u5668\u4E66\u7B7E\uFF08chrome.bookmarks.search\uFF09\u3002\u8FD4\u56DE [{id, title, url}]\u3002\n\n\u793A\u4F8B\uFF1A{ query: 'react', limit: 20 }",
|
|
1434
|
+
input_schema: {
|
|
1435
|
+
type: "object",
|
|
1436
|
+
properties: {
|
|
1437
|
+
query: { type: "string" },
|
|
1438
|
+
limit: { type: "integer", default: 50 }
|
|
1439
|
+
},
|
|
1440
|
+
required: ["query"]
|
|
1441
|
+
}
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
name: "searchHistory",
|
|
1445
|
+
description: "[META] \u641C\u7D22\u6D4F\u89C8\u5668\u5386\u53F2\u3002daysBack \u9ED8\u8BA4 7\u3002\u8FD4\u56DE [{url, title, lastVisitTime, visitCount}]\u3002",
|
|
1446
|
+
input_schema: {
|
|
1447
|
+
type: "object",
|
|
1448
|
+
properties: {
|
|
1449
|
+
query: { type: "string" },
|
|
1450
|
+
daysBack: { type: "integer", default: 7 },
|
|
1451
|
+
limit: { type: "integer", default: 50 }
|
|
1452
|
+
},
|
|
1453
|
+
required: ["query"]
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
name: "downloadImage",
|
|
1458
|
+
description: "[ACT] \u628A\u4E00\u4E2A URL \u4E0B\u8F7D\u5230\u672C\u5730\uFF08Chrome Downloads\uFF09\u3002\u8FD4\u56DE {downloadId, filename}\u3002caution \u7EA7\u3002",
|
|
1459
|
+
input_schema: {
|
|
1460
|
+
type: "object",
|
|
1461
|
+
properties: {
|
|
1462
|
+
url: { type: "string" },
|
|
1463
|
+
filename: { type: "string", description: "\u53EF\u9009\uFF1A\u5EFA\u8BAE\u7684\u6587\u4EF6\u540D\uFF08\u542B\u540E\u7F00\uFF09" }
|
|
1464
|
+
},
|
|
1465
|
+
required: ["url"]
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
// ─── Tier 4 · UID-based interaction + visual + batch ────────
|
|
1469
|
+
{
|
|
1470
|
+
name: "takeSnapshot",
|
|
1471
|
+
description: "[FIRST\xB7UID] \u6293\u53D6\u9875\u9762 accessibility snapshot\uFF1A\u8FD4\u56DE [{uid, role, name, tag, text, bounds}]\u3002\nUID \u5728\u672C\u6B21 snapshot \u5185\u7A33\u5B9A\uFF0C\u540E\u7EED clickByUid / fillByUid \u5F15\u7528\uFF1B\u6BD4 selector \u5065\u58EE\uFF0C\u4E0D\u6015 class \u6539\u540D\u3002\n\u6BCF\u6B21\u5927\u52A8\u4F5C\u524D\u5237\u65B0\u4E00\u6B21\u3002snapshot \u9ED8\u8BA4\u53EA\u8FD4\u56DE\u4EA4\u4E92\u5143\u7D20\uFF08button / link / input / textarea / select / [role] / [data-testid]\uFF09\u3002",
|
|
1472
|
+
input_schema: {
|
|
1473
|
+
type: "object",
|
|
1474
|
+
properties: {
|
|
1475
|
+
includeAll: { type: "boolean", default: false, description: "true=\u5168\u90E8 element\uFF1Bfalse=\u53EA interactive\uFF08\u9ED8\u8BA4\uFF09" },
|
|
1476
|
+
tabId: TAB_ID_FIELD
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
name: "clickByUid",
|
|
1482
|
+
description: "[ACT\xB7UID] \u7528 takeSnapshot \u8FD4\u56DE\u7684 uid \u70B9\u51FB\u5143\u7D20\u3002\u6BD4 selector \u7248\u7A33\u5B9A\u3002",
|
|
1483
|
+
input_schema: {
|
|
1484
|
+
type: "object",
|
|
1485
|
+
properties: {
|
|
1486
|
+
uid: { type: "string" },
|
|
1487
|
+
tabId: TAB_ID_FIELD
|
|
1488
|
+
},
|
|
1489
|
+
required: ["uid"]
|
|
1490
|
+
}
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
name: "fillByUid",
|
|
1494
|
+
description: "[ACT\xB7UID] \u7528 takeSnapshot \u8FD4\u56DE\u7684 uid \u586B\u503C\uFF08input/textarea/contenteditable\uFF09\u3002",
|
|
1495
|
+
input_schema: {
|
|
1496
|
+
type: "object",
|
|
1497
|
+
properties: {
|
|
1498
|
+
uid: { type: "string" },
|
|
1499
|
+
value: { type: "string" },
|
|
1500
|
+
clear: { type: "boolean", default: true },
|
|
1501
|
+
tabId: TAB_ID_FIELD
|
|
1502
|
+
},
|
|
1503
|
+
required: ["uid", "value"]
|
|
1504
|
+
}
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
name: "highlightElement",
|
|
1508
|
+
description: "[VISUAL] \u7ED9\u9875\u9762\u67D0\u5143\u7D20\u52A0\u7EA2\u8272\u865A\u7EBF\u6846\uFF08\u9ED8\u8BA4 3s \u81EA\u52A8\u6D88\u5931\uFF09\uFF0C\u8BA9\u7528\u6237\u770B\u6E05\u4F60\u8BF4\u7684\u662F\u54EA\u4E2A\u3002\u4EC5\u89C6\u89C9\uFF0C\u4E0D\u6539 DOM\u3002\n\u53EF\u7528 selector \u6216 uid \u4EFB\u4E00\u79CD\u3002",
|
|
1509
|
+
input_schema: {
|
|
1510
|
+
type: "object",
|
|
1511
|
+
properties: {
|
|
1512
|
+
selector: { type: "string" },
|
|
1513
|
+
uid: { type: "string", description: "\u6216 takeSnapshot \u8FD4\u56DE\u7684 uid" },
|
|
1514
|
+
ms: { type: "integer", default: 3e3 },
|
|
1515
|
+
tabId: TAB_ID_FIELD
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
name: "highlightText",
|
|
1521
|
+
description: "[VISUAL] \u5728\u9875\u9762\u6587\u672C\u91CC\u9AD8\u4EAE\u67D0\u6BB5\u6587\u5B57\uFF08\u9EC4\u8272\u80CC\u666F\uFF0C3s \u540E\u8FD8\u539F\uFF09\u3002\u4EC5\u627E\u5230\u7B2C\u4E00\u6B21\u51FA\u73B0\u7684\u4F4D\u7F6E\u3002",
|
|
1522
|
+
input_schema: {
|
|
1523
|
+
type: "object",
|
|
1524
|
+
properties: {
|
|
1525
|
+
text: { type: "string" },
|
|
1526
|
+
ms: { type: "integer", default: 3e3 },
|
|
1527
|
+
tabId: TAB_ID_FIELD
|
|
1528
|
+
},
|
|
1529
|
+
required: ["text"]
|
|
1530
|
+
}
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
name: "fillForm",
|
|
1534
|
+
description: "[BATCH\xB7ACT] \u4E00\u6B21\u6027\u586B\u591A\u4E2A\u5B57\u6BB5\u3002\u6BCF\u9879\u5199 selector + value \u6216 uid + value\u3002\u8FD4\u56DE {filled: N, failed: [{at, error}]}\u3002\n\u6BD4\u5FAA\u73AF\u8C03 fillInput \u5FEB\u5F97\u591A\uFF0C\u4E5F\u7701 round-trip\u3002\n\n\u793A\u4F8B\uFF1A\n{ fields: [\n { selector: 'input[name=name]', value: '\u5F20\u4E09' },\n { selector: 'input[name=phone]', value: '13800000000' },\n { uid: 'el_5', value: 'mushroom' }\n] }",
|
|
1535
|
+
input_schema: {
|
|
1536
|
+
type: "object",
|
|
1537
|
+
properties: {
|
|
1538
|
+
fields: {
|
|
1539
|
+
type: "array",
|
|
1540
|
+
items: {
|
|
1541
|
+
type: "object",
|
|
1542
|
+
properties: {
|
|
1543
|
+
selector: { type: "string" },
|
|
1544
|
+
uid: { type: "string" },
|
|
1545
|
+
value: { type: "string" }
|
|
1546
|
+
},
|
|
1547
|
+
required: ["value"]
|
|
1548
|
+
}
|
|
1549
|
+
},
|
|
1550
|
+
tabId: TAB_ID_FIELD
|
|
1551
|
+
},
|
|
1552
|
+
required: ["fields"]
|
|
1553
|
+
}
|
|
1386
1554
|
}
|
|
1387
1555
|
];
|
|
1388
1556
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attson/atwebpilot-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "MCP server for the atwebpilot browser extension — let Claude Code drive your browser.",
|
|
6
6
|
"homepage": "https://github.com/attson/atwebpilot#readme",
|