Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 33 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ MetaBot 不是只绑定一家 — 三大顶级 AI 编码 Agent 都内置原生
{ "name": "vegeta", "engine": "codex", "codex": { "model": "gpt-5.4-codex" } }
```

Codex 支持通过本机 `codex exec --json` CLI 接入,并使用 `codex exec resume` 续接聊天会话。启动 MetaBot 前,请先执行 `codex login` 或配置好 Codex API key/profile。MetaBot 会把 `/metaskill ...` 等飞书 slash skill 调用转成 Codex `$metaskill ...` 显式技能调用
Codex 支持通过本机 `codex exec --json` CLI 接入,并使用 `codex exec resume` 续接聊天会话。启动 MetaBot 前,请先执行 `codex login` 或配置好 Codex API key/profile。MetaBot 会把飞书侧的 `/<skill-name> ...` 调用统一转成 Codex 的 `$<skill-name> ...` 显式技能调用(例如安装了 `/metaschedule` 后,Codex 会收到 `$metaschedule ...`

### Codex 迁移:复用 `.claude` 配置

Expand Down Expand Up @@ -114,7 +114,7 @@ Claude/Kimi 和 Codex 的发现路径不同。MetaBot 安装、更新和 Skill H
| **代码能力** | 完整 Agent SDK(Read/Write/Edit/Bash/MCP) | 完整 | 无 |
| **多 Agent** | Agent 总线 + 任务委派 + 运行时创建 | 单会话 | 有,但封闭生态 |
| **共享记忆** | MetaMemory 全文搜索 + 自动同步飞书知识库 | 无 | 无 |
| **定时任务** | Cron 调度,跨重启持久化 | | 有 |
| **定时任务** | CC 原生 `CronCreate` / `/loop` 即开即用,可选 `/metaschedule` 跨重启持久化 | 仅原生 `CronCreate` / `/loop` | 有 |
| **自主运行** | bypassPermissions / yoloMode,全自动 | 需要人工确认 | 受限于 workflow |
| **开源** | MIT,完全可控 | CLI 开源 | 闭源 SaaS |

Expand All @@ -128,9 +128,9 @@ Claude/Kimi 和 Codex 的发现路径不同。MetaBot 安装、更新和 Skill H
└─→ Codex CLI(codex exec --json 子进程)
MetaMemory(共享知识库)
MetaSkill(Agent 工厂,产出 CLAUDE.md + AGENTS.md)
定时调度器(Cron 任务)
定时调度(CC 原生 CronCreate / /loop;可选 /metaschedule 持久化)
Agent 总线(跨 Bot 通信,引擎无关)
Agent 工厂(可选 /metaskill,按需安装)
```

引擎层已抽象 —— Kimi 事件流和 Codex JSONL 都被翻译成 Claude 形状的 `SDKMessage`,流式卡片、工具调用追踪、MetaMemory/调度/Agent 总线在三种引擎下表现一致。
Expand All @@ -149,7 +149,7 @@ MetaBot 支持 4 种方式与你的 Agent 团队交互:
|------|------|------|
| **受监督** | IM Bridge | 实时流式卡片展示每一步工具调用。人类看到 Agent 做的一切 |
| **自我进化** | MetaMemory | 共享知识库。Agent 写入学到的东西,其他 Agent 检索引用 |
| **Agent 组织** | MetaSkill + 调度器 + Agent 总线 | 一个命令生成完整 Agent 团队。Agent 互相委派任务、创建新 Agent |
| **Agent 组织** | Agent 总线 + CC 原生调度(可选 MetaSkill / MetaSchedule) | Agent 互相委派任务、按需创建新 Agent;用 CC 内置 `CronCreate` / `/loop` 即可定时;要跨重启可装可选 `/metaschedule` |

## Web UI

Expand All @@ -175,11 +175,12 @@ MetaBot 支持 4 种方式与你的 Agent 团队交互:
| 组件 | 一句话说明 |
|------|-----------|
| **三引擎内核** | 每个 Bot 独立选 Claude Code / Kimi Code / Codex CLI — 完整工具链(Read/Write/Edit/Bash/Glob/Grep/WebSearch/MCP),自主模式运行 |
| **MetaSkill** | Agent 工厂。`/metaskill` 一键生成可迁移的 Agent 团队(`CLAUDE.md` / `AGENTS.md` + skills) |
| **CC 原生调度** | 直接用 Claude Code 内置的 `CronCreate` / `/loop` —— 即开即用,会话内最简单 |
| **MetaMemory** | 内嵌 SQLite 知识库,全文搜索,Web UI,变更自动同步到飞书知识库 |
| **IM Bridge** | 飞书、Telegram、微信(含手机端)对话任意 Agent,流式卡片 + 工具调用追踪 |
| **Agent 总线** | Agent 通过 `mb talk` 互相对话,运行时创建/删除 Bot |
| **定时调度器** | Cron 周期任务 + 一次性延迟任务,跨重启持久化,忙时自动重试 |
| **MetaSchedule(可选)** | 跨重启的服务端定时调度器,Cron + 一次性延迟,HTTP API + `mb schedule` CLI。默认不装,按需 `cp src/skills/metaschedule/SKILL.md` 启用 |
| **MetaSkill(可选)** | Agent 工厂。`/metaskill` 一键生成可迁移的 Agent 团队。默认不装,按需 `cp src/skills/metaskill/` 启用 |
| **飞书 Lark CLI** | 200+ 命令覆盖文档、消息、日历、任务等 11 大业务域,19 个 AI Agent Skills |
| **Skill Hub** | 跨实例技能共享注册中心。`mb skills` 发布、发现、安装技能,FTS5 全文搜索 |
| **Peers 联邦** | 跨实例 Bot 发现和任务路由,`mb talk alice/backend-bot` 自动路由 |
Expand Down Expand Up @@ -223,22 +224,30 @@ MetaBot 支持 4 种方式与你的 Agent 团队交互:
搜索一下 MetaMemory 里有没有关于 API 设计规范的文档。
```

### MetaSkill — Agent 工厂
### 定时任务(Claude Code 原生)

直接用 CC 内置的 `CronCreate` 和 `/loop`,会话内即开即用:

```
/metaskill 给这个 React Native 项目创建一个 agent 团队 ——
我需要一个前端专家、一个后端 API 专家、一个 code reviewer
设个每天早上9点的定时任务:搜索 Hacker News 和 TechCrunch 的 AI 新闻,
总结 Top 5,保存到 MetaMemory
```

### 定时任务

```
设一个每天早上9点的定时任务:搜索 Hacker News 和 TechCrunch 的 AI 新闻,
总结 Top 5,保存到 MetaMemory。
/loop 每隔 5 分钟检查一下 PR #123 的 CI 状态,跑完为止
```

> 想跨重启活下来、其他 Bot 也能看到/取消?装可选的 `/metaschedule` skill
> (`cp src/skills/metaschedule/SKILL.md ~/.claude/skills/metaschedule/`),
> 就能用 `mb schedule cron` / HTTP API 提交到 MetaBot 服务端调度器。

### MetaSkill — Agent 工厂(可选)

`/metaskill` 默认不装。先启用:`cp -r src/skills/metaskill ~/.claude/skills/`,然后:

```
设一个每周一早上8点的任务:review 上周的 git commit,生成进度报告。
/metaskill 给这个 React Native 项目创建一个 agent 团队 ——
我需要一个前端专家、一个后端 API 专家、一个 code reviewer。
```

### Agent-to-Agent 协作
Expand All @@ -260,7 +269,8 @@ MetaBot 支持 4 种方式与你的 Agent 团队交互:
```

```
/metaskill 创建一个 "daily-ops" agent,每天早上8点自动运行:
(先 cp src/skills/metaskill 到 ~/.claude/skills/ 以启用 /metaskill)
/metaskill 创建一个 "daily-ops" agent,让它每天早上8点跑:
检查服务健康状态、review 昨晚的错误日志、发一份运维摘要。
```

Expand Down Expand Up @@ -400,11 +410,11 @@ MetaBot 以 `bypassPermissions` 模式运行 Claude Code — 无交互式确认
| `/memory list` | 浏览知识库目录 |
| `/memory search 关键词` | 搜索知识库 |
| `/sync` | 同步 MetaMemory 到飞书知识库 |
| `/metaskill ...` | 生成 Agent 团队、Agent 或 Skill |
| `/metaskill ...` | 生成 Agent 团队、Agent 或 Skill(可选 skill,默认不装) |
| `/help` | 帮助 |

> **模型切换**:每个会话可独立设置模型。在模型名后加 `[1m]` 可启用 1M 上下文窗口(仅 Opus 4.7/4.6、Sonnet 4.6 支持),例如 `/model claude-opus-4-7[1m]`。OAuth/Pro-Max 登录用户 SDK 会丢弃 beta flag,`[1m]` 后缀是唯一可靠的 1M 开启方式。
> **Codex Skill 调用**:飞书里仍然可以发 `/metaskill ...`。当当前会话是 Codex 引擎时,MetaBot 会自动转换为 Codex 识别的 `$metaskill ...`。
> **Codex Skill 调用**:飞书里发的 `/<skill> ...`Codex 会话下会被 MetaBot 自动改写成 `$<skill> ...`,例如 `$metaschedule ...`。

<details>
<summary><strong>API 参考</strong></summary>
Expand Down Expand Up @@ -453,10 +463,13 @@ mm folders # 文件夹树
# Agent 总线
mb bots # 列出所有 Bot
mb talk <bot> <chatId> <prompt> # 与 Bot 对话
mb schedule list # 列出定时任务
mb schedule cron <bot> <chatId> '<cron>' <prompt> # 创建周期性任务
mb stats # 费用和使用统计

# 定时任务 — 推荐 CC 原生:直接在 Claude Code 里用 CronCreate / /loop。
# 跨重启的服务端调度(mb schedule list / cron / cancel / pause / resume)
# 由可选 /metaschedule skill 提供,按需安装:
# cp src/skills/metaschedule/SKILL.md ~/.claude/skills/metaschedule/

# 飞书 Lark CLI(飞书 Bot 专属)
lark-cli docs +fetch --doc <飞书链接>
lark-cli im +messages-send --chat-id oc_xxx --text "Hi"
Expand Down
55 changes: 35 additions & 20 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ MetaBot isn't locked to one vendor — all three top AI coding agents ship with
{ "name": "vegeta", "engine": "codex", "codex": { "model": "gpt-5.4-codex" } }
```

Codex support uses the local `codex exec --json` CLI and resumes chat sessions with `codex exec resume`. Authenticate once with `codex login` (or configure your Codex API key/profile) before starting MetaBot. MetaBot translates Feishu slash-skill invocations like `/metaskill ...` into Codex's explicit `$metaskill ...` skill syntax.
Codex support uses the local `codex exec --json` CLI and resumes chat sessions with `codex exec resume`. Authenticate once with `codex login` (or configure your Codex API key/profile) before starting MetaBot. MetaBot translates Feishu slash-skill invocations like `/<skill> ...` into Codex's explicit `$<skill> ...` skill syntax (e.g. once `/metaschedule` is installed, Codex receives `$metaschedule ...`).

### Codex Migration: Reuse `.claude` Config

Expand Down Expand Up @@ -114,7 +114,7 @@ Run your frontend bot on Claude and your backend bot on Kimi? Totally fine. The
| **Code capabilities** | Full Agent SDK (Read/Write/Edit/Bash/MCP) | Full | None |
| **Multi-agent** | Agent Bus + task delegation + runtime creation | Single session | Yes, but closed ecosystem |
| **Shared memory** | MetaMemory with FTS + auto-sync to Wiki | None | None |
| **Scheduling** | Cron jobs, persisted across restarts | None | Yes |
| **Scheduling** | CC-native `CronCreate` / `/loop` work out of the box; opt-in `/metaschedule` for cross-restart persistence | Native `CronCreate` / `/loop` only | Yes |
| **Autonomous** | bypassPermissions / yoloMode, fully automated | Requires human approval | Limited to workflows |
| **Open source** | MIT, fully controllable | CLI is open source | Closed-source SaaS |

Expand All @@ -128,9 +128,9 @@ Feishu/TG/WeChat → IM Bridge → Engine Router ──┬─→ Claude Code Age
└─→ Codex CLI (codex exec --json subprocess)
MetaMemory (shared knowledge)
MetaSkill (agent factory, emits CLAUDE.md + AGENTS.md)
Scheduler (cron tasks)
Scheduling (CC-native CronCreate / /loop; opt-in /metaschedule for persistence)
Agent Bus (cross-bot comms, engine-agnostic)
Agent Factory (opt-in /metaskill)
```

The engine layer is abstracted — Kimi's event stream and Codex's JSONL stream are both translated into Claude-shaped `SDKMessage` objects, so streaming cards, tool-call tracking, MetaMemory/Scheduler/Agent Bus behave identically across all three engines.
Expand All @@ -147,7 +147,7 @@ The engine layer is abstracted — Kimi's event stream and Codex's JSONL stream
|--------|-----------|-------------|
| **Supervised** | IM Bridge | Real-time streaming cards show every tool call. Humans see everything agents do |
| **Self-Improving** | MetaMemory | Shared knowledge store. Agents write what they learn, other agents retrieve it |
| **Agent Organization** | MetaSkill + Scheduler + Agent Bus | One command generates a full agent team. Agents delegate tasks and create new agents |
| **Agent Organization** | Agent Bus + CC-native scheduling (opt-in MetaSkill / MetaSchedule) | Agents delegate tasks and spin up new bots on demand; CC's built-in `CronCreate` / `/loop` cover scheduling, and opt-in `/metaschedule` adds cross-restart persistence |

Full-featured browser-based chat interface. Access at `https://your-server/web/` after starting MetaBot.

Expand All @@ -171,11 +171,12 @@ Full-featured browser-based chat interface. Access at `https://your-server/web/`
| Component | Description |
|-----------|-------------|
| **Triple Engine Kernel** | Each bot independently chooses Claude Code / Kimi Code / Codex CLI — full tool stack (Read/Write/Edit/Bash/Glob/Grep/WebSearch/MCP) in autonomous mode |
| **MetaSkill** | Agent factory. `/metaskill` generates portable agent teams (`CLAUDE.md` / `AGENTS.md` + skills) |
| **CC-Native Scheduling** | Use Claude Code's built-in `CronCreate` and `/loop` directly — zero MetaBot setup, runs in-session |
| **MetaMemory** | Embedded SQLite knowledge store with full-text search, Web UI, auto-syncs to Feishu Wiki |
| **IM Bridge** | Chat with any agent from Feishu, Telegram, or WeChat (including mobile). Streaming cards + tool call tracking |
| **Agent Bus** | Agents talk to each other via `mb talk`. Create/remove bots at runtime |
| **Task Scheduler** | Cron recurring tasks + one-time delays, persisted across restarts, auto-retries when busy |
| **MetaSchedule (opt-in)** | Persistent server-side scheduler — cron + one-shot, survives restarts, exposes HTTP API + `mb schedule` CLI. Not installed by default; enable with `cp src/skills/metaschedule/SKILL.md ~/.claude/skills/metaschedule/` |
| **MetaSkill (opt-in)** | Agent factory. `/metaskill` generates portable agent teams. Not installed by default; enable with `cp -r src/skills/metaskill ~/.claude/skills/` |
| **Feishu Lark CLI** | 200+ commands covering docs, messaging, calendar, tasks, and 8 more domains. 19 AI Agent Skills |
| **Skill Hub** | Cross-instance skill sharing registry. `mb skills` to publish, discover, and install skills with FTS5 search |
| **Peers** | Cross-instance bot discovery and task routing. `mb talk alice/backend-bot` routes automatically |
Expand Down Expand Up @@ -220,23 +221,33 @@ under /projects/deployment.
Search MetaMemory for our API design conventions.
```

### MetaSkill — Agent Factory
### Scheduling (Claude Code native)

```
/metaskill Create an agent team for this React Native project —
I need a frontend specialist, a backend API specialist, and a code reviewer.
```

### Scheduling
Use CC's built-in `CronCreate` and `/loop` — zero setup, runs inside the session:

```
Schedule a daily task at 9am: search Hacker News and TechCrunch for AI news,
summarize the top 5 stories, and save the summary to MetaMemory.
```

```
Set up a weekly Monday 8am task: review last week's git commits, generate
a progress report, and save it to MetaMemory under /reports.
/loop poll PR #123's CI status every 5 minutes until it finishes.
```

> Need the schedule to survive MetaBot restarts and be visible to other bots?
> Install the opt-in `/metaschedule` skill
> (`cp src/skills/metaschedule/SKILL.md ~/.claude/skills/metaschedule/`),
> then use `mb schedule cron` / the HTTP API to submit jobs to MetaBot's
> persistent scheduler.

### MetaSkill — Agent Factory (opt-in)

`/metaskill` is not installed by default. Enable it first:
`cp -r src/skills/metaskill ~/.claude/skills/`. Then:

```
/metaskill Create an agent team for this React Native project —
I need a frontend specialist, a backend API specialist, and a code reviewer.
```

### Agent-to-Agent
Expand All @@ -261,6 +272,7 @@ progress against these requirements.
```

```
(First copy src/skills/metaskill into ~/.claude/skills/ to enable /metaskill)
/metaskill Create a "daily-ops" agent that runs every morning at 8am:
checks service health, reviews overnight error logs, and posts a summary.
```
Expand Down Expand Up @@ -401,11 +413,11 @@ MetaBot runs Claude Code in `bypassPermissions` mode — no interactive approval
| `/memory list` | Browse knowledge tree |
| `/memory search <query>` | Search knowledge base |
| `/sync` | Sync MetaMemory to Feishu Wiki |
| `/metaskill ...` | Generate agent teams, agents, or skills |
| `/metaskill ...` | Generate agent teams, agents, or skills (opt-in skill — not installed by default) |
| `/help` | Show help |

> **Model switching**: Each session can pick its own model. Append `[1m]` to the model name to enable the 1M context window (only Opus 4.7/4.6 and Sonnet 4.6 support it), e.g. `/model claude-opus-4-7[1m]`. OAuth/Pro-Max users must use this suffix — the SDK silently drops beta headers under that auth mode.
> **Codex skills**: In Feishu you can still send `/metaskill ...`. When the session is on Codex, MetaBot converts it to Codex's `$metaskill ...` form.
> **Codex skills**: Slash invocations like `/<skill> ...` are auto-rewritten to Codex's `$<skill> ...` form whenever the active session runs on Codex.

<details>
<summary><strong>API Reference</strong></summary>
Expand Down Expand Up @@ -454,10 +466,13 @@ mm folders # folder tree
# Agent Bus
mb bots # list all bots
mb talk <bot> <chatId> <prompt> # talk to a bot
mb schedule list # list scheduled tasks
mb schedule cron <bot> <chatId> '<cron>' <prompt> # recurring task
mb stats # cost & usage stats

# Scheduling — prefer Claude Code's native CronCreate / /loop directly in chat.
# The persistent server-side scheduler (`mb schedule list / cron / cancel /
# pause / resume`) is exposed by the opt-in /metaschedule skill. Enable with:
# cp src/skills/metaschedule/SKILL.md ~/.claude/skills/metaschedule/

# Feishu Lark CLI (Feishu bots only)
lark-cli docs +fetch --doc <feishu-url>
lark-cli im +messages-send --chat-id oc_xxx --text "Hi"
Expand Down
Loading
Loading