@mearl/setup 2.15.2 → 2.16.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/README.md CHANGED
@@ -31,7 +31,7 @@ mearl yuque read "https://aliyuque.antfin.com/group/book/doc"
31
31
 
32
32
  安装参数透传给 `npx -y ali-skills add`,末尾统一追加 `--global --install-mode symlink`;不接受会截断后置选项的 `--` 参数分隔符,
33
33
  确保 skill 存放在 `~/.agents/skills` 并共享给所选 agent。安装日志实时显示,保留交互;
34
- setup 从 `Installed … skill(s)` 成功区块提取路径,仅注册本次安装且包含 `scripts/main.mjs` 的 skill。
34
+ setup 从 `Installed … skill(s)` 成功区块提取路径,仅注册本次安装且包含 `scripts/main.mjs` 或 `scripts/main.py` 的 skill;两者同时存在时使用 JavaScript 入口。
35
35
  普通 skill 正常安装。输出格式无法识别时提示手动注册,不扫描其他 skill 或猜测安装结果。
36
36
 
37
37
  默认 `install` 和 `update` 完成后,setup 会用最多 5 秒的 `npm ping` 检查阿里内网 registry。
@@ -41,8 +41,8 @@ setup 从 `Installed … skill(s)` 成功区块提取路径,仅注册本次安
41
41
 
42
42
  Mearl client 内置官方插件名称与安装来源目录。CLI、SDK、MCP 或另一个插件首次调用尚未注册的官方插件时,会通过内部幂等流程安装并重试一次;未知名称不会触发安装。
43
43
 
44
- 自动注册默认使用安装目录名;入口可用 `export const name = 'yuque'` 指定简短命令名。
45
- 重装会刷新同名绑定。每个入口必须默认导出 `register(app)`;完整协议见
44
+ 自动注册默认使用安装目录名;入口可声明 `name` 指定简短命令名。
45
+ 重装会刷新同名绑定。JavaScript 入口必须默认导出 `register(app)`,Python 入口必须导出 `register(app)` 函数;完整协议见
46
46
  [Skill 插件规范](../skills/mearl-skill-creator/references/cli-plugin.md)。
47
47
 
48
48
  已通过其他渠道分发的 skill 或自定义入口,可以直接传入路径注册:
@@ -52,7 +52,7 @@ npx @mearl/setup plugin yuque /absolute/path/to/yuque-doc-fetch
52
52
  npx @mearl/setup plugin custom ./skills/custom/entry.mjs
53
53
  ```
54
54
 
55
- path 接受目录或具体文件;目录默认读取 `scripts/main.mjs`,相对路径基于调用工作目录解析。
55
+ path 接受目录或具体文件;目录默认读取 `scripts/main.mjs` 或 `scripts/main.py`,相对路径基于调用工作目录解析。Python 插件要求 `python3 >= 3.9`,可通过 `MEARL_PYTHON` 指定解释器路径;setup 只验证入口可加载,不安装 Python,也不执行 `pip install`。
56
56
  命令检查入口注册函数,然后保存绝对入口路径,同名注册更新绑定。
57
57
  两种注册流程都会检查本机 `@mearl/client` 和 `@mearl/native-host`:缺失或低于当前 setup 版本时,
58
58
  复用已有包管理器安装 setup 的对应版本,更新后再次验证;更高版本保持不动。
package/dist/plugin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { existsSync, mkdirSync, rmdirSync, statSync } from 'node:fs';
2
2
  import { homedir } from 'node:os';
3
3
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
4
- import { assertPluginName, findOfficialPlugin, findPluginEntry, findPluginRegistration, listPluginNames, loadPlugin, OFFICIAL_PLUGIN_MANAGER, registerPlugin, resolvePluginEntry, unregisterPlugin, } from '@mearl/client/plugin';
4
+ import { assertPluginName, findPluginDirectoryEntry, findOfficialPlugin, findPluginEntry, findPluginRegistration, listPluginNames, loadPlugin, OFFICIAL_PLUGIN_MANAGER, registerPlugin, resolvePluginEntry, unregisterPlugin, } from '@mearl/client/plugin';
5
5
  import { ensurePluginRuntime } from './pluginRuntime.js';
6
6
  import { resolveAliSkillsInvocation, stripAnsi } from './aliSkills.js';
7
7
  import { findExecutable, prependNodePath, runCommand } from './process.js';
@@ -178,8 +178,8 @@ export async function installPlugins(args, runner = runCommand, options = {}) {
178
178
  for (const skillPath of paths) {
179
179
  if (!statSync(join(skillPath, 'SKILL.md')).isFile())
180
180
  throw new Error(`安装结果缺少 SKILL.md: ${skillPath}`);
181
- const entry = join(skillPath, 'scripts', 'main.mjs');
182
- if (!existsSync(entry))
181
+ const entry = findPluginDirectoryEntry(skillPath);
182
+ if (!entry)
183
183
  continue;
184
184
  const plugin = await loadPlugin(entry, registrationContext);
185
185
  const name = plugin.name ?? basename(skillPath);
@@ -189,7 +189,7 @@ export async function installPlugins(args, runner = runCommand, options = {}) {
189
189
  plugins.set(name, { entry, description: plugin.description });
190
190
  }
191
191
  if (plugins.size === 0) {
192
- console.error('未找到 scripts/main.mjs 插件入口;自定义入口可用 setup plugin <name> <path> 注册。');
192
+ console.error('未找到 scripts/main.mjs 或 scripts/main.py 插件入口;自定义入口可用 setup plugin <name> <path> 注册。');
193
193
  return 0;
194
194
  }
195
195
  await ensurePluginRuntime(runner);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mearl/setup",
3
- "version": "2.15.2",
3
+ "version": "2.16.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.15.2",
65
- "@mearl/provider": "2.15.2"
64
+ "@mearl/client": "2.16.0",
65
+ "@mearl/provider": "2.16.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/node": "^24.9.1",