@open-multi-agent/core 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -53
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +5 -0
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/runner.d.ts +12 -0
- package/dist/agent/runner.d.ts.map +1 -1
- package/dist/agent/runner.js +48 -12
- package/dist/agent/runner.js.map +1 -1
- package/dist/cli/oma.d.ts +10 -2
- package/dist/cli/oma.d.ts.map +1 -1
- package/dist/cli/oma.js +10 -5
- package/dist/cli/oma.js.map +1 -1
- package/dist/dashboard/render-team-run-dashboard.d.ts.map +1 -1
- package/dist/dashboard/render-team-run-dashboard.js +177 -84
- package/dist/dashboard/render-team-run-dashboard.js.map +1 -1
- package/dist/llm/adapter.d.ts +3 -1
- package/dist/llm/adapter.d.ts.map +1 -1
- package/dist/llm/adapter.js +10 -0
- package/dist/llm/adapter.js.map +1 -1
- package/dist/llm/ai-sdk.d.ts +2 -1
- package/dist/llm/ai-sdk.d.ts.map +1 -1
- package/dist/llm/ai-sdk.js +45 -13
- package/dist/llm/ai-sdk.js.map +1 -1
- package/dist/llm/anthropic.d.ts.map +1 -1
- package/dist/llm/anthropic.js +24 -13
- package/dist/llm/anthropic.js.map +1 -1
- package/dist/llm/azure-openai.js +2 -2
- package/dist/llm/azure-openai.js.map +1 -1
- package/dist/llm/bedrock.d.ts.map +1 -1
- package/dist/llm/bedrock.js +29 -19
- package/dist/llm/bedrock.js.map +1 -1
- package/dist/llm/copilot.js +2 -2
- package/dist/llm/copilot.js.map +1 -1
- package/dist/llm/deepseek.d.ts +9 -2
- package/dist/llm/deepseek.d.ts.map +1 -1
- package/dist/llm/deepseek.js +21 -2
- package/dist/llm/deepseek.js.map +1 -1
- package/dist/llm/doubao.d.ts +21 -0
- package/dist/llm/doubao.d.ts.map +1 -0
- package/dist/llm/doubao.js +24 -0
- package/dist/llm/doubao.js.map +1 -0
- package/dist/llm/gemini.d.ts.map +1 -1
- package/dist/llm/gemini.js +32 -18
- package/dist/llm/gemini.js.map +1 -1
- package/dist/llm/mimo.d.ts +24 -0
- package/dist/llm/mimo.d.ts.map +1 -0
- package/dist/llm/mimo.js +30 -0
- package/dist/llm/mimo.js.map +1 -0
- package/dist/llm/openai-common.d.ts +3 -17
- package/dist/llm/openai-common.d.ts.map +1 -1
- package/dist/llm/openai-common.js +66 -42
- package/dist/llm/openai-common.js.map +1 -1
- package/dist/llm/openai.d.ts +22 -1
- package/dist/llm/openai.d.ts.map +1 -1
- package/dist/llm/openai.js +44 -5
- package/dist/llm/openai.js.map +1 -1
- package/dist/llm/reasoning-fallback.d.ts +80 -15
- package/dist/llm/reasoning-fallback.d.ts.map +1 -1
- package/dist/llm/reasoning-fallback.js +45 -12
- package/dist/llm/reasoning-fallback.js.map +1 -1
- package/dist/orchestrator/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/orchestrator.js +35 -2
- package/dist/orchestrator/orchestrator.js.map +1 -1
- package/dist/tool/built-in/bash.d.ts +1 -1
- package/dist/tool/built-in/bash.d.ts.map +1 -1
- package/dist/tool/built-in/bash.js +60 -7
- package/dist/tool/built-in/bash.js.map +1 -1
- package/dist/tool/built-in/file-edit.d.ts.map +1 -1
- package/dist/tool/built-in/file-edit.js +13 -8
- package/dist/tool/built-in/file-edit.js.map +1 -1
- package/dist/tool/built-in/file-read.d.ts.map +1 -1
- package/dist/tool/built-in/file-read.js +9 -4
- package/dist/tool/built-in/file-read.js.map +1 -1
- package/dist/tool/built-in/file-write.d.ts.map +1 -1
- package/dist/tool/built-in/file-write.js +11 -6
- package/dist/tool/built-in/file-write.js.map +1 -1
- package/dist/tool/built-in/fs-walk.d.ts.map +1 -1
- package/dist/tool/built-in/fs-walk.js +6 -3
- package/dist/tool/built-in/fs-walk.js.map +1 -1
- package/dist/tool/built-in/glob.d.ts.map +1 -1
- package/dist/tool/built-in/glob.js +10 -4
- package/dist/tool/built-in/glob.js.map +1 -1
- package/dist/tool/built-in/grep.d.ts.map +1 -1
- package/dist/tool/built-in/grep.js +15 -6
- package/dist/tool/built-in/grep.js.map +1 -1
- package/dist/tool/built-in/path-safety.d.ts +30 -0
- package/dist/tool/built-in/path-safety.d.ts.map +1 -0
- package/dist/tool/built-in/path-safety.js +106 -0
- package/dist/tool/built-in/path-safety.js.map +1 -0
- package/dist/tool/mcp.d.ts.map +1 -1
- package/dist/tool/mcp.js +58 -33
- package/dist/tool/mcp.js.map +1 -1
- package/dist/types.d.ts +108 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/redaction.d.ts +4 -0
- package/dist/utils/redaction.d.ts.map +1 -0
- package/dist/utils/redaction.js +78 -0
- package/dist/utils/redaction.js.map +1 -0
- package/package.json +1 -2
- package/docs/DECISIONS.md +0 -49
- package/docs/cli.md +0 -265
- package/docs/context-management.md +0 -64
- package/docs/featured-partner.md +0 -28
- package/docs/observability.md +0 -56
- package/docs/providers/minimax.md +0 -75
- package/docs/providers.md +0 -80
- package/docs/shared-memory.md +0 -27
- package/docs/tool-configuration.md +0 -152
package/docs/cli.md
DELETED
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
# Command-line interface (`oma`)
|
|
2
|
-
|
|
3
|
-
The package ships a small binary **`oma`** that exposes the same primitives as the TypeScript API: `runTeam`, `runTasks`, plus a static provider reference. It is meant for **shell scripts and CI** (JSON on stdout, stable exit codes).
|
|
4
|
-
|
|
5
|
-
It does **not** provide an interactive REPL, working-directory injection into tools, human approval gates, or session persistence. Those stay in application code.
|
|
6
|
-
|
|
7
|
-
## Installation and invocation
|
|
8
|
-
|
|
9
|
-
After installing the package, the binary is on `PATH` when using `npx` or a local `node_modules/.bin`:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @open-multi-agent/core
|
|
13
|
-
npx oma help
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
From a clone of the repository you need a build first:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm run build
|
|
20
|
-
node dist/cli/oma.js help
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Set the usual provider API keys in the environment (see [README](../README.md#quick-start)); the CLI does not read secrets from flags. MiniMax additionally reads `MINIMAX_BASE_URL` to select the global (`https://api.minimax.io/v1`) or China (`https://api.minimaxi.com/v1`) endpoint.
|
|
24
|
-
|
|
25
|
-
OpenRouter works through the OpenAI-compatible adapter: set `provider` to `openai`, `baseURL` to `https://openrouter.ai/api/v1`, and pass `OPENROUTER_API_KEY` as the agent or orchestrator `apiKey`.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Commands
|
|
30
|
-
|
|
31
|
-
### `oma run`
|
|
32
|
-
|
|
33
|
-
Runs **`OpenMultiAgent.runTeam(team, goal)`**: coordinator decomposition, task queue, optional synthesis.
|
|
34
|
-
|
|
35
|
-
When invoked with `--dashboard`, the **`oma` CLI** writes a static post-execution DAG dashboard HTML to `oma-dashboards/runTeam-<timestamp>.html` under the current working directory (the library does not write files itself; if you want this outside the CLI, call `renderTeamRunDashboard(result)` in application code — see `src/dashboard/render-team-run-dashboard.ts`).
|
|
36
|
-
|
|
37
|
-
The dashboard page loads **Tailwind CSS** (Play CDN), **Google Fonts** (Space Grotesk, Inter, Material Symbols), and **Material Symbols** from the network at view time. Opening the HTML file requires an **online** environment unless you host or inline those assets yourself (a future improvement).
|
|
38
|
-
|
|
39
|
-
| Argument | Required | Description |
|
|
40
|
-
|----------|----------|-------------|
|
|
41
|
-
| `--goal` | Yes | Natural-language goal passed to the team run. |
|
|
42
|
-
| `--team` | Yes | Path to JSON (see [Team file](#team-file)). |
|
|
43
|
-
| `--orchestrator` | No | Path to JSON merged into `new OpenMultiAgent(...)` after any orchestrator fragment from the team file. |
|
|
44
|
-
| `--coordinator` | No | Path to JSON passed as `runTeam(..., { coordinator })` (`CoordinatorConfig`). |
|
|
45
|
-
| `--dashboard` | No | Write a post-execution DAG dashboard HTML to `oma-dashboards/runTeam-<timestamp>.html`. |
|
|
46
|
-
|
|
47
|
-
Global flags: [`--pretty`](#output-flags), [`--include-messages`](#output-flags).
|
|
48
|
-
|
|
49
|
-
### `oma task`
|
|
50
|
-
|
|
51
|
-
Runs **`OpenMultiAgent.runTasks(team, tasks)`** with a fixed task list (no coordinator decomposition).
|
|
52
|
-
|
|
53
|
-
| Argument | Required | Description |
|
|
54
|
-
|----------|----------|-------------|
|
|
55
|
-
| `--file` | Yes | Path to [tasks file](#tasks-file). |
|
|
56
|
-
| `--team` | No | Path to JSON `TeamConfig`. When set, overrides the `team` object inside `--file`. |
|
|
57
|
-
|
|
58
|
-
Global flags: [`--pretty`](#output-flags), [`--include-messages`](#output-flags).
|
|
59
|
-
|
|
60
|
-
### `oma provider`
|
|
61
|
-
|
|
62
|
-
Read-only helper for wiring JSON configs and env vars.
|
|
63
|
-
|
|
64
|
-
- **`oma provider`** or **`oma provider list`** — Prints JSON: built-in provider ids, API key environment variable names, whether `baseURL` is supported, and short notes (e.g. OpenAI-compatible servers, Copilot in CI).
|
|
65
|
-
- **`oma provider template <provider>`** — Prints a JSON object with example `orchestrator` and `agent` fields plus placeholder `env` entries. `<provider>` is one of: `anthropic`, `openai`, `gemini`, `grok`, `minimax`, `deepseek`, `qiniu`, `copilot`.
|
|
66
|
-
|
|
67
|
-
For OpenRouter, use the `openai` provider template, set `baseURL` to `https://openrouter.ai/api/v1`, and set `apiKey` from `OPENROUTER_API_KEY` in your JSON config.
|
|
68
|
-
|
|
69
|
-
Supports `--pretty`.
|
|
70
|
-
|
|
71
|
-
### `oma`, `oma help`, `oma -h`, `oma --help`
|
|
72
|
-
|
|
73
|
-
Prints usage text to stdout and exits **0**.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Configuration files
|
|
78
|
-
|
|
79
|
-
Shapes match the library types `TeamConfig`, `OrchestratorConfig`, `CoordinatorConfig`, and the task objects accepted by `runTasks()`.
|
|
80
|
-
|
|
81
|
-
### Team file
|
|
82
|
-
|
|
83
|
-
Used with **`oma run --team`** (and optionally **`oma task --team`**).
|
|
84
|
-
|
|
85
|
-
**Option A — plain `TeamConfig`**
|
|
86
|
-
|
|
87
|
-
```json
|
|
88
|
-
{
|
|
89
|
-
"name": "api-team",
|
|
90
|
-
"agents": [
|
|
91
|
-
{
|
|
92
|
-
"name": "architect",
|
|
93
|
-
"model": "claude-sonnet-4-6",
|
|
94
|
-
"provider": "anthropic",
|
|
95
|
-
"systemPrompt": "You design APIs.",
|
|
96
|
-
"tools": ["file_read", "file_write"],
|
|
97
|
-
"maxTurns": 6
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
"sharedMemory": true
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
**Option B — team plus default orchestrator settings**
|
|
105
|
-
|
|
106
|
-
```json
|
|
107
|
-
{
|
|
108
|
-
"team": {
|
|
109
|
-
"name": "api-team",
|
|
110
|
-
"agents": [{ "name": "worker", "model": "claude-sonnet-4-6", "systemPrompt": "…" }]
|
|
111
|
-
},
|
|
112
|
-
"orchestrator": {
|
|
113
|
-
"defaultModel": "claude-sonnet-4-6",
|
|
114
|
-
"defaultProvider": "anthropic",
|
|
115
|
-
"maxConcurrency": 3
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Validation rules enforced by the CLI:
|
|
121
|
-
|
|
122
|
-
- Root (or `team`) must be an object.
|
|
123
|
-
- `team.name` is a non-empty string.
|
|
124
|
-
- `team.agents` is a non-empty array; each agent must have non-empty `name` and `model`.
|
|
125
|
-
|
|
126
|
-
Any other fields are passed through to the library as in TypeScript.
|
|
127
|
-
|
|
128
|
-
**SDK-only fields**: `sharedMemoryStore` (custom `MemoryStore` instance) cannot be set from JSON since it is a runtime object. Use `sharedMemory: true` for the default in-memory store, or wire a custom store in TypeScript via `orchestrator.createTeam()`.
|
|
129
|
-
|
|
130
|
-
### Tasks file
|
|
131
|
-
|
|
132
|
-
Used with **`oma task --file`**.
|
|
133
|
-
|
|
134
|
-
```json
|
|
135
|
-
{
|
|
136
|
-
"orchestrator": {
|
|
137
|
-
"defaultModel": "claude-sonnet-4-6"
|
|
138
|
-
},
|
|
139
|
-
"team": {
|
|
140
|
-
"name": "pipeline",
|
|
141
|
-
"agents": [
|
|
142
|
-
{ "name": "designer", "model": "claude-sonnet-4-6", "systemPrompt": "…" },
|
|
143
|
-
{ "name": "builder", "model": "claude-sonnet-4-6", "systemPrompt": "…" }
|
|
144
|
-
],
|
|
145
|
-
"sharedMemory": true
|
|
146
|
-
},
|
|
147
|
-
"tasks": [
|
|
148
|
-
{
|
|
149
|
-
"title": "Design",
|
|
150
|
-
"description": "Produce a short spec for the feature.",
|
|
151
|
-
"assignee": "designer"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"title": "Implement",
|
|
155
|
-
"description": "Implement from the design.",
|
|
156
|
-
"assignee": "builder",
|
|
157
|
-
"dependsOn": ["Design"]
|
|
158
|
-
}
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
- **`dependsOn`** — Task titles (not internal ids), same convention as the coordinator output in the library.
|
|
164
|
-
- Optional per-task fields: `memoryScope` (`"dependencies"` \| `"all"`), `maxRetries`, `retryDelayMs`, `retryBackoff`.
|
|
165
|
-
- **`tasks`** must be a non-empty array; each item needs string `title` and `description`.
|
|
166
|
-
|
|
167
|
-
If **`--team path.json`** is passed, the file’s top-level `team` property is ignored and the external file is used instead (useful when the same team definition is shared across several pipeline files).
|
|
168
|
-
|
|
169
|
-
### Orchestrator and coordinator JSON
|
|
170
|
-
|
|
171
|
-
These files are arbitrary JSON objects merged into **`OrchestratorConfig`** and **`CoordinatorConfig`**. Function-valued options (`onProgress`, `onApproval`, etc.) cannot appear in JSON and are not supported by the CLI.
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Output
|
|
176
|
-
|
|
177
|
-
### Stdout
|
|
178
|
-
|
|
179
|
-
Every invocation prints **one JSON document** to stdout, followed by a newline.
|
|
180
|
-
|
|
181
|
-
**Successful `run` / `task`**
|
|
182
|
-
|
|
183
|
-
```json
|
|
184
|
-
{
|
|
185
|
-
"command": "run",
|
|
186
|
-
"success": true,
|
|
187
|
-
"totalTokenUsage": { "input_tokens": 0, "output_tokens": 0 },
|
|
188
|
-
"agentResults": {
|
|
189
|
-
"architect": {
|
|
190
|
-
"success": true,
|
|
191
|
-
"output": "…",
|
|
192
|
-
"tokenUsage": { "input_tokens": 0, "output_tokens": 0 },
|
|
193
|
-
"toolCalls": [],
|
|
194
|
-
"structured": null,
|
|
195
|
-
"loopDetected": false,
|
|
196
|
-
"budgetExceeded": false
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
`agentResults` keys are agent names. When an agent ran multiple tasks, the library merges results; the CLI mirrors the merged `AgentRunResult` fields.
|
|
203
|
-
|
|
204
|
-
**Errors (usage, validation, I/O, runtime)**
|
|
205
|
-
|
|
206
|
-
```json
|
|
207
|
-
{
|
|
208
|
-
"error": {
|
|
209
|
-
"kind": "usage",
|
|
210
|
-
"message": "--goal and --team are required"
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
`kind` is one of: `usage`, `validation`, `io`, `runtime`, or `internal` (uncaught errors in the outer handler).
|
|
216
|
-
|
|
217
|
-
### Output flags
|
|
218
|
-
|
|
219
|
-
| Flag | Effect |
|
|
220
|
-
|------|--------|
|
|
221
|
-
| `--pretty` | Pretty-print JSON with indentation. |
|
|
222
|
-
| `--include-messages` | Include each agent’s full `messages` array in `agentResults`. **Very large** for long runs; default is omit. |
|
|
223
|
-
|
|
224
|
-
There is no separate progress stream; for rich telemetry use the TypeScript API with `onProgress` / `onTrace`.
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Exit codes
|
|
229
|
-
|
|
230
|
-
| Code | Meaning |
|
|
231
|
-
|------|---------|
|
|
232
|
-
| **0** | Success: `run`/`task` finished with `success === true`, or help / `provider` completed normally. |
|
|
233
|
-
| **1** | Run finished but **`success === false`** (agent or task failure as reported by the library). |
|
|
234
|
-
| **2** | Usage, validation, readable JSON errors, or file access issues (e.g. missing file). |
|
|
235
|
-
| **3** | Unexpected error, including typical LLM/API failures surfaced as thrown errors. |
|
|
236
|
-
|
|
237
|
-
In scripts:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
npx oma run --goal "Summarize README" --team team.json > result.json
|
|
241
|
-
code=$?
|
|
242
|
-
case $code in
|
|
243
|
-
0) echo "OK" ;;
|
|
244
|
-
1) echo "Run reported failure — inspect result.json" ;;
|
|
245
|
-
2) echo "Bad inputs or files" ;;
|
|
246
|
-
3) echo "Crash or API error" ;;
|
|
247
|
-
esac
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Argument parsing
|
|
253
|
-
|
|
254
|
-
- Long options only: `--goal`, `--team`, `--file`, etc.
|
|
255
|
-
- Values may be attached with `=`: `--team=./team.json`.
|
|
256
|
-
- Boolean-style flags (`--pretty`, `--include-messages`) take no value; if the next token does not start with `--`, it is treated as the value of the previous option (standard `getopt`-style pairing).
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## Limitations (by design)
|
|
261
|
-
|
|
262
|
-
- No TTY session, history, or `stdin` goal input.
|
|
263
|
-
- No built-in **`cwd`** or metadata passed into `ToolUseContext` (tools use process cwd unless the library adds other hooks later).
|
|
264
|
-
- No **`onApproval`** from JSON; non-interactive batch only.
|
|
265
|
-
- Coordinator **`runTeam`** path still requires network and API keys like any other run.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# Context Management
|
|
2
|
-
|
|
3
|
-
Long-running agents can hit input token ceilings fast. Set `contextStrategy` on `AgentConfig` to control how the conversation shrinks as it grows:
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
const agent: AgentConfig = {
|
|
7
|
-
name: 'long-runner',
|
|
8
|
-
model: 'claude-sonnet-4-6',
|
|
9
|
-
// Pick one:
|
|
10
|
-
contextStrategy: { type: 'sliding-window', maxTurns: 20 },
|
|
11
|
-
// contextStrategy: { type: 'summarize', maxTokens: 80_000, summaryModel: 'claude-haiku-4-5' },
|
|
12
|
-
// contextStrategy: { type: 'compact', maxTokens: 100_000, preserveRecentTurns: 4 },
|
|
13
|
-
// contextStrategy: { type: 'custom', compress: (messages, estimatedTokens) => ... },
|
|
14
|
-
}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
| Strategy | When to reach for it |
|
|
18
|
-
|----------|----------------------|
|
|
19
|
-
| `sliding-window` | Cheapest. Keep the last N turns, drop the rest. |
|
|
20
|
-
| `summarize` | Send old turns to a summary model; keep the summary in place of the originals. |
|
|
21
|
-
| `compact` | Rule-based: truncate large assistant text blocks and tool results, keep recent turns intact. No extra LLM call. |
|
|
22
|
-
| `custom` | Supply your own `compress(messages, estimatedTokens)` function. |
|
|
23
|
-
|
|
24
|
-
## Compressing Tool Results
|
|
25
|
-
|
|
26
|
-
Tool outputs persist in the conversation history across turns even after the agent has acted on them. In long runs this can consume a significant portion of the context budget.
|
|
27
|
-
|
|
28
|
-
`compressToolResults` replaces already-consumed tool results (those followed by an assistant response) with a short marker before each new LLM call:
|
|
29
|
-
|
|
30
|
-
```typescript
|
|
31
|
-
const agent: AgentConfig = {
|
|
32
|
-
name: 'long-runner',
|
|
33
|
-
model: 'claude-sonnet-4-6',
|
|
34
|
-
// Enable with the default threshold (500 chars):
|
|
35
|
-
compressToolResults: true,
|
|
36
|
-
// Or only compress results longer than N characters:
|
|
37
|
-
// compressToolResults: { minChars: 2000 },
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
| Value | Behaviour |
|
|
42
|
-
|-------|-----------|
|
|
43
|
-
| `true` | Compress results longer than 500 characters (default threshold) |
|
|
44
|
-
| `{ minChars: N }` | Compress results longer than N characters |
|
|
45
|
-
| `false` / `undefined` | Disabled (default) |
|
|
46
|
-
|
|
47
|
-
**Notes:**
|
|
48
|
-
- Error tool results are never compressed.
|
|
49
|
-
- Delegation `tool_result` blocks (from `delegate_to_agent`) are exempt — the parent agent always retains the full sub-agent output.
|
|
50
|
-
- Works alongside `contextStrategy`; combine both for maximum context headroom.
|
|
51
|
-
|
|
52
|
-
## Truncating Tool Output
|
|
53
|
-
|
|
54
|
-
`maxToolOutputChars` caps the raw output length for every tool used by an agent. Outputs longer than the limit are truncated to a head + tail excerpt with a marker in between. This applies at execution time, before the result enters the conversation.
|
|
55
|
-
|
|
56
|
-
```typescript
|
|
57
|
-
const agent: AgentConfig = {
|
|
58
|
-
name: 'long-runner',
|
|
59
|
-
model: 'claude-sonnet-4-6',
|
|
60
|
-
maxToolOutputChars: 10_000, // truncate any single tool output to 10 k chars
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Per-tool `maxOutputChars` (set on `ToolDefinition`) takes priority over the agent-level `maxToolOutputChars`.
|
package/docs/featured-partner.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Featured Partner program
|
|
2
|
-
|
|
3
|
-
For products and platforms already integrated with `open-multi-agent`. Reserves prominent placement in the [Ecosystem](../README.md#ecosystem) section of the project README for 12 months at a time.
|
|
4
|
-
|
|
5
|
-
## What you get
|
|
6
|
-
|
|
7
|
-
- Logo, 100-word description, and a maintainer endorsement quote in a dedicated row above the integrations list.
|
|
8
|
-
- 12-month placement, renewable.
|
|
9
|
-
- Cross-link from the [English](../README.md) and [中文](../README_zh.md) README.
|
|
10
|
-
|
|
11
|
-
## Eligibility
|
|
12
|
-
|
|
13
|
-
- Active integration with `open-multi-agent` already in production or a publicly testable beta.
|
|
14
|
-
- Aligned with the project's positioning: TypeScript multi-agent orchestration, agent infrastructure, observability, memory backends, and adjacent tooling.
|
|
15
|
-
|
|
16
|
-
## Cost
|
|
17
|
-
|
|
18
|
-
$3,000 USD per partner per 12-month placement. Single partner per slot at a time, renewable on the same terms.
|
|
19
|
-
|
|
20
|
-
## How to apply
|
|
21
|
-
|
|
22
|
-
[Open an inquiry issue](https://github.com/open-multi-agent/open-multi-agent/issues/new?title=Featured+Partner+Inquiry&labels=featured-partner-inquiry) with:
|
|
23
|
-
|
|
24
|
-
- A short description of your product and how it integrates with `open-multi-agent`.
|
|
25
|
-
- A link to the integration code or live deployment.
|
|
26
|
-
- The contact you want us to reply to.
|
|
27
|
-
|
|
28
|
-
The maintainers will follow up to review and confirm.
|
package/docs/observability.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Observability
|
|
2
|
-
|
|
3
|
-
`open-multi-agent` exposes three telemetry layers: live progress events, structured trace spans, and a static post-run dashboard.
|
|
4
|
-
|
|
5
|
-
## Progress Events
|
|
6
|
-
|
|
7
|
-
Use `onProgress` when you need lightweight lifecycle events for logs, terminal output, or a live UI.
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
const orchestrator = new OpenMultiAgent({
|
|
11
|
-
onProgress: (event) => {
|
|
12
|
-
console.log(event.type, event.task ?? event.agent ?? '')
|
|
13
|
-
},
|
|
14
|
-
})
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Common event types include `task_start`, `task_complete`, `task_retry`, `task_skipped`, `agent_start`, `agent_complete`, `budget_exceeded`, and `error`.
|
|
18
|
-
|
|
19
|
-
## Trace Spans
|
|
20
|
-
|
|
21
|
-
Use `onTrace` when you need structured spans for LLM calls, tool executions, and tasks. Each span carries parent IDs, durations, token counts, and tool I/O.
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
const orchestrator = new OpenMultiAgent({
|
|
25
|
-
onTrace: async (span) => {
|
|
26
|
-
await traceSink.write(span)
|
|
27
|
-
},
|
|
28
|
-
})
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Forward trace spans to OpenTelemetry, Datadog, Honeycomb, Langfuse, or your own run database. See [`integrations/trace-observability`](../examples/integrations/trace-observability.ts) for a runnable example.
|
|
32
|
-
|
|
33
|
-
## Post-Run Dashboard
|
|
34
|
-
|
|
35
|
-
`renderTeamRunDashboard(result)` returns a static HTML page that visualizes the executed task DAG with timing, token usage, per-task status, and task details.
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
import { writeFileSync } from 'node:fs'
|
|
39
|
-
import { renderTeamRunDashboard } from '@open-multi-agent/core'
|
|
40
|
-
|
|
41
|
-
const result = await orchestrator.runTeam(team, goal)
|
|
42
|
-
writeFileSync('run.html', renderTeamRunDashboard(result))
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
The library does not write files by itself. The CLI can write dashboard HTML for you with `oma run --dashboard`; see [docs/cli.md](./cli.md).
|
|
46
|
-
|
|
47
|
-
The dashboard HTML loads Tailwind CSS and Google Fonts from the network at view time. Opening the generated HTML requires an online environment unless you host or inline those assets yourself.
|
|
48
|
-
|
|
49
|
-
## What to Persist
|
|
50
|
-
|
|
51
|
-
For production runs, persist enough data to reconstruct a failure without replaying the entire job:
|
|
52
|
-
|
|
53
|
-
- `TeamRunResult.tasks` for the executed DAG and task states.
|
|
54
|
-
- `TeamRunResult.totalTokenUsage` for cost attribution.
|
|
55
|
-
- `onTrace` spans for LLM calls and tool executions.
|
|
56
|
-
- The rendered dashboard HTML when you need a shareable post-mortem artifact.
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# MiniMax setup guide
|
|
2
|
-
|
|
3
|
-
<img src="../../.github/brand/minimax-banner.png" alt="MiniMax" width="600">
|
|
4
|
-
|
|
5
|
-
MiniMax M2.7 can be used in OMA's TypeScript multi-agent workflows with a simple provider config.
|
|
6
|
-
|
|
7
|
-
## Community offer
|
|
8
|
-
|
|
9
|
-
OMA users get **12% off** the MiniMax Token Plan. Valid until **2026-06-30**.
|
|
10
|
-
|
|
11
|
-
| Region | Link |
|
|
12
|
-
|--------|------|
|
|
13
|
-
| Global | [platform.minimax.io](https://platform.minimax.io/subscribe/coding-plan?code=6ZoOY13DDV&source=link) |
|
|
14
|
-
| China | [platform.minimaxi.com](https://platform.minimaxi.com/subscribe/token-plan?code=98qruMqQhL&source=link) |
|
|
15
|
-
|
|
16
|
-
This is a limited-time community offer, not a paid endorsement.
|
|
17
|
-
|
|
18
|
-
## About MiniMax M2.7
|
|
19
|
-
|
|
20
|
-
MiniMax describes M2.7 as:
|
|
21
|
-
|
|
22
|
-
> MiniMax M2.7 is MiniMax's first self-evolution model, capable of autonomously building complex Agent Harnesses and completing high-complexity productivity tasks via Agent Teams, advanced Skills, and Tool Search Tool. It excels in software engineering, end-to-end project delivery, and office scenarios, with stable task execution, environment interaction, and identity-preserving capabilities.
|
|
23
|
-
|
|
24
|
-
MiniMax 对 M2.7 的描述:
|
|
25
|
-
|
|
26
|
-
> MiniMax M2.7 是 MiniMax 首个深度参与自我迭代的模型,可自主构建复杂 Agent Harness,并基于 Agent Teams、复杂 Skills、Tool Search Tool 等能力完成高复杂度生产力任务;其在软件工程、端到端项目交付及办公场景中表现优异,多项评测接近行业领先水平,同时具备稳定的复杂任务执行、环境交互能力以及良好的情商与身份保持能力。
|
|
27
|
-
|
|
28
|
-
## Setup
|
|
29
|
-
|
|
30
|
-
### Environment variables
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
export MINIMAX_API_KEY=your-api-key
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
The adapter defaults to the global endpoint (`https://api.minimax.io/v1`). China users should override the base URL:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
export MINIMAX_BASE_URL=https://api.minimaxi.com/v1
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Agent config
|
|
43
|
-
|
|
44
|
-
```typescript
|
|
45
|
-
const agent: AgentConfig = {
|
|
46
|
-
name: 'my-agent',
|
|
47
|
-
provider: 'minimax',
|
|
48
|
-
model: 'MiniMax-M2.7',
|
|
49
|
-
systemPrompt: 'You are a helpful assistant.',
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Full example:
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
import { OpenMultiAgent, type AgentConfig } from '@open-multi-agent/core'
|
|
57
|
-
|
|
58
|
-
const agent: AgentConfig = {
|
|
59
|
-
name: 'analyst',
|
|
60
|
-
provider: 'minimax',
|
|
61
|
-
model: 'MiniMax-M2.7',
|
|
62
|
-
systemPrompt: 'Analyze data and produce concise reports.',
|
|
63
|
-
tools: ['bash', 'file_read', 'file_write'],
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const orchestrator = new OpenMultiAgent()
|
|
67
|
-
const result = await orchestrator.runAgent(agent, 'Summarize /tmp/report.csv')
|
|
68
|
-
console.log(result.output)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Disclosure
|
|
72
|
-
|
|
73
|
-
- This is a limited-time community offer valid through 2026-06-30.
|
|
74
|
-
- Listings are not paid endorsements.
|
|
75
|
-
- Some provider offers may include referral credits that help maintain the project.
|
package/docs/providers.md
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# Providers
|
|
2
|
-
|
|
3
|
-
`open-multi-agent` keeps the agent config shape stable across hosted, cloud, and local providers. Change `provider`, `model`, and the relevant credential; the rest of your team definition stays the same.
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
const agent = {
|
|
7
|
-
name: 'my-agent',
|
|
8
|
-
provider: 'anthropic',
|
|
9
|
-
model: 'claude-sonnet-4-6',
|
|
10
|
-
systemPrompt: 'You are a helpful assistant.',
|
|
11
|
-
}
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Built-In Provider Shortcuts
|
|
15
|
-
|
|
16
|
-
The framework ships a wired-in provider name for each of these. Set `provider` and the env var, and the adapter handles the endpoint.
|
|
17
|
-
|
|
18
|
-
> Under the hood, Anthropic, Gemini, and Bedrock use provider-specific APIs. The other built-in shortcuts are pre-configured wrappers around OpenAI-compatible endpoints; same wire format as the OpenAI-compatible table below, with the `baseURL` already supplied.
|
|
19
|
-
|
|
20
|
-
| Provider | Config | Env var | Example model | Notes |
|
|
21
|
-
|----------|--------|---------|---------------|-------|
|
|
22
|
-
| Anthropic (Claude) | `provider: 'anthropic'` | `ANTHROPIC_API_KEY` | `claude-sonnet-4-6` | Native Anthropic SDK. |
|
|
23
|
-
| Gemini | `provider: 'gemini'` | `GEMINI_API_KEY` | `gemini-2.5-pro` | Native Google GenAI SDK. Requires `npm install @google/genai`. |
|
|
24
|
-
| OpenAI (GPT) | `provider: 'openai'` | `OPENAI_API_KEY` | `gpt-4o` | |
|
|
25
|
-
| Azure OpenAI | `provider: 'azure-openai'` | `AZURE_OPENAI_API_KEY`, `AZURE_OPENAI_ENDPOINT` | `gpt-4` | Optional `AZURE_OPENAI_API_VERSION`, `AZURE_OPENAI_DEPLOYMENT`. |
|
|
26
|
-
| GitHub Copilot | `provider: 'copilot'` | `GITHUB_COPILOT_TOKEN` (falls back to `GITHUB_TOKEN`) | `gpt-4o` | Custom token-exchange flow on top of OpenAI protocol. |
|
|
27
|
-
| Grok (xAI) | `provider: 'grok'` | `XAI_API_KEY` | `grok-4` | OpenAI-compatible; endpoint is `api.x.ai/v1`. |
|
|
28
|
-
| DeepSeek | `provider: 'deepseek'` | `DEEPSEEK_API_KEY` | `deepseek-chat` | OpenAI-compatible. `deepseek-chat` (V3, coding) or `deepseek-reasoner` (thinking mode). |
|
|
29
|
-
| MiniMax (global) | `provider: 'minimax'` | `MINIMAX_API_KEY` | `MiniMax-M2.7` | OpenAI-compatible. |
|
|
30
|
-
| MiniMax (China) | `provider: 'minimax'` + `MINIMAX_BASE_URL` | `MINIMAX_API_KEY` | `MiniMax-M2.7` | Set `MINIMAX_BASE_URL=https://api.minimaxi.com/v1`. |
|
|
31
|
-
| Qiniu | `provider: 'qiniu'` | `QINIU_API_KEY` | `deepseek-v3` | OpenAI-compatible. Endpoint `https://api.qnaigc.com/v1`; multiple model families, see [Qiniu AI docs](https://developer.qiniu.com/aitokenapi/12882/ai-inference-api). |
|
|
32
|
-
| AWS Bedrock | `provider: 'bedrock'` | none (AWS SDK credential chain) | `anthropic.claude-3-5-haiku-20241022-v1:0` | No API key. Set `AWS_REGION` or pass `region` as the 4th arg to `createAdapter`. Credentials come from env vars, shared config, or IAM role. Newer Claude models can require a cross-region inference profile prefix such as `us.`. Also supports Llama, Mistral, and Cohere. See [`providers/bedrock`](../examples/providers/bedrock.ts). Requires `npm install @aws-sdk/client-bedrock-runtime`. |
|
|
33
|
-
|
|
34
|
-
## OpenAI-Compatible Providers
|
|
35
|
-
|
|
36
|
-
No bundled shortcut is needed when a server speaks OpenAI Chat Completions. Use `provider: 'openai'` and point `baseURL` at the service.
|
|
37
|
-
|
|
38
|
-
| Service | Config | Env var | Example model | Notes |
|
|
39
|
-
|---------|--------|---------|---------------|-------|
|
|
40
|
-
| Ollama (local) | `provider: 'openai'` + `baseURL: 'http://localhost:11434/v1'` | none | `llama3.1` | |
|
|
41
|
-
| vLLM (local) | `provider: 'openai'` + `baseURL` | none | server-loaded | |
|
|
42
|
-
| LM Studio (local) | `provider: 'openai'` + `baseURL` | none | server-loaded | |
|
|
43
|
-
| llama.cpp server (local) | `provider: 'openai'` + `baseURL` | none | server-loaded | |
|
|
44
|
-
| OpenRouter | `provider: 'openai'` + `baseURL: 'https://openrouter.ai/api/v1'` + `apiKey` | `OPENROUTER_API_KEY` | `openai/gpt-4o-mini` | |
|
|
45
|
-
| Groq | `provider: 'openai'` + `baseURL: 'https://api.groq.com/openai/v1'` | `GROQ_API_KEY` | `llama-3.3-70b-versatile` | |
|
|
46
|
-
| Mistral | `provider: 'openai'` + `baseURL: 'https://api.mistral.ai/v1'` | `MISTRAL_API_KEY` | `mistral-large-latest` | See [`providers/mistral`](../examples/providers/mistral.ts). |
|
|
47
|
-
| Zhipu GLM | `provider: 'openai'` + `baseURL: 'https://open.bigmodel.cn/api/paas/v4'` | `ZHIPU_API_KEY` | `glm-4-plus` | See [`providers/zhipu`](../examples/providers/zhipu.ts). |
|
|
48
|
-
| Doubao (ByteDance) | `provider: 'openai'` + `baseURL: 'https://ark.cn-beijing.volces.com/api/v3'` | `ARK_API_KEY` | `doubao-1-5-pro-32k-250115` | See [`providers/doubao`](../examples/providers/doubao.ts). |
|
|
49
|
-
|
|
50
|
-
Other services can be connected the same way if they implement the OpenAI Chat Completions API, but they are not listed as verified providers here. For services where the key is not `OPENAI_API_KEY`, pass it explicitly via `apiKey`; otherwise the `openai` adapter falls back to `OPENAI_API_KEY`.
|
|
51
|
-
|
|
52
|
-
## Local Model Tool-Calling
|
|
53
|
-
|
|
54
|
-
The framework supports tool-calling with local models served by Ollama, vLLM, LM Studio, or llama.cpp. Tool-calling is handled natively through the OpenAI-compatible API.
|
|
55
|
-
|
|
56
|
-
Verified local models include Gemma 4, Llama 3.1, Qwen 3, Mistral, and Phi-4. Ollama publishes its tool-capable models at [ollama.com/search?c=tools](https://ollama.com/search?c=tools).
|
|
57
|
-
|
|
58
|
-
If a local model returns tool calls as text instead of the `tool_calls` wire format, the framework automatically extracts them from the text output. This helps with thinking models or misconfigured local servers.
|
|
59
|
-
|
|
60
|
-
Use `timeoutMs` on `AgentConfig` for slow local inference:
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
const localAgent = {
|
|
64
|
-
name: 'local',
|
|
65
|
-
model: 'llama3.1',
|
|
66
|
-
provider: 'openai',
|
|
67
|
-
baseURL: 'http://localhost:11434/v1',
|
|
68
|
-
apiKey: 'ollama',
|
|
69
|
-
tools: ['bash', 'file_read'],
|
|
70
|
-
timeoutMs: 120_000,
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Highly quantized MoE models on consumer hardware can fall into repetition loops or hallucinate tool-call schemas under default sampling. `AgentConfig` exposes `topK`, `minP`, `frequencyPenalty`, `presencePenalty`, `parallelToolCalls`, and `extraBody` for server-specific knobs such as vLLM's `repetition_penalty`. See [`providers/local-quantized`](../examples/providers/local-quantized.ts) for a complete setup.
|
|
75
|
-
|
|
76
|
-
## Troubleshooting
|
|
77
|
-
|
|
78
|
-
- Model not calling tools? Confirm it appears in Ollama's [Tools category](https://ollama.com/search?c=tools).
|
|
79
|
-
- Using Ollama? Update to the latest version with `ollama update`.
|
|
80
|
-
- Proxy interfering with local servers? Use `no_proxy=localhost`.
|
package/docs/shared-memory.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Shared Memory
|
|
2
|
-
|
|
3
|
-
Teams can share a namespaced key-value store so later agents see earlier agents' findings. Enable it with a boolean for the default in-process store:
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
const team = orchestrator.createTeam('research-team', {
|
|
7
|
-
name: 'research-team',
|
|
8
|
-
agents: [researcher, writer],
|
|
9
|
-
sharedMemory: true,
|
|
10
|
-
})
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
For durable or cross-process backends (Redis, Postgres, Engram, etc.), implement the `MemoryStore` interface and pass it via `sharedMemoryStore`. Keys are still namespaced as `<agentName>/<key>` before reaching the store:
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
import type { MemoryStore } from '@open-multi-agent/core'
|
|
17
|
-
|
|
18
|
-
class RedisStore implements MemoryStore { /* get/set/list/delete/clear */ }
|
|
19
|
-
|
|
20
|
-
const team = orchestrator.createTeam('durable-team', {
|
|
21
|
-
name: 'durable-team',
|
|
22
|
-
agents: [researcher, writer],
|
|
23
|
-
sharedMemoryStore: new RedisStore(),
|
|
24
|
-
})
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
When both are provided, `sharedMemoryStore` wins. SDK-only: the CLI cannot pass runtime objects.
|