Skip to content
Andy963Public

About

A self-hosted web console that orchestrates Codex/Claude agents around an Advisor/Worker chat and task queue, with remote control of agents and tasks via the web UI and a Telegram bot.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ADS (Agent Dispatch & Orchestration System)

License: MIT Node Version

ADS 是一个面向 AI 编程工作流的本地 Web Console 与智能任务编排中枢。它以项目工作区为核心,围绕 Acopilot(方案规划)/ Actions(代码执行)双 Lane 构建 AI 开发工作流。Agent 运行时提供双引擎:默认通过 Codex App-Server 统一接入多 Provider 模型,也可通过 ADS_AGENT_RUNTIME=native 切换到进程内原生运行时(Native Runtime),直连 OpenAI 兼容端点并在项目级沙箱中执行工具。同时还支持可选的独立 Channel Connector。


核心特性

  • 现代 Web Console:基于 Vue 3 + Vite 构建的响应式控制台,支持移动端抽屉导航与桌面端全功能布局。
  • 双 Lane 协作工作流:顶层只有两个 Lane,Actions Lane 内部再分执行角色,两套词汇互不相交(见 ADR 0027)。
    • Acopilot (规划 Lane):专属架构方案研讨,可通过 GitHub Issue/PR 追踪设计与交付。
    • Actions (执行 Lane):专注代码执行、命令运行与文件修改,实时输出紧凑的阶段进展和执行预览。
    • Actions 执行角色:Developer 负责代码执行;Reviewer 在物理隔离的干净上下文中做独立审查,不是顶层 Lane。
  • 双引擎 Agent 运行时:默认经 Codex App-Server 路由多 Provider 模型(包括 Anthropic Claude、Google Gemini 与 DeepSeek);设置 ADS_AGENT_RUNTIME=native 可切换到进程内 Native Runtime,直连 OpenAI 兼容端点并在项目级沙箱内执行工具。支持模型可视化启用/停用与即时配置。
  • 确定性安全拦截:在命令执行边界保护 ADS 自身进程和 SQLite 数据库文件,不依赖模型提示或可变数据库规则。
  • Codex 标准技能体系:全局技能原生对齐 $CODEX_HOME/skills(默认 ~/.codex/skills);支持对话中 <skill_save> 自动沉淀与存量遗留技能无损原子迁移,与 native Codex CLI 完全互通。
  • 原生会话恢复 (Session Resume):零 Token 冗余恢复底层 CLI 真实历史上下文,断线重连自动增量同步。
  • 多模态与语音转写:支持拖拽/粘贴图片预览、语音一键转写 Prompt,以及代码文件与行号跳转预览模态框。
  • 远程 Telegram Connector:可选的独立单用户 Connector,支持文本对话、会话控制与任务终态通知,不将 Telegram 依赖加载到 Core。

快速开始

1. 环境依赖

  • Node.js: >= 24.0.0
  • npm: 确保具备 C++ 编译环境以支持 better-sqlite3 原生模块构建。
  • Agent runtime: 默认后端需本机已安装并配置 codex App-Server CLI;若使用 ADS_AGENT_RUNTIME=native 原生运行时,则无需 codex CLI(命令直接在宿主机上执行,与 Web 工作区的 danger-full-access 语义一致,请仅在单租户自托管环境启用)。

2. 安装与构建

git clone https://github.com/Andy963/ads.git
cd ads
npm install
npm run build

3. 初始化管理员

首次启动前需创建 Web Console 管理员账号:

npm run web:init-admin -- --username admin --password-stdin

4. 启动服务

  • 生产方式启动 Web Console:

    npm start
    # or
    npm run web

    默认监听 http://127.0.0.1:8787。

  • 开发调试模式:

    npm run dev       # 服务端源码监听 (tsx watch)
    npm run dev:web   # 前端 Vite 热重载开发服务器
  • 启动 Telegram Connector(可选):

    export TELEGRAM_BOT_TOKEN="your-bot-token"
    export TELEGRAM_ALLOWED_USER_ID="your-user-id"
    export ADS_CONNECTOR_TOKEN="your-shared-core-token"
    node connectors/telegram/bin/ads-telegram.js start

模块文档索引

详细的模块说明与进阶指南请查阅 docs/ 目录:


常用开发命令

命令 说明
npm run build 完整构建(TypeScript 编译 + 资源同步 + Vite 前端打包)
npm run build:web 仅重新打包前端 Web 资源
npm run build:web:fixture 打包包含浏览器测试 fixture 入口(fixture.html)的前端构建
npm run report:web-bundle 构建并输出前端分包体积报告(初始加载/总量、gzip、构建耗时)
npm run test 运行服务端完整单元测试(Node test runner)
npm run test:web 运行前端 Vitest 组件与状态测试
npm run lint 运行 ESLint 代码规范检查
npm run skills:migrate 运行技能迁移 CLI,将遗留技能非破坏性迁移至 Codex 标准目录
npm run web:reset-admin 重置或创建新的 Web 管理员账号

项目目录结构

ads/
├── connectors/        # Channel Connectors (e.g. telegram)
│   └── telegram/      # Standalone Telegram channel connector
├── server/            # Core backend engine
│   ├── actions/       # Actions 任务总线与执行交付流水线
│   ├── agents/        # Agent 适配器(Codex App-Server / Native Runtime)与执行守护器
│   ├── audio/         # 内置语音识别 (ASR) 与纠错服务
│   ├── middleware/    # Turn 生命周期、中间件与内置安全拦截
│   ├── reviewer/      # Detached Reviewer 独立审查执行器与工具
│   ├── runtime/       # 原生 Agent 运行时引擎与上下文投影
│   ├── scheduler/     # 自然语言定时调度引擎与 Cron 运行时
│   ├── sessions/      # Session, directory, and thread persistence
│   ├── state/         # 全局 SQLite (state.db) 数据表与迁移
│   ├── storage/       # 工作区独立 SQLite (ads.db) 数据表与迁移
│   └── web/           # Web HTTP API、WebSocket Hub 与鉴权系统
├── client/            # 前端 Web Console 源码 (Vue 3 + TypeScript + Vite)
├── docs/              # 模块化详细设计与配置文档
└── tests/             # 后端完整测试用例集

License

MIT License. See LICENSE.

About

A self-hosted web console that orchestrates Codex/Claude agents around an Advisor/Worker chat and task queue, with remote control of agents and tasks via the web UI and a Telegram bot.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages