@mastra/mcp-docs-server 1.1.41 → 1.1.42-alpha.2
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/.docs/docs/agent-builder/access-control.md +97 -0
- package/.docs/docs/agent-builder/browser.md +61 -0
- package/.docs/docs/agent-builder/channels.md +76 -0
- package/.docs/docs/agent-builder/configuration.md +147 -0
- package/.docs/docs/agent-builder/deploying.md +121 -0
- package/.docs/docs/agent-builder/memory.md +65 -0
- package/.docs/docs/agent-builder/model-policy.md +48 -0
- package/.docs/docs/agent-builder/overview.md +97 -0
- package/.docs/docs/agent-builder/skill-registries.md +31 -0
- package/.docs/docs/agent-builder/workspace.md +60 -0
- package/.docs/reference/client-js/agent-builder.md +161 -0
- package/.docs/reference/client-js/mastra-client.md +4 -0
- package/.docs/reference/editor/agent-builder/agent-builder-options.md +74 -0
- package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +77 -0
- package/.docs/reference/editor/agent-builder/builder-models.md +64 -0
- package/.docs/reference/editor/blob-store-provider.md +59 -0
- package/.docs/reference/editor/browser-provider.md +75 -0
- package/.docs/reference/editor/filesystem-provider.md +62 -0
- package/.docs/reference/editor/mastra-editor.md +44 -0
- package/.docs/reference/editor/processor-provider.md +64 -0
- package/.docs/reference/editor/sandbox-provider.md +61 -0
- package/.docs/reference/editor/storage-browser-ref.md +80 -0
- package/.docs/reference/editor/storage-workspace-ref.md +93 -0
- package/.docs/reference/index.md +12 -0
- package/.docs/reference/memory/serialized-memory-config.md +72 -0
- package/CHANGELOG.md +14 -0
- package/package.json +5 -5
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Agent Builder overview
|
|
2
|
+
|
|
3
|
+
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
4
|
+
|
|
5
|
+
The Agent Builder lets you build, configure, and operate Mastra agents all within the UI. It runs inside your Mastra server, persists everything to `Mastra.storage`, and supports multi-tenant agent workflows with RBAC and channel integrations.
|
|
6
|
+
|
|
7
|
+
- [**Configuration**](https://mastra.ai/docs/agent-builder/configuration): Toggle UI sections and pin admin-controlled defaults for every new agent.
|
|
8
|
+
- [**Model policy**](https://mastra.ai/docs/agent-builder/model-policy): Restrict which providers and models the Builder exposes, and pin a default.
|
|
9
|
+
- [**Memory**](https://mastra.ai/docs/agent-builder/memory): Configure the default memory shape for every Builder-created agent.
|
|
10
|
+
- [**Access control**](https://mastra.ai/docs/agent-builder/access-control): Gate the Builder behind Mastra RBAC roles and permissions.
|
|
11
|
+
- [**Channels**](https://mastra.ai/docs/agent-builder/channels): Connect Builder-created agents to Slack and other channels.
|
|
12
|
+
- [**Skill registries**](https://mastra.ai/docs/agent-builder/skill-registries): Browse and install community skills from opt-in registries.
|
|
13
|
+
- [**Deploying**](https://mastra.ai/docs/agent-builder/deploying): Swap local primitives for cloud-backed storage, filesystems, and sandboxes.
|
|
14
|
+
|
|
15
|
+
For building agents entirely in code, see the [Agents overview](https://mastra.ai/docs/agents/overview). For editing code-defined agents through Studio, see the [Editor overview](https://mastra.ai/docs/editor/overview).
|
|
16
|
+
|
|
17
|
+
## Get started
|
|
18
|
+
|
|
19
|
+
Install `@mastra/editor` alongside a storage adapter:
|
|
20
|
+
|
|
21
|
+
**npm**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @mastra/editor @mastra/libsql
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**pnpm**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm add @mastra/editor @mastra/libsql
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Yarn**:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn add @mastra/editor @mastra/libsql
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Bun**:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
bun add @mastra/editor @mastra/libsql
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Wire the Agent Builder onto a `Mastra` instance:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
49
|
+
import { MastraEditor } from '@mastra/editor'
|
|
50
|
+
import { createBuilderAgent } from '@mastra/editor/ee'
|
|
51
|
+
import { LibSQLStore } from '@mastra/libsql'
|
|
52
|
+
|
|
53
|
+
export const mastra = new Mastra({
|
|
54
|
+
storage: new LibSQLStore({ url: 'file:./mastra.db' }),
|
|
55
|
+
agents: { builderAgent: createBuilderAgent() },
|
|
56
|
+
editor: new MastraEditor({
|
|
57
|
+
builder: {
|
|
58
|
+
enabled: true,
|
|
59
|
+
configuration: {
|
|
60
|
+
agent: {
|
|
61
|
+
memory: { observationalMemory: true },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Start the dev server:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx mastra dev
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The Agent Builder is mounted at `http://localhost:4111/agent-builder`.
|
|
76
|
+
|
|
77
|
+
## Prerequisites
|
|
78
|
+
|
|
79
|
+
The Agent Builder requires:
|
|
80
|
+
|
|
81
|
+
- **Storage**: An `@mastra/core` storage adapter on the `Mastra` instance. Agents, memory, and workspace state all persist through `Mastra.storage`.
|
|
82
|
+
- **The Builder agent**: Register a Builder agent created with the `createBuilderAgent()` factory from `@mastra/editor/ee` on `Mastra.agents`. The chat-based editor invokes it through the same `Mastra.getAgent(id)` lookup as any other agent. Without this registration, the chat-based editor returns 404.
|
|
83
|
+
- **`OPENAI_API_KEY`**: The Builder agent created by `createBuilderAgent()` runs on an OpenAI model, so an `OPENAI_API_KEY` environment variable is required.
|
|
84
|
+
|
|
85
|
+
## Disabling the Builder
|
|
86
|
+
|
|
87
|
+
Set `enabled: false` to keep the config in place but turn the surface off:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
new MastraEditor({
|
|
91
|
+
builder: {
|
|
92
|
+
enabled: false,
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Omitting the `builder` field has the same effect.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill registries
|
|
2
|
+
|
|
3
|
+
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
4
|
+
|
|
5
|
+
Registries let the Agent Builder browse and install community skills directly from the UI. All registries are opt-in. When no registry is enabled, the Builder hides registry browse UI entirely.
|
|
6
|
+
|
|
7
|
+
## Quickstart
|
|
8
|
+
|
|
9
|
+
Enable the [skills.sh](https://skills.sh) registry:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { MastraEditor } from '@mastra/editor'
|
|
13
|
+
|
|
14
|
+
new MastraEditor({
|
|
15
|
+
builder: {
|
|
16
|
+
enabled: true,
|
|
17
|
+
registries: {
|
|
18
|
+
skillsSh: { enabled: true },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The Builder library tab now exposes a **Browse** view backed by skills.sh. End users can preview a skill, then install it into an agent.
|
|
25
|
+
|
|
26
|
+
> **Note:** See the [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) for the full `registries` schema.
|
|
27
|
+
|
|
28
|
+
## Related
|
|
29
|
+
|
|
30
|
+
- [Configuration](https://mastra.ai/docs/agent-builder/configuration) — wire registries alongside the rest of the Builder config.
|
|
31
|
+
- [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) — every field on `builder`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Workspace
|
|
2
|
+
|
|
3
|
+
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
4
|
+
|
|
5
|
+
A [workspace](https://mastra.ai/docs/workspace/overview) gives agents filesystem access, command execution, and skill loading. The Agent Builder pins a default workspace onto every new agent through `builder.configuration.agent.workspace`. End users can still override the workspace per agent through the Builder UI.
|
|
6
|
+
|
|
7
|
+
## Quickstart
|
|
8
|
+
|
|
9
|
+
Pin an inline workspace snapshot as the Builder default:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Mastra } from '@mastra/core'
|
|
13
|
+
import { MastraEditor } from '@mastra/editor'
|
|
14
|
+
|
|
15
|
+
export const mastra = new Mastra({
|
|
16
|
+
editor: new MastraEditor({
|
|
17
|
+
builder: {
|
|
18
|
+
enabled: true,
|
|
19
|
+
configuration: {
|
|
20
|
+
agent: {
|
|
21
|
+
workspace: {
|
|
22
|
+
type: 'inline',
|
|
23
|
+
config: {
|
|
24
|
+
name: 'project-workspace',
|
|
25
|
+
filesystem: {
|
|
26
|
+
provider: 'local',
|
|
27
|
+
config: { basePath: './workspace' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The Builder derives a deterministic id from the inline config and persists the snapshot, so identical inline configs are deduplicated across agents.
|
|
39
|
+
|
|
40
|
+
## Workspace references
|
|
41
|
+
|
|
42
|
+
`configuration.agent.workspace` accepts a `StorageWorkspaceRef`:
|
|
43
|
+
|
|
44
|
+
- **`{ type: 'inline', config }`** — embeds a serialized workspace snapshot directly on the agent. Useful for per-agent, ad-hoc configurations.
|
|
45
|
+
- **`{ type: 'id', workspaceId }`** — references a workspace already registered on the `Mastra` instance via `new Mastra({ workspace })` or `mastra.addWorkspace(...)`. Use this for shared, named workspaces.
|
|
46
|
+
|
|
47
|
+
See the [StorageWorkspaceRef reference](https://mastra.ai/reference/editor/storage-workspace-ref) for both variants.
|
|
48
|
+
|
|
49
|
+
## Filesystem and sandbox
|
|
50
|
+
|
|
51
|
+
A workspace combines a `filesystem` (file tools) and an optional `sandbox` (command execution). For local development, point both at the same directory so files written through the filesystem are immediately visible to commands in the sandbox.
|
|
52
|
+
|
|
53
|
+
For cloud deployments, swap `LocalFilesystem` / `LocalSandbox` for managed providers (e.g., S3, E2B). See [Deploying](https://mastra.ai/docs/agent-builder/deploying) for the cloud-swap pattern.
|
|
54
|
+
|
|
55
|
+
## Related
|
|
56
|
+
|
|
57
|
+
- [Workspace overview](https://mastra.ai/docs/workspace/overview) — the underlying workspace model.
|
|
58
|
+
- [Filesystem](https://mastra.ai/docs/workspace/filesystem) and [Sandbox](https://mastra.ai/docs/workspace/sandbox) — the building blocks.
|
|
59
|
+
- [BuilderAgentDefaults reference](https://mastra.ai/reference/editor/agent-builder/builder-agent-defaults) — the full `workspace` field schema.
|
|
60
|
+
- [Configuration](https://mastra.ai/docs/agent-builder/configuration) — wire `workspace` alongside the rest of the Builder config.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Agent Builder API
|
|
2
|
+
|
|
3
|
+
The Agent Builder API provides methods to interact with [Agent Builder](https://mastra.ai/docs/agent-builder/overview) actions on the server. Each action is a workflow exposed under `/agent-builder/:actionId/*`. The Builder must be enabled on the server via `MastraEditor.builder.enabled`, with a valid `MASTRA_EE_LICENSE` in production.
|
|
4
|
+
|
|
5
|
+
## Getting all actions
|
|
6
|
+
|
|
7
|
+
Retrieve a record of available Agent Builder actions:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
const actions = await mastraClient.getAgentBuilderActions()
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Returns a `Record<string, WorkflowInfo>` keyed by action ID.
|
|
14
|
+
|
|
15
|
+
## Working with a specific action
|
|
16
|
+
|
|
17
|
+
Get an instance of a specific action by its ID:
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
const action = mastraClient.getAgentBuilderAction('create-agent')
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Action methods
|
|
24
|
+
|
|
25
|
+
### `details()`
|
|
26
|
+
|
|
27
|
+
Retrieve metadata about an Agent Builder action:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
const info = await action.details()
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### `createRun()`
|
|
34
|
+
|
|
35
|
+
Create a new run for this action and receive a `runId`. Use the returned id with `startActionRun()`, `stream()`, `resume()`, or `observeStream()`.
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
const { runId } = await action.createRun()
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
You can also pass an explicit `runId`:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
const { runId } = await action.createRun({ runId: 'my-run-id' })
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `startAsync()`
|
|
48
|
+
|
|
49
|
+
Start the action and wait for completion. Returns the final `AgentBuilderActionResult` with `success`, `applied`, `branchName`, `message`, `validationResults`, `error`, `errors`, and `stepResults`.
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
const result = await action.startAsync({
|
|
53
|
+
inputData: { agentName: 'support-bot' },
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Pass an existing `runId` as the second argument to start a previously created run:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
const { runId } = await action.createRun()
|
|
61
|
+
const result = await action.startAsync({ inputData }, runId)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `startActionRun()`
|
|
65
|
+
|
|
66
|
+
Start an existing run without waiting for completion. Returns `{ message }`.
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
const { runId } = await action.createRun()
|
|
70
|
+
await action.startActionRun({ inputData }, runId)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### `stream()`
|
|
74
|
+
|
|
75
|
+
Start an existing run and stream progress events as a `ReadableStream<{ type, payload }>`.
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
const { runId } = await action.createRun()
|
|
79
|
+
const stream = await action.stream({ inputData }, runId)
|
|
80
|
+
|
|
81
|
+
for await (const event of stream) {
|
|
82
|
+
console.log(event.type, event.payload)
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### `resume()`
|
|
87
|
+
|
|
88
|
+
Resume a suspended step on a run. Returns `{ message }`.
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
await action.resume({ step: 'review', resumeData: { approved: true } }, runId)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### `resumeAsync()`
|
|
95
|
+
|
|
96
|
+
Resume a suspended step and wait for completion. Returns an `AgentBuilderActionResult`.
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
const result = await action.resumeAsync({ step: 'review', resumeData: { approved: true } }, runId)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `resumeStream()`
|
|
103
|
+
|
|
104
|
+
Resume a suspended step and stream subsequent events.
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
const stream = await action.resumeStream({
|
|
108
|
+
runId,
|
|
109
|
+
step: 'review',
|
|
110
|
+
resumeData: { approved: true },
|
|
111
|
+
})
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### `observeStream()`
|
|
115
|
+
|
|
116
|
+
Attach to an existing run, replaying cached events from the beginning, then continuing with live events. Use this to recover after a page refresh or hot reload.
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
const stream = await action.observeStream({ runId })
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### `observeStreamLegacy()`
|
|
123
|
+
|
|
124
|
+
Same as `observeStream()` but uses the legacy streaming endpoint. Prefer `observeStream()` for new code.
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
const stream = await action.observeStreamLegacy({ runId })
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `runs()`
|
|
131
|
+
|
|
132
|
+
List runs for this action with optional filters.
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
const runs = await action.runs({ page: 0, perPage: 20 })
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Accepts `fromDate`, `toDate`, `page`, `perPage`, `resourceId`, and legacy `limit`/`offset`.
|
|
139
|
+
|
|
140
|
+
### `runById()`
|
|
141
|
+
|
|
142
|
+
Fetch a specific run by ID. Use `fields` to limit the returned payload and `withNestedWorkflows` to skip nested workflow data.
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
const run = await action.runById(runId, {
|
|
146
|
+
fields: ['result', 'steps'],
|
|
147
|
+
withNestedWorkflows: false,
|
|
148
|
+
})
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### `cancelRun()`
|
|
152
|
+
|
|
153
|
+
Cancel an in-flight run.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
await action.cancelRun(runId)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Access control
|
|
160
|
+
|
|
161
|
+
The `/agent-builder/*` routes are gated by the `agent-builder` permission resource. Calling clients need at minimum `agent-builder:read` and `agent-builder:execute`, plus any picker resources the action touches (`stored-agents`, `stored-skills`, `tools`, `workflows`, `memory`). See [Access control](https://mastra.ai/docs/agent-builder/access-control) for the full grant list.
|
|
@@ -73,6 +73,10 @@ You can also pass `requestContext` as a `Record<string, any>`.
|
|
|
73
73
|
|
|
74
74
|
**getWorkflow(workflowId)** (`Workflow`): Retrieves a specific workflow instance by ID.
|
|
75
75
|
|
|
76
|
+
**getAgentBuilderActions()** (`Promise<Record<string, WorkflowInfo>>`): Returns all available Agent Builder actions. See \[Agent Builder API]\(/reference/client-js/agent-builder).
|
|
77
|
+
|
|
78
|
+
**getAgentBuilderAction(actionId)** (`AgentBuilder`): Retrieves an Agent Builder action by ID. See \[Agent Builder API]\(/reference/client-js/agent-builder).
|
|
79
|
+
|
|
76
80
|
**responses** (`Responses`): Provides OpenAI-style Responses API helpers with \`create()\`, \`retrieve()\`, \`stream()\`, and \`delete()\`.
|
|
77
81
|
|
|
78
82
|
**conversations** (`Conversations`): Provides conversation helpers with \`create()\`, \`retrieve()\`, \`delete()\`, and \`items.list()\`.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# AgentBuilderOptions
|
|
2
|
+
|
|
3
|
+
`AgentBuilderOptions` configures the Agent Builder. Pass it as `MastraEditor.builder` to enable the Builder UI, toggle visible surfaces, pin admin defaults, and opt into skill registries.
|
|
4
|
+
|
|
5
|
+
See the [Configuration](https://mastra.ai/docs/agent-builder/configuration) page for concepts and worked examples.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { MastraEditor } from '@mastra/editor'
|
|
11
|
+
|
|
12
|
+
new MastraEditor({
|
|
13
|
+
builder: {
|
|
14
|
+
enabled: true,
|
|
15
|
+
features: {
|
|
16
|
+
agent: { browser: false },
|
|
17
|
+
},
|
|
18
|
+
configuration: {
|
|
19
|
+
agent: {
|
|
20
|
+
memory: { observationalMemory: true },
|
|
21
|
+
models: {
|
|
22
|
+
allowed: [
|
|
23
|
+
{ provider: 'openai', modelId: 'gpt-5.4-mini' },
|
|
24
|
+
{ provider: 'openai', modelId: 'gpt-5.4' },
|
|
25
|
+
{ provider: 'anthropic', modelId: 'claude-opus-4-7' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
registries: {
|
|
31
|
+
skillsSh: { enabled: true },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
**enabled** (`boolean`): Master switch. When false, the Builder UI is disabled and \`MastraEditor.resolveBuilder()\` returns undefined. (Default: `true`)
|
|
40
|
+
|
|
41
|
+
**features** (`{ agent?: AgentFeatures }`): UI toggles. Each key on \`features.agent\` defaults to true when omitted.
|
|
42
|
+
|
|
43
|
+
**features.agent.tools** (`boolean`): Show the tools tab in the agent editor.
|
|
44
|
+
|
|
45
|
+
**features.agent.agents** (`boolean`): Show the sub-agents picker in the agent editor.
|
|
46
|
+
|
|
47
|
+
**features.agent.workflows** (`boolean`): Show the workflows picker in the agent editor.
|
|
48
|
+
|
|
49
|
+
**features.agent.skills** (`boolean`): Show the skills tab and library for the agent.
|
|
50
|
+
|
|
51
|
+
**features.agent.memory** (`boolean`): Show the memory configuration in the agent editor.
|
|
52
|
+
|
|
53
|
+
**features.agent.model** (`boolean`): Show the model picker in the agent editor. When false, the admin-pinned default model applies.
|
|
54
|
+
|
|
55
|
+
**features.agent.browser** (`boolean`): Show the browser tab. Resolves to true only when a valid browser provider is registered on \`MastraEditor.browsers\`; otherwise it is downgraded to false and a warning is logged.
|
|
56
|
+
|
|
57
|
+
**features.agent.avatarUpload** (`boolean`): Allow end users to upload an avatar for stored agents.
|
|
58
|
+
|
|
59
|
+
**features.agent.favorites** (`boolean`): Show favorite agents and skills with per-user state and aggregate counts.
|
|
60
|
+
|
|
61
|
+
**configuration** (`{ agent?: BuilderAgentDefaults }`): Admin-pinned defaults applied to every Builder-created agent. End users cannot override these values. See the BuilderAgentDefaults reference for the full schema.
|
|
62
|
+
|
|
63
|
+
**registries** (`{ skillsSh?: { enabled: boolean } }`): Opt-in third-party skill registries. When no registry is enabled, the Builder hides registry browse UI.
|
|
64
|
+
|
|
65
|
+
**registries.skillsSh** (`{ enabled: boolean }`): Enable the skills.sh registry. When enabled, the Builder shows registry browse UI for skills.sh skills.
|
|
66
|
+
|
|
67
|
+
**registries.skillsSh.enabled** (`boolean`): Set to \`true\` to opt in. Defaults to \`false\`.
|
|
68
|
+
|
|
69
|
+
## Related
|
|
70
|
+
|
|
71
|
+
- [Configuration](https://mastra.ai/docs/agent-builder/configuration) — concept and worked examples.
|
|
72
|
+
- [BuilderAgentDefaults](https://mastra.ai/reference/editor/agent-builder/builder-agent-defaults) — full schema for `configuration.agent`.
|
|
73
|
+
- [builder.configuration.agent.models](https://mastra.ai/reference/editor/agent-builder/builder-models) — model allowlist and default model.
|
|
74
|
+
- [MastraEditor class](https://mastra.ai/reference/editor/mastra-editor) — the parent surface that hosts `builder`.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# BuilderAgentDefaults
|
|
2
|
+
|
|
3
|
+
`BuilderAgentDefaults` describes the admin-pinned defaults applied to every agent the Agent Builder produces. Pass it as `builder.configuration.agent`. End users can't override these values from the Builder UI.
|
|
4
|
+
|
|
5
|
+
See [Configuration](https://mastra.ai/docs/agent-builder/configuration) and [Memory](https://mastra.ai/docs/agent-builder/memory) for worked examples.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { MastraEditor } from '@mastra/editor'
|
|
11
|
+
|
|
12
|
+
new MastraEditor({
|
|
13
|
+
builder: {
|
|
14
|
+
enabled: true,
|
|
15
|
+
configuration: {
|
|
16
|
+
agent: {
|
|
17
|
+
memory: { observationalMemory: true },
|
|
18
|
+
workspace: {
|
|
19
|
+
type: 'inline',
|
|
20
|
+
config: {
|
|
21
|
+
name: 'builder-workspace',
|
|
22
|
+
filesystem: {
|
|
23
|
+
provider: 'local',
|
|
24
|
+
config: { basePath: './workspace' },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
models: {
|
|
29
|
+
allowed: [
|
|
30
|
+
{ provider: 'openai', modelId: 'gpt-5.4-mini' },
|
|
31
|
+
{ provider: 'openai', modelId: 'gpt-5.4' },
|
|
32
|
+
{ provider: 'anthropic', modelId: 'claude-opus-4-7' },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
tools: { allowed: ['weather-info'] },
|
|
36
|
+
agents: { allowed: ['weather-agent'] },
|
|
37
|
+
workflows: { allowed: ['greet-workflow'] },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Properties
|
|
45
|
+
|
|
46
|
+
**memory** (`SerializedMemoryConfig`): Default memory configuration for new agents. Pass \`{ observationalMemory: true }\` to enable long-lived fact extraction. Requires \`Mastra.storage\`. See the SerializedMemoryConfig reference for the full schema.
|
|
47
|
+
|
|
48
|
+
**workspace** (`StorageWorkspaceRef`): Default workspace reference for new agents. Pass \`{ type: 'inline', config }\` to embed a snapshot, or \`{ type: 'id', workspaceId }\` to point at a workspace registered on \`Mastra.workspace\`. See the StorageWorkspaceRef reference for both variants.
|
|
49
|
+
|
|
50
|
+
**browser** (`StorageBrowserRef`): Default browser configuration for new agents. Pass \`{ type: 'inline', config: { provider } }\` to attach a registered browser provider. See the StorageBrowserRef reference for the full schema.
|
|
51
|
+
|
|
52
|
+
**models** (`{ allowed?: ProviderModelEntry[]; default?: DefaultModelEntry }`): Model allowlist and default applied to every Builder-created agent. See the BuilderModels reference for the full schema and validation rules.
|
|
53
|
+
|
|
54
|
+
**models.allowed** (`ProviderModelEntry[]`): Allowlist of providers and models. Omit to allow every registered model. ProviderModelEntry is a discriminated union (known providers vs. custom).
|
|
55
|
+
|
|
56
|
+
**models.default** (`DefaultModelEntry`): Pre-selected model on new-agent create. Required when the model picker is hidden. DefaultModelEntry requires \`provider\` and \`modelId\`, with an optional \`kind\`.
|
|
57
|
+
|
|
58
|
+
**tools** (`{ allowed?: string[] }`): Allowlist of tool IDs visible in the Builder tools picker. Unknown IDs are dropped and surfaced as warnings.
|
|
59
|
+
|
|
60
|
+
**tools.allowed** (`string[]`): Allowlist of \`tool.id\` values. Omit for unrestricted, pass \`\[]\` to lock the picker down, pass \`\[...ids]\` to restrict to the listed tools.
|
|
61
|
+
|
|
62
|
+
**agents** (`{ allowed?: string[] }`): Allowlist of agent IDs visible in the Builder sub-agents picker. Unknown IDs are dropped and surfaced as warnings.
|
|
63
|
+
|
|
64
|
+
**agents.allowed** (`string[]`): Allowlist of \`Agent.id\` values. Omit for unrestricted, pass \`\[]\` to lock the picker down, pass \`\[...ids]\` to restrict to the listed agents.
|
|
65
|
+
|
|
66
|
+
**workflows** (`{ allowed?: string[] }`): Allowlist of workflow IDs visible in the Builder workflows picker. Unknown IDs are dropped and surfaced as warnings.
|
|
67
|
+
|
|
68
|
+
**workflows.allowed** (`string[]`): Allowlist of \`workflow\.id\` values. Omit for unrestricted, pass \`\[]\` to lock the picker down, pass \`\[...ids]\` to restrict to the listed workflows.
|
|
69
|
+
|
|
70
|
+
## Related
|
|
71
|
+
|
|
72
|
+
- [AgentBuilderOptions](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) — the parent options object.
|
|
73
|
+
- [builder.configuration.agent.models](https://mastra.ai/reference/editor/agent-builder/builder-models) — admin-facing model allowlist and default.
|
|
74
|
+
- [SerializedMemoryConfig](https://mastra.ai/reference/memory/serialized-memory-config) — memory shape for new agents.
|
|
75
|
+
- [StorageWorkspaceRef](https://mastra.ai/reference/editor/storage-workspace-ref) — workspace reference shape.
|
|
76
|
+
- [StorageBrowserRef](https://mastra.ai/reference/editor/storage-browser-ref) — browser reference shape.
|
|
77
|
+
- [Configuration](https://mastra.ai/docs/agent-builder/configuration) — concept and worked examples.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# builder.configuration.agent.models
|
|
2
|
+
|
|
3
|
+
`builder.configuration.agent.models` is the admin-facing model policy input on `AgentBuilderOptions`. It controls which providers and models the Agent Builder exposes, and which model is pre-selected on new-agent create.
|
|
4
|
+
|
|
5
|
+
See [Model policy](https://mastra.ai/docs/agent-builder/model-policy) for concepts and worked examples.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { MastraEditor } from '@mastra/editor'
|
|
11
|
+
|
|
12
|
+
new MastraEditor({
|
|
13
|
+
builder: {
|
|
14
|
+
enabled: true,
|
|
15
|
+
configuration: {
|
|
16
|
+
agent: {
|
|
17
|
+
models: {
|
|
18
|
+
allowed: [
|
|
19
|
+
{ provider: 'openai', modelId: 'gpt-5.4-mini' },
|
|
20
|
+
{ provider: 'openai', modelId: 'gpt-5.4' },
|
|
21
|
+
{ provider: 'anthropic', modelId: 'claude-opus-4-7' },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Properties
|
|
31
|
+
|
|
32
|
+
**allowed** (`ProviderModelEntry[]`): Allowlist of providers and models. Omit to allow every registered model. When non-empty, only the listed entries are selectable in the Builder.
|
|
33
|
+
|
|
34
|
+
**allowed.provider** (`Provider`): Provider id from the generated provider registry (for example, \`openai\`, \`anthropic\`).
|
|
35
|
+
|
|
36
|
+
**allowed.modelId** (`ModelForProvider<Provider>`): Specific model id for that provider. Omit to allow every model under the provider.
|
|
37
|
+
|
|
38
|
+
**allowed.kind** (`'custom'`): Discriminant marking this entry as a gateway or self-hosted provider not in the registry.
|
|
39
|
+
|
|
40
|
+
**allowed.provider** (`string`): Provider id for the custom provider.
|
|
41
|
+
|
|
42
|
+
**allowed.modelId** (`string`): Specific model id under the custom provider. Omit to allow every model under it.
|
|
43
|
+
|
|
44
|
+
**default** (`DefaultModelEntry`): Pre-selected model on new-agent create. Same shape as \`ProviderModelEntry\`, but \`modelId\` is required. Must satisfy the \`allowed\` list when set.
|
|
45
|
+
|
|
46
|
+
**default.provider** (`Provider | string`): Provider id. Use a \`Provider\` literal for known providers, or any \`string\` with \`kind: 'custom'\`.
|
|
47
|
+
|
|
48
|
+
**default.modelId** (`string`): Required model id. Points at a specific model, not a whole provider.
|
|
49
|
+
|
|
50
|
+
**default.kind** (`'custom'`): Set to \`custom\` when targeting a provider that isn't in the generated registry.
|
|
51
|
+
|
|
52
|
+
## Validation rules
|
|
53
|
+
|
|
54
|
+
Mastra validates the admin policy at server boot. Violations surface as warnings on `GET /editor/builder/settings.modelPolicyWarnings`.
|
|
55
|
+
|
|
56
|
+
- `allowed` empty or omitted: no restriction. Every registered model is available.
|
|
57
|
+
- When `allowed` is non-empty and a `default` is set: `default` must satisfy `isModelAllowed(allowed, default)`. A `default` that fails this check is dropped and surfaced as a warning.
|
|
58
|
+
- To hide the end-user model picker, set `features.agent.model: false` in [AgentBuilderOptions](https://mastra.ai/reference/editor/agent-builder/agent-builder-options). When the picker is hidden, provide a `default` so new agents resolve a model.
|
|
59
|
+
|
|
60
|
+
## Related
|
|
61
|
+
|
|
62
|
+
- [BuilderAgentDefaults](https://mastra.ai/reference/editor/agent-builder/builder-agent-defaults) — parent object containing `models`.
|
|
63
|
+
- [AgentBuilderOptions](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) — the top-level Builder options.
|
|
64
|
+
- [Model policy](https://mastra.ai/docs/agent-builder/model-policy) — concept and worked examples.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# BlobStoreProvider
|
|
2
|
+
|
|
3
|
+
`BlobStoreProvider` is the interface a package implements to register a blob store with [`MastraEditor`](https://mastra.ai/reference/editor/mastra-editor). Blob stores hold content-addressable skill blobs and other large artifacts produced by the editor.
|
|
4
|
+
|
|
5
|
+
The built-in `storage` provider uses the configured storage backend's `blobs` domain. External providers (for example, S3) are supplied via `MastraEditorConfig.blobStores`.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { MastraEditor } from '@mastra/editor'
|
|
11
|
+
import { s3BlobStoreProvider } from '@mastra/s3'
|
|
12
|
+
|
|
13
|
+
new MastraEditor({
|
|
14
|
+
blobStores: {
|
|
15
|
+
[s3BlobStoreProvider.id]: s3BlobStoreProvider,
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
**id** (`string`): Unique provider identifier (for example, \`"storage"\`, \`"s3"\`).
|
|
23
|
+
|
|
24
|
+
**name** (`string`): Human-readable name for UI display.
|
|
25
|
+
|
|
26
|
+
**description** (`string`): Short description.
|
|
27
|
+
|
|
28
|
+
**configSchema** (`Record<string, unknown>`): JSON Schema describing provider-specific configuration. Used by the UI to render config forms.
|
|
29
|
+
|
|
30
|
+
**createBlobStore** (`(config: TConfig) => BlobStore | Promise<BlobStore>`): Create a runtime \`BlobStore\` instance from the stored config. Called when the editor resolves a blob store via \`MastraEditor.resolveBlobStore(providerId, config)\`.
|
|
31
|
+
|
|
32
|
+
## Implementing a provider
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import type { BlobStore, BlobStoreProvider } from '@mastra/core/editor'
|
|
36
|
+
|
|
37
|
+
export const myBlobStoreProvider: BlobStoreProvider<{ bucket: string; region: string }> = {
|
|
38
|
+
id: 'my-blob-store',
|
|
39
|
+
name: 'My Blob Store',
|
|
40
|
+
description: 'Object-store-backed blob storage.',
|
|
41
|
+
configSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
required: ['bucket', 'region'],
|
|
44
|
+
properties: {
|
|
45
|
+
bucket: { type: 'string' },
|
|
46
|
+
region: { type: 'string' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
async createBlobStore(config): Promise<BlobStore> {
|
|
50
|
+
return createMyBlobStore({ bucket: config.bucket, region: config.region })
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
When no `providerId` is passed to `MastraEditor.resolveBlobStore()`, the editor falls back to the storage backend's `blobs` domain.
|
|
56
|
+
|
|
57
|
+
## Related
|
|
58
|
+
|
|
59
|
+
- [MastraEditor class](https://mastra.ai/reference/editor/mastra-editor) — provider registry and `resolveBlobStore()` method.
|