first commit

This commit is contained in:
2026-08-14 23:41:57 +08:00
commit 086803a8dd
471 changed files with 91938 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# Local Agent
基于 GoGin)的多轮对话 AI AgentChatGPT 风格 Web 界面,可通过真实工具(Shell、文件、Python、Docker、协作容器)自主完成复杂任务。
## 核心特性
- **多轮工具调用**`run_bash` / `read_file` / `write_file` / `run_python` / `list_directory`
- **Docker 操作**`docker_ps` / `docker_exec` / `docker_start` 等,支持远程 Docker Socket
- **协作任务**`run_coop` 调起独立协作容器(pi / pigo / claude 三种引擎),异步完成大型任务
- **流式输出**:SSE 逐 token 输出,超长上下文自动压缩
- **多协议 LLM**OpenAI / Anthropic 兼容接口,Web 界面可切换模型与密钥
## 快速开始
```powershell
go run .
```
打开 http://localhost:8080 ,在 Web 设置中填入 API Key 即可使用。
## 部署
支持三种方式:本地运行、Docker 协作引擎、Tsecbench 托管镜像。
**详细步骤见 [DEPLOY.md](./DEPLOY.md)**(含全部环境变量说明、镜像构建、托管模式与排障)。
## 目录结构
| 路径 | 说明 |
| --- | --- |
| `main.go` / `internal/` | Go 控制层(Agent 核心 + HTTP/WS 服务) |
| `web/static/` | 前端静态资源 |
| `pi-coop/` | pi 协作引擎运行时(默认引擎) |
| `pigo/` | pigo 协作引擎(Go 实现) |
| `claude code/` | Claude Code 协作引擎 |
| `tencent/` | Tsecbench 托管模式镜像构建 |
## 安全提醒
本程序具备命令执行与 Docker 操作能力,云端部署务必设置 `AGENT_AUTH_CODE` 授权码;API Key 通过环境变量注入,切勿提交到仓库。