docs(readme): keep the first screen to title, tagline, badges, and links (#583)

Move the approval and checkpoint code sample out of the first screen into a collapsed block under the getting-started section in all four README copies, so the top of the page carries identity and trust signals only.
This commit is contained in:
Jack Chen authored and GitHub committed 2026-09-05 13:20:55 +08:00
1 parent 6815e891e9
commit e3a64a2330
4 files changed
+120 -100

No files matched your search

+30 -25
View File
@@ -21,31 +21,6 @@
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License"></a>
</p>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// Your keys and your endpoint: a hosted provider, or a local server through baseURL.
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// Consequential tool calls (file writes, shell) pause for a human decision.
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: 'Reconcile overdue invoices.', toolPreset: 'readwrite' }],
})
// The coordinator plans the task DAG from the goal; the checkpoint store keeps the run durable.
const result = await oma.runTeam(team, 'Find overdue invoices and draft the reminders.', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// result.status?.code === 'suspended' until a reviewer decides result.pendingApprovals,
// each bound to a hash of exactly what the reviewer was shown.
```
<p align="center">
<a href="https://open-multi-agent.com/?utm_source=github&utm_medium=readme">Website</a> ·
<a href="https://open-multi-agent.com/getting-started/introduction/?utm_source=github&utm_medium=readme">Docs</a> ·
@@ -132,6 +107,36 @@ console.log(result.totalTokenUsage)
</details>
<details>
<summary>Pause consequential tool calls for approval</summary>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// Your keys and your endpoint: a hosted provider, or a local server through baseURL.
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// Consequential tool calls (file writes, shell) pause for a human decision.
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: 'Reconcile overdue invoices.', toolPreset: 'readwrite' }],
})
// The coordinator plans the task DAG from the goal; the checkpoint store keeps the run durable.
const result = await oma.runTeam(team, 'Find overdue invoices and draft the reminders.', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// result.status?.code === 'suspended' until a reviewer decides result.pendingApprovals,
// each bound to a hash of exactly what the reviewer was shown.
```
</details>
Set `OPENAI_API_KEY` to run this example. [Providers](docs/providers.md) covers other hosted models, local servers, OpenAI-compatible endpoints, and AI SDK providers.
`runTeam()` plans from a goal, `runAgent()` runs a single agent, and `runTasks()` executes an explicit pipeline. The [Core package guide](packages/core/README.md) walks through all three modes, provider and credential setup, and the production checklist. The [example index](packages/core/examples/README.md) lists 50+ runnable examples across basics, cookbook workflows, patterns, providers, and integrations.
+30 -25
View File
@@ -21,31 +21,6 @@
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License"></a>
</p>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// 密钥与端点都是你自己的:托管模型,或通过 baseURL 接本地服务。
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// 有实际副作用的工具调用(写文件、执行 shell)挂起,等待人工决定。
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: '核对逾期发票。', toolPreset: 'readwrite' }],
})
// Coordinator 从目标规划任务 DAG;checkpoint store 让整次运行可持久化。
const result = await oma.runTeam(team, '找出逾期发票并起草催款提醒。', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// 在审批人处理 result.pendingApprovals 之前,result.status?.code 保持为 'suspended';
// 每条待审批请求都绑定审批人实际看到内容的哈希。
```
<p align="center">
<a href="https://open-multi-agent.com/zh/?utm_source=github&utm_medium=readme">官网</a> ·
<a href="https://open-multi-agent.com/zh/getting-started/introduction/?utm_source=github&utm_medium=readme">文档</a> ·
@@ -131,6 +106,36 @@ console.log(result.totalTokenUsage)
</details>
<details>
<summary>让有副作用的工具调用挂起等待审批</summary>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// 密钥与端点都是你自己的:托管模型,或通过 baseURL 接本地服务。
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// 有实际副作用的工具调用(写文件、执行 shell)挂起,等待人工决定。
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: '核对逾期发票。', toolPreset: 'readwrite' }],
})
// Coordinator 从目标规划任务 DAG;checkpoint store 让整次运行可持久化。
const result = await oma.runTeam(team, '找出逾期发票并起草催款提醒。', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// 在审批人处理 result.pendingApprovals 之前,result.status?.code 保持为 'suspended';
// 每条待审批请求都绑定审批人实际看到内容的哈希。
```
</details>
运行这段示例需要设置 `OPENAI_API_KEY`。其他云端模型、本地服务、OpenAI 兼容端点与 AI SDK provider 的配置见 [Provider 文档](docs/providers.md)。
`runTeam()` 从目标自动规划,`runAgent()` 运行单个 Agent,`runTasks()` 执行显式流水线。三种模式、Provider 与凭证配置、生产检查清单见[核心包使用指南](packages/core/README_zh.md)。[示例索引](packages/core/examples/README.md)收录 50+ 个可运行示例,覆盖基础、cookbook 流程、模式、Provider 与集成。
+30 -25
View File
@@ -21,31 +21,6 @@
<a href="https://codecov.io/gh/open-multi-agent/open-multi-agent"><img src="https://codecov.io/gh/open-multi-agent/open-multi-agent/graph/badge.svg" alt="codecov"></a>
</p>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// Your keys and your endpoint: a hosted provider, or a local server through baseURL.
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// Consequential tool calls (file writes, shell) pause for a human decision.
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: 'Reconcile overdue invoices.', toolPreset: 'readwrite' }],
})
// The coordinator plans the task DAG from the goal; the checkpoint store keeps the run durable.
const result = await oma.runTeam(team, 'Find overdue invoices and draft the reminders.', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// result.status?.code === 'suspended' until a reviewer decides result.pendingApprovals,
// each bound to a hash of exactly what the reviewer was shown.
```
<p align="center">
<a href="https://open-multi-agent.com/?utm_source=npm&utm_medium=package_readme">Website</a> ·
<a href="https://open-multi-agent.com/getting-started/introduction/?utm_source=npm&utm_medium=package_readme">Docs</a> ·
@@ -109,6 +84,36 @@ const result = await orchestrator.runTeam(team, 'Compare three approaches and re
console.log(result.agentResults.get('coordinator')?.output)
```
<details>
<summary>Pause consequential tool calls for approval</summary>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// Your keys and your endpoint: a hosted provider, or a local server through baseURL.
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// Consequential tool calls (file writes, shell) pause for a human decision.
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: 'Reconcile overdue invoices.', toolPreset: 'readwrite' }],
})
// The coordinator plans the task DAG from the goal; the checkpoint store keeps the run durable.
const result = await oma.runTeam(team, 'Find overdue invoices and draft the reminders.', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// result.status?.code === 'suspended' until a reviewer decides result.pendingApprovals,
// each bound to a hash of exactly what the reviewer was shown.
```
</details>
Set `OPENAI_API_KEY` for this example. For other hosted or local models, see [Providers](#providers).
## Execution Modes
+30 -25
View File
@@ -21,31 +21,6 @@
<a href="https://codecov.io/gh/open-multi-agent/open-multi-agent"><img src="https://codecov.io/gh/open-multi-agent/open-multi-agent/graph/badge.svg" alt="codecov"></a>
</p>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// 密钥与端点都是你自己的:托管模型,或通过 baseURL 接本地服务。
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// 有实际副作用的工具调用(写文件、执行 shell)挂起,等待人工决定。
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: '核对逾期发票。', toolPreset: 'readwrite' }],
})
// Coordinator 从目标规划任务 DAG;checkpoint store 让整次运行可持久化。
const result = await oma.runTeam(team, '找出逾期发票并起草催款提醒。', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// 在审批人处理 result.pendingApprovals 之前,result.status?.code 保持为 'suspended';
// 每条待审批请求都绑定审批人实际看到内容的哈希。
```
<p align="center">
<a href="https://open-multi-agent.com/zh/?utm_source=github&utm_medium=package_readme">官网</a> ·
<a href="https://open-multi-agent.com/zh/getting-started/introduction/?utm_source=github&utm_medium=package_readme">文档</a> ·
@@ -109,6 +84,36 @@ const result = await orchestrator.runTeam(team, 'Compare three approaches and re
console.log(result.agentResults.get('coordinator')?.output)
```
<details>
<summary>让有副作用的工具调用挂起等待审批</summary>
```typescript
import { FileStore, OpenMultiAgent } from '@open-multi-agent/core'
// 密钥与端点都是你自己的:托管模型,或通过 baseURL 接本地服务。
const oma = new OpenMultiAgent({
defaultProvider: 'openai',
defaultModel: 'gpt-5.4',
// 有实际副作用的工具调用(写文件、执行 shell)挂起,等待人工决定。
onToolCall: ({ consequential }) => (consequential ? { action: 'suspend' } : { action: 'allow' }),
})
const team = oma.createTeam('ops', {
name: 'ops',
agents: [{ name: 'operator', systemPrompt: '核对逾期发票。', toolPreset: 'readwrite' }],
})
// Coordinator 从目标规划任务 DAG;checkpoint store 让整次运行可持久化。
const result = await oma.runTeam(team, '找出逾期发票并起草催款提醒。', {
checkpoint: { store: new FileStore('./.oma/run.json') },
})
// 在审批人处理 result.pendingApprovals 之前,result.status?.code 保持为 'suspended';
// 每条待审批请求都绑定审批人实际看到内容的哈希。
```
</details>
该示例需要设置 `OPENAI_API_KEY`。其他云端或本地模型见 [Provider](#provider)。
## 执行模式