cbrowser 19.1.6 → 19.1.8
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/README.md +4 -0
- package/dist/analysis/accessibility-empathy.d.ts.map +1 -1
- package/dist/analysis/accessibility-empathy.js +54 -2
- package/dist/analysis/accessibility-empathy.js.map +1 -1
- package/dist/analysis/natural-language.d.ts.map +1 -1
- package/dist/analysis/natural-language.js +3 -1
- package/dist/analysis/natural-language.js.map +1 -1
- package/dist/browser.d.ts +83 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +738 -12
- package/dist/browser.js.map +1 -1
- package/dist/cli.js +27 -5
- package/dist/cli.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +12 -3
- package/dist/daemon.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +5 -0
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp-tools/base/advanced-interaction-tools.d.ts.map +1 -1
- package/dist/mcp-tools/base/advanced-interaction-tools.js +29 -5
- package/dist/mcp-tools/base/advanced-interaction-tools.js.map +1 -1
- package/dist/mcp-tools/base/interaction-tools.d.ts.map +1 -1
- package/dist/mcp-tools/base/interaction-tools.js +8 -1
- package/dist/mcp-tools/base/interaction-tools.js.map +1 -1
- package/dist/testing/nl-test-suite.d.ts.map +1 -1
- package/dist/testing/nl-test-suite.js +4 -0
- package/dist/testing/nl-test-suite.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -997,7 +997,7 @@ const COMMAND_FLAGS = {
|
|
|
997
997
|
uninstall: ["yes", "keep-config"],
|
|
998
998
|
evaluate: ["file", "arg", "json", "raw", "wait-for", "timeout", "expect-truthy"],
|
|
999
999
|
eval: ["file", "arg", "json", "raw", "wait-for", "timeout", "expect-truthy"],
|
|
1000
|
-
keyboard: ["delay", "selector", "hold", "repeat", "text"],
|
|
1000
|
+
keyboard: ["delay", "selector", "hold", "repeat", "text", "force"],
|
|
1001
1001
|
"test-suite": [
|
|
1002
1002
|
"capture", "capture-fps", "capture-format", "capture-out",
|
|
1003
1003
|
"api-key", "auto-apply", "comprehensive", "concurrency", "continue-on-failure",
|
|
@@ -2036,7 +2036,7 @@ function parseKeyboardToken(token, literal = false) {
|
|
|
2036
2036
|
}
|
|
2037
2037
|
/** Flags `keyboard` understands. */
|
|
2038
2038
|
const KEYBOARD_FLAGS = new Set([
|
|
2039
|
-
"delay", "selector", "hold", "repeat", "text",
|
|
2039
|
+
"delay", "selector", "hold", "repeat", "text", "force",
|
|
2040
2040
|
"url", "browser", "device", "headless", "persistent", "restore",
|
|
2041
2041
|
"locale", "timezone", "geo", "verbose",
|
|
2042
2042
|
]);
|
|
@@ -2099,6 +2099,12 @@ async function runKeyboard(browser, args, options) {
|
|
|
2099
2099
|
try {
|
|
2100
2100
|
for (let pass = 0; pass < repeat; pass++) {
|
|
2101
2101
|
for (const step of steps) {
|
|
2102
|
+
const refusal = await browser.keystrokeRedZone(step.kind === "text" ? { text: step.text } : { key: step.key }, options.force === true);
|
|
2103
|
+
if (refusal) {
|
|
2104
|
+
console.error(`✗ ${refusal}`);
|
|
2105
|
+
process.exitCode = 1;
|
|
2106
|
+
return;
|
|
2107
|
+
}
|
|
2102
2108
|
if (step.kind === "text") {
|
|
2103
2109
|
await page.keyboard.type(step.text, { delay: Math.min(delay, 50) });
|
|
2104
2110
|
}
|
|
@@ -2879,7 +2885,7 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
|
|
|
2879
2885
|
daemonArgs = { url: args[0] || options.url };
|
|
2880
2886
|
break;
|
|
2881
2887
|
case "click":
|
|
2882
|
-
daemonArgs = { selector: args[0] };
|
|
2888
|
+
daemonArgs = { selector: args[0], force: options.force === true };
|
|
2883
2889
|
break;
|
|
2884
2890
|
case "hover":
|
|
2885
2891
|
daemonArgs = { selector: args[0] };
|
|
@@ -2913,14 +2919,15 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
|
|
|
2913
2919
|
delay: options.delay !== undefined ? Number(options.delay) : 50,
|
|
2914
2920
|
repeat: options.repeat !== undefined ? Number(options.repeat) : 1,
|
|
2915
2921
|
selector: typeof options.selector === "string" ? options.selector : undefined,
|
|
2922
|
+
force: options.force === true,
|
|
2916
2923
|
};
|
|
2917
2924
|
break;
|
|
2918
2925
|
}
|
|
2919
2926
|
case "press":
|
|
2920
|
-
daemonArgs = { key: args[0] };
|
|
2927
|
+
daemonArgs = { key: args[0], force: options.force === true };
|
|
2921
2928
|
break;
|
|
2922
2929
|
case "type":
|
|
2923
|
-
daemonArgs = { text: args[0], delay: options.delay !== undefined ? Number(options.delay) : 50 };
|
|
2930
|
+
daemonArgs = { text: args[0], delay: options.delay !== undefined ? Number(options.delay) : 50, force: options.force === true };
|
|
2924
2931
|
break;
|
|
2925
2932
|
case "eval":
|
|
2926
2933
|
case "evaluate": {
|
|
@@ -3129,6 +3136,11 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
|
|
|
3129
3136
|
await browser.navigate(options.url);
|
|
3130
3137
|
const page = await browser.getPage();
|
|
3131
3138
|
const delay = typeof options.delay === "number" ? options.delay : 50;
|
|
3139
|
+
const refusal = await browser.keystrokeRedZone({ text }, options.force === true);
|
|
3140
|
+
if (refusal) {
|
|
3141
|
+
console.error(`✗ ${refusal}`);
|
|
3142
|
+
process.exit(1);
|
|
3143
|
+
}
|
|
3132
3144
|
await page.keyboard.type(text, { delay });
|
|
3133
3145
|
console.log(`✓ Typed ${text.length} characters`);
|
|
3134
3146
|
break;
|
|
@@ -3142,6 +3154,11 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
|
|
|
3142
3154
|
if (options.url)
|
|
3143
3155
|
await browser.navigate(options.url);
|
|
3144
3156
|
const page = await browser.getPage();
|
|
3157
|
+
const refusal = await browser.keystrokeRedZone({ key }, options.force === true);
|
|
3158
|
+
if (refusal) {
|
|
3159
|
+
console.error(`✗ ${refusal}`);
|
|
3160
|
+
process.exit(1);
|
|
3161
|
+
}
|
|
3145
3162
|
await page.keyboard.press(key);
|
|
3146
3163
|
console.log(`✓ Pressed ${key}`);
|
|
3147
3164
|
break;
|
|
@@ -3156,6 +3173,11 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
|
|
|
3156
3173
|
if (options.url)
|
|
3157
3174
|
await browser.navigate(options.url);
|
|
3158
3175
|
const page = await browser.getPage();
|
|
3176
|
+
const refusal = await browser.dragRedZone(source, target, options.force === true);
|
|
3177
|
+
if (refusal) {
|
|
3178
|
+
console.error(`✗ ${refusal}`);
|
|
3179
|
+
process.exit(1);
|
|
3180
|
+
}
|
|
3159
3181
|
await page.dragAndDrop(source, target);
|
|
3160
3182
|
console.log(`✓ Dragged ${source} → ${target}`);
|
|
3161
3183
|
break;
|