@mearl/client 3.0.5 → 3.0.6
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.en.md +2 -2
- package/README.md +2 -2
- package/dist/cli.js +11 -2
- package/dist/commands.d.ts +24 -0
- package/dist/commands.js +54 -7
- package/dist/guides/api-browser-setup.md +24 -0
- package/dist/guides/browser-tool-cooperation.md +9 -11
- package/dist/guides/related-skills.md +5 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -0
- package/package.json +6 -6
package/README.en.md
CHANGED
|
@@ -273,7 +273,7 @@ Intervals use local calendar days. Run `mearl check --updates` for immediate rel
|
|
|
273
273
|
Install a Skill and automatically register commands, or register an existing entry:
|
|
274
274
|
|
|
275
275
|
```bash
|
|
276
|
-
npx @mearl/setup plugin install https://github.com/mearlhq/mearl --skill browser-tab-manager --yes
|
|
276
|
+
npx @mearl/setup plugin install https://github.com/mearlhq/mearl --github --skill browser-tab-manager --yes
|
|
277
277
|
npx @mearl/setup plugin /absolute/path/to/browser-tab-manager
|
|
278
278
|
npx @mearl/setup plugin uninstall tabs
|
|
279
279
|
mearl tabs summary
|
|
@@ -458,7 +458,7 @@ Node plugins execute on the CLI/SDK/MCP Server host, never forwarded with browse
|
|
|
458
458
|
| Network requests | `send_request` `request_permission` |
|
|
459
459
|
| Tabs | `tab_open` `tab_list` `tab_close` |
|
|
460
460
|
| Page observation | `page_snapshot` `page_inspect` `page_screenshot` `page_frames` |
|
|
461
|
-
| Page actions | `page_click` `page_drag` `page_type` `page_hover` `page_scroll` `page_press` `page_wait` `page_navigate` `page_upload` `page_eval` |
|
|
461
|
+
| Page actions | `page_click` `page_drag` `page_type` `page_hover` `page_scroll` `page_press` `page_wait` `page_navigate` `page_upload` `page_eval` `page_call_tool` |
|
|
462
462
|
| Page runtimes | `page_runtime` (internal document adapter; plugins use `app.page`) |
|
|
463
463
|
| Composition | `run_actions` |
|
|
464
464
|
| Environment and Cookies | `set_device_emulation` `set_app_profile` `set_timezone` `get_cookie` `set_cookie` |
|
package/README.md
CHANGED
|
@@ -273,7 +273,7 @@ client、native-host、cloud-server 和 MCP server 的已安装版本。发现
|
|
|
273
273
|
安装 skill 并自动注册命令,或直接注册已有入口:
|
|
274
274
|
|
|
275
275
|
```bash
|
|
276
|
-
npx @mearl/setup plugin install https://github.com/mearlhq/mearl --skill browser-tab-manager --yes
|
|
276
|
+
npx @mearl/setup plugin install https://github.com/mearlhq/mearl --github --skill browser-tab-manager --yes
|
|
277
277
|
npx @mearl/setup plugin /absolute/path/to/browser-tab-manager
|
|
278
278
|
npx @mearl/setup plugin uninstall tabs
|
|
279
279
|
mearl tabs summary
|
|
@@ -458,7 +458,7 @@ Node 插件在运行 CLI、SDK 或 MCP Server 的宿主上执行,不随浏览
|
|
|
458
458
|
| 网络请求 | `send_request` `request_permission` |
|
|
459
459
|
| 标签页 | `tab_open` `tab_list` `tab_close` |
|
|
460
460
|
| 页面感知 | `page_snapshot` `page_inspect` `page_screenshot` `page_frames` |
|
|
461
|
-
| 页面操作 | `page_click` `page_drag` `page_type` `page_hover` `page_scroll` `page_press` `page_wait` `page_navigate` `page_upload` `page_eval`
|
|
461
|
+
| 页面操作 | `page_click` `page_drag` `page_type` `page_hover` `page_scroll` `page_press` `page_wait` `page_navigate` `page_upload` `page_eval` `page_call_tool` |
|
|
462
462
|
| 页面运行时 | `page_runtime`(内部文档适配,插件使用 `app.page`) |
|
|
463
463
|
| 组合调用 | `run_actions` |
|
|
464
464
|
| 环境与 Cookie | `set_device_emulation` `set_app_profile` `set_timezone` `get_cookie` `set_cookie` |
|
package/dist/cli.js
CHANGED
|
@@ -42,6 +42,7 @@ const CATEGORIES = [
|
|
|
42
42
|
'page_upload',
|
|
43
43
|
'page_download',
|
|
44
44
|
'page_eval',
|
|
45
|
+
'page_call_tool',
|
|
45
46
|
],
|
|
46
47
|
},
|
|
47
48
|
{ title: '组合调用', names: ['run_actions'] },
|
|
@@ -61,7 +62,11 @@ const CATEGORIES = [
|
|
|
61
62
|
},
|
|
62
63
|
];
|
|
63
64
|
const BUILTIN_COMMANDS = [
|
|
64
|
-
{
|
|
65
|
+
{
|
|
66
|
+
name: 'guide',
|
|
67
|
+
description: '按需读取与当前 CLI 配套的本地指南',
|
|
68
|
+
examples: ['guide', 'guide environment'],
|
|
69
|
+
},
|
|
65
70
|
{
|
|
66
71
|
name: 'run',
|
|
67
72
|
description: '执行预注入 mearl SDK 的 Node.js 脚本',
|
|
@@ -516,7 +521,11 @@ async function runPluginCli(args, commandName) {
|
|
|
516
521
|
console.log(plugin.version ?? 'unknown');
|
|
517
522
|
return 0;
|
|
518
523
|
}
|
|
519
|
-
if (parsed.help ||
|
|
524
|
+
if (parsed.help ||
|
|
525
|
+
(!plugin.defaultCommand &&
|
|
526
|
+
!parsed.pluginArgs?.length &&
|
|
527
|
+
!parsed.hasPayload &&
|
|
528
|
+
!Object.keys(parsed.pluginInput ?? {}).length)) {
|
|
520
529
|
console.error(plugin.help(`${commandName} ${parsed.action}`, parsed.pluginArgs?.[0]));
|
|
521
530
|
return 0;
|
|
522
531
|
}
|
package/dist/commands.d.ts
CHANGED
|
@@ -709,6 +709,26 @@ export declare const COMMANDS: readonly [{
|
|
|
709
709
|
}];
|
|
710
710
|
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。CLI 单次调用失败以退出码 1 结束;脚本需检查 action.success。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "effects.texts 按需返回普通可见文本的 selector/text,不代表可点击控件或业务成功;超限或覆盖不完整时仍提示补快照。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。", "action.data 返回 moved、atTop/atBottom、scrollYBefore/After、maxScrollY、resolvedContainer 和 ancestorDistance;自动发现的内部容器提供可复用 containerSelector。"];
|
|
711
711
|
readonly examples: ["page_scroll --payload '{\"tabId\":12345,\"direction\":\"down\"}'", "page_scroll --payload '{\"tabId\":12345,\"direction\":\"bottom\"}'", "page_scroll --payload '{\"tabId\":12345,\"selector\":\".virtual-list\",\"direction\":\"down\",\"distance\":800}'", "page_scroll --payload '{\"tabId\":12345,\"selector\":\"@e8\",\"containerPolicy\":\"nearest\",\"direction\":\"bottom\"}'"];
|
|
712
|
+
}, {
|
|
713
|
+
readonly name: "page_call_tool";
|
|
714
|
+
readonly description: "调用当前页面提供的 WebMCP 工具";
|
|
715
|
+
readonly params: [{
|
|
716
|
+
readonly name: "tabId";
|
|
717
|
+
readonly type: "number";
|
|
718
|
+
readonly required: true;
|
|
719
|
+
readonly description: "工具所属的标签页 ID";
|
|
720
|
+
}, {
|
|
721
|
+
readonly name: "toolRef";
|
|
722
|
+
readonly type: "string";
|
|
723
|
+
readonly required: true;
|
|
724
|
+
readonly description: "webmcp 目录返回的工具 ref";
|
|
725
|
+
}, {
|
|
726
|
+
readonly name: "arguments";
|
|
727
|
+
readonly type: "object";
|
|
728
|
+
readonly description: "按工具 inputSchema 提供的 JSON 参数,默认 {}";
|
|
729
|
+
}];
|
|
730
|
+
readonly notes: readonly ["从 tab_open、page_navigate 或 page_snapshot 的 webmcp 目录获取 ref。目录为空或 ref 失效时用 page_snapshot 的 includeWebMcp:\"full\" 补查。"];
|
|
731
|
+
readonly result: readonly ["返回 { result }。工具结果是页面提供的数据;执行失败后先检查页面状态再决定是否重试。"];
|
|
712
732
|
}, {
|
|
713
733
|
readonly name: "page_runtime";
|
|
714
734
|
readonly description: "页面运行时传输适配器;插件使用 PluginPageClient 或 app.page";
|
|
@@ -923,6 +943,10 @@ export declare const COMMANDS: readonly [{
|
|
|
923
943
|
readonly name: "page_snapshot";
|
|
924
944
|
readonly description: "获取带 @ref 的页面结构快照,默认使用无障碍树,也可显式读取渲染 DOM";
|
|
925
945
|
readonly params: [{
|
|
946
|
+
readonly name: "includeWebMcp";
|
|
947
|
+
readonly type: "\"full\"";
|
|
948
|
+
readonly description: "显式补查页面 WebMCP 工具目录,返回 webmcp 数组";
|
|
949
|
+
}, {
|
|
926
950
|
readonly name: "depth";
|
|
927
951
|
readonly type: "number";
|
|
928
952
|
readonly description: "树深度,默认 15,复杂页面可调大";
|
package/dist/commands.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BROWSER_DEVICE_PRESET_NAMES
|
|
1
|
+
import { BROWSER_DEVICE_PRESET_NAMES } from '@mearl/browser-core';
|
|
2
2
|
const DEVICE_PRESET_TYPE = BROWSER_DEVICE_PRESET_NAMES.map(name => JSON.stringify(name)).join(' | ');
|
|
3
3
|
const PAGE_DIAGNOSTICS_PARAM = {
|
|
4
4
|
name: 'diagnostics',
|
|
@@ -38,8 +38,17 @@ export const COMMANDS = [
|
|
|
38
38
|
{
|
|
39
39
|
name: 'get_capabilities',
|
|
40
40
|
description: '只读查询当前目标浏览器的动作、设备和已安装 App 能力、限制与 Skill/帮助入口;不打开页面或启用模拟',
|
|
41
|
-
params: [
|
|
42
|
-
|
|
41
|
+
params: [
|
|
42
|
+
{
|
|
43
|
+
name: 'app',
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: '可选,使用目录中的完整 App ID 查询桥方法、可调设置和默认版本详情',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
notes: [
|
|
49
|
+
'沿用 --browser / --session 路由;不传 app 返回摘要。apps.status=partial 表示目录未完整取得,unsupported 表示目标未提供目录;不能把两者当作未安装。',
|
|
50
|
+
'available=false 的 App 当前不可启用;支持某个 action 不代表已有域名权限或真实设备授权。按需读取 usage.skills / usage.documentation,查询不会自动安装或加载 Skill。',
|
|
51
|
+
],
|
|
43
52
|
examples: ['get_capabilities', `get_capabilities --payload '{"app":"example/app"}'`],
|
|
44
53
|
},
|
|
45
54
|
{
|
|
@@ -374,8 +383,16 @@ export const COMMANDS = [
|
|
|
374
383
|
description: '列出所有浏览器及其连接状态、类型和 Provider 托管实例信息',
|
|
375
384
|
summary: '列出本地及远端浏览器与连接状态',
|
|
376
385
|
params: [
|
|
377
|
-
{
|
|
378
|
-
|
|
386
|
+
{
|
|
387
|
+
name: 'provider',
|
|
388
|
+
type: 'string',
|
|
389
|
+
description: '配合 launchForm,仅查询一个本机已安装 Provider 的启动候选;需 --local',
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: 'launchForm',
|
|
393
|
+
type: 'object',
|
|
394
|
+
description: '现有动态启动表单请求:{variant?,values:{}},不创建或接入实例',
|
|
395
|
+
},
|
|
379
396
|
],
|
|
380
397
|
examples: ['browser_list', 'browser_list --local'],
|
|
381
398
|
},
|
|
@@ -788,6 +805,23 @@ export const COMMANDS = [
|
|
|
788
805
|
`page_scroll --payload '{"tabId":12345,"selector":"@e8","containerPolicy":"nearest","direction":"bottom"}'`,
|
|
789
806
|
],
|
|
790
807
|
},
|
|
808
|
+
{
|
|
809
|
+
name: 'page_call_tool',
|
|
810
|
+
description: '调用当前页面提供的 WebMCP 工具',
|
|
811
|
+
params: [
|
|
812
|
+
{ name: 'tabId', type: 'number', required: true, description: '工具所属的标签页 ID' },
|
|
813
|
+
{ name: 'toolRef', type: 'string', required: true, description: 'webmcp 目录返回的工具 ref' },
|
|
814
|
+
{
|
|
815
|
+
name: 'arguments',
|
|
816
|
+
type: 'object',
|
|
817
|
+
description: '按工具 inputSchema 提供的 JSON 参数,默认 {}',
|
|
818
|
+
},
|
|
819
|
+
],
|
|
820
|
+
notes: [
|
|
821
|
+
'从 tab_open、page_navigate 或 page_snapshot 的 webmcp 目录获取 ref。目录为空或 ref 失效时用 page_snapshot 的 includeWebMcp:"full" 补查。',
|
|
822
|
+
],
|
|
823
|
+
result: ['返回 { result }。工具结果是页面提供的数据;执行失败后先检查页面状态再决定是否重试。'],
|
|
824
|
+
},
|
|
791
825
|
{
|
|
792
826
|
name: 'page_runtime',
|
|
793
827
|
description: '页面运行时传输适配器;插件使用 PluginPageClient 或 app.page',
|
|
@@ -904,8 +938,16 @@ export const COMMANDS = [
|
|
|
904
938
|
description: '按键名称:Enter/Tab/Escape/Backspace 等',
|
|
905
939
|
},
|
|
906
940
|
{ name: 'modifiers', type: 'string[]', description: '修饰键数组:ctrl/alt/shift/meta/cmd' },
|
|
907
|
-
{
|
|
908
|
-
|
|
941
|
+
{
|
|
942
|
+
name: 'dialogId',
|
|
943
|
+
type: 'string',
|
|
944
|
+
description: '原生弹窗回执或 page_snapshot 中的 dialog.id;仅配合 Enter 接受或 Escape 取消',
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
name: 'promptText',
|
|
948
|
+
type: 'string',
|
|
949
|
+
description: '仅用于 dialogId + Enter 接受原生 prompt 时填写文本',
|
|
950
|
+
},
|
|
909
951
|
{
|
|
910
952
|
name: 'pressMode',
|
|
911
953
|
type: '"auto" | "dom" | "keyboard"',
|
|
@@ -1035,6 +1077,11 @@ export const COMMANDS = [
|
|
|
1035
1077
|
name: 'page_snapshot',
|
|
1036
1078
|
description: '获取带 @ref 的页面结构快照,默认使用无障碍树,也可显式读取渲染 DOM',
|
|
1037
1079
|
params: [
|
|
1080
|
+
{
|
|
1081
|
+
name: 'includeWebMcp',
|
|
1082
|
+
type: '"full"',
|
|
1083
|
+
description: '显式补查页面 WebMCP 工具目录,返回 webmcp 数组',
|
|
1084
|
+
},
|
|
1038
1085
|
{ name: 'depth', type: 'number', description: '树深度,默认 15,复杂页面可调大' },
|
|
1039
1086
|
{
|
|
1040
1087
|
name: 'mode',
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
## 目录
|
|
6
6
|
|
|
7
7
|
- [浏览器实例](#browser-instances)
|
|
8
|
+
- [Electron 桌面应用](#electron-cdp)
|
|
8
9
|
- [控制会话与人工交接](#control-sessions)
|
|
9
10
|
- [目标宿主与高级路由参数](#cloud-connectors)
|
|
10
11
|
- [可选浏览器 Provider](#browser-providers)
|
|
@@ -33,6 +34,29 @@ mearl browser_launch --payload '{"provider":"<providerId>","providerOptions":{}}
|
|
|
33
34
|
|
|
34
35
|
浏览器访问入口不会出现在 `browser_list` 中。只有用户明确需要时才运行 `mearl check --browser <id|名称>`,并把返回的 `browserAccess.url` 按敏感信息处理,不写入日志或转发给无关方。
|
|
35
36
|
|
|
37
|
+
<a id="electron-cdp"></a>
|
|
38
|
+
|
|
39
|
+
## Electron 桌面应用
|
|
40
|
+
|
|
41
|
+
Electron 应用开放 Chromium CDP 后,可用 Mearl 操作其渲染页面,复用页面快照、点击、输入和截图。原生菜单、系统弹窗和主进程调试不在这条链路内,具体能力以目标实际响应为准。
|
|
42
|
+
|
|
43
|
+
先使用应用已提供的调试端口;需要启动应用时,可按应用支持的方式传 `--remote-debugging-port=9223`(示例端口)。该参数须在应用启动时生效,已运行实例不一定接受再次启动的参数;重启前确认不会中断用户工作。不要把主进程的 `--inspect` 端口当作渲染页面端点。参见 [Electron 调试开关](https://www.electronjs.org/docs/latest/api/command-line-switches#--remote-debugging-portport)。
|
|
44
|
+
|
|
45
|
+
对已确认的本机端口,在单独终端运行 CDP 宿主并保持进程运行:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
mearl-native-host --daemon --cdp-port 9223 --browser-id electron-app --browser-name "Electron App"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
在另一个终端用 `mearl browser_list` 找到该实例,后续沿用返回的 `browserId`:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
mearl tab_list --browser '<browserId>'
|
|
55
|
+
mearl page_snapshot --browser '<browserId>' --payload '{"tabId":12345,"mode":"viewport"}'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`tabId` 使用 `tab_list` 返回的真实值。优先操作已有应用窗口,不用 `tab_open` 导航替换应用主界面;未列出页面时先检查端点与页面目标,不把连接成功等同于应用已可操作。
|
|
59
|
+
|
|
36
60
|
<a id="control-sessions"></a>
|
|
37
61
|
|
|
38
62
|
## 控制会话与人工交接
|
|
@@ -4,18 +4,16 @@ Mearl 单独使用时沿用主 Skill 的页面操作流程。任务已有 Ego、
|
|
|
4
4
|
|
|
5
5
|
## EgoLite
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
使用独立 `@mearl/provider-ego`,安装入口和支持范围以 Provider 自身 README 为准。本地源码构建后可用 `{{setup}} provider install '@mearl/provider-ego@/absolute/path/to/provider-ego'` 安装并注册;也可指定 GitHub Release 安装包地址。
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- 普通打开后设置模拟并重载,不等于业务页首次访问即处于模拟环境。需要首屏模拟时先确认当前工具支持的准备流程。
|
|
18
|
-
- 成功收尾遵守 Ego 的页面保留规则;保留结果页时保留用户需要的模拟状态。需要恢复时在结束前通过扩展显式恢复原配置;Mearl 会话释放不替代 Ego 收尾,也不保证清除模拟。
|
|
9
|
+
- 无需浏览器扩展。已有扩展可关闭 Agent 服务,保留人工调试面板。Mearl 本地运行时仍负责 Provider 路由和已安装 App 资源解析。
|
|
10
|
+
- 一个 Provider 浏览器对应一个 Ego Space。启动时传 `providerOptions.name`;已有任务传数字 `providerOptions.spaceId`。只关联 Agent 所有的 Space,不隐式认领用户 Space。
|
|
11
|
+
- 使用 Provider 返回的完整 `browserId` 和页面 `tabId`,不需要 Agent 手工匹配扩展标签页。不传 Mearl `--session`。
|
|
12
|
+
- Space 交接和完成使用 Provider 的 `mearl-ego` CLI;源码安装时执行 `node /absolute/path/to/provider-ego/dist/cli.js handoff <spaceId>`、`resume <spaceId>`、`finish <spaceId> --keep p1,p2`。这里的 `mearl-ego` 是命令,不是 Skill。仅在用户明确交还后 resume。
|
|
13
|
+
- 所有页面操作经过 Ego 原生通道;用户接管、Space 失活时由 Ego 阻断,不改走扩展。连接断开或效果未知时不重放动作。
|
|
14
|
+
- 设备和 App 分别通过 `set_device_emulation`、`set_app_profile` 设置。App 来自已安装目录,使用当前已解析版本;UA、声明式全局变量和页面桥通过原生 CDP 安装。导航、截图继续使用同一个 Provider。
|
|
15
|
+
- 共享原生页面宿主提供设备外壳、根 WebView、网络控制和已安装 App 的协议/授权桥。真实授权仍需用户批准;接管会取消待授权会话,交还不恢复旧请求。不提供扩展专属请求/日志入口,其他参数限制以 Provider 指引为准。
|
|
16
|
+
- `finish` 默认不保留 Agent 页面;需要保留结果时显式传 Ego Page label。`browser_release` 只解绑,不结束 Space、不清除模拟;需要普通页面时先清除模拟再 finish。
|
|
19
17
|
|
|
20
18
|
## agent-browser 等其他工具
|
|
21
19
|
|
|
@@ -12,14 +12,13 @@
|
|
|
12
12
|
| 把设计稿叠加到网页并做像素差异对比 | design-overlay |
|
|
13
13
|
| 为网页提供持续双语阅读 | immersive-translate |
|
|
14
14
|
| 运行 bb-browser 站点适配器 | mearl-bbrowser |
|
|
15
|
-
| Ego / EgoLite 任务中配合扩展进行端模拟、接口与日志调试 | mearl-ego |
|
|
16
15
|
| 开发或审查外部浏览器、真机 Provider | mearl-provider-creator |
|
|
17
16
|
| 把网站操作沉淀为可复用 Skill、CLI 或工具箱 GUI | mearl-skill-creator |
|
|
18
17
|
|
|
19
18
|
有脚本入口的 Skill 可安装并自动注册插件:
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
|
-
{{setup}} plugin install https://github.com/mearlhq/mearl --skill <skill-name> --yes
|
|
21
|
+
{{setup}} plugin install https://github.com/mearlhq/mearl --github --skill <skill-name> --yes
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
已可用的专用 Skill 按其说明执行。用户明确要求使用表中某项专用能力、且执行任务需要该插件时,可在缺失时按需安装并继续。普通网页操作使用通用流程。
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
任务要运行小程序工程或已编译的微信产物时,先用 `mearl --help` 检查已注册插件中是否有 `wxa`。缺失时,从已包含此 Skill 且当前可访问的官方来源补装:
|
|
30
29
|
|
|
31
30
|
```bash
|
|
32
|
-
{{setup}} plugin install https://github.com/mearlhq/wechat-profile --skill wechat-miniprogram --yes
|
|
31
|
+
{{setup}} plugin install https://github.com/mearlhq/wechat-profile --github --skill wechat-miniprogram --yes
|
|
33
32
|
```
|
|
34
33
|
|
|
35
34
|
官方来源暂不可用且本机已有包含此 Skill 的源码时,可直接注册:
|
|
@@ -42,7 +41,9 @@
|
|
|
42
41
|
|
|
43
42
|
## 开发与协作指引
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
EgoLite 使用独立 `@mearl/provider-ego`,具体流程见工具协作(`mearl guide cooperation`),不需要额外协作 Skill。
|
|
45
|
+
|
|
46
|
+
`mearl-skill-creator` 与 `mearl-provider-creator` 是指引型 Skill,没有可注册的脚本入口;直接用标准 Skills 工具安装,不运行 `setup plugin`:
|
|
46
47
|
|
|
47
48
|
```bash
|
|
48
49
|
npx skills add https://github.com/mearlhq/mearl --skill mearl-skill-creator --global
|
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare function pageType(params: Protocol.PageTypeParams, options?: Unif
|
|
|
46
46
|
export declare function pageScroll(params: Protocol.PageScrollParams, options?: UnifiedInvokeOptions): Promise<Protocol.BrowserActionResponse<'page_scroll'>>;
|
|
47
47
|
export declare function pageHover(params: Protocol.PageHoverParams, options?: UnifiedInvokeOptions): Promise<Protocol.BrowserActionResponse<'page_hover'>>;
|
|
48
48
|
export declare function pageEval(params: Protocol.PageEvalParams, options?: UnifiedInvokeOptions): Promise<Protocol.BrowserActionResponse<'page_eval'>>;
|
|
49
|
+
export declare function pageCallTool(params: Protocol.BrowserActionRequest<'page_call_tool'>, options?: UnifiedInvokeOptions): Promise<Protocol.BrowserActionResponse<'page_call_tool'>>;
|
|
49
50
|
export declare function pageInspect(params: Protocol.PageInspectParams, options?: UnifiedInvokeOptions): Promise<Protocol.BrowserActionResponse<'page_inspect'>>;
|
|
50
51
|
export declare function pageSnapshot(params: Protocol.PageSnapshotParams, options?: UnifiedInvokeOptions): Promise<Protocol.BrowserActionResponse<'page_snapshot'>>;
|
|
51
52
|
export declare function pagePress(params: Protocol.PagePressParams, options?: UnifiedInvokeOptions): Promise<Protocol.BrowserActionResponse<'page_press'>>;
|
|
@@ -71,4 +72,4 @@ export { PluginStateClient } from './plugins/clients/pluginState.js';
|
|
|
71
72
|
export { PluginModelClient } from './plugins/clients/pluginModels.js';
|
|
72
73
|
export type * from '@mearl/browser-core';
|
|
73
74
|
export { getStructure as structure, type StructureOptions } from '@mearl/browser-core';
|
|
74
|
-
export type { GetCapabilitiesParams, BrowserCapabilityCatalog, AppCapability, AppProfileUsage } from '@mearl/browser-core';
|
|
75
|
+
export type { GetCapabilitiesParams, BrowserCapabilityCatalog, AppCapability, AppProfileUsage, } from '@mearl/browser-core';
|
package/dist/index.js
CHANGED
|
@@ -97,6 +97,9 @@ export function pageHover(params, options) {
|
|
|
97
97
|
export function pageEval(params, options) {
|
|
98
98
|
return invoke('page_eval', params, options);
|
|
99
99
|
}
|
|
100
|
+
export function pageCallTool(params, options) {
|
|
101
|
+
return invoke('page_call_tool', params, options);
|
|
102
|
+
}
|
|
100
103
|
export function pageInspect(params, options) {
|
|
101
104
|
return invoke('page_inspect', params, options);
|
|
102
105
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/client",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
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/
|
|
72
|
-
"@mearl/
|
|
73
|
-
"@mearl/
|
|
74
|
-
"@mearl/provider": "3.0.
|
|
75
|
-
"@mearl/
|
|
71
|
+
"@mearl/daemon-core": "3.0.6",
|
|
72
|
+
"@mearl/cloud-types": "3.0.6",
|
|
73
|
+
"@mearl/browser-core": "3.0.6",
|
|
74
|
+
"@mearl/provider": "3.0.6",
|
|
75
|
+
"@mearl/agent-runtime": "3.0.6"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/node": "^24.9.1",
|