diff --git a/marketplace.json b/marketplace.json index b988fe5..9aef1d0 100644 --- a/marketplace.json +++ b/marketplace.json @@ -94,7 +94,7 @@ "en": "Automated video editing toolkit: standard cloud speech transcription and synthesis, full video frame extraction and understanding, local re-inspection, timeline, preview rendering, QC, and TTS.", "zh-CN": "自动化视频剪辑工具包: 标准云端语音转录与合成、完整视频抽帧理解、局部复看、时间线、预览渲染、QC 和 TTS。" }, - "version": "0.4.3", + "version": "0.4.5", "author": { "name": "Z.ai", "url": "https://z.ai" diff --git a/plugins/video-agent-kit/.claude-plugin/plugin.json b/plugins/video-agent-kit/.claude-plugin/plugin.json index c0c93df..6bba17c 100644 --- a/plugins/video-agent-kit/.claude-plugin/plugin.json +++ b/plugins/video-agent-kit/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "video-agent-kit", - "version": "0.4.3", + "version": "0.4.5", "description": "自动化视频剪辑工具包: 标准云端语音转录与合成、完整视频抽帧理解、局部复看、时间线、预览渲染、QC 和 TTS。", "author": { "name": "Z.ai", @@ -47,8 +47,9 @@ "mcpServers": { "video-edit": { "type": "stdio", - "command": "python3", + "command": "node", "args": [ + "${CLAUDE_PLUGIN_ROOT}/hooks/run_python.mjs", "${CLAUDE_PLUGIN_ROOT}/mcp/video_edit_server.py" ], "cwd": "${CLAUDE_PROJECT_DIR}", diff --git a/plugins/video-agent-kit/.mcp.json b/plugins/video-agent-kit/.mcp.json index 0138aa6..545032a 100644 --- a/plugins/video-agent-kit/.mcp.json +++ b/plugins/video-agent-kit/.mcp.json @@ -2,8 +2,9 @@ "mcpServers": { "video-edit": { "type": "stdio", - "command": "python3", + "command": "node", "args": [ + "${CLAUDE_PLUGIN_ROOT}/hooks/run_python.mjs", "${CLAUDE_PLUGIN_ROOT}/mcp/video_edit_server.py" ], "cwd": "${CLAUDE_PROJECT_DIR}", diff --git a/plugins/video-agent-kit/.zcode-plugin/plugin.json b/plugins/video-agent-kit/.zcode-plugin/plugin.json index a6179d5..6d28cd1 100644 --- a/plugins/video-agent-kit/.zcode-plugin/plugin.json +++ b/plugins/video-agent-kit/.zcode-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "video-agent-kit", - "version": "0.4.3", + "version": "0.4.5", "description": "自动化视频剪辑工具包: 标准云端语音转录与合成、完整视频抽帧理解、局部复看、时间线、预览渲染、QC 和 TTS。", "author": { "name": "Z.ai", @@ -35,8 +35,9 @@ "mcpServers": { "video-edit": { "type": "stdio", - "command": "python3", + "command": "node", "args": [ + "${CLAUDE_PLUGIN_ROOT}/hooks/run_python.mjs", "${CLAUDE_PLUGIN_ROOT}/mcp/video_edit_server.py" ], "cwd": "${CLAUDE_PROJECT_DIR}", diff --git a/plugins/video-agent-kit/README.md b/plugins/video-agent-kit/README.md index 4da1bd8..6491565 100644 --- a/plugins/video-agent-kit/README.md +++ b/plugins/video-agent-kit/README.md @@ -51,7 +51,7 @@ skills/video-recap-workflows/SKILL.md 处理完整电影/赛事/比赛回放的解说剪辑;`env-setup` 只管环境(体检 + 装依赖, 跨 macOS / Windows / Linux),不碰剪辑任务。 -首次使用前装环境(推荐走体检脚本,它跨 macOS / Windows / Linux 且默认用国内镜像): +首次使用前装环境(推荐走体检脚本,它跨 macOS / Windows / Linux 且默认用国内镜像)。运行插件 Hook 和 `video-edit` MCP server 的前置条件是:宿主环境中可从 `PATH` 解析到 `node`,并安装 Python 3.10+: ```bash # 只体检:逐项报"要什么 / 缺了挂哪个能力 / 本平台怎么装" @@ -68,6 +68,12 @@ python3 video-agent-kit/skills/env-setup/scripts/env_doctor.py --fix 真覆盖中文(`fc-match` 对着没装的中文族会返回 DejaVu,烧出来是豆腐块而 ffmpeg 退出码 0)、以及语音走的是哪条通道(在 ZCode 里就是"官方通道,本地无需 key",不会催你配凭据)。 +Hook 和 `video-edit` MCP server 通过插件内置的 `hooks/run_python.mjs` 启动 Python, +不会把宿主平台固定为 `python3`:Windows 优先使用 `py -3` / `python`,macOS、Linux +优先使用 `python3` / `python`。入口命令使用宿主环境中位于 `PATH` 的 `node`;ZCode +不会为第三方插件提供独立的 Node.js。请确保 Node.js 和 Python 3.10+ 都已安装。解析器 +只在解释器不存在时尝试下一个候选,脚本本身的退出码会原样返回。 + 也可以手工只装 Python 依赖(注意 `scenedetect` 必须 `--no-deps`,否则会把 GUI 版 opencv 盖到 `opencv-python-headless` 的 `cv2` 上,两个包一起坏): diff --git a/plugins/video-agent-kit/hooks/hooks.json b/plugins/video-agent-kit/hooks/hooks.json index d79aa8a..0982431 100644 --- a/plugins/video-agent-kit/hooks/hooks.json +++ b/plugins/video-agent-kit/hooks/hooks.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/env_check.py\"", + "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/run_python.mjs\" \"${CLAUDE_PLUGIN_ROOT}/hooks/env_check.py\"", "timeout": 30, "statusMessage": "video-agent-kit environment check..." } @@ -18,7 +18,7 @@ "hooks": [ { "type": "command", - "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/check_video_input.py\"", + "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/run_python.mjs\" \"${CLAUDE_PLUGIN_ROOT}/hooks/check_video_input.py\"", "timeout": 15 } ] @@ -29,7 +29,7 @@ "hooks": [ { "type": "command", - "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/check_closeout.py\"", + "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/run_python.mjs\" \"${CLAUDE_PLUGIN_ROOT}/hooks/check_closeout.py\"", "timeout": 15 } ] diff --git a/plugins/video-agent-kit/hooks/run_python.mjs b/plugins/video-agent-kit/hooks/run_python.mjs new file mode 100644 index 0000000..3a57bfc --- /dev/null +++ b/plugins/video-agent-kit/hooks/run_python.mjs @@ -0,0 +1,62 @@ +#!/usr/bin/env node +/** + * Run a plugin Python entrypoint with the interpreter names used by each OS. + * + * Python's Windows launcher is preferred there because the official installer + * does not create a `python3` command. The first interpreter that exists is + * used; a real script failure is returned unchanged instead of being retried + * with another interpreter. + */ + +import { spawnSync } from "node:child_process"; + +const [script, ...scriptArgs] = process.argv.slice(2); + +if (!script) { + process.stderr.write("Usage: run_python.mjs