agentation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgentation Setup
Agentation 配置
Set up the Agentation annotation toolbar in this project.
在本项目中设置Agentation标注工具栏。
Steps
步骤
-
Check if already installed
- Look for in package.json dependencies
agentation - If not found, run (or pnpm/yarn based on lockfile)
npm install agentation
- Look for
-
Check if already configured
- Search for or
<Agentationin src/ or app/import { Agentation } - If found, report that Agentation is already set up and exit
- Search for
-
Detect framework
- Next.js App Router: has or
app/layout.tsxapp/layout.js - Next.js Pages Router: has or
pages/_app.tsxpages/_app.js
- Next.js App Router: has
-
Add the componentFor Next.js App Router, add to the root layout:tsx
import { Agentation } from "agentation"; // Add inside the body, after children: {process.env.NODE_ENV === "development" && <Agentation />}For Next.js Pages Router, add to _app:tsximport { Agentation } from "agentation"; // Add after Component: {process.env.NODE_ENV === "development" && <Agentation />} -
Confirm setup
- Tell the user to run their dev server and look for the Agentation toolbar (floating button in bottom-right corner)
-
检查是否已安装
- 在package.json的依赖项中查找
agentation - 如果未找到,运行(或根据锁定文件使用pnpm/yarn)
npm install agentation
- 在package.json的依赖项中查找
-
检查是否已配置
- 在src/或app/目录中搜索或
<Agentationimport { Agentation } - 如果找到,说明Agentation已完成设置,操作结束
- 在src/或app/目录中搜索
-
检测框架路由类型
- Next.js App Router:存在或
app/layout.tsx文件app/layout.js - Next.js Pages Router:存在或
pages/_app.tsx文件pages/_app.js
- Next.js App Router:存在
-
添加组件对于Next.js App Router,添加到根布局文件:tsx
import { Agentation } from "agentation"; // 添加到body内部,children之后: {process.env.NODE_ENV === "development" && <Agentation />}对于Next.js Pages Router,添加到_app文件:tsximport { Agentation } from "agentation"; // 添加到Component之后: {process.env.NODE_ENV === "development" && <Agentation />} -
确认配置完成
- 告知用户启动开发服务器,然后寻找Agentation工具栏(右下角的悬浮按钮)
Notes
注意事项
- The check ensures Agentation only loads in development
NODE_ENV - Agentation requires React 18
- No additional configuration needed — it works out of the box
- 检查确保Agentation仅在开发环境中加载
NODE_ENV - Agentation需要React 18版本
- 无需额外配置——开箱即用