@mearl/setup 2.9.0 → 2.9.1
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 +16 -3
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +31 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Mearl 环境的一次性安装、更新、卸载与配置工具。无需先全局安装 setup:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx @mearl/setup [install] [--local] [--cloud|--qoder-cloud] [--mcp]
|
|
7
|
-
npx @mearl/setup <update|uninstall> [--local] [--cloud|--qoder-cloud] [--mcp]
|
|
8
|
-
npx @mearl/setup extension [--
|
|
6
|
+
npx @mearl/setup [install] [--local] [--cloud|--qoder-cloud] [--mcp]
|
|
7
|
+
npx @mearl/setup <update|uninstall> [--local] [--cloud|--qoder-cloud] [--mcp]
|
|
8
|
+
npx @mearl/setup extension [--full] [--force]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
配置 AgentBay API Key 时只需执行一次下面的命令,然后在隐藏输入提示中粘贴 Key。
|
|
@@ -51,6 +51,10 @@ npx @mearl/setup agentbay
|
|
|
51
51
|
加载;后续更新由 `mearl check --local --json` 确认当前扩展仍来自 setup 管理目录后,直接替换
|
|
52
52
|
文件并通过 Native Host 触发扩展 reload。固定目录和 manifest 中的 `key` 保证扩展 ID
|
|
53
53
|
与浏览器存储保持稳定。
|
|
54
|
+
- `extension --full` 会先安装或更新扩展,再复用 local profile 安装
|
|
55
|
+
`@mearl/client`、安装并初始化 `@mearl/native-host`,最后安装全局 Mearl Skill。
|
|
56
|
+
两部分都会尽量执行;任一步失败时命令返回非零退出码,已安装的部分会保留。它不安装
|
|
57
|
+
cloud 或 MCP 环境。
|
|
54
58
|
- 下载前会通过 CDP 检查同 ID 插件的来源。未安装,或来源为固定目录中的 `UNPACKED`
|
|
55
59
|
插件时可继续;Chrome 商店、企业策略或其他本地目录安装的版本默认保持不变。只有显式
|
|
56
60
|
传入 `--force` 才会接管并替换这些版本。
|
|
@@ -61,6 +65,12 @@ npx @mearl/setup agentbay
|
|
|
61
65
|
npx @mearl/setup extension
|
|
62
66
|
```
|
|
63
67
|
|
|
68
|
+
首次使用时可一次安装完整的本地浏览器环境:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx @mearl/setup extension --full
|
|
72
|
+
```
|
|
73
|
+
|
|
64
74
|
首次安装、旧版 setup 扩展首次迁移,或 Native Host reload 不可用时才需要 CDP。如果
|
|
65
75
|
Chrome 尚未开放 CDP,交互命令会提示打开
|
|
66
76
|
`chrome://inspect/#remote-debugging`、启用远程调试并允许连接,然后等待安装完成。无 TTY
|
|
@@ -127,6 +137,9 @@ npx @mearl/setup update
|
|
|
127
137
|
# 独立安装或更新到最新浏览器扩展
|
|
128
138
|
npx @mearl/setup extension
|
|
129
139
|
|
|
140
|
+
# 安装完整本地环境(client、Native Host、Skill 和扩展)
|
|
141
|
+
npx @mearl/setup extension --full
|
|
142
|
+
|
|
130
143
|
# 只卸载本地环境
|
|
131
144
|
npx @mearl/setup uninstall --local
|
|
132
145
|
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -80,6 +80,7 @@ export function parseSetupArgs(argv) {
|
|
|
80
80
|
const extension = new Command('extension')
|
|
81
81
|
.exitOverride()
|
|
82
82
|
.configureOutput({ writeErr: () => { }, writeOut: () => { } })
|
|
83
|
+
.option('--full')
|
|
83
84
|
.option('--force')
|
|
84
85
|
.option('-y, --yes')
|
|
85
86
|
.option('--non-interactive')
|
|
@@ -88,6 +89,7 @@ export function parseSetupArgs(argv) {
|
|
|
88
89
|
parsed = {
|
|
89
90
|
...baseParsedArgs(),
|
|
90
91
|
...(options.force ? { force: true } : {}),
|
|
92
|
+
...(options.full ? { full: true } : {}),
|
|
91
93
|
operation: 'extension',
|
|
92
94
|
yes: options.yes === true || options.nonInteractive === true,
|
|
93
95
|
};
|
|
@@ -142,14 +144,14 @@ function printHelp(toError = false) {
|
|
|
142
144
|
Usage:
|
|
143
145
|
npx @mearl/setup [install] [--local] [--cloud|--qoder-cloud] [--mcp] [--yes]
|
|
144
146
|
npx @mearl/setup <update|uninstall> [--local] [--cloud|--qoder-cloud] [--mcp] [--yes]
|
|
145
|
-
npx @mearl/setup extension [--force] [--yes]
|
|
147
|
+
npx @mearl/setup extension [--full] [--force] [--yes]
|
|
146
148
|
npx @mearl/setup agentbay [--stdin | --key-file <path>]
|
|
147
149
|
|
|
148
150
|
Behavior:
|
|
149
151
|
install Default command; defaults to --local when no environment is specified
|
|
150
152
|
update Auto-detects installed environments from the current PATH
|
|
151
153
|
uninstall Auto-detects installed environments and asks for confirmation
|
|
152
|
-
extension
|
|
154
|
+
extension Install or update the browser extension; --full also installs the local environment
|
|
153
155
|
agentbay Save or update AGENTBAY_KEY without changing other Mearl settings
|
|
154
156
|
|
|
155
157
|
Options:
|
|
@@ -163,6 +165,7 @@ Options:
|
|
|
163
165
|
--target-line <major.minor.x>
|
|
164
166
|
Install the latest packages from one release line, such as 2.3.x
|
|
165
167
|
--skip-skill Keep the independently managed Mearl Skill unchanged
|
|
168
|
+
--full Also install @mearl/client, @mearl/native-host, and the Mearl Skill
|
|
166
169
|
--force Replace an existing store, managed, or other local Mearl extension
|
|
167
170
|
--yes, -y Run without prompts and accept detected defaults
|
|
168
171
|
--non-interactive
|
|
@@ -179,6 +182,7 @@ Examples:
|
|
|
179
182
|
npx @mearl/setup --local --cloud
|
|
180
183
|
npx @mearl/setup update
|
|
181
184
|
npx @mearl/setup extension
|
|
185
|
+
npx @mearl/setup extension --full
|
|
182
186
|
npx @mearl/setup agentbay
|
|
183
187
|
npx @mearl/setup --qoder-cloud --yes
|
|
184
188
|
npx @mearl/setup update --local --target-line 2.3.x --skip-skill
|
|
@@ -236,6 +240,7 @@ export async function main(argv = process.argv.slice(2), interactiveTerminal = p
|
|
|
236
240
|
console.error('Non-interactive input detected. Re-run with --yes or --non-interactive.');
|
|
237
241
|
return 2;
|
|
238
242
|
}
|
|
243
|
+
let extensionInstalled = false;
|
|
239
244
|
try {
|
|
240
245
|
const result = await (dependencies.installBrowserExtension ?? installMearlBrowserExtension)({
|
|
241
246
|
force: parsed.force,
|
|
@@ -248,20 +253,35 @@ export async function main(argv = process.argv.slice(2), interactiveTerminal = p
|
|
|
248
253
|
: `Browser extension v${result.version} installed or reloaded through CDP.`);
|
|
249
254
|
console.error(`Extension ID: ${result.extensionId}`);
|
|
250
255
|
console.error(`Extension directory: ${result.path}`);
|
|
251
|
-
|
|
256
|
+
extensionInstalled = true;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
console.error(result.filesUpdated
|
|
260
|
+
? `Browser extension v${result.version} files were updated, but the extension was not reloaded.`
|
|
261
|
+
: `Browser extension v${result.version} was not installed.`);
|
|
262
|
+
if (result.cdpError)
|
|
263
|
+
console.error(`CDP installation pending: ${result.cdpError}`);
|
|
264
|
+
console.error('Open chrome://inspect/#remote-debugging, enable remote debugging, approve the connection, then rerun: npx @mearl/setup extension');
|
|
252
265
|
}
|
|
253
|
-
console.error(result.filesUpdated
|
|
254
|
-
? `Browser extension v${result.version} files were updated, but the extension was not reloaded.`
|
|
255
|
-
: `Browser extension v${result.version} was not installed.`);
|
|
256
|
-
if (result.cdpError)
|
|
257
|
-
console.error(`CDP installation pending: ${result.cdpError}`);
|
|
258
|
-
console.error('Open chrome://inspect/#remote-debugging, enable remote debugging, approve the connection, then rerun: npx @mearl/setup extension');
|
|
259
|
-
return 1;
|
|
260
266
|
}
|
|
261
267
|
catch (error) {
|
|
262
268
|
console.error(error instanceof Error ? error.message : String(error));
|
|
263
|
-
return 1;
|
|
264
269
|
}
|
|
270
|
+
if (!parsed.full)
|
|
271
|
+
return extensionInstalled ? 0 : 1;
|
|
272
|
+
let localInstalled = false;
|
|
273
|
+
try {
|
|
274
|
+
localInstalled = await (dependencies.runLifecycle ?? runMearlLifecycle)({
|
|
275
|
+
operation: 'install',
|
|
276
|
+
profiles: ['local'],
|
|
277
|
+
skipSkill: false,
|
|
278
|
+
yes: parsed.yes,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
283
|
+
}
|
|
284
|
+
return extensionInstalled && localInstalled ? 0 : 1;
|
|
265
285
|
}
|
|
266
286
|
if (!interactiveTerminal && !parsed.yes && parsed.operation !== 'update') {
|
|
267
287
|
console.error('Non-interactive input detected. Re-run with --yes or --non-interactive.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/setup",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "One-shot environment setup and configuration for Mearl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"commander": "^15.0.0",
|
|
66
66
|
"extract-zip": "^2.0.1",
|
|
67
67
|
"ws": "^8.18.3",
|
|
68
|
-
"@mearl/client": "2.9.
|
|
68
|
+
"@mearl/client": "2.9.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^24.9.1",
|