diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 0b3913bd4..b56c49c19 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -1,14 +1,14 @@ { - "name": "infinite-canvas-local", + "name": "yingce-local", "interface": { "displayName": "影策 Local" }, "plugins": [ { - "name": "infinite-canvas", + "name": "yingce", "source": { "source": "local", - "path": "./plugins/infinite-canvas" + "path": "./plugins/yingce" }, "policy": { "installation": "AVAILABLE", diff --git a/AGENTS.md b/AGENTS.md index 97c4e7032..a832ecf55 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,7 @@ | `web/` | Vite、React 19、TypeScript、React Router、Ant Design、Tailwind、Zustand、TanStack Query | `web/src/application.tsx`、`web/src/router.tsx` | 工作区 UI、画布交互、浏览器缓存、API 调用和模型协议适配 | | `backend/` | Go 1.25、Gin、GORM、SQLite/PostgreSQL、Redis 协调 | `backend/cmd/server/main.go` | 登录、权限、业务 API、任务队列、资源、模型中转和后台管理 | | `canvas-agent/` | Node.js 18+、TypeScript、Express、MCP SDK、Codex SDK | `canvas-agent/src/index.ts` | 本机 Agent、MCP、画布会话桥接和本地渠道 | -| `plugins/infinite-canvas/` | Codex App 插件清单和 skills | `.codex-plugin/plugin.json` | 将 Canvas Agent MCP 接入 Codex App | +| `plugins/yingce/` | Codex App 插件清单和 skills | `.codex-plugin/plugin.json` | 将 Canvas Agent MCP 接入 Codex App | | `docs/` | Next.js、Fumadocs、MDX | `docs/content/docs/` | 面向用户和开发者的专题文档;构建配置见 `docs/source.config.ts` | 根目录的 `Dockerfile` 构建前端静态镜像;`nginx.conf` 托管 SPA 并代理后端。`docker-compose.dev.yml` 是源码热更新开发编排,`docker-compose.local.yml` 是本地构建运行,`docker-compose.deploy.yml` 是 PostgreSQL + Redis 部署编排。 @@ -54,7 +54,7 @@ ### Agent、插件和文档 - 修改 `canvas-agent/` 前先读 `canvas-agent/README.md`,它有独立的 Node 版本、构建、发布和 token 边界。 -- 修改 `plugins/infinite-canvas/` 前先读插件 README、manifest 和对应 skill;不要把主应用的页面约定套到插件运行时。 +- 修改 `plugins/yingce/` 前先读插件 README、manifest 和对应 skill;不要把主应用的页面约定套到插件运行时。 - 修改 `docs/` 前确认内容属于专题文档,而不是把长篇说明重新复制到根 README。目录索引见 `docs/index.md`。 ## 4. 前端 API 和状态合同 diff --git a/README.md b/README.md index c7702e9d3..e8e725113 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ └─ provider/outbound -> 外部模型渠道 本地 Agent(canvas-agent/) <-> 浏览器画布 <-> Codex MCP / 本机 CLI -Codex 插件(plugins/infinite-canvas/)负责把 MCP 接入 Codex App。 +Codex 插件(`plugins/yingce/`)负责把 MCP 接入 Codex App。 ``` 前端默认把 `/api` 代理到 `http://127.0.0.1:8080`;生产环境由网页容器的 Nginx 代理到后端,只有 web 的 `3000` 端口需要对外暴露。系统模型和文本任务的 SSE 只在明确的流式路径关闭代理缓冲,详见 [`nginx.conf`](nginx.conf) 和 [SSE 文档](docs/content/docs/overview/docker.mdx)。 @@ -206,7 +206,7 @@ npm run build node dist/index.js ``` -启动后将终端输出的 Local URL 和 Connect token 填入画布右上角 Agent 面板。Agent 默认只监听 `127.0.0.1`,token 不应写入 URL、日志或任务正文。完整 MCP 工具、Codex App 插件安装和本地安全边界见 [`canvas-agent/README.md`](canvas-agent/README.md) 与 [`plugins/infinite-canvas/README.md`](plugins/infinite-canvas/README.md)。 +启动后将终端输出的 Local URL 和 Connect token 填入画布右上角 Agent 面板。Agent 默认只监听 `127.0.0.1`,token 不应写入 URL、日志或任务正文。完整 MCP 工具、Codex App 插件安装和本地安全边界见 [`canvas-agent/README.md`](canvas-agent/README.md) 与 [`plugins/yingce/README.md`](plugins/yingce/README.md)。 ## 验证命令 diff --git a/canvas-agent/README.md b/canvas-agent/README.md index 34d2066ac..6689b41dc 100644 --- a/canvas-agent/README.md +++ b/canvas-agent/README.md @@ -47,14 +47,14 @@ Canvas Agent 默认只监听 `127.0.0.1`。网页第一次带正确 token 连接 ### Codex app 插件 -仓库内提供了 Codex app 插件:`plugins/infinite-canvas`。该插件尚未上架公共插件目录,直接搜索不会显示;在 Codex app 中添加本仓库的 marketplace 后即可安装。插件会注册同一个 `infinite-canvas` MCP,并带上画布操作说明。 +仓库内提供了 Codex app 插件:`plugins/yingce`。该插件尚未上架公共插件目录,直接搜索不会显示;在 Codex app 中添加本仓库的 marketplace 后即可安装。插件会注册 `yingce` MCP,并带上画布操作说明。 添加本地 marketplace 时建议使用仓库绝对路径,避免 Codex 从其他工作目录解析失败: ```bash -cd /path/to/infinite-canvas +cd /path/to/open-ai-canvas codex plugin marketplace add "$(pwd)" -codex plugin add infinite-canvas@infinite-canvas-local +codex plugin add yingce@yingce-local ``` 插件默认通过 npm 启动 MCP: @@ -68,13 +68,13 @@ npx -y @ddcat666/open-ai-canvas-agent mcp Canvas Agent 启动后,给 Codex 添加 MCP: ```bash -codex mcp add infinite-canvas -- npx -y @ddcat666/open-ai-canvas-agent mcp +codex mcp add yingce -- npx -y @ddcat666/open-ai-canvas-agent mcp ``` 本仓库开发时可以改成,实际使用建议替换为本机绝对路径: ```bash -codex mcp add infinite-canvas -- node /path/to/infinite-canvas/canvas-agent/dist/index.js mcp +codex mcp add yingce -- node /path/to/open-ai-canvas/canvas-agent/dist/index.js mcp ``` Canvas Agent 源码使用 TypeScript 编写,MCP 协议层使用官方 `@modelcontextprotocol/sdk`,工具入参使用 `zod` 描述。 @@ -82,7 +82,7 @@ Canvas Agent 源码使用 TypeScript 编写,MCP 协议层使用官方 `@modelc 如果希望终端里的 Codex 不被 MCP 审批卡住,可以在 `~/.codex/config.toml` 里给这个 MCP 设置自动放行: ```toml -[mcp_servers.infinite-canvas] +[mcp_servers.yingce] command = "npx" args = ["-y", "@ddcat666/open-ai-canvas-agent", "mcp"] default_tools_approval_mode = "approve" @@ -115,7 +115,7 @@ default_tools_approval_mode = "approve" ## 侧边栏 Codex -本地面板会把提示词发送给 Canvas Agent。Canvas Agent 使用官方 `@openai/codex` CLI 的 `codex app-server --stdio` 启动并复用同一个 Codex thread,启动时会注入 `infinite-canvas` MCP 配置并自动放行 MCP 审批,真正执行画布修改前仍由网页侧边栏二次确认。 +本地面板会把提示词发送给 Canvas Agent。Canvas Agent 使用官方 `@openai/codex` CLI 的 `codex app-server --stdio` 启动并复用同一个 Codex thread,启动时会注入 `yingce` MCP 配置并自动放行 MCP 审批,真正执行画布修改前仍由网页侧边栏二次确认。 侧边栏会展示 Codex 返回的 `thread.started`、`turn.started`、`item.*`、`turn.completed` 等结构化事件;收到 app-server 的 `item/agentMessage/delta` 时,Canvas Agent 会转成 `item.updated`,网页会用同一条消息做真实流式更新,并把工具细节收进运行日志。 @@ -128,13 +128,13 @@ Claude Code Adapter 代码暂时保留,但当前网页侧边栏只开放 Codex 如果希望 Claude Code 也能操作画布,需要给 Claude Code 添加同一个 MCP。建议用 user scope,避免 Canvas Agent 从不同目录启动时找不到配置: ```bash -claude mcp add --scope user --transport stdio infinite-canvas -- npx -y @ddcat666/open-ai-canvas-agent mcp +claude mcp add --scope user --transport stdio yingce -- npx -y @ddcat666/open-ai-canvas-agent mcp ``` 本仓库开发时可以改成: ```bash -claude mcp add --scope user --transport stdio infinite-canvas -- node /path/to/infinite-canvas/canvas-agent/dist/index.js mcp +claude mcp add --scope user --transport stdio yingce -- node /path/to/open-ai-canvas/canvas-agent/dist/index.js mcp ``` -Canvas Agent 调用 Claude Code 时会默认带上 `--allowedTools mcp__infinite-canvas__*`,画布写操作仍由网页侧边栏确认。 +Canvas Agent 调用 Claude Code 时会默认带上 `--allowedTools mcp__yingce__*`,画布写操作仍由网页侧边栏确认。 diff --git a/canvas-agent/src/agents.ts b/canvas-agent/src/agents.ts index 6c9f08baa..977c9eb8f 100644 --- a/canvas-agent/src/agents.ts +++ b/canvas-agent/src/agents.ts @@ -95,7 +95,7 @@ export async function archiveCodexThread(emit: AgentEmit, threadId: string, cwd? export function runClaudeTurn(prompt: string, emit: AgentEmit) { if (!prompt.trim()) return; - const child = spawnAgent("claude", ["-p", "--output-format", "stream-json", "--verbose", "--include-partial-messages", "--allowedTools", "mcp__infinite-canvas__*", prompt], ["ignore", "pipe", "pipe"], emit); + const child = spawnAgent("claude", ["-p", "--output-format", "stream-json", "--verbose", "--include-partial-messages", "--allowedTools", "mcp__yingce__*", prompt], ["ignore", "pipe", "pipe"], emit); if (!child) return; pipeJsonLines(child, emit, "claude"); } @@ -277,7 +277,7 @@ export function canvasAgentMcpCommand() { export function codexConfig(configDir = CONFIG_DIR) { return { mcp_servers: { - "infinite-canvas": { + "yingce": { command: canvasAgentMcp.command, args: canvasAgentMcp.args, env: { FRAMEFIELD_LOCAL_RUNTIME_CONFIG_DIR: configDir }, diff --git a/canvas-agent/src/config.ts b/canvas-agent/src/config.ts index 5e7dfd5d7..05632e710 100644 --- a/canvas-agent/src/config.ts +++ b/canvas-agent/src/config.ts @@ -11,7 +11,7 @@ export const DEFAULT_PORT = LOCAL_RUNTIME_DEFAULT_PORT; export const CONFIG_DIR = startupConfigDirectory(); export const CONFIG_FILE = path.join(CONFIG_DIR, "canvas-agent.json"); export const VERSION = readPackageVersion(); -export const AGENT_PROMPT = "你正在帮助用户操作影策网页画布。需要改动画布时优先使用已配置的 infinite-canvas MCP 工具:先 canvas_get_state 读取当前画布,再根据任务使用 canvas_create_text_node、canvas_generate_text、canvas_generate_image、canvas_generate_video、canvas_generate_audio、canvas_create_generation_flow、canvas_run_generation、canvas_update_node、canvas_connect_nodes 等通用工具;复杂批量改动再用 canvas_apply_ops,删除连线可用 delete_connections。需要生成内容时直接调用对应生成工具,不要绑定特定业务场景。即使用户明确点名 Dreamina/即梦,本机 Canvas Agent 也必须通过 canvas_generate_image 或 canvas_generate_video 进入共享 GenerationTask;本机图片模型使用 model=local:dreamina-cli:5.0 这类产品模型值,用户选择自动分辨率时使用 quality=auto;禁止调用 direct dreamina_cli provider tool。不要模拟鼠标点击,不要要求用户手动复制 JSON。"; +export const AGENT_PROMPT = "你正在帮助用户操作影策网页画布。需要改动画布时优先使用已配置的 yingce MCP 工具:先 canvas_get_state 读取当前画布,再根据任务使用 canvas_create_text_node、canvas_generate_text、canvas_generate_image、canvas_generate_video、canvas_generate_audio、canvas_create_generation_flow、canvas_run_generation、canvas_update_node、canvas_connect_nodes 等通用工具;复杂批量改动再用 canvas_apply_ops,删除连线可用 delete_connections。需要生成内容时直接调用对应生成工具,不要绑定特定业务场景。即使用户明确点名 Dreamina/即梦,本机 Canvas Agent 也必须通过 canvas_generate_image 或 canvas_generate_video 进入共享 GenerationTask;本机图片模型使用 model=local:dreamina-cli:5.0 这类产品模型值,用户选择自动分辨率时使用 quality=auto;禁止调用 direct dreamina_cli provider tool。不要模拟鼠标点击,不要要求用户手动复制 JSON。"; export type CanvasWorkspaceConfig = { workspacePath: string; activeThreadId?: string; pinnedThreadIds?: string[] }; export type LocalRuntimeConfig = { diff --git a/canvas-agent/src/local-runtime-host.ts b/canvas-agent/src/local-runtime-host.ts index 0bad12ad9..69930528e 100644 --- a/canvas-agent/src/local-runtime-host.ts +++ b/canvas-agent/src/local-runtime-host.ts @@ -95,7 +95,7 @@ export function startLocalRuntime(options: StartLocalRuntimeOptions = {}) { await listening(server); log("Framefield Local Runtime"); log("Runtime is listening on 127.0.0.1"); - log("Codex MCP: codex mcp add infinite-canvas -- npx -y @ddcat666/open-ai-canvas-agent mcp"); + log("Codex MCP: codex mcp add yingce -- npx -y @ddcat666/open-ai-canvas-agent mcp"); } catch (startupError) { sessions.dispose(); const cleanupErrors: unknown[] = []; diff --git a/canvas-agent/test/internal-canvas-mcp-mode.test.ts b/canvas-agent/test/internal-canvas-mcp-mode.test.ts index 75555d296..323316333 100644 --- a/canvas-agent/test/internal-canvas-mcp-mode.test.ts +++ b/canvas-agent/test/internal-canvas-mcp-mode.test.ts @@ -17,7 +17,7 @@ const config: CanvasAgentConfig = { type CommandFactory = () => { command: string; args: string[] }; type CodexConfigFactory = (configDir?: string) => { mcp_servers: { - "infinite-canvas": { + "yingce": { command: string; args: string[]; env?: Record; @@ -44,7 +44,7 @@ test("internal Codex MCP config binds only the parent Runtime config directory", assert.equal(typeof configFactory, "function"); if (!configFactory) return; const configDir = path.resolve("fixture-runtime-config-18871"); - const server = configFactory(configDir).mcp_servers["infinite-canvas"]; + const server = configFactory(configDir).mcp_servers["yingce"]; assert.deepEqual(server.env, { FRAMEFIELD_LOCAL_RUNTIME_CONFIG_DIR: configDir }); assert.equal(server.args.includes("--canvas-only"), true); assert.equal(server.args.some((value) => /token|secret/i.test(value)), false); @@ -55,7 +55,7 @@ test("internal MCP tool timeout covers the Canvas generation continuation window const configFactory = (agentsModule as unknown as { codexConfig?: CodexConfigFactory }).codexConfig; assert.equal(typeof configFactory, "function"); if (!configFactory) return; - const timeoutMs = configFactory().mcp_servers["infinite-canvas"].tool_timeout_sec * 1_000; + const timeoutMs = configFactory().mcp_servers["yingce"].tool_timeout_sec * 1_000; assert.ok(timeoutMs >= 35 * 60 * 1_000, `internal MCP timeout ${timeoutMs}ms must cover the 35-minute generation continuation window`); assert.ok(timeoutMs > 35 * 60 * 1_000, "internal MCP timeout must leave shutdown/response margin after the Canvas continuation window"); }); diff --git a/plugins/infinite-canvas/.codex-plugin/plugin.json b/plugins/yingce/.codex-plugin/plugin.json similarity index 91% rename from plugins/infinite-canvas/.codex-plugin/plugin.json rename to plugins/yingce/.codex-plugin/plugin.json index 5b138660e..22f199362 100644 --- a/plugins/infinite-canvas/.codex-plugin/plugin.json +++ b/plugins/yingce/.codex-plugin/plugin.json @@ -1,5 +1,5 @@ { - "name": "infinite-canvas", + "name": "yingce", "version": "0.1.0", "description": "Use Codex to read and operate Yingce through the local Canvas Agent MCP server.", "author": { @@ -7,7 +7,7 @@ }, "repository": "https://github.com/ddcat-ai/open-ai-canvas", "license": "MIT", - "keywords": ["infinite-canvas", "canvas", "mcp", "agent"], + "keywords": ["yingce", "影策", "canvas", "mcp", "agent"], "skills": "./skills/", "mcpServers": "./.mcp.json", "interface": { diff --git a/plugins/infinite-canvas/.mcp.json b/plugins/yingce/.mcp.json similarity index 87% rename from plugins/infinite-canvas/.mcp.json rename to plugins/yingce/.mcp.json index 1592c25d3..ced07bd97 100644 --- a/plugins/infinite-canvas/.mcp.json +++ b/plugins/yingce/.mcp.json @@ -1,6 +1,6 @@ { "mcpServers": { - "infinite-canvas": { + "yingce": { "command": "npx", "args": ["-y", "@ddcat666/open-ai-canvas-agent", "mcp"], "startup_timeout_sec": 20, diff --git a/plugins/infinite-canvas/README.md b/plugins/yingce/README.md similarity index 90% rename from plugins/infinite-canvas/README.md rename to plugins/yingce/README.md index 1720543af..4349f924b 100644 --- a/plugins/infinite-canvas/README.md +++ b/plugins/yingce/README.md @@ -13,9 +13,9 @@ ```text 请从 https://github.com/ddcat-ai/open-ai-canvas.git 安装影策 Codex 插件。 请 clone 仓库到 ~/plugins/open-ai-canvas,确认 .agents/plugins/marketplace.json 和 -plugins/infinite-canvas/.codex-plugin/plugin.json 都存在。然后运行 +plugins/yingce/.codex-plugin/plugin.json 都存在。然后运行 codex plugin marketplace add ~/plugins/open-ai-canvas, -再运行 codex plugin add infinite-canvas@infinite-canvas-local。 +再运行 codex plugin add yingce@yingce-local。 安装后请校验插件,并告诉我是否需要开启一个新对话来加载新技能和 MCP 工具。 ``` @@ -32,7 +32,7 @@ git clone https://github.com/ddcat-ai/open-ai-canvas.git ~/plugins/open-ai-canva ```bash codex plugin marketplace add ~/plugins/open-ai-canvas -codex plugin add infinite-canvas@infinite-canvas-local +codex plugin add yingce@yingce-local ``` 安装后建议开启一个新的 Codex 对话,让新的 skill 和 MCP 工具完整加载。 @@ -42,9 +42,9 @@ codex plugin add infinite-canvas@infinite-canvas-local 如果你就在影策仓库中调试插件,可以直接添加当前仓库。建议使用仓库绝对路径,避免 Codex 从其他工作目录解析失败: ```bash -cd /path/to/infinite-canvas +cd /path/to/open-ai-canvas codex plugin marketplace add "$(pwd)" -codex plugin add infinite-canvas@infinite-canvas-local +codex plugin add yingce@yingce-local ``` ## 使用 diff --git a/plugins/infinite-canvas/assets/icon.png b/plugins/yingce/assets/icon.png similarity index 100% rename from plugins/infinite-canvas/assets/icon.png rename to plugins/yingce/assets/icon.png diff --git a/plugins/infinite-canvas/skills/canvas/SKILL.md b/plugins/yingce/skills/canvas/SKILL.md similarity index 92% rename from plugins/infinite-canvas/skills/canvas/SKILL.md rename to plugins/yingce/skills/canvas/SKILL.md index 682958acf..7c8d427b5 100644 --- a/plugins/infinite-canvas/skills/canvas/SKILL.md +++ b/plugins/yingce/skills/canvas/SKILL.md @@ -5,7 +5,7 @@ description: 操作影策当前网页画布,读取节点、选区、创建文 # 影策画布 -你正在帮助用户操作影策网页画布。需要理解或改动画布时,优先使用已配置的 `infinite-canvas` MCP 工具;不要让用户手动复制 JSON、URL 或 token。 +你正在帮助用户操作影策网页画布。需要理解或改动画布时,优先使用已配置的 `yingce` MCP 工具;不要让用户手动复制 JSON、URL 或 token。 ## 工作流 diff --git a/plugins/infinite-canvas/skills/open-canvas/SKILL.md b/plugins/yingce/skills/open-canvas/SKILL.md similarity index 100% rename from plugins/infinite-canvas/skills/open-canvas/SKILL.md rename to plugins/yingce/skills/open-canvas/SKILL.md