@mearl/setup 2.17.1 → 2.18.0
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/plugin.js +11 -4
- package/package.json +3 -3
package/dist/plugin.js
CHANGED
|
@@ -19,7 +19,7 @@ export async function setupPlugin(name, target) {
|
|
|
19
19
|
const entry = resolvePluginEntry(target);
|
|
20
20
|
const plugin = await loadPlugin(entry, registrationContext);
|
|
21
21
|
await ensurePluginRuntime();
|
|
22
|
-
return registerPlugin(name, entry, plugin.description);
|
|
22
|
+
return registerPlugin(name, entry, plugin.description, { toolbox: plugin.toolbox });
|
|
23
23
|
}
|
|
24
24
|
export async function ensureOfficialPlugin(name, runner = runCommand) {
|
|
25
25
|
const definition = findOfficialPlugin(name);
|
|
@@ -186,15 +186,22 @@ export async function installPlugins(args, runner = runCommand, options = {}) {
|
|
|
186
186
|
assertPluginName(name);
|
|
187
187
|
if (plugins.has(name))
|
|
188
188
|
throw new Error(`多个 skill 使用插件名称 ${name},请通过 setup plugin <name> <path> 分别注册。`);
|
|
189
|
-
plugins.set(name, {
|
|
189
|
+
plugins.set(name, {
|
|
190
|
+
entry,
|
|
191
|
+
description: plugin.description,
|
|
192
|
+
...(plugin.toolbox ? { toolbox: plugin.toolbox } : {}),
|
|
193
|
+
});
|
|
190
194
|
}
|
|
191
195
|
if (plugins.size === 0) {
|
|
192
196
|
console.error('未找到 scripts/main.mjs 或 scripts/main.py 插件入口;自定义入口可用 setup plugin <name> <path> 注册。');
|
|
193
197
|
return 0;
|
|
194
198
|
}
|
|
195
199
|
await ensurePluginRuntime(runner);
|
|
196
|
-
for (const [name, { entry, description }] of plugins) {
|
|
197
|
-
registerPlugin(name, entry, description, {
|
|
200
|
+
for (const [name, { entry, description, toolbox }] of plugins) {
|
|
201
|
+
registerPlugin(name, entry, description, {
|
|
202
|
+
managedBy: options.registrationManagedBy,
|
|
203
|
+
...(toolbox ? { toolbox } : {}),
|
|
204
|
+
});
|
|
198
205
|
console.error(`Plugin ${name} registered: ${entry}\nRun: mearl ${name} --help`);
|
|
199
206
|
}
|
|
200
207
|
return 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/setup",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "One-shot environment setup and configuration for Mearl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"commander": "^15.0.0",
|
|
62
62
|
"extract-zip": "^2.0.1",
|
|
63
63
|
"ws": "^8.18.3",
|
|
64
|
-
"@mearl/client": "2.
|
|
65
|
-
"@mearl/provider": "2.
|
|
64
|
+
"@mearl/client": "2.18.0",
|
|
65
|
+
"@mearl/provider": "2.18.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/node": "^24.9.1",
|