断点管理器
配有API的轻量级断点管理器,队列工人,以及网络UI.
这个包裹现在住在 packages/breakpoints。 。 。 .
所需资源
- 节点.js 18+
设置
cd packages/breakpoints
npm install
npm run init:db
运行( dev)
cd packages/breakpoints
npm run dev
运行( 安装的 CLI)
breakpoints start
或者分开运行 :
npm run start:api
npm run start:worker
CLI 实例
启动完整系统( API + Web UI + 工人):
breakpoints start
创建断点( 代理) :
breakpoints breakpoint create --question "Need approval?" --title "Approval"
检查状态 :
breakpoints breakpoint status <id>
等待释放 :
breakpoints breakpoint wait <id> --interval 3
配置
环境变量:
PORT(违约3185)WEB_PORT(违约3184)DB_PATH(默认)~/.a5c/breakpoints/db/breakpoints.db(中文(简体) )REPO_ROOT(默认包根/ 当前工作目录)AGENT_TOKEN(可选)HUMAN_TOKEN(可选)WORKER_POLL_MS(2000年违约)WORKER_BATCH_SIZE(默认 10)
API 示例
创建断点( 代理) :
curl -X POST http://localhost:3185/api/breakpoints \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-d '{"agentId":"agent-1","title":"Need review","payload":{"summary":"check this"},"tags":["review"],"ttlSeconds":3600}'
检查状态 :
curl http://localhost:3185/api/breakpoints/<id>/status
有反馈的发布( 人力):
curl -X POST http://localhost:3185/api/breakpoints/<id>/feedback \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HUMAN_TOKEN" \
-d '{"author":"reviewer","comment":"Looks good","release":true}'
断点上下文有效载荷
为了在用户界面中允许上下文渲染,包括 context.files 数组
断点有效载荷:
{
"context": {
"runId": "run-...",
"files": [
{ "path": "docs/plan.md", "format": "markdown" },
{ "path": "api/routes.js", "format": "code", "language": "javascript" }
]
}
}
API通过下列方式服务文件内容:
GET /api/breakpoints/:id/context?path=path/to/file
只提供允许的列表扩展名, 文件必须在 断点有效载荷.
网络用户界面
打开 http://localhost:3184 并提供UI中的人类标志.
电报扩展
Telegram扩展允许您接收断点通知,并通过Telegram与它们互动.
设置
- 通过 @ 父爱 @ info
- 拿回你的宝物
- 配置扩展名 :
breakpoints extension enable telegram --token <bot-token> --username <your-username>
特征
自动通知 :
- 创建新断点时接收通知
- 断点释放时得到通知
连接 :
发送任何斜线命令(例如, /start与你的机器人连接。 机器人会:
- 确认连接
- 显示所有等待断点, 标题、 ID、 运行 ID 和问题
- 提供与断点相互作用的指示
图标 :
list(或ls, (中文(简体) ),waiting) - 显示所有等待断点preview <number>(或show <number>- 查看断点的全部细节file <number>- 按其编号下载上下文文件file <path>- 以路径下载上下文文件raw <path>- 以语法加亮查看文件内置线性( 如果足够短)
复出断点:
- 回复任何断点信息以发布
- 发送断点ID以发布
- 发送任何文本信息以释放最近的断点
示例工作流程 :
You: /start
Bot: Telegram connected. I will notify you about breakpoints here.
🔔 You have 2 waiting breakpoints:
1. Approve refactoring plan
ID: abc-123
Run: run-20260120-refactor
Created: 5 mins ago
Question: Should I proceed with this refactoring?
2. Review API changes
ID: def-456
Run: run-20260120-api
Created: 2 mins ago
Question: Are these API changes acceptable?
You: preview 1
Bot: [Shows full details including all context files]
You: file 1
Bot: [Sends the first context file as document]
You: Looks good, proceed!
Bot: ✅ Breakpoint released
ID: abc-123
Feedback: Looks good, proceed!
中间点 CLI( 方便代理人)
创建断点 :
breakpoints breakpoint create \
--question "Approve process + inputs + main.js?" \
--run-id run-123 \
--title "Approval needed" \
--file ".a5c/runs/run-123/artifacts/process.md,markdown" \
--file ".a5c/runs/run-123/inputs.json,code,json" \
--file ".a5c/runs/run-123/code/main.js,code,javascript"
等待发布(发布时打印出全部细节):
breakpoints breakpoint wait <id> --interval 3
页:1
- 标记作为JSON存储于SQLite;标记过滤使用简单的字符串匹配.
- 排队工人处理TTL过期工作;通知工作被固定.