@xbrowser/cli 1.7.6 → 1.7.7
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/cli.js +8 -4
- package/dist/daemon-main.js +1 -0
- package/dist/index.js +8 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5545,6 +5545,7 @@ registerCommandDefinition("actions", ["url"]);
|
|
|
5545
5545
|
registerCommandDefinition("find", ["strategy", "value", "operation"]);
|
|
5546
5546
|
registerCommandDefinition("addinitscript", ["script"]);
|
|
5547
5547
|
registerCommandDefinition("tab", ["subcommand"]);
|
|
5548
|
+
registerCommandDefinition("mouse", ["action", "x", "y"]);
|
|
5548
5549
|
|
|
5549
5550
|
// src/commands/addinitscript.ts
|
|
5550
5551
|
var InitScriptParams = z24.object({
|
|
@@ -7669,7 +7670,7 @@ async function executeChain(input, options) {
|
|
|
7669
7670
|
}
|
|
7670
7671
|
}
|
|
7671
7672
|
function isChainInput(input) {
|
|
7672
|
-
return /\s&&\s|\|\|\s|\s;\s|\s,\s|\s\+\s|\s->\s/.test(input);
|
|
7673
|
+
return /\s&&\s|\|\|\s|\s;\s|;\s|\s,\s|\s\+\s|\s->\s/.test(input);
|
|
7673
7674
|
}
|
|
7674
7675
|
|
|
7675
7676
|
// src/session/session-client.ts
|
|
@@ -12581,7 +12582,9 @@ async function handleEvalMode(argv) {
|
|
|
12581
12582
|
if (evalCommands.length === 0) return;
|
|
12582
12583
|
const chain = evalCommands.join(" ; ");
|
|
12583
12584
|
const cdpEndpoint = extractCdpFromArgv(argv);
|
|
12584
|
-
const
|
|
12585
|
+
const sessionArgIdx = argv.indexOf("--session");
|
|
12586
|
+
const sessionName = sessionArgIdx >= 0 && argv[sessionArgIdx + 1] ? argv[sessionArgIdx + 1] : process.env.XBROWSER_SESSION || "default";
|
|
12587
|
+
const chainResult = await executeChain(chain, { cdpEndpoint, sessionName });
|
|
12585
12588
|
printChainResult(chainResult);
|
|
12586
12589
|
if (!chainResult.success) throw new Error("Command failed");
|
|
12587
12590
|
}
|
|
@@ -12642,7 +12645,8 @@ async function routeCommand(argvIn, stdinCommands) {
|
|
|
12642
12645
|
const possibleCmd = chainArg.substring(0, spaceIdx);
|
|
12643
12646
|
if (/^[a-zA-Z][\w-]*$/.test(possibleCmd)) {
|
|
12644
12647
|
const remainder = chainArg.substring(spaceIdx + 1);
|
|
12645
|
-
|
|
12648
|
+
let remainderParts = remainder.split(/\s+/).filter(Boolean);
|
|
12649
|
+
remainderParts = remainderParts.flatMap((part) => part.split(";").filter(Boolean));
|
|
12646
12650
|
argv = [...argv.slice(0, chainArgIdx), possibleCmd, ...remainderParts, ...argv.slice(chainArgIdx + 1)];
|
|
12647
12651
|
}
|
|
12648
12652
|
}
|
|
@@ -12664,7 +12668,7 @@ async function routeCommand(argvIn, stdinCommands) {
|
|
|
12664
12668
|
return;
|
|
12665
12669
|
}
|
|
12666
12670
|
if (positional.length === 0) {
|
|
12667
|
-
const chainHints = [options.json, options.yaml, options.session, options.cdp].filter(Boolean).find((v) => typeof v === "string" && v
|
|
12671
|
+
const chainHints = [options.json, options.yaml, options.session, options.cdp].filter(Boolean).find((v) => typeof v === "string" && /^[a-zA-Z]/.test(v));
|
|
12668
12672
|
if (chainHints) {
|
|
12669
12673
|
positional.push(chainHints);
|
|
12670
12674
|
} else {
|
package/dist/daemon-main.js
CHANGED
|
@@ -5512,6 +5512,7 @@ registerCommandDefinition("actions", ["url"]);
|
|
|
5512
5512
|
registerCommandDefinition("find", ["strategy", "value", "operation"]);
|
|
5513
5513
|
registerCommandDefinition("addinitscript", ["script"]);
|
|
5514
5514
|
registerCommandDefinition("tab", ["subcommand"]);
|
|
5515
|
+
registerCommandDefinition("mouse", ["action", "x", "y"]);
|
|
5515
5516
|
|
|
5516
5517
|
// src/commands/addinitscript.ts
|
|
5517
5518
|
var InitScriptParams = z24.object({
|
package/dist/index.js
CHANGED
|
@@ -5862,6 +5862,7 @@ registerCommandDefinition("actions", ["url"]);
|
|
|
5862
5862
|
registerCommandDefinition("find", ["strategy", "value", "operation"]);
|
|
5863
5863
|
registerCommandDefinition("addinitscript", ["script"]);
|
|
5864
5864
|
registerCommandDefinition("tab", ["subcommand"]);
|
|
5865
|
+
registerCommandDefinition("mouse", ["action", "x", "y"]);
|
|
5865
5866
|
|
|
5866
5867
|
// src/commands/addinitscript.ts
|
|
5867
5868
|
var InitScriptParams = z24.object({
|
|
@@ -7989,7 +7990,7 @@ async function executeChain(input, options) {
|
|
|
7989
7990
|
}
|
|
7990
7991
|
}
|
|
7991
7992
|
function isChainInput(input) {
|
|
7992
|
-
return /\s&&\s|\|\|\s|\s;\s|\s,\s|\s\+\s|\s->\s/.test(input);
|
|
7993
|
+
return /\s&&\s|\|\|\s|\s;\s|;\s|\s,\s|\s\+\s|\s->\s/.test(input);
|
|
7993
7994
|
}
|
|
7994
7995
|
|
|
7995
7996
|
// src/context.ts
|
|
@@ -12904,7 +12905,9 @@ async function handleEvalMode(argv) {
|
|
|
12904
12905
|
if (evalCommands.length === 0) return;
|
|
12905
12906
|
const chain = evalCommands.join(" ; ");
|
|
12906
12907
|
const cdpEndpoint = extractCdpFromArgv(argv);
|
|
12907
|
-
const
|
|
12908
|
+
const sessionArgIdx = argv.indexOf("--session");
|
|
12909
|
+
const sessionName = sessionArgIdx >= 0 && argv[sessionArgIdx + 1] ? argv[sessionArgIdx + 1] : process.env.XBROWSER_SESSION || "default";
|
|
12910
|
+
const chainResult = await executeChain(chain, { cdpEndpoint, sessionName });
|
|
12908
12911
|
printChainResult(chainResult);
|
|
12909
12912
|
if (!chainResult.success) throw new Error("Command failed");
|
|
12910
12913
|
}
|
|
@@ -12965,7 +12968,8 @@ async function routeCommand(argvIn, stdinCommands) {
|
|
|
12965
12968
|
const possibleCmd = chainArg.substring(0, spaceIdx);
|
|
12966
12969
|
if (/^[a-zA-Z][\w-]*$/.test(possibleCmd)) {
|
|
12967
12970
|
const remainder = chainArg.substring(spaceIdx + 1);
|
|
12968
|
-
|
|
12971
|
+
let remainderParts = remainder.split(/\s+/).filter(Boolean);
|
|
12972
|
+
remainderParts = remainderParts.flatMap((part) => part.split(";").filter(Boolean));
|
|
12969
12973
|
argv = [...argv.slice(0, chainArgIdx), possibleCmd, ...remainderParts, ...argv.slice(chainArgIdx + 1)];
|
|
12970
12974
|
}
|
|
12971
12975
|
}
|
|
@@ -12987,7 +12991,7 @@ async function routeCommand(argvIn, stdinCommands) {
|
|
|
12987
12991
|
return;
|
|
12988
12992
|
}
|
|
12989
12993
|
if (positional.length === 0) {
|
|
12990
|
-
const chainHints = [options.json, options.yaml, options.session, options.cdp].filter(Boolean).find((v) => typeof v === "string" && v
|
|
12994
|
+
const chainHints = [options.json, options.yaml, options.session, options.cdp].filter(Boolean).find((v) => typeof v === "string" && /^[a-zA-Z]/.test(v));
|
|
12991
12995
|
if (chainHints) {
|
|
12992
12996
|
positional.push(chainHints);
|
|
12993
12997
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbrowser/cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"description": "Browser automation CLI for web scraping, headless browsing, SEO analysis, and AI agent workflows. A command-line alternative to Playwright, Puppeteer, and Selenium.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|