auto-chrome-mcp-shared 1.10.1 → 1.11.0
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 +48 -9
- package/dist/index.mjs +48 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -75,6 +75,8 @@ var NativeMessageType = /* @__PURE__ */ ((NativeMessageType2) => {
|
|
|
75
75
|
var TOOL_NAMES = {
|
|
76
76
|
BROWSER: {
|
|
77
77
|
GET_WINDOWS_AND_TABS: "get_windows_and_tabs",
|
|
78
|
+
// Hidden from TOOL_SCHEMAS (schema-size reduction, v1.10.1) — still dispatch-registered
|
|
79
|
+
// and fully implemented (vector-search.ts). See docs/TOOLS.md "Hidden Tools".
|
|
78
80
|
SEARCH_TABS_CONTENT: "search_tabs_content",
|
|
79
81
|
NAVIGATE: "chrome_navigate",
|
|
80
82
|
SCREENSHOT: "chrome_screenshot",
|
|
@@ -84,6 +86,9 @@ var TOOL_NAMES = {
|
|
|
84
86
|
CLICK: "chrome_click_element",
|
|
85
87
|
FILL: "chrome_fill_or_select",
|
|
86
88
|
REQUEST_ELEMENT_SELECTION: "chrome_request_element_selection",
|
|
89
|
+
// Deprecated, hidden from TOOL_SCHEMAS — chrome_read_page replaces it as the primary
|
|
90
|
+
// discovery tool (and falls back to this logic internally when needed). Kept only for
|
|
91
|
+
// backward compatibility. See docs/TOOLS.md "Hidden Tools".
|
|
87
92
|
GET_INTERACTIVE_ELEMENTS: "chrome_get_interactive_elements",
|
|
88
93
|
NETWORK_CAPTURE: "chrome_network_capture",
|
|
89
94
|
// Legacy tool names (kept for internal use, not exposed in TOOL_SCHEMAS)
|
|
@@ -97,6 +102,9 @@ var TOOL_NAMES = {
|
|
|
97
102
|
BOOKMARK_SEARCH: "chrome_bookmark_search",
|
|
98
103
|
BOOKMARK_ADD: "chrome_bookmark_add",
|
|
99
104
|
BOOKMARK_DELETE: "chrome_bookmark_delete",
|
|
105
|
+
// Hidden from TOOL_SCHEMAS (schema-size reduction, v1.10.1) — still dispatch-registered
|
|
106
|
+
// and fully implemented (inject-script.ts); also used internally by the record-replay
|
|
107
|
+
// engine. See docs/TOOLS.md "Hidden Tools".
|
|
100
108
|
INJECT_SCRIPT: "chrome_inject_script",
|
|
101
109
|
SEND_COMMAND_TO_INJECT_SCRIPT: "chrome_send_command_to_inject_script",
|
|
102
110
|
JAVASCRIPT: "chrome_javascript",
|
|
@@ -107,6 +115,8 @@ var TOOL_NAMES = {
|
|
|
107
115
|
HANDLE_DIALOG: "chrome_handle_dialog",
|
|
108
116
|
HANDLE_DOWNLOAD: "chrome_handle_download",
|
|
109
117
|
REQUEST_USER_CONSENT: "chrome_request_user_consent",
|
|
118
|
+
// Hidden from TOOL_SCHEMAS (schema-size reduction, v1.10.1) — still dispatch-registered
|
|
119
|
+
// and fully implemented (userscript.ts). See docs/TOOLS.md "Hidden Tools".
|
|
110
120
|
USERSCRIPT: "chrome_userscript",
|
|
111
121
|
PERFORMANCE_START_TRACE: "performance_start_trace",
|
|
112
122
|
PERFORMANCE_STOP_TRACE: "performance_stop_trace",
|
|
@@ -139,6 +149,14 @@ var P_FRAME_ID = "Target frame id (iframe).";
|
|
|
139
149
|
var P_SELECTOR_TYPE = 'Selector type (default "css").';
|
|
140
150
|
var P_WAIT_FOR_ELEMENT_MS = "Ms to wait for the element to appear/become visible before failing (default 2000; 0 = fail now).";
|
|
141
151
|
var P_BACKGROUND = "Do not activate the tab or focus the window (default false).";
|
|
152
|
+
var P_STEP_AS = "Name this step result so later steps can read it.";
|
|
153
|
+
var P_TEMPLATES = 'Enable {{name.path}} substitution in step args, e.g. ref: "{{hit.matches[0].ref}}". Auto on when any step has "as".';
|
|
154
|
+
var P_RETURN = 'Names to include in the response "results" object.';
|
|
155
|
+
var P_WHEN = 'Run only if this condition holds, e.g. { path: "hit.matches", op: "notEmpty" }. Otherwise the step is skipped.';
|
|
156
|
+
var P_STOP_IF = "Stop the whole run after this step when the condition holds.";
|
|
157
|
+
var P_REPEAT = 'Repeat group: { max: 1-20, until?: condition, delayMs?: 0-5000 } together with a "steps" array.';
|
|
158
|
+
var P_GROUP_STEPS = "Steps of a repeat group (no repeat inside a repeat).";
|
|
159
|
+
var P_PARAMS = "save: declare { user: { required: true }, pw: { secret: true } }. run: values for {{params.user}}.";
|
|
142
160
|
var tabIdProp = { type: "number", description: P_TAB_ID };
|
|
143
161
|
var windowIdProp = { type: "number", description: P_WINDOW_ID };
|
|
144
162
|
var frameIdProp = { type: "number", description: P_FRAME_ID };
|
|
@@ -158,19 +176,29 @@ var TOOL_SCHEMAS = [
|
|
|
158
176
|
properties: {
|
|
159
177
|
steps: {
|
|
160
178
|
type: "array",
|
|
161
|
-
description: "Steps in order (max 20). Each: { tool: string, args?: object }",
|
|
179
|
+
description: "Steps in order (max 20). Each: { tool: string, args?: object }, or a repeat group { repeat: {...}, steps: [...] }",
|
|
162
180
|
items: {
|
|
163
181
|
type: "object",
|
|
164
182
|
properties: {
|
|
165
183
|
tool: { type: "string", description: "Tool name, e.g. chrome_click_element" },
|
|
166
|
-
args: { type: "object", description: "Arguments for the tool" }
|
|
167
|
-
|
|
168
|
-
|
|
184
|
+
args: { type: "object", description: "Arguments for the tool" },
|
|
185
|
+
as: { type: "string", description: P_STEP_AS },
|
|
186
|
+
when: { type: "object", description: P_WHEN },
|
|
187
|
+
stopIf: { type: "object", description: P_STOP_IF },
|
|
188
|
+
repeat: { type: "object", description: P_REPEAT },
|
|
189
|
+
steps: { type: "array", description: P_GROUP_STEPS }
|
|
190
|
+
}
|
|
169
191
|
}
|
|
170
192
|
},
|
|
171
193
|
continueOnError: {
|
|
172
194
|
type: "boolean",
|
|
173
195
|
description: "Keep running after a step fails (default false)"
|
|
196
|
+
},
|
|
197
|
+
templates: { type: "boolean", description: P_TEMPLATES },
|
|
198
|
+
return: {
|
|
199
|
+
type: "array",
|
|
200
|
+
items: { type: "string" },
|
|
201
|
+
description: P_RETURN
|
|
174
202
|
}
|
|
175
203
|
},
|
|
176
204
|
required: ["steps"]
|
|
@@ -210,21 +238,32 @@ var TOOL_SCHEMAS = [
|
|
|
210
238
|
name: { type: "string", description: "Shortcut name (save/run/delete)" },
|
|
211
239
|
steps: {
|
|
212
240
|
type: "array",
|
|
213
|
-
description: 'action="save": chrome_batch steps, max 20. Each: { tool: string, args?: object }',
|
|
241
|
+
description: 'action="save": chrome_batch steps, max 20. Each: { tool: string, args?: object }, or a repeat group',
|
|
214
242
|
items: {
|
|
215
243
|
type: "object",
|
|
216
244
|
properties: {
|
|
217
245
|
tool: { type: "string" },
|
|
218
|
-
args: { type: "object" }
|
|
219
|
-
|
|
220
|
-
|
|
246
|
+
args: { type: "object" },
|
|
247
|
+
as: { type: "string", description: P_STEP_AS },
|
|
248
|
+
when: { type: "object", description: P_WHEN },
|
|
249
|
+
stopIf: { type: "object", description: P_STOP_IF },
|
|
250
|
+
repeat: { type: "object", description: P_REPEAT },
|
|
251
|
+
steps: { type: "array", description: P_GROUP_STEPS }
|
|
252
|
+
}
|
|
221
253
|
}
|
|
222
254
|
},
|
|
223
255
|
description: { type: "string", description: 'action="save": what this shortcut does' },
|
|
224
256
|
continueOnError: {
|
|
225
257
|
type: "boolean",
|
|
226
258
|
description: 'action="run": keep running after a failure (default false)'
|
|
227
|
-
}
|
|
259
|
+
},
|
|
260
|
+
templates: { type: "boolean", description: P_TEMPLATES },
|
|
261
|
+
return: {
|
|
262
|
+
type: "array",
|
|
263
|
+
items: { type: "string" },
|
|
264
|
+
description: P_RETURN
|
|
265
|
+
},
|
|
266
|
+
params: { type: "object", description: P_PARAMS }
|
|
228
267
|
},
|
|
229
268
|
required: ["action"]
|
|
230
269
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -30,6 +30,8 @@ var NativeMessageType = /* @__PURE__ */ ((NativeMessageType2) => {
|
|
|
30
30
|
var TOOL_NAMES = {
|
|
31
31
|
BROWSER: {
|
|
32
32
|
GET_WINDOWS_AND_TABS: "get_windows_and_tabs",
|
|
33
|
+
// Hidden from TOOL_SCHEMAS (schema-size reduction, v1.10.1) — still dispatch-registered
|
|
34
|
+
// and fully implemented (vector-search.ts). See docs/TOOLS.md "Hidden Tools".
|
|
33
35
|
SEARCH_TABS_CONTENT: "search_tabs_content",
|
|
34
36
|
NAVIGATE: "chrome_navigate",
|
|
35
37
|
SCREENSHOT: "chrome_screenshot",
|
|
@@ -39,6 +41,9 @@ var TOOL_NAMES = {
|
|
|
39
41
|
CLICK: "chrome_click_element",
|
|
40
42
|
FILL: "chrome_fill_or_select",
|
|
41
43
|
REQUEST_ELEMENT_SELECTION: "chrome_request_element_selection",
|
|
44
|
+
// Deprecated, hidden from TOOL_SCHEMAS — chrome_read_page replaces it as the primary
|
|
45
|
+
// discovery tool (and falls back to this logic internally when needed). Kept only for
|
|
46
|
+
// backward compatibility. See docs/TOOLS.md "Hidden Tools".
|
|
42
47
|
GET_INTERACTIVE_ELEMENTS: "chrome_get_interactive_elements",
|
|
43
48
|
NETWORK_CAPTURE: "chrome_network_capture",
|
|
44
49
|
// Legacy tool names (kept for internal use, not exposed in TOOL_SCHEMAS)
|
|
@@ -52,6 +57,9 @@ var TOOL_NAMES = {
|
|
|
52
57
|
BOOKMARK_SEARCH: "chrome_bookmark_search",
|
|
53
58
|
BOOKMARK_ADD: "chrome_bookmark_add",
|
|
54
59
|
BOOKMARK_DELETE: "chrome_bookmark_delete",
|
|
60
|
+
// Hidden from TOOL_SCHEMAS (schema-size reduction, v1.10.1) — still dispatch-registered
|
|
61
|
+
// and fully implemented (inject-script.ts); also used internally by the record-replay
|
|
62
|
+
// engine. See docs/TOOLS.md "Hidden Tools".
|
|
55
63
|
INJECT_SCRIPT: "chrome_inject_script",
|
|
56
64
|
SEND_COMMAND_TO_INJECT_SCRIPT: "chrome_send_command_to_inject_script",
|
|
57
65
|
JAVASCRIPT: "chrome_javascript",
|
|
@@ -62,6 +70,8 @@ var TOOL_NAMES = {
|
|
|
62
70
|
HANDLE_DIALOG: "chrome_handle_dialog",
|
|
63
71
|
HANDLE_DOWNLOAD: "chrome_handle_download",
|
|
64
72
|
REQUEST_USER_CONSENT: "chrome_request_user_consent",
|
|
73
|
+
// Hidden from TOOL_SCHEMAS (schema-size reduction, v1.10.1) — still dispatch-registered
|
|
74
|
+
// and fully implemented (userscript.ts). See docs/TOOLS.md "Hidden Tools".
|
|
65
75
|
USERSCRIPT: "chrome_userscript",
|
|
66
76
|
PERFORMANCE_START_TRACE: "performance_start_trace",
|
|
67
77
|
PERFORMANCE_STOP_TRACE: "performance_stop_trace",
|
|
@@ -94,6 +104,14 @@ var P_FRAME_ID = "Target frame id (iframe).";
|
|
|
94
104
|
var P_SELECTOR_TYPE = 'Selector type (default "css").';
|
|
95
105
|
var P_WAIT_FOR_ELEMENT_MS = "Ms to wait for the element to appear/become visible before failing (default 2000; 0 = fail now).";
|
|
96
106
|
var P_BACKGROUND = "Do not activate the tab or focus the window (default false).";
|
|
107
|
+
var P_STEP_AS = "Name this step result so later steps can read it.";
|
|
108
|
+
var P_TEMPLATES = 'Enable {{name.path}} substitution in step args, e.g. ref: "{{hit.matches[0].ref}}". Auto on when any step has "as".';
|
|
109
|
+
var P_RETURN = 'Names to include in the response "results" object.';
|
|
110
|
+
var P_WHEN = 'Run only if this condition holds, e.g. { path: "hit.matches", op: "notEmpty" }. Otherwise the step is skipped.';
|
|
111
|
+
var P_STOP_IF = "Stop the whole run after this step when the condition holds.";
|
|
112
|
+
var P_REPEAT = 'Repeat group: { max: 1-20, until?: condition, delayMs?: 0-5000 } together with a "steps" array.';
|
|
113
|
+
var P_GROUP_STEPS = "Steps of a repeat group (no repeat inside a repeat).";
|
|
114
|
+
var P_PARAMS = "save: declare { user: { required: true }, pw: { secret: true } }. run: values for {{params.user}}.";
|
|
97
115
|
var tabIdProp = { type: "number", description: P_TAB_ID };
|
|
98
116
|
var windowIdProp = { type: "number", description: P_WINDOW_ID };
|
|
99
117
|
var frameIdProp = { type: "number", description: P_FRAME_ID };
|
|
@@ -113,19 +131,29 @@ var TOOL_SCHEMAS = [
|
|
|
113
131
|
properties: {
|
|
114
132
|
steps: {
|
|
115
133
|
type: "array",
|
|
116
|
-
description: "Steps in order (max 20). Each: { tool: string, args?: object }",
|
|
134
|
+
description: "Steps in order (max 20). Each: { tool: string, args?: object }, or a repeat group { repeat: {...}, steps: [...] }",
|
|
117
135
|
items: {
|
|
118
136
|
type: "object",
|
|
119
137
|
properties: {
|
|
120
138
|
tool: { type: "string", description: "Tool name, e.g. chrome_click_element" },
|
|
121
|
-
args: { type: "object", description: "Arguments for the tool" }
|
|
122
|
-
|
|
123
|
-
|
|
139
|
+
args: { type: "object", description: "Arguments for the tool" },
|
|
140
|
+
as: { type: "string", description: P_STEP_AS },
|
|
141
|
+
when: { type: "object", description: P_WHEN },
|
|
142
|
+
stopIf: { type: "object", description: P_STOP_IF },
|
|
143
|
+
repeat: { type: "object", description: P_REPEAT },
|
|
144
|
+
steps: { type: "array", description: P_GROUP_STEPS }
|
|
145
|
+
}
|
|
124
146
|
}
|
|
125
147
|
},
|
|
126
148
|
continueOnError: {
|
|
127
149
|
type: "boolean",
|
|
128
150
|
description: "Keep running after a step fails (default false)"
|
|
151
|
+
},
|
|
152
|
+
templates: { type: "boolean", description: P_TEMPLATES },
|
|
153
|
+
return: {
|
|
154
|
+
type: "array",
|
|
155
|
+
items: { type: "string" },
|
|
156
|
+
description: P_RETURN
|
|
129
157
|
}
|
|
130
158
|
},
|
|
131
159
|
required: ["steps"]
|
|
@@ -165,21 +193,32 @@ var TOOL_SCHEMAS = [
|
|
|
165
193
|
name: { type: "string", description: "Shortcut name (save/run/delete)" },
|
|
166
194
|
steps: {
|
|
167
195
|
type: "array",
|
|
168
|
-
description: 'action="save": chrome_batch steps, max 20. Each: { tool: string, args?: object }',
|
|
196
|
+
description: 'action="save": chrome_batch steps, max 20. Each: { tool: string, args?: object }, or a repeat group',
|
|
169
197
|
items: {
|
|
170
198
|
type: "object",
|
|
171
199
|
properties: {
|
|
172
200
|
tool: { type: "string" },
|
|
173
|
-
args: { type: "object" }
|
|
174
|
-
|
|
175
|
-
|
|
201
|
+
args: { type: "object" },
|
|
202
|
+
as: { type: "string", description: P_STEP_AS },
|
|
203
|
+
when: { type: "object", description: P_WHEN },
|
|
204
|
+
stopIf: { type: "object", description: P_STOP_IF },
|
|
205
|
+
repeat: { type: "object", description: P_REPEAT },
|
|
206
|
+
steps: { type: "array", description: P_GROUP_STEPS }
|
|
207
|
+
}
|
|
176
208
|
}
|
|
177
209
|
},
|
|
178
210
|
description: { type: "string", description: 'action="save": what this shortcut does' },
|
|
179
211
|
continueOnError: {
|
|
180
212
|
type: "boolean",
|
|
181
213
|
description: 'action="run": keep running after a failure (default false)'
|
|
182
|
-
}
|
|
214
|
+
},
|
|
215
|
+
templates: { type: "boolean", description: P_TEMPLATES },
|
|
216
|
+
return: {
|
|
217
|
+
type: "array",
|
|
218
|
+
items: { type: "string" },
|
|
219
|
+
description: P_RETURN
|
|
220
|
+
},
|
|
221
|
+
params: { type: "object", description: P_PARAMS }
|
|
183
222
|
},
|
|
184
223
|
required: ["action"]
|
|
185
224
|
}
|