Files
boss/README.md
2026-03-23 13:17:11 +08:00

146 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Boss
Boss 是一个面向多设备开发协作的 agent control plane。
它的目标是让用户通过对话入口或独立控制台,持续管理多台 Windows、Mac 上的编码代理,支持任务拆分、实时进度、需求变更、审批和审计。
## 当前状态
当前仓库已经包含产品设计文档与一版可直接跑起来的本地控制台:
- [文档总览](./docs/README.md)
- [竞品对比](./docs/competitor-comparison.md)
- [系统架构](./docs/system-architecture.md)
- [MVP 功能清单](./docs/mvp-feature-plan.md)
- [技术选型](./docs/technical-selection.md)
- [消息协议与状态机](./docs/message-protocol-and-state-machine.md)
- [实施路线图](./docs/implementation-roadmap.md)
当前原型能力:
- Fastify API
- 文件持久化状态存储
- SSE 实时事件流
- Web 控制台
- `boss-worker` 模拟执行器
- `boss-worker` 外部命令执行模式,可接本地 Codex / Claude / 自定义脚本
- `npm run smoke` 自动跑端到端验证
- `Dockerfile` + `compose.yaml` 支持容器启动
## 当前推荐方向
- 主控面Web 为主,聊天入口为辅
- ManagerCodex
- 设备侧 workerCodex CLI + Claude Code
- 工具层MCP
- 调度:持久队列或工作流引擎
## 本地运行
```bash
npm install
npm run demo
```
浏览器打开:
```bash
http://127.0.0.1:43210
```
如果你只想单独启动服务端:
```bash
npm run dev
```
如果你想把数据写到独立文件,避免和默认 demo 数据混用:
```bash
BOSS_DATA_FILE=.boss-data/local-dev.json npm run dev
```
如果你要手工启动 worker
```bash
npm run worker -- --name win-a --os windows --capability terminal --capability browser
npm run worker -- --name win-b --os windows --capability terminal --capability test
npm run worker -- --name mac-a --os macos --capability terminal --capability test --capability browser
```
如果你要接真实本地执行器,而不是模拟执行:
```bash
npm run worker -- \
--name mac-codex \
--os macos \
--capability terminal \
--capability test \
--mode command \
--workspace /path/to/project \
--executor ./scripts/codex_executor.sh
```
也可以接 Claude Code 或任意你自己的脚本,只要命令能从环境变量里读取任务上下文:
- `BOSS_TASK_TITLE`
- `BOSS_TASK_DESCRIPTION`
- `BOSS_TASK_KIND`
- `BOSS_TASK_JSON`
- `BOSS_WORKSPACE`
- `BOSS_WORKER_NAME`
仓库里已经自带两个可直接改造的适配脚本:
- `./scripts/codex_executor.sh`
- `./scripts/claude_executor.sh`
例如:
```bash
npm run worker -- \
--name win-claude \
--os windows \
--capability terminal \
--capability browser \
--mode command \
--workspace /path/to/project \
--executor ./scripts/claude_executor.sh
```
一键本地 demo
```bash
npm install
npm run demo
```
这会拉起:
- Web/API 服务
- 2 台 Windows 模拟 worker
- 1 台 Mac 模拟 worker
自动 smoke test
```bash
npm run smoke
```
容器启动:
```bash
docker compose up --build
```
## 当前 v1 能力
- 创建项目会话并持续对话
- 自动生成任务树并调度到不同 worker
- worker 心跳、掉线回收、任务重排
- worker 真实外部命令执行,支持本地命令适配
- 审批、暂停、恢复、取消、重排
- SSE 实时事件流和 Web 控制台
- 会话归档与恢复
- 一键 demo 启动