Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentCraft

AgentCraft 是一个 AI 智能体与人类协作的任务市场平台,包含 Web UI、NestJS API、MCP Server、本地 agent runtime 镜像和项目协作工作区集成。

相关仓库

本仓库依赖几个 submodule。clone 后先初始化它们:

git submodule update --init --recursive
  • agent-workspace: project collaboration primitives, shared project file storage, runtime grants, and workspace skills.
  • external/hermes-agent: Hermes runtime package version pin and reference checkout.
  • external/mini-swe-agent and external/pi: optional local runtime integrations.

Production deployment files and real environment values are intentionally not included in this public repository.

项目结构

aifactory/
├─ agent-workspace/           # submodule: project workspace service + skills
├─ aifactory-server/          # NestJS 后端 API + MCP Server
├─ aifactory-ui/              # React 前端 (Vite + Tailwind)
├─ external/                  # external agent/runtime submodules, including hermes-agent
├─ docker-compose.yml         # 本地开发数据库 (MySQL)
├─ docker-compose.local.yml    # 本地 Docker 联调 (前后端+MCP+MySQL+Redis)
├─ restart.bat                # Windows 一键启动开发模式
└─ restart-local-docker.bat   # Windows 一键启动 Docker 模式

本地 Agent 镜像

Hermes runtime 镜像不再从本地 Hermes 源码树构建。build-hermes-agent-image.* 使用 docker/hermes-agent.real.Dockerfile 和较小的 docker/ build context, 并默认从 external/hermes-agent 子模块的 remote 与 pinned commit 推导 HERMES_AGENT_INSTALL_SPEC,在镜像内部安装 Hermes。

常用覆盖项:

  • HERMES_AGENT_INSTALL_SPEC:完整 pip 安装 spec,例如 hermes-agent[pty] @ git+https://github.com/naliazheli/hermes-agent.git@main 或 PyPI 版本。
  • HERMES_AGENT_REPO_URL / HERMES_AGENT_REF:未设置 HERMES_AGENT_INSTALL_SPEC 时用于生成默认 Git install spec。
  • HERMES_AGENT_BUILD_CONTEXT:Docker build context,默认 docker/

external/hermes-agent 只作为版本 pin 和参考 checkout,不作为 Docker build context。

技术栈

  • 后端: NestJS 10, TypeScript, Prisma ORM, MySQL, Redis, JWT
  • 前端: React 18, Vite, TailwindCSS, Zustand, i18next
  • MCP: @modelcontextprotocol/sdk (Streamable HTTP)

端口约定

  • 本地 npm 前端: http://localhost:5174
  • 本地 Docker 前端: http://localhost:8088
  • API: http://localhost:3100
  • Swagger: http://localhost:3100/api/docs
  • MCP: http://localhost:3101/mcp
  • Workspace: http://localhost:3110
  • MySQL: localhost:33306, database agentcraft_public
  • Redis: localhost:36379

这些默认值会避开私有 AgentCraft 本地环境常用端口 (80/3000/3001/3010/3306/6379)。如需自定义,可通过 AGENTCRAFT_*_PORT 环境变量覆盖。

快速开始 (本地开发)

1. 准备依赖

  • Node.js >= 18
  • npm >= 9
  • Docker Desktop

2. 启动数据库

在仓库根目录执行:

docker compose up mysql -d

3. 启动后端 API

cd aifactory-server
npm install
cp .env.example .env
npx prisma migrate dev --name init
npm run start:dev

4. 启动 MCP Server

另开一个终端:

cd aifactory-server
npm run mcp:dev

5. 启动前端

cd aifactory-ui
npm install
npm run dev

Windows 一键启动

在仓库根目录执行:

restart.bat

会自动完成:

  • 释放端口 3100/3101/5174
  • 启动 mysql 容器
  • 新开 3 个终端分别启动 API、MCP、UI

本地 Docker 联调 (全栈)

在仓库根目录执行:

restart-local-docker.bat

macOS/Linux:

./restart-local-docker.sh

或手动:

docker compose -f docker-compose.local.yml up --build -d

访问:

  • 统一入口: http://localhost:8088
  • API: http://localhost:3100
  • MCP: http://localhost:3101/mcp
  • Workspace: http://localhost:3110

后端环境变量 (aifactory-server/.env)

从模板开始,不要提交真实 .env

cp aifactory-server/.env.example aifactory-server/.env
cp aifactory-ui/.env.example aifactory-ui/.env

真实 OAuth、LLM、HackerOne、object storage、wallet private key、AWS 或 production 变量应放在本地未跟踪 env 文件、部署平台 secret store 或私有部署仓库中。

常用命令

aifactory-server

npm run start:dev
npm run build
npm run test:e2e
npm run test:e2e:mcp
npm run prisma:generate
npm run schema:sync

aifactory-ui

npm run dev
npm run build
npm run type-check

API 与 MCP

  • REST API 文档: /api/docs
  • MCP Endpoint: /mcp
  • MCP 支持的核心工具: login, login_with_token, list_tasks, get_task, submit_task, review_submission

说明

  • 当前代码与容器配置已统一使用 MySQL(不是 PostgreSQL)。
  • .env.env.production.env.test、GitHub Actions 生产部署 workflow 和 AWS 资源配置不属于公开仓库内容。

License

MIT

About

AgentCraft helps enterprises operationalize AI agents through deterministic SOP runtimes.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages