@mastra/mcp-docs-server 1.1.41 → 1.1.42-alpha.4

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.
Files changed (33) hide show
  1. package/.docs/docs/agent-builder/access-control.md +97 -0
  2. package/.docs/docs/agent-builder/browser.md +61 -0
  3. package/.docs/docs/agent-builder/channels.md +76 -0
  4. package/.docs/docs/agent-builder/configuration.md +147 -0
  5. package/.docs/docs/agent-builder/deploying.md +121 -0
  6. package/.docs/docs/agent-builder/memory.md +65 -0
  7. package/.docs/docs/agent-builder/model-policy.md +48 -0
  8. package/.docs/docs/agent-builder/overview.md +97 -0
  9. package/.docs/docs/agent-builder/skill-registries.md +31 -0
  10. package/.docs/docs/agent-builder/workspace.md +60 -0
  11. package/.docs/docs/agents/channels.md +2 -0
  12. package/.docs/docs/memory/observational-memory.md +19 -0
  13. package/.docs/guides/deployment/inngest.md +69 -0
  14. package/.docs/reference/agents/channels.md +1 -1
  15. package/.docs/reference/client-js/agent-builder.md +161 -0
  16. package/.docs/reference/client-js/mastra-client.md +4 -0
  17. package/.docs/reference/editor/agent-builder/agent-builder-options.md +74 -0
  18. package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +77 -0
  19. package/.docs/reference/editor/agent-builder/builder-models.md +64 -0
  20. package/.docs/reference/editor/blob-store-provider.md +59 -0
  21. package/.docs/reference/editor/browser-provider.md +75 -0
  22. package/.docs/reference/editor/filesystem-provider.md +62 -0
  23. package/.docs/reference/editor/mastra-editor.md +44 -0
  24. package/.docs/reference/editor/processor-provider.md +64 -0
  25. package/.docs/reference/editor/sandbox-provider.md +61 -0
  26. package/.docs/reference/editor/storage-browser-ref.md +80 -0
  27. package/.docs/reference/editor/storage-workspace-ref.md +93 -0
  28. package/.docs/reference/evals/create-scorer.md +2 -0
  29. package/.docs/reference/index.md +12 -0
  30. package/.docs/reference/memory/observational-memory.md +2 -0
  31. package/.docs/reference/memory/serialized-memory-config.md +72 -0
  32. package/CHANGELOG.md +21 -0
  33. package/package.json +4 -4
@@ -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.
@@ -88,6 +88,8 @@ When a user mentions the agent mid-conversation in a channel thread, the agent m
88
88
 
89
89
  Set `threadContext: { maxMessages: 0 }` to disable this behavior. This only applies to non-DM threads.
90
90
 
91
+ Mastra also adds a short system message telling the agent which channel and platform the request came from (DM vs public channel, platform name, bot display name). Set `threadContext: { addSystemMessage: false }` to skip it.
92
+
91
93
  ## Tool approval
92
94
 
93
95
  Tools with `requireApproval: true` render as interactive cards with Approve and Deny buttons:
@@ -117,6 +117,25 @@ const memory = new Memory({
117
117
 
118
118
  In this example, the top-level idle setting is disabled for observations, while reflections opt into idle and provider-change activation.
119
119
 
120
+ ### Buffer on idle
121
+
122
+ Set `observation.bufferOnIdle` to `true` to run background observation buffering when an agent turn ends and the agent becomes idle. This is useful for apps that want short turns to be observed without waiting for the next turn or the `messageTokens` threshold.
123
+
124
+ ```typescript
125
+ const memory = new Memory({
126
+ options: {
127
+ observationalMemory: {
128
+ model: 'openai/gpt-5-mini',
129
+ observation: {
130
+ bufferOnIdle: true,
131
+ },
132
+ },
133
+ },
134
+ })
135
+ ```
136
+
137
+ `bufferOnIdle` is off by default. It is separate from `bufferTokens`: `bufferTokens` controls step-time async buffering, while `bufferOnIdle` controls end-of-turn buffering for idle turns.
138
+
120
139
  See [the API reference](https://mastra.ai/reference/memory/observational-memory) for the full configuration shape.
121
140
 
122
141
  ## Benefits
@@ -431,6 +431,75 @@ export { handler as GET, handler as POST, handler as PUT }
431
431
 
432
432
  The `createServe` function works with any Inngest adapter. See the [Inngest serve documentation](https://www.inngest.com/docs/reference/serve) for a complete list of available adapters including AWS Lambda, Cloudflare Workers, and more.
433
433
 
434
+ ## Running as a Connect worker
435
+
436
+ `serve()` exposes an HTTP endpoint that Inngest calls into. As an alternative, `connect()` opens a long-lived outbound connection from your worker to Inngest, so the worker does not need a publicly reachable endpoint. Use this for long-running worker processes on runtimes such as Kubernetes, Docker, ECS, Fly.io, or Render.
437
+
438
+ > **Note:** Inngest Connect is in public beta. Serverless runtimes such as Vercel and AWS Lambda are not supported for Connect workers.
439
+
440
+ ### When to use `connect()` instead of `serve()`
441
+
442
+ - The worker process runs in a private network that only allows outbound connections.
443
+ - You want to keep heavy workflow execution out of the same process that serves user-facing HTTP traffic.
444
+ - You want to scale workers up and down independently of the Mastra HTTP server, with per-worker concurrency limits.
445
+
446
+ Use the same Mastra workflow definitions with either `serve()` or `connect()`. The collection behavior is the same for standard workflows, nested workflows, cron workflows, and additional Inngest functions.
447
+
448
+ ### Requirements
449
+
450
+ - `inngest@^4`
451
+ - Node.js `22.13.0` or later
452
+ - A long-running process for the worker
453
+
454
+ ### Setup
455
+
456
+ Run the Mastra server and the Connect worker as two processes. The Mastra server in this setup does not need to expose `/inngest/api`:
457
+
458
+ ```ts
459
+ import { Mastra } from '@mastra/core'
460
+ import { incrementWorkflow } from './workflows'
461
+ import { PinoLogger } from '@mastra/loggers'
462
+
463
+ export const mastra = new Mastra({
464
+ workflows: { incrementWorkflow },
465
+ logger: new PinoLogger({ name: 'Mastra', level: 'info' }),
466
+ })
467
+ ```
468
+
469
+ ```ts
470
+ import { connect } from '@mastra/inngest/connect'
471
+ import { mastra } from './mastra'
472
+ import { inngest } from './mastra/inngest'
473
+
474
+ await connect({
475
+ mastra,
476
+ inngest,
477
+ instanceId: process.env.INNGEST_CONNECT_INSTANCE_ID,
478
+ maxWorkerConcurrency: Number(process.env.INNGEST_CONNECT_MAX_WORKER_CONCURRENCY ?? 10),
479
+ })
480
+ ```
481
+
482
+ Start the worker with `INNGEST_DEV=1 node --import tsx src/worker.ts` during local development. The Inngest Dev Server discovers the worker through the outbound connection, so no `-u` flag is required.
483
+
484
+ In production, set `INNGEST_EVENT_KEY` and `INNGEST_SIGNING_KEY`. Set `appVersion` on the `Inngest` client to a deploy identifier, such as a commit SHA or image tag, so Inngest can manage rolling deploys.
485
+
486
+ When migrating an existing production app from `serve()` to `connect()`, test the worker with a separate Inngest app before moving traffic.
487
+
488
+ ### Options
489
+
490
+ `connect()` accepts the same options as Inngest's [`connect`](https://www.inngest.com/docs/setup/connect) plus the Mastra-specific fields. The most common ones:
491
+
492
+ - `mastra`: The Mastra instance whose workflows should be exposed.
493
+ - `inngest`: The Inngest client. Use the same client you would pass to `serve()`.
494
+ - `functions`: Optional array of additional Inngest functions to register alongside Mastra workflows.
495
+ - `instanceId`: Stable identifier for the worker, shown in the Inngest dashboard. Defaults to the machine hostname.
496
+ - `maxWorkerConcurrency`: Maximum number of steps the worker runs at a time. Defaults to unlimited.
497
+ - `registerOptions`: Forwarded to Inngest during app registration (for example `signingKey`). When a field is set both here and at the top level, `registerOptions` wins — this matches the behavior of `serve()`.
498
+
499
+ `connect()` returns Inngest's `WorkerConnection`. The Inngest SDK handles `SIGINT` and `SIGTERM` by default. Store the returned connection and call `.close()` only when your worker needs custom shutdown control.
500
+
501
+ If the Mastra instance has no `InngestWorkflow` and no additional `functions` are provided, `connect()` logs a warning because the worker would otherwise stay connected with nothing to execute. Register at least one workflow on Mastra or pass `functions: [...]`.
502
+
434
503
  ## Using a custom `apiPrefix`
435
504
 
436
505
  If you need to keep `/api/inngest` (for example to match Inngest's auto-discover convention without changing the dashboard URL), set `server.apiPrefix` to relocate Mastra's built-in routes:
@@ -41,7 +41,7 @@ export const supportAgent = new Agent({
41
41
 
42
42
  **userName** (`string`): Bot display name shown in platform messages. Defaults to the agent's \`name\`, or \`'Mastra'\` if no name is set. (Default: `` agent's `name` ``)
43
43
 
44
- **threadContext** (`{ maxMessages?: number }`): Fetch recent messages from the platform when the agent is first mentioned in a thread. Set \`maxMessages: 0\` to disable. Only applies to non-DM threads. (Default: `{ maxMessages: 10 }`)
44
+ **threadContext** (`{ maxMessages?: number; addSystemMessage?: boolean }`): How the agent picks up context about the current thread. \`maxMessages\` controls how many recent platform messages are fetched on first mention (set to \`0\` to disable; only applies to non-DM threads). \`addSystemMessage: false\` skips the built-in system message that tells the agent which channel/platform a request came from. (Default: `{ maxMessages: 10, addSystemMessage: true }`)
45
45
 
46
46
  **chatOptions** (`Omit<ChatConfig, 'adapters' | 'state' | 'userName'>`): Additional options passed directly to the \[Chat SDK]\(https\://chat-sdk.dev/docs/usage). Use for advanced configuration such as \`dedupeTtlMs\`, \`fallbackStreamingPlaceholderText\`, \`lockScope\`, and \`messageHistory\`.
47
47
 
@@ -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.