Files
openmotion/scripts/install-motion.command
Awek-015 27c6003ec3 docs(motion): end the first-run experience in the editor without an MP4
Accepting the installation experience now opens the unchanged
product-promo project on the right and stops there: the project open in
the editor is the result, and no MP4 is exported unless the user asks.
The reply keeps the completion sentence and the next-step invitation and
drops the playable MP4. Without a browser panel the reply gives the
project link and says the page could not be opened. The onboarding
script, usage guide, READMEs and architecture describe the same flow.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-11-10 00:03:45 +08:00

58 lines
4.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Run from a normal user terminal. Only registers OpenDesign; does not restart Codex.
set -euo pipefail
motion_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
motion_logs="$motion_root/.artifacts/install"
command -v node >/dev/null || { echo '需要先安装 Node.js 22.18+'; exit 1; }
command -v npm >/dev/null || { echo '需要先安装 npm'; exit 1; }
command -v codex >/dev/null || { echo '未找到 codex CLI,请在能运行 codex 的终端执行此脚本。'; exit 1; }
node -e 'const [major,minor]=process.versions.node.split(".").map(Number);if(major<22||(major===22&&minor<18)){console.error("需要 Node.js 22.18+");process.exit(1)}'
codex plugin add --help >/dev/null || { echo '当前 Codex CLI 不支持插件安装,请升级后重试。'; exit 1; }
mkdir -p "$motion_root/.agents/plugins" "$motion_logs"
motion_catalog="$motion_root/.agents/plugins/marketplace.json"
if [ -e "$motion_catalog" ]; then
node --input-type=module - "$motion_catalog" <<'JS'
import fs from 'node:fs';
const catalog = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
if (catalog.name !== 'motion-local' || !catalog.plugins?.some(p => p.name === 'motion' && p.source?.source === 'local' && p.source.path === './')) {
console.error('已有不同的 marketplace 配置,已停止,未覆盖该文件。'); process.exit(1);
}
JS
else
cp "$motion_root/marketplace.example.json" "$motion_catalog"
fi
# Git checkouts omit studio/build; release ZIPs already contain the editor.
if [ ! -f "$motion_root/studio/build/index.html" ]; then
echo '首次从源码安装:下载锁定依赖并构建编辑器。'
(
cd "$motion_root"
npm ci --include=dev
npm run build:studio
)
fi
echo '只注册 motion-local 并安装 OpenDesign(Motion),不升级或移除其他插件。'
codex plugin marketplace add "$motion_root"
codex plugin add motion@motion-local
codex plugin list --marketplace motion-local
node "$motion_root/scripts/check-installed-mcp.mjs"
cat <<'MOTION_ONBOARDING'
OpenDesign(Motion) 已安装。MCP 连接预检通过。
安装后引导(Codex / Agent):
请在当前对话简要介绍 OpenDesign(Motion) 支持产品宣传视频、动态图表与流程动画、模板和可编辑预览、MP4 导出。
然后主动询问用户:“要现在体验一个无需准备素材的 20 秒视频吗?我会在右侧打开一个可编辑工程。”
停下来等待用户选择;用户明确只要安装或暂不体验时,尊重该选择。
用户回复“体验”或明确接受本次邀请,即确认使用内置 Product Promo(product-promo):沿用示例文字、图形和动画,创建独立的 20 秒可编辑工程,保留原有工程;同一次体验已创建则复用。
不再追问素材、品牌、风格或模板。进入 motion-template-to-video 的首次体验默认路径,在 Codex 右侧打开工作室的可编辑工程,检查载入与播放;右侧打开的工程就是这次的结果,用户没有要求时不导出 MP4。
After the editor check succeeds, follow the first-run delivery rules in skills/motion-production/references/templates.md: one completion sentence, then one contextual next-step invitation; keep the editable project open on the right. Use plain Markdown and retain screenshots/check evidence locally, with no MP4, extra editor screenshot, ZIP, duplicate project link, checklist or HTML wrapper unless requested.
Generate the next-step sentence naturally in the user's language, asking what video they want next and offering existing templates, video-link recreation and creation from their requirements. Adapt it to the conversation rather than quoting fixed copy. If the next request is already known, continue it instead of asking again; otherwise wait for a choice. Invite only after the first successful experience delivery, not on follow-up edits, exports or a failed experience.
宿主无浏览器/面板能力时提供实际工程链接,并说明页面未自动打开;工程创建或载入失败时说明原因,不发出完成语和邀请。
先在当前对话完成介绍与邀请。若新插件工具尚未加载,在用户同意体验后再提供新会话接续方式。
MOTION_ONBOARDING