@mearl/client 3.0.7 → 3.0.9
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/check.js +4 -2
- package/dist/cli.js +17 -0
- package/dist/guides/related-skills.md +2 -2
- package/package.json +6 -6
package/dist/check.js
CHANGED
|
@@ -4,7 +4,7 @@ const UPDATE_SOURCES = {
|
|
|
4
4
|
client: 'https://registry.npmjs.org/@mearl%2Fclient/latest',
|
|
5
5
|
'native-host': 'https://registry.npmjs.org/@mearl%2Fnative-host/latest',
|
|
6
6
|
'cloud-connector': 'https://registry.npmjs.org/@mearl%2Fcloud-connector/latest',
|
|
7
|
-
extension: 'https://github.
|
|
7
|
+
extension: 'https://mearlhq.github.io/mearl/config.json',
|
|
8
8
|
};
|
|
9
9
|
export function parseReleaseVersion(value) {
|
|
10
10
|
if (typeof value !== 'string')
|
|
@@ -30,7 +30,9 @@ export function isNewerRelease(latest, installed) {
|
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
async function fetchLatestVersion(component) {
|
|
33
|
-
const source = component === 'extension'
|
|
33
|
+
const source = component === 'extension'
|
|
34
|
+
? process.env.MEARL_EXTENSION_CONFIG_URL || UPDATE_SOURCES.extension
|
|
35
|
+
: UPDATE_SOURCES[component];
|
|
34
36
|
const response = await fetch(source, {
|
|
35
37
|
signal: AbortSignal.timeout(1500),
|
|
36
38
|
});
|
package/dist/cli.js
CHANGED
|
@@ -317,6 +317,20 @@ function printAdvancedCommandHelp(commandName, action) {
|
|
|
317
317
|
'结果包含 count 与 connectors;每项包含 ID、名称、可选版本、连接时间和最后心跳。',
|
|
318
318
|
].join('\n'));
|
|
319
319
|
}
|
|
320
|
+
function printInternalCommandHelp(commandName, action) {
|
|
321
|
+
console.error([
|
|
322
|
+
action,
|
|
323
|
+
action === '__extension_reload'
|
|
324
|
+
? ' 重载目标浏览器中的 Mearl 扩展。'
|
|
325
|
+
: ' 内部动作透传入口;是否支持及参数要求由目标宿主决定。',
|
|
326
|
+
'',
|
|
327
|
+
'用法:',
|
|
328
|
+
` ${commandName} ${action} [--payload '<JSON>'] [--browser <id|名称>] [--local] [--timeout <seconds>]`,
|
|
329
|
+
'',
|
|
330
|
+
'--local 只使用本机连接;多浏览器时用 --browser 指定目标。',
|
|
331
|
+
'此帮助不会连接浏览器或执行动作。内部动作不属于稳定的公共 API。',
|
|
332
|
+
].join('\n'));
|
|
333
|
+
}
|
|
320
334
|
function printUnknownCommand(commandName, args) {
|
|
321
335
|
const input = commandInput(args) || args[0] || '';
|
|
322
336
|
const suggestions = findCommandSuggestions(args, SUGGESTABLE_COMMANDS);
|
|
@@ -628,6 +642,9 @@ export async function runMearlCli(args, options = {}) {
|
|
|
628
642
|
else if (ADVANCED_BUILTIN_COMMANDS.has(args[0])) {
|
|
629
643
|
printAdvancedCommandHelp(commandName, args[0]);
|
|
630
644
|
}
|
|
645
|
+
else if (args[0]?.startsWith('__')) {
|
|
646
|
+
printInternalCommandHelp(commandName, args[0]);
|
|
647
|
+
}
|
|
631
648
|
else if (args[0]?.startsWith('-')) {
|
|
632
649
|
printUsage(commandName, clientVersion);
|
|
633
650
|
console.error(formatCapabilityHelp(await readHelpCapabilities(args)));
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
任务要运行小程序工程或已编译的微信产物时,先用 `mearl --help` 检查已注册插件中是否有 `wxa`。缺失时,从已包含此 Skill 且当前可访问的官方来源补装:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
{{setup}} plugin install https://github.com/mearlhq/wechat
|
|
31
|
+
{{setup}} plugin install https://github.com/mearlhq/profile-wechat --github --skill wechat-miniprogram --yes
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
官方来源暂不可用且本机已有包含此 Skill 的源码时,可直接注册:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
{{setup}} plugin "/path/to/wechat
|
|
37
|
+
{{setup}} plugin "/path/to/profile-wechat/skills/wechat-miniprogram"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
两种方式都会准备运行依赖并注册 `wxa`。读取对应目录中的 `wechat-miniprogram` Skill,查看 `mearl wxa run --help` 后用 `mearl wxa run <项目路径>` 编译并打开预览。框架项目先构建微信产物。看完可以直接关闭预览标签页。若安装失败,报告具体阻塞。用户只要求普通微信 H5 / WebView 模拟时,查询目标浏览器是否支持微信端模拟。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/client",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"description": "Unified Mearl SDK & CLI for local and remote browsers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"commander": "^14.0.3",
|
|
69
69
|
"fastest-levenshtein": "^1.0.16",
|
|
70
70
|
"ws": "^8.18.0",
|
|
71
|
-
"@mearl/daemon-core": "3.0.
|
|
72
|
-
"@mearl/cloud-types": "3.0.
|
|
73
|
-
"@mearl/agent-runtime": "3.0.
|
|
74
|
-
"@mearl/browser-core": "3.0.
|
|
75
|
-
"@mearl/provider": "3.0.
|
|
71
|
+
"@mearl/daemon-core": "3.0.9",
|
|
72
|
+
"@mearl/cloud-types": "3.0.9",
|
|
73
|
+
"@mearl/agent-runtime": "3.0.9",
|
|
74
|
+
"@mearl/browser-core": "3.0.9",
|
|
75
|
+
"@mearl/provider": "3.0.9"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/node": "^24.9.1",
|