Peach: Local-first video metadata scraper and media manager.
feat(web): 界面标注同步到本机 agentation-mcp
longmeidaoe6a8f83826da
diff --git a/docs/FRONTEND.md b/docs/FRONTEND.mdindex d74bede67..a1c850269 100644--- a/docs/FRONTEND.md+++ b/docs/FRONTEND.md@@ -193,8 +193,11 @@ npm --prefix frontend run build:agentation # 在要用它的那份检出里构`peach-react.js` 的压缩改掉了。要在 Tailwind 类名之外给智能体更稳的抓手,给区块加`data-component`(Agentation 默认采集的属性之一)。- Agentation 自己的全局快捷键已关闭,避免与 Peach 的 Esc、方向键冲突,只用工具栏按钮操作。-- 没有接 MCP:标注靠复制粘贴交接。要让智能体直接读标注,另行注册 `agentation-mcp`- 并给组件传 `endpoint`。+- 标注同步到本机 `agentation-mcp`(`http://localhost:4747`),智能体用它的 MCP 工具直接读、+ 回复和标记已处理,不必复制粘贴。服务由注册了它的 Claude Code 会话拉起:+ `claude mcp add agentation -- npx -y agentation-mcp server`,注册后新开的会话才有这组工具。+ 服务没起时标注照存浏览器里,起来后补传;它只接受回环来源的请求,局域网其他设备连不上。+ 浏览器若询问是否允许页面访问本机上的应用和服务,选允许。## 挂载契约diff --git a/frontend/src/dev/agentation.tsx b/frontend/src/dev/agentation.tsxindex dcd1dbcba..bb443fc12 100644--- a/frontend/src/dev/agentation.tsx+++ b/frontend/src/dev/agentation.tsx@@ -6,8 +6,13 @@import { Agentation } from 'agentation';import { createRoot } from 'react-dom/client';+/** 本机 `agentation-mcp` 的 HTTP 端口。服务没起时标注照样存在浏览器里,起来后自动补传。 */+const ENDPOINT = 'http://localhost:4747';+const host = document.createElement('div');host.dataset.agentation = '';document.body.append(host);// Peach 自己占着全局快捷键(Esc 收起面板、方向键翻图),标注工具只走工具栏按钮。-createRoot(host).render(<Agentation appName="Peach" enableKeyboardShortcuts={false} />);+createRoot(host).render(+ <Agentation appName="Peach" endpoint={ENDPOINT} enableKeyboardShortcuts={false} />,+);