@xbrowser/cli 1.5.3 → 1.5.4
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.
|
@@ -289,11 +289,28 @@ function saveConfig(config) {
|
|
|
289
289
|
coreSaveConfig(getConfigSource(), config);
|
|
290
290
|
}
|
|
291
291
|
function getConfigValue(key) {
|
|
292
|
-
|
|
292
|
+
const parts = key.split(".");
|
|
293
|
+
let obj = loadConfig();
|
|
294
|
+
for (const part of parts) {
|
|
295
|
+
if (obj && typeof obj === "object") {
|
|
296
|
+
obj = obj[part];
|
|
297
|
+
} else {
|
|
298
|
+
return void 0;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return obj;
|
|
293
302
|
}
|
|
294
303
|
function setConfigValue(key, value) {
|
|
295
304
|
const config = loadConfig();
|
|
296
|
-
|
|
305
|
+
const parts = key.split(".");
|
|
306
|
+
let obj = config;
|
|
307
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
308
|
+
if (!obj[parts[i]] || typeof obj[parts[i]] !== "object") {
|
|
309
|
+
obj[parts[i]] = {};
|
|
310
|
+
}
|
|
311
|
+
obj = obj[parts[i]];
|
|
312
|
+
}
|
|
313
|
+
obj[parts[parts.length - 1]] = value;
|
|
297
314
|
saveConfig(config);
|
|
298
315
|
}
|
|
299
316
|
var DEFAULT_MARKETPLACE_URL = "https://marketplace.xbrowser.dev";
|
package/dist/cli.js
CHANGED
|
@@ -7088,7 +7088,44 @@ async function executeCommand(commandName, params, sessionName = "default", extr
|
|
|
7088
7088
|
if (!command) {
|
|
7089
7089
|
const available = getAllCommands().map((c) => c.name);
|
|
7090
7090
|
const suggestions = available.map((name) => ({ name, dist: levenshtein(commandName, name) })).filter((s) => s.dist <= 3).sort((a, b) => a.dist - b.dist).slice(0, 3).map((s) => s.name);
|
|
7091
|
-
|
|
7091
|
+
let hint = suggestions.length > 0 ? ` Did you mean: ${suggestions.join(" or ")}?` : "";
|
|
7092
|
+
const knownPlugins = [
|
|
7093
|
+
"douyin",
|
|
7094
|
+
"xiaohongshu",
|
|
7095
|
+
"zhihu",
|
|
7096
|
+
"chatgpt",
|
|
7097
|
+
"deepseek",
|
|
7098
|
+
"baidu",
|
|
7099
|
+
"bilibili",
|
|
7100
|
+
"github",
|
|
7101
|
+
"medium",
|
|
7102
|
+
"juejin",
|
|
7103
|
+
"devto",
|
|
7104
|
+
"twitter",
|
|
7105
|
+
"reddit",
|
|
7106
|
+
"steam",
|
|
7107
|
+
"doubao",
|
|
7108
|
+
"qianwen",
|
|
7109
|
+
"yuanbao",
|
|
7110
|
+
"claude",
|
|
7111
|
+
"gemini",
|
|
7112
|
+
"suno",
|
|
7113
|
+
"mureka",
|
|
7114
|
+
"wanx",
|
|
7115
|
+
"taobao",
|
|
7116
|
+
"google",
|
|
7117
|
+
"wordpress",
|
|
7118
|
+
"csdn",
|
|
7119
|
+
"quora",
|
|
7120
|
+
"producthunt",
|
|
7121
|
+
"hashnode",
|
|
7122
|
+
"blogger",
|
|
7123
|
+
"facebook",
|
|
7124
|
+
"instagram"
|
|
7125
|
+
];
|
|
7126
|
+
if (knownPlugins.includes(commandName)) {
|
|
7127
|
+
hint = ` Plugin "${commandName}" may need to be installed. Try: xbrowser plugin install @xbrowser/${commandName}`;
|
|
7128
|
+
}
|
|
7092
7129
|
return errorResult(
|
|
7093
7130
|
`Unknown command: ${commandName}.${hint} Available: ${available.join(", ")}`
|
|
7094
7131
|
);
|
|
@@ -7695,11 +7732,28 @@ function saveConfig(config) {
|
|
|
7695
7732
|
coreSaveConfig(getConfigSource(), config);
|
|
7696
7733
|
}
|
|
7697
7734
|
function getConfigValue(key) {
|
|
7698
|
-
|
|
7735
|
+
const parts = key.split(".");
|
|
7736
|
+
let obj = loadConfig();
|
|
7737
|
+
for (const part of parts) {
|
|
7738
|
+
if (obj && typeof obj === "object") {
|
|
7739
|
+
obj = obj[part];
|
|
7740
|
+
} else {
|
|
7741
|
+
return void 0;
|
|
7742
|
+
}
|
|
7743
|
+
}
|
|
7744
|
+
return obj;
|
|
7699
7745
|
}
|
|
7700
7746
|
function setConfigValue(key, value) {
|
|
7701
7747
|
const config = loadConfig();
|
|
7702
|
-
|
|
7748
|
+
const parts = key.split(".");
|
|
7749
|
+
let obj = config;
|
|
7750
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
7751
|
+
if (!obj[parts[i]] || typeof obj[parts[i]] !== "object") {
|
|
7752
|
+
obj[parts[i]] = {};
|
|
7753
|
+
}
|
|
7754
|
+
obj = obj[parts[i]];
|
|
7755
|
+
}
|
|
7756
|
+
obj[parts[parts.length - 1]] = value;
|
|
7703
7757
|
saveConfig(config);
|
|
7704
7758
|
}
|
|
7705
7759
|
var DEFAULT_MARKETPLACE_URL = "https://marketplace.xbrowser.dev";
|
package/dist/daemon-main.js
CHANGED
|
@@ -6619,7 +6619,44 @@ async function executeCommand(commandName, params, sessionName = "default", extr
|
|
|
6619
6619
|
if (!command) {
|
|
6620
6620
|
const available = getAllCommands().map((c) => c.name);
|
|
6621
6621
|
const suggestions = available.map((name) => ({ name, dist: levenshtein(commandName, name) })).filter((s) => s.dist <= 3).sort((a, b) => a.dist - b.dist).slice(0, 3).map((s) => s.name);
|
|
6622
|
-
|
|
6622
|
+
let hint = suggestions.length > 0 ? ` Did you mean: ${suggestions.join(" or ")}?` : "";
|
|
6623
|
+
const knownPlugins = [
|
|
6624
|
+
"douyin",
|
|
6625
|
+
"xiaohongshu",
|
|
6626
|
+
"zhihu",
|
|
6627
|
+
"chatgpt",
|
|
6628
|
+
"deepseek",
|
|
6629
|
+
"baidu",
|
|
6630
|
+
"bilibili",
|
|
6631
|
+
"github",
|
|
6632
|
+
"medium",
|
|
6633
|
+
"juejin",
|
|
6634
|
+
"devto",
|
|
6635
|
+
"twitter",
|
|
6636
|
+
"reddit",
|
|
6637
|
+
"steam",
|
|
6638
|
+
"doubao",
|
|
6639
|
+
"qianwen",
|
|
6640
|
+
"yuanbao",
|
|
6641
|
+
"claude",
|
|
6642
|
+
"gemini",
|
|
6643
|
+
"suno",
|
|
6644
|
+
"mureka",
|
|
6645
|
+
"wanx",
|
|
6646
|
+
"taobao",
|
|
6647
|
+
"google",
|
|
6648
|
+
"wordpress",
|
|
6649
|
+
"csdn",
|
|
6650
|
+
"quora",
|
|
6651
|
+
"producthunt",
|
|
6652
|
+
"hashnode",
|
|
6653
|
+
"blogger",
|
|
6654
|
+
"facebook",
|
|
6655
|
+
"instagram"
|
|
6656
|
+
];
|
|
6657
|
+
if (knownPlugins.includes(commandName)) {
|
|
6658
|
+
hint = ` Plugin "${commandName}" may need to be installed. Try: xbrowser plugin install @xbrowser/${commandName}`;
|
|
6659
|
+
}
|
|
6623
6660
|
return errorResult(
|
|
6624
6661
|
`Unknown command: ${commandName}.${hint} Available: ${available.join(", ")}`
|
|
6625
6662
|
);
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
loadConfig,
|
|
40
40
|
resolveNpmPackageWithFallback,
|
|
41
41
|
setConfigValue
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-ZJHQPMCY.js";
|
|
43
43
|
import {
|
|
44
44
|
generateBashScript,
|
|
45
45
|
generateJSScript,
|
|
@@ -7408,7 +7408,44 @@ async function executeCommand(commandName, params, sessionName = "default", extr
|
|
|
7408
7408
|
if (!command) {
|
|
7409
7409
|
const available = getAllCommands().map((c) => c.name);
|
|
7410
7410
|
const suggestions = available.map((name) => ({ name, dist: levenshtein(commandName, name) })).filter((s) => s.dist <= 3).sort((a, b) => a.dist - b.dist).slice(0, 3).map((s) => s.name);
|
|
7411
|
-
|
|
7411
|
+
let hint = suggestions.length > 0 ? ` Did you mean: ${suggestions.join(" or ")}?` : "";
|
|
7412
|
+
const knownPlugins = [
|
|
7413
|
+
"douyin",
|
|
7414
|
+
"xiaohongshu",
|
|
7415
|
+
"zhihu",
|
|
7416
|
+
"chatgpt",
|
|
7417
|
+
"deepseek",
|
|
7418
|
+
"baidu",
|
|
7419
|
+
"bilibili",
|
|
7420
|
+
"github",
|
|
7421
|
+
"medium",
|
|
7422
|
+
"juejin",
|
|
7423
|
+
"devto",
|
|
7424
|
+
"twitter",
|
|
7425
|
+
"reddit",
|
|
7426
|
+
"steam",
|
|
7427
|
+
"doubao",
|
|
7428
|
+
"qianwen",
|
|
7429
|
+
"yuanbao",
|
|
7430
|
+
"claude",
|
|
7431
|
+
"gemini",
|
|
7432
|
+
"suno",
|
|
7433
|
+
"mureka",
|
|
7434
|
+
"wanx",
|
|
7435
|
+
"taobao",
|
|
7436
|
+
"google",
|
|
7437
|
+
"wordpress",
|
|
7438
|
+
"csdn",
|
|
7439
|
+
"quora",
|
|
7440
|
+
"producthunt",
|
|
7441
|
+
"hashnode",
|
|
7442
|
+
"blogger",
|
|
7443
|
+
"facebook",
|
|
7444
|
+
"instagram"
|
|
7445
|
+
];
|
|
7446
|
+
if (knownPlugins.includes(commandName)) {
|
|
7447
|
+
hint = ` Plugin "${commandName}" may need to be installed. Try: xbrowser plugin install @xbrowser/${commandName}`;
|
|
7448
|
+
}
|
|
7412
7449
|
return errorResult(
|
|
7413
7450
|
`Unknown command: ${commandName}.${hint} Available: ${available.join(", ")}`
|
|
7414
7451
|
);
|
|
@@ -7917,7 +7954,7 @@ function attachWaitForHuman(ctx, getOrCreateWSServer) {
|
|
|
7917
7954
|
if (!ctx.page) {
|
|
7918
7955
|
throw new Error("waitForHuman requires an active page");
|
|
7919
7956
|
}
|
|
7920
|
-
const { HumanInteractionManager: HumanInteractionManager2 } = await import("./human-interaction-
|
|
7957
|
+
const { HumanInteractionManager: HumanInteractionManager2 } = await import("./human-interaction-2DZK4MW7.js");
|
|
7921
7958
|
const wsServer2 = await getOrCreateWSServer(ctx.browserContext);
|
|
7922
7959
|
const manager = new HumanInteractionManager2(wsServer2, ctx.page);
|
|
7923
7960
|
return manager.waitForHuman(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbrowser/cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
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": {
|