refactor(*): 插件身份 - 将旧插件统一更名为 yingce
This commit is contained in:
29
plugins/yingce/.codex-plugin/plugin.json
Normal file
29
plugins/yingce/.codex-plugin/plugin.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "yingce",
|
||||
"version": "0.1.0",
|
||||
"description": "Use Codex to read and operate Yingce through the local Canvas Agent MCP server.",
|
||||
"author": {
|
||||
"name": "ddcat"
|
||||
},
|
||||
"repository": "https://github.com/ddcat-ai/open-ai-canvas",
|
||||
"license": "MIT",
|
||||
"keywords": ["yingce", "影策", "canvas", "mcp", "agent"],
|
||||
"skills": "./skills/",
|
||||
"mcpServers": "./.mcp.json",
|
||||
"interface": {
|
||||
"displayName": "影策",
|
||||
"shortDescription": "Use Codex to operate the current Yingce canvas.",
|
||||
"longDescription": "Connects Codex to the local Canvas Agent MCP server so Codex can inspect the current Yingce canvas, create nodes, connect flows, and trigger generation through the web canvas confirmation flow.",
|
||||
"developerName": "ddcat",
|
||||
"category": "Productivity",
|
||||
"capabilities": ["Canvas", "MCP", "Creative Workflow"],
|
||||
"defaultPrompt": [
|
||||
"打开影策",
|
||||
"读取当前画布并总结节点结构",
|
||||
"根据选中节点创建一组生图提示词"
|
||||
],
|
||||
"brandColor": "#2563EB",
|
||||
"composerIcon": "./assets/icon.png",
|
||||
"logo": "./assets/icon.png"
|
||||
}
|
||||
}
|
||||
10
plugins/yingce/.mcp.json
Normal file
10
plugins/yingce/.mcp.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"yingce": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@ddcat666/open-ai-canvas-agent", "mcp"],
|
||||
"startup_timeout_sec": 20,
|
||||
"tool_timeout_sec": 90
|
||||
}
|
||||
}
|
||||
}
|
||||
89
plugins/yingce/README.md
Normal file
89
plugins/yingce/README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# 影策 Codex 插件
|
||||
|
||||
这个插件把影策的本地 Canvas Agent MCP 打包给 Codex app 使用,让 Codex 能打开本地画布、读取当前节点、创建内容并触发生成流程。
|
||||
|
||||
## 安装
|
||||
|
||||
> 影策尚未上架 Codex 公共插件目录,直接搜索不会显示。请从本仓库自带的 marketplace 安装。
|
||||
|
||||
### AI 自动安装
|
||||
|
||||
把下面这段发给 Codex:
|
||||
|
||||
```text
|
||||
请从 https://github.com/ddcat-ai/open-ai-canvas.git 安装影策 Codex 插件。
|
||||
请 clone 仓库到 ~/plugins/open-ai-canvas,确认 .agents/plugins/marketplace.json 和
|
||||
plugins/yingce/.codex-plugin/plugin.json 都存在。然后运行
|
||||
codex plugin marketplace add ~/plugins/open-ai-canvas,
|
||||
再运行 codex plugin add yingce@yingce-local。
|
||||
安装后请校验插件,并告诉我是否需要开启一个新对话来加载新技能和 MCP 工具。
|
||||
```
|
||||
|
||||
### 手动安装
|
||||
|
||||
如果本机还没有仓库,先 clone:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/plugins
|
||||
git clone https://github.com/ddcat-ai/open-ai-canvas.git ~/plugins/open-ai-canvas
|
||||
```
|
||||
|
||||
注册仓库 marketplace 并安装插件;如果使用已有仓库,请把路径替换为仓库的绝对路径:
|
||||
|
||||
```bash
|
||||
codex plugin marketplace add ~/plugins/open-ai-canvas
|
||||
codex plugin add yingce@yingce-local
|
||||
```
|
||||
|
||||
安装后建议开启一个新的 Codex 对话,让新的 skill 和 MCP 工具完整加载。
|
||||
|
||||
### 本仓库开发调试
|
||||
|
||||
如果你就在影策仓库中调试插件,可以直接添加当前仓库。建议使用仓库绝对路径,避免 Codex 从其他工作目录解析失败:
|
||||
|
||||
```bash
|
||||
cd /path/to/open-ai-canvas
|
||||
codex plugin marketplace add "$(pwd)"
|
||||
codex plugin add yingce@yingce-local
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
1. 新建 Codex 线程后说“打开影策”。
|
||||
2. 插件会确认当前仓库的本地画布服务是否已运行;端口被占用时会检查进程归属,不会把其他项目的 `3000` 当作影策。
|
||||
3. 确认或启动后,插件会直接打开新建画布 URL,并自动尝试连接本地 Agent。
|
||||
4. 画布打开后,让 Codex 读取或操作当前画布。
|
||||
|
||||
常用提示:
|
||||
|
||||
```text
|
||||
打开影策
|
||||
读取当前画布并总结节点结构
|
||||
根据选中节点创建一组生图提示词
|
||||
```
|
||||
|
||||
## 工作机制
|
||||
|
||||
插件默认通过以下命令启动 MCP,并会在 MCP 启动时自动尝试拉起本地 Agent:
|
||||
|
||||
```bash
|
||||
npx -y @ddcat666/open-ai-canvas-agent mcp
|
||||
```
|
||||
|
||||
## 手动排查
|
||||
|
||||
优先本地启动画布:
|
||||
|
||||
```bash
|
||||
cd web
|
||||
bun install
|
||||
bun run dev
|
||||
```
|
||||
|
||||
然后启动本地 Agent。端口不是 `3000` 时,把 `CANVAS_URL` 换成真实本地画布地址:
|
||||
|
||||
```bash
|
||||
CANVAS_URL=http://localhost:3000 npx -y @ddcat666/open-ai-canvas-agent
|
||||
```
|
||||
|
||||
手动排查时先从 Agent 输出或 `http://127.0.0.1:17371/config` 读取本地地址和 token,然后直接打开 `<画布网页地址>/canvas?mode=new&agentUrl=<Local URL>&agentToken=<Connect token>`。不要通过页面点击来新建画布;`mode=new` 会让网页自动创建具体画布并连接本地 Agent。
|
||||
BIN
plugins/yingce/assets/icon.png
Normal file
BIN
plugins/yingce/assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
27
plugins/yingce/skills/canvas/SKILL.md
Normal file
27
plugins/yingce/skills/canvas/SKILL.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: canvas
|
||||
description: 操作影策当前网页画布,读取节点、选区、创建文本节点、创建生成流程、连接节点或触发生成。
|
||||
---
|
||||
|
||||
# 影策画布
|
||||
|
||||
你正在帮助用户操作影策网页画布。需要理解或改动画布时,优先使用已配置的 `yingce` MCP 工具;不要让用户手动复制 JSON、URL 或 token。
|
||||
|
||||
## 工作流
|
||||
|
||||
- 如果用户还没有打开或连接网页画布,使用 `open-canvas` 技能打开影策,不要要求用户手动复制 URL 或 token。
|
||||
- 操作前先用 `canvas_get_state` 读取当前画布;如果用户明确提到选中内容、当前节点或“这个”,先用 `canvas_get_selection`。
|
||||
- 创建单个文本内容优先用 `canvas_create_text_node`。
|
||||
- 创建生成内容优先用 `canvas_generate_text`、`canvas_generate_image`、`canvas_generate_video`、`canvas_generate_audio`。
|
||||
- 需要把提示词、参考素材和生成目标节点串成流程时,使用 `canvas_create_generation_flow` 或项目已有的流程工具。
|
||||
- 需要批量增删改、移动、连接节点或设置视口时,使用 `canvas_apply_ops`。
|
||||
- 不要模拟鼠标点击,不要要求用户手动复制 JSON。
|
||||
- 写入画布的操作会由网页侧边栏做二次确认,按当前工具结果继续推进即可。
|
||||
|
||||
## 风格
|
||||
|
||||
- 页面文案和画布节点内容默认使用中文。
|
||||
- 生成目标节点和提示词节点要保持结构清晰,方便用户继续编辑。
|
||||
- 批量创建节点时注意给节点留出间距,不要堆叠在同一个位置。
|
||||
- 图片、视频、音频等媒体节点默认保留原始比例;只有用户明确要求自由变形时才改变比例。
|
||||
- 生成流程尽量少而清楚,优先让用户一眼能看懂节点关系。
|
||||
36
plugins/yingce/skills/open-canvas/SKILL.md
Normal file
36
plugins/yingce/skills/open-canvas/SKILL.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
name: open-canvas
|
||||
description: 打开影策网页画布并自动连接本地 Canvas Agent。用户要求打开、启动、进入、使用影策或画布时使用。
|
||||
---
|
||||
|
||||
# 打开影策画布
|
||||
|
||||
当用户要求打开、启动、进入或使用影策时,不要把 URL 交给用户手动复制,不要通过浏览器点击“新建画布”。优先快速拉起本地画布和本地 Canvas Agent,然后直接打开带 `mode`、`agentUrl`、`agentToken` 的 URL,让网页自动创建或选择画布并连接 Agent。
|
||||
|
||||
## 默认打开方式
|
||||
|
||||
- 新建画布:`<画布网页地址>/canvas?mode=new&agentUrl=<Local URL>&agentToken=<Connect token>`
|
||||
- 最近画布:`<画布网页地址>/canvas?mode=recent&agentUrl=<Local URL>&agentToken=<Connect token>`
|
||||
- 自己选择:`<画布网页地址>/canvas?mode=choose&agentUrl=<Local URL>&agentToken=<Connect token>`
|
||||
|
||||
默认打开新建本地画布;只有用户明确要求线上地址、最近画布或自己选择时,才改用对应模式。
|
||||
|
||||
## 工作流
|
||||
|
||||
1. 如果当前仓库是影策项目,优先使用当前仓库的 `web/` 前端。
|
||||
2. 先检查本地端口归属:如果 `3000`、`3001` 等端口已被占用,必须用 `lsof`/`ps` 或服务输出确认监听进程的工作目录属于当前仓库的 `web/`,不能只因为端口存在就当成本地画布。
|
||||
3. 如果已有当前仓库的 Next dev 服务,复用它并记录真实画布地址,例如 `http://localhost:3001`。
|
||||
4. 如果没有当前仓库的服务,启动本地画布开发服务,默认在 `web/` 下运行 `bun run dev`;若默认端口被其他项目占用,改用空闲端口启动,例如 `bunx next dev --webpack -H 0.0.0.0 -p <空闲端口>`。不要执行构建或测试。
|
||||
5. 启动本地 Canvas Agent,必须带上第 3/4 步得到的真实画布地址:`CANVAS_URL=<真实画布地址> npx -y @ddcat666/open-ai-canvas-agent`。如果 Agent 已经在运行,则读取 `~/.infinite-canvas/canvas-agent.json` 或启动输出获取 `Local URL` 和 token。
|
||||
6. 读取 Agent 输出或配置中的 `Local URL` 和 `Connect token`,不要让用户手动复制。
|
||||
7. 不走本地 Agent 的 `/open` 跳转;直接构造并打开最终 URL:`<真实画布地址>/canvas?mode=new&agentUrl=<Local URL>&agentToken=<Connect token>`。
|
||||
8. 画布网页会自动新建具体画布、打开本机 Agent 面板并连接本地 Agent;不要用浏览器点击新建画布。
|
||||
9. 打开后再使用 `canvas_get_state` 检查画布是否已经连接;如果尚未连接,等待片刻再检查,不要改用线上站点,除非用户明确要求。
|
||||
|
||||
## 用户只安装插件时
|
||||
|
||||
- 如果当前工作区不是影策源码仓库,优先提示用户先打开或启动影策网页,再连接本地 Agent。
|
||||
- 可以使用线上画布地址或用户给出的本地地址作为 `<画布网页地址>`,但仍要通过本地 Canvas Agent 获取 token 后再打开最终 URL。
|
||||
- 不要假设用户已经安装本仓库依赖;插件的 MCP 会通过 `npx -y @ddcat666/open-ai-canvas-agent mcp` 使用已发布的 Canvas Agent。
|
||||
|
||||
不要要求用户手动填写 URL、token 或复制 JSON。
|
||||
Reference in New Issue
Block a user