@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
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
# Tool Configuration
|
|
2
|
-
|
|
3
|
-
Agents can be configured with fine-grained tool access control using presets, allowlists, and denylists.
|
|
4
|
-
|
|
5
|
-
## Tool Presets
|
|
6
|
-
|
|
7
|
-
Predefined tool sets for common use cases:
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
const readonlyAgent: AgentConfig = {
|
|
11
|
-
name: 'reader',
|
|
12
|
-
model: 'claude-sonnet-4-6',
|
|
13
|
-
toolPreset: 'readonly', // file_read, grep, glob
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const readwriteAgent: AgentConfig = {
|
|
17
|
-
name: 'editor',
|
|
18
|
-
model: 'claude-sonnet-4-6',
|
|
19
|
-
toolPreset: 'readwrite', // file_read, file_write, file_edit, grep, glob
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const fullAgent: AgentConfig = {
|
|
23
|
-
name: 'executor',
|
|
24
|
-
model: 'claude-sonnet-4-6',
|
|
25
|
-
toolPreset: 'full', // file_read, file_write, file_edit, grep, glob, bash
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Advanced Filtering
|
|
30
|
-
|
|
31
|
-
Combine presets with allowlists and denylists for precise control:
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
const customAgent: AgentConfig = {
|
|
35
|
-
name: 'custom',
|
|
36
|
-
model: 'claude-sonnet-4-6',
|
|
37
|
-
toolPreset: 'readwrite', // Start with: file_read, file_write, file_edit, grep, glob
|
|
38
|
-
tools: ['file_read', 'grep'], // Allowlist: intersect with preset = file_read, grep
|
|
39
|
-
disallowedTools: ['grep'], // Denylist: subtract = file_read only
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Resolution order:** preset → allowlist → denylist → framework safety rails.
|
|
44
|
-
|
|
45
|
-
## Custom Tools
|
|
46
|
-
|
|
47
|
-
Two ways to give an agent a tool that is not in the built-in set.
|
|
48
|
-
|
|
49
|
-
**Inject at config time** via `customTools` on `AgentConfig`. Good when the orchestrator wires up tools centrally. Tools defined here bypass preset/allowlist filtering but still respect `disallowedTools`.
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
import { defineTool } from '@open-multi-agent/core'
|
|
53
|
-
import { z } from 'zod'
|
|
54
|
-
|
|
55
|
-
const weatherTool = defineTool({
|
|
56
|
-
name: 'get_weather',
|
|
57
|
-
description: 'Look up current weather for a city.',
|
|
58
|
-
inputSchema: z.object({ city: z.string() }),
|
|
59
|
-
execute: async ({ city }) => ({ data: await fetchWeather(city) }),
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
const agent: AgentConfig = {
|
|
63
|
-
name: 'assistant',
|
|
64
|
-
model: 'claude-sonnet-4-6',
|
|
65
|
-
customTools: [weatherTool],
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Register at runtime** via `agent.addTool(tool)`. Tools added this way are always available, regardless of filtering.
|
|
70
|
-
|
|
71
|
-
## Tool Output Control
|
|
72
|
-
|
|
73
|
-
Long tool outputs can blow up conversation size and cost. Two controls work together.
|
|
74
|
-
|
|
75
|
-
**Validation (optional).** Add `outputSchema` to catch malformed tool results before they are forwarded:
|
|
76
|
-
|
|
77
|
-
> **Note — two different `outputSchema` fields.** The one on `defineTool()` /
|
|
78
|
-
> `ToolDefinition` (shown below) validates a single **tool's** `ToolResult.data`
|
|
79
|
-
> — it is always a `ZodSchema<string>` because tool output is serialised as
|
|
80
|
-
> text. The `outputSchema` on [`AgentConfig`](../examples/patterns/structured-output.ts)
|
|
81
|
-
> is different: it validates the **agent's final answer** as parsed JSON
|
|
82
|
-
> against an arbitrary Zod schema (see _Structured output_ in `examples/`).
|
|
83
|
-
> Different types, different scopes — TypeScript won't warn you if you mix
|
|
84
|
-
> them up, so pick the one that matches the layer you're working at.
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
const jsonTool = defineTool({
|
|
88
|
-
name: 'json_tool',
|
|
89
|
-
description: 'Return JSON payload as string.',
|
|
90
|
-
inputSchema: z.object({}),
|
|
91
|
-
outputSchema: z.string().refine((value) => {
|
|
92
|
-
try {
|
|
93
|
-
JSON.parse(value)
|
|
94
|
-
return true
|
|
95
|
-
} catch {
|
|
96
|
-
return false
|
|
97
|
-
}
|
|
98
|
-
}, 'Output must be valid JSON'),
|
|
99
|
-
execute: async () => ({ data: '{"ok": true}' }),
|
|
100
|
-
})
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Truncation.** Cap an individual tool result to a head + tail excerpt with a marker in between:
|
|
104
|
-
|
|
105
|
-
```typescript
|
|
106
|
-
const agent: AgentConfig = {
|
|
107
|
-
// ...
|
|
108
|
-
maxToolOutputChars: 10_000, // applies to every tool this agent runs
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Per-tool override (takes priority over AgentConfig.maxToolOutputChars):
|
|
112
|
-
const bigQueryTool = defineTool({
|
|
113
|
-
// ...
|
|
114
|
-
maxOutputChars: 50_000,
|
|
115
|
-
})
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Post-consumption compression.** Once the agent has acted on a tool result, compress older copies in the transcript so they stop costing input tokens on every subsequent turn. Error results are never compressed.
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
const agent: AgentConfig = {
|
|
122
|
-
// ...
|
|
123
|
-
compressToolResults: true, // default threshold: 500 chars
|
|
124
|
-
// or: compressToolResults: { minChars: 2_000 }
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## MCP Tools (Model Context Protocol)
|
|
129
|
-
|
|
130
|
-
`open-multi-agent` can connect to stdio MCP servers and expose their tools directly to agents.
|
|
131
|
-
|
|
132
|
-
```typescript
|
|
133
|
-
import { connectMCPTools } from '@open-multi-agent/core/mcp'
|
|
134
|
-
|
|
135
|
-
const { tools, disconnect } = await connectMCPTools({
|
|
136
|
-
command: 'npx',
|
|
137
|
-
args: ['-y', '@modelcontextprotocol/server-github'],
|
|
138
|
-
env: { GITHUB_TOKEN: process.env.GITHUB_TOKEN },
|
|
139
|
-
namePrefix: 'github',
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
// Register each MCP tool in your ToolRegistry, then include their names in AgentConfig.tools
|
|
143
|
-
// Don't forget cleanup when done
|
|
144
|
-
await disconnect()
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Notes:
|
|
148
|
-
- `@modelcontextprotocol/sdk` is an optional peer dependency, only needed when using MCP.
|
|
149
|
-
- Current transport support is stdio.
|
|
150
|
-
- MCP input validation is delegated to the MCP server (`inputSchema` is `z.any()`).
|
|
151
|
-
|
|
152
|
-
See [`integrations/mcp-github`](../examples/integrations/mcp-github.ts) for a full runnable setup.
|