@mastra/mcp-docs-server 1.2.14-alpha.1 → 1.2.14-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.
- package/.docs/docs/agents/a2a.md +1 -1
- package/.docs/docs/agents/acp.md +1 -1
- package/.docs/docs/agents/agent-approval.md +1 -1
- package/.docs/docs/agents/networks.md +2 -2
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +25 -1
- package/.docs/docs/agents/using-tools.md +2 -2
- package/.docs/docs/capabilities/channels/overview.md +1 -1
- package/.docs/docs/{agents/supervisor-agents.md → capabilities/subagents.md} +58 -58
- package/.docs/docs/deployment/sandbox.md +95 -1
- package/.docs/docs/getting-started/develop.md +2 -0
- package/.docs/docs/harness/agent-controller.md +370 -0
- package/.docs/docs/long-running-agents/background-tasks.md +1 -1
- package/.docs/docs/long-running-agents/goals.md +3 -3
- package/.docs/docs/mcp/overview.md +222 -281
- package/.docs/docs/memory/overview.md +2 -2
- package/.docs/docs/observability/integrations/exporters/confident-ai.md +140 -0
- package/.docs/docs/observability/integrations/overview.md +1 -1
- package/.docs/docs/observability/overview.md +122 -8
- package/.docs/docs/observability/tracing/overview.md +2 -2
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/server-adapters.md +2 -0
- package/.docs/docs/storage/overview.md +2 -2
- package/.docs/docs/workflows/agents-and-tools.md +29 -0
- package/.docs/docs/workflows/stored-workflows.md +146 -0
- package/.docs/guides/build-your-ui/copilotkit/channels.md +49 -39
- package/.docs/guides/concepts/multi-agent-systems.md +7 -7
- package/.docs/guides/guide/coding-agent.md +2 -2
- package/.docs/guides/guide/research-coordinator.md +1 -1
- package/.docs/guides/migrations/network-to-supervisor.md +1 -1
- package/.docs/models/environment-variables.md +1 -1
- package/.docs/models/gateways/neon.md +71 -0
- package/.docs/models/gateways/netlify.md +6 -6
- package/.docs/models/gateways/openrouter.md +6 -6
- package/.docs/models/gateways/vercel.md +6 -6
- package/.docs/models/gateways.md +1 -0
- package/.docs/models/index.md +96 -97
- package/.docs/models/providers/alibaba-cn.md +23 -25
- package/.docs/models/providers/alibaba-token-plan-cn.md +24 -24
- package/.docs/models/providers/alibaba-token-plan.md +23 -25
- package/.docs/models/providers/alibaba.md +23 -25
- package/.docs/models/providers/ambient.md +23 -25
- package/.docs/models/providers/baseten.md +23 -25
- package/.docs/models/providers/chutes.md +23 -25
- package/.docs/models/providers/cortecs.md +23 -25
- package/.docs/models/providers/crof.md +23 -25
- package/.docs/models/providers/crossmodel.md +23 -25
- package/.docs/models/providers/deepinfra.md +22 -24
- package/.docs/models/providers/digitalocean.md +32 -34
- package/.docs/models/providers/empiriolabs.md +23 -25
- package/.docs/models/providers/fireworks-ai.md +24 -24
- package/.docs/models/providers/greenpt.md +23 -25
- package/.docs/models/providers/groq.md +23 -25
- package/.docs/models/providers/huggingface.md +23 -25
- package/.docs/models/providers/hyper.md +23 -25
- package/.docs/models/providers/impossibl.md +23 -25
- package/.docs/models/providers/infomaniak.md +24 -24
- package/.docs/models/providers/kilo.md +24 -26
- package/.docs/models/providers/llmgateway.md +24 -26
- package/.docs/models/providers/mistral.md +23 -25
- package/.docs/models/providers/modal.md +23 -25
- package/.docs/models/providers/modelis.md +23 -25
- package/.docs/models/providers/nano-gpt.md +23 -25
- package/.docs/models/providers/neuralwatt.md +23 -25
- package/.docs/models/providers/ofox.md +23 -25
- package/.docs/models/providers/ollama-cloud.md +23 -25
- package/.docs/models/providers/opencode-go.md +23 -25
- package/.docs/models/providers/opencode.md +25 -26
- package/.docs/models/providers/pioneer.md +23 -25
- package/.docs/models/providers/requesty.md +23 -25
- package/.docs/models/providers/routing-run.md +23 -25
- package/.docs/models/providers/scx.md +23 -25
- package/.docs/models/providers/tensorx.md +23 -25
- package/.docs/models/providers/togetherai.md +22 -24
- package/.docs/models/providers/umans-ai-coding-plan.md +24 -24
- package/.docs/models/providers/umans-ai.md +23 -25
- package/.docs/models/providers/wandb.md +23 -25
- package/.docs/models/providers/xai.md +26 -28
- package/.docs/models/providers/zai-coding-plan.md +23 -25
- package/.docs/models/providers/zhipuai-coding-plan.md +23 -25
- package/.docs/models/providers.md +0 -1
- package/.docs/reference/acp/acp-agent.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +195 -506
- package/.docs/reference/agent-controller/session.md +274 -111
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/handle-network-stream.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/cli/create-mastra.md +1 -1
- package/.docs/reference/client-js/workflows.md +92 -0
- package/.docs/reference/core/addStoredWorkflow.md +62 -0
- package/.docs/reference/core/addStoredWorkflows.md +40 -0
- package/.docs/reference/editor/versioning.md +1 -1
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/observability.md +2 -2
- package/.docs/reference/file-based-agents/storage.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +1 -1
- package/.docs/reference/file-based-agents/tools.md +1 -1
- package/.docs/reference/index.md +5 -0
- package/.docs/reference/observability/tracing/configuration.md +1 -1
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +138 -0
- package/.docs/reference/observability/tracing/interfaces.md +29 -0
- package/.docs/reference/processors/processor-interface.md +121 -10
- package/.docs/reference/server/routes.md +13 -0
- package/.docs/reference/signals/signal-provider.md +2 -0
- package/.docs/reference/storage/overview.md +9 -8
- package/.docs/reference/streaming/workflows/observeStream.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/tools/mcp-server.md +1 -1
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/workflows/stored-workflow-definition.md +292 -0
- package/.docs/reference/workflows/workflow-methods/agent.md +62 -0
- package/.docs/reference/workflows/workflow-methods/tool.md +43 -0
- package/.docs/reference/workspace/railway-sandbox.md +5 -5
- package/CHANGELOG.md +14 -0
- package/package.json +4 -4
- package/.docs/docs/agent-controller/channels.md +0 -111
- package/.docs/docs/agent-controller/modes.md +0 -147
- package/.docs/docs/agent-controller/overview.md +0 -136
- package/.docs/docs/agent-controller/session.md +0 -161
- package/.docs/docs/agent-controller/subagents.md +0 -110
- package/.docs/docs/agent-controller/threads-and-state.md +0 -148
- package/.docs/docs/agent-controller/tool-approvals.md +0 -147
- package/.docs/docs/mcp/mcp-apps.md +0 -306
- package/.docs/docs/observability/config.md +0 -140
- package/.docs/docs/observability/storage.md +0 -81
- package/.docs/models/providers/neon.md +0 -109
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The `.network()` method enables multi-agent collaboration and routing. This method accepts messages and optional execution options.
|
|
6
6
|
|
|
7
|
-
> **Deprecated:** The `.network()` primitive has been deprecated and will be removed in a future major release. Use [supervisor agents](https://mastra.ai/docs/
|
|
7
|
+
> **Deprecated:** The `.network()` primitive has been deprecated and will be removed in a future major release. Use [supervisor agents](https://mastra.ai/docs/capabilities/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/guides/migrations/network-to-supervisor) to upgrade.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# handleNetworkStream()
|
|
4
4
|
|
|
5
|
-
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/
|
|
5
|
+
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/capabilities/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/guides/migrations/network-to-supervisor) to upgrade.
|
|
6
6
|
|
|
7
7
|
Framework-agnostic handler for streaming network execution in AI SDK-compatible format. Use this function directly when you need to handle network streaming outside Hono or Mastra's own [apiRoutes](https://mastra.ai/docs/server/custom-api-routes) feature.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# networkRoute()
|
|
4
4
|
|
|
5
|
-
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/
|
|
5
|
+
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/capabilities/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/guides/migrations/network-to-supervisor) to upgrade.
|
|
6
6
|
|
|
7
7
|
Creates a network route handler for streaming network execution using the AI SDK format. This function registers an HTTP `POST` endpoint that accepts messages, executes an agent network, and streams the response back to the client in AI SDK-compatible format. Agent networks allow a routing agent to delegate tasks to other agents. You have to use it inside a [custom API route](https://mastra.ai/docs/server/custom-api-routes).
|
|
8
8
|
|
|
@@ -195,7 +195,7 @@ Invalid input is rejected before templates are fetched or files are created.
|
|
|
195
195
|
|
|
196
196
|
**-l, --llm \<provider>** (`string`): Managed agent-harness provider: openai, anthropic, google, or xai.
|
|
197
197
|
|
|
198
|
-
**-k, --llm-api-key \<key>** (`string`): Write the selected provider API key to the generated .env file.
|
|
198
|
+
**-k, --llm-api-key \<key>** (`string`): Write the selected provider API key to the generated .env file when automatic provider setup succeeds.
|
|
199
199
|
|
|
200
200
|
**--no-skills** (`boolean`): Skip automatic Mastra skills installation.
|
|
201
201
|
|
|
@@ -212,6 +212,98 @@ A workflow run result yields the following:
|
|
|
212
212
|
|
|
213
213
|
**payload** (`object`): Contains currentStep (id, status, output, payload) and workflowState (status, steps record)
|
|
214
214
|
|
|
215
|
+
## Stored workflows
|
|
216
|
+
|
|
217
|
+
> **Beta:** Stored workflows are in beta. Breaking changes may occur without a major version bump until the API is stable.
|
|
218
|
+
|
|
219
|
+
Stored workflows are workflow definitions expressed as JSON. The server persists each definition and registers it as a runnable workflow. See [Stored workflows](https://mastra.ai/docs/workflows/stored-workflows) for the definition format.
|
|
220
|
+
|
|
221
|
+
### `listStoredWorkflows()`
|
|
222
|
+
|
|
223
|
+
List stored workflow definitions, optionally filtered by `status` (`'active' | 'archived'`) and `authorId`:
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
const { definitions, total } = await mastraClient.listStoredWorkflows({
|
|
227
|
+
status: 'active',
|
|
228
|
+
})
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### `upsertStoredWorkflow()`
|
|
232
|
+
|
|
233
|
+
Create or replace a stored workflow definition. The server validates the definition, persists it, and live-registers it for execution:
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
const stored = await mastraClient.upsertStoredWorkflow({
|
|
237
|
+
id: 'greeting-workflow',
|
|
238
|
+
description: 'Returns a greeting for the supplied name',
|
|
239
|
+
inputSchema: {
|
|
240
|
+
type: 'object',
|
|
241
|
+
properties: { name: { type: 'string' } },
|
|
242
|
+
required: ['name'],
|
|
243
|
+
},
|
|
244
|
+
outputSchema: {
|
|
245
|
+
type: 'object',
|
|
246
|
+
properties: { message: { type: 'string' } },
|
|
247
|
+
required: ['message'],
|
|
248
|
+
},
|
|
249
|
+
graph: [
|
|
250
|
+
{
|
|
251
|
+
type: 'mapping',
|
|
252
|
+
id: 'create-greeting',
|
|
253
|
+
mapConfig: JSON.stringify({
|
|
254
|
+
message: { template: 'Hello, ${initData.name}!' },
|
|
255
|
+
}),
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
})
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
When the root definition nests helper workflows that don't exist yet, pass them in the same request through `dependencies`. The server validates and registers the bundle as a unit and echoes the helper ids back as `dependencyIds`:
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
const stored = await mastraClient.upsertStoredWorkflow({
|
|
265
|
+
id: 'root-workflow',
|
|
266
|
+
// ...schemas and graph referencing 'helper-workflow'...
|
|
267
|
+
dependencies: [helperDefinition],
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
console.log(stored.dependencyIds) // ['helper-workflow']
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### `getStoredWorkflow()`
|
|
274
|
+
|
|
275
|
+
Get a stored workflow instance for definition management. To execute a stored workflow, use `getWorkflow(id).createRun()` like any other workflow:
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
const storedWorkflow = mastraClient.getStoredWorkflow('greeting-workflow')
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### `storedWorkflow.details()`
|
|
282
|
+
|
|
283
|
+
Retrieve the persisted definition, including schemas, graph, status, and timestamps:
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
const definition = await storedWorkflow.details()
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### `storedWorkflow.delete()`
|
|
290
|
+
|
|
291
|
+
Delete the stored definition and unregister the live workflow:
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
await storedWorkflow.delete()
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Executing a stored workflow
|
|
298
|
+
|
|
299
|
+
Once registered, a stored workflow runs through the ordinary workflow API:
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
const workflow = mastraClient.getWorkflow('greeting-workflow')
|
|
303
|
+
const run = await workflow.createRun()
|
|
304
|
+
const result = await run.startAsync({ inputData: { name: 'Ada' } })
|
|
305
|
+
```
|
|
306
|
+
|
|
215
307
|
## Schedules
|
|
216
308
|
|
|
217
309
|
Schedules are declared in code via the `schedule` field on `createWorkflow`. The client SDK exposes read and operational methods for managing workflow schedules at runtime. See [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Mastra.addStoredWorkflow()
|
|
4
|
+
|
|
5
|
+
> **Beta:** Stored workflows are in beta. Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
7
|
+
The `.addStoredWorkflow()` method validates a stored workflow definition and registers it as a live workflow on the instance, persisting it through the `workflowDefinitions` storage domain. Once registered, the workflow runs like any other workflow via [`getWorkflow()`](https://mastra.ai/reference/core/getWorkflow).
|
|
8
|
+
|
|
9
|
+
See [Stored workflows](https://mastra.ai/docs/workflows/stored-workflows) for a complete setup example and the [stored workflow definition reference](https://mastra.ai/reference/workflows/stored-workflow-definition) for the accepted fields and graph entries.
|
|
10
|
+
|
|
11
|
+
## Usage example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
await mastra.addStoredWorkflow({
|
|
15
|
+
id: 'greeting-workflow',
|
|
16
|
+
description: 'Returns a greeting for the supplied name',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: { name: { type: 'string' } },
|
|
20
|
+
required: ['name'],
|
|
21
|
+
},
|
|
22
|
+
outputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: { message: { type: 'string' } },
|
|
25
|
+
required: ['message'],
|
|
26
|
+
},
|
|
27
|
+
graph: [
|
|
28
|
+
{
|
|
29
|
+
type: 'mapping',
|
|
30
|
+
id: 'create-greeting',
|
|
31
|
+
mapConfig: JSON.stringify({
|
|
32
|
+
message: { template: 'Hello, ${initData.name}!' },
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const run = await mastra.getWorkflow('greeting-workflow').createRun()
|
|
39
|
+
const result = await run.start({ inputData: { name: 'Ada' } })
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Parameters
|
|
43
|
+
|
|
44
|
+
**def** (`StoredWorkflowGraph`): The workflow definition: id, optional description and metadata, JSON Schema input/output schemas, optional state and request-context schemas, and the step graph.
|
|
45
|
+
|
|
46
|
+
## Returns
|
|
47
|
+
|
|
48
|
+
A promise that resolves once the definition is validated, registered, and persisted.
|
|
49
|
+
|
|
50
|
+
## Behavior
|
|
51
|
+
|
|
52
|
+
- The definition is fully validated (structure, references, schema flow) before anything is mutated. Agents, tools, and workflows referenced by the graph must already be registered on the instance.
|
|
53
|
+
- Adding a definition with an existing ID replaces both the stored definition and the live registration. In-flight runs keep the graph they started with.
|
|
54
|
+
- Without a storage adapter that supports the `workflowDefinitions` domain, the workflow is still validated and registered in memory, but the definition is lost on restart.
|
|
55
|
+
- To add a root workflow together with helper workflows it nests, use [`addStoredWorkflows()`](https://mastra.ai/reference/core/addStoredWorkflows).
|
|
56
|
+
|
|
57
|
+
## Related
|
|
58
|
+
|
|
59
|
+
- [Mastra.addStoredWorkflows()](https://mastra.ai/reference/core/addStoredWorkflows): Add a dependency-ordered bundle of definitions
|
|
60
|
+
- [Mastra.getWorkflow()](https://mastra.ai/reference/core/getWorkflow): Retrieve a registered workflow
|
|
61
|
+
- [Stored workflows](https://mastra.ai/docs/workflows/stored-workflows): Set up and use stored workflows
|
|
62
|
+
- [Stored workflow definition](https://mastra.ai/reference/workflows/stored-workflow-definition): Definition fields and graph entries
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Mastra.addStoredWorkflows()
|
|
4
|
+
|
|
5
|
+
> **Beta:** Stored workflows are in beta. Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
7
|
+
The `.addStoredWorkflows()` method adds a bundle of stored workflow definitions that may reference each other. The typical case is a root workflow plus helper workflows it nests, where none of the definitions exist yet.
|
|
8
|
+
|
|
9
|
+
The whole bundle is validated up front. Members are then registered in dependency order, so a helper is always in place before the workflow that nests it.
|
|
10
|
+
|
|
11
|
+
[`addStoredWorkflow()`](https://mastra.ai/reference/core/addStoredWorkflow) is the single-member case.
|
|
12
|
+
|
|
13
|
+
## Usage example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
await mastra.addStoredWorkflows([
|
|
17
|
+
helperDefinition, // nested by the root — order in the array doesn't matter
|
|
18
|
+
rootDefinition, // graph contains { type: 'workflow', workflowId: helperDefinition.id }
|
|
19
|
+
])
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Parameters
|
|
23
|
+
|
|
24
|
+
**defs** (`readonly StoredWorkflowGraph[]`): The workflow definitions to add. Nested-workflow references may resolve against the live registries or against other members of the same bundle.
|
|
25
|
+
|
|
26
|
+
## Returns
|
|
27
|
+
|
|
28
|
+
A promise that resolves once every member is validated, registered, and persisted.
|
|
29
|
+
|
|
30
|
+
## Behavior
|
|
31
|
+
|
|
32
|
+
- References resolve against the instance's registries union the bundle's own IDs, so a root may nest a helper introduced in the same call. Registration order is derived from the dependency graph, not the array order.
|
|
33
|
+
- A rejected bundle registers nothing. Duplicate IDs, invalid members, and dependency cycles are detected before anything is mutated, and if registration or persistence fails partway, the in-memory registry is restored to its prior state.
|
|
34
|
+
- Storage writes happen last. A storage-level failure mid-bundle can leave some rows written, but the registry is still rolled back and the orphaned rows are inert until the next boot.
|
|
35
|
+
|
|
36
|
+
## Related
|
|
37
|
+
|
|
38
|
+
- [Mastra.addStoredWorkflow()](https://mastra.ai/reference/core/addStoredWorkflow): Add a single definition
|
|
39
|
+
- [Stored workflows](https://mastra.ai/docs/workflows/stored-workflows): Set up and use stored workflows
|
|
40
|
+
- [Stored workflow definition](https://mastra.ai/reference/workflows/stored-workflow-definition): Definition fields and graph entries
|
|
@@ -54,7 +54,7 @@ See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agen
|
|
|
54
54
|
|
|
55
55
|
## Sub-agent versioning
|
|
56
56
|
|
|
57
|
-
Version overrides propagate through [supervisor-agent delegation](https://mastra.ai/docs/
|
|
57
|
+
Version overrides propagate through [supervisor-agent delegation](https://mastra.ai/docs/capabilities/subagents) in request context. Define selectors at three levels:
|
|
58
58
|
|
|
59
59
|
1. `Mastra` instance `versions`: Defaults for every invocation
|
|
60
60
|
2. Server request-body `versions`: Per-request values added to request context
|
|
@@ -111,5 +111,5 @@ The `reason` summarizes the result and lists each criterion with its verdict, so
|
|
|
111
111
|
## Related
|
|
112
112
|
|
|
113
113
|
- [isTaskComplete on stream()](https://mastra.ai/reference/streaming/agents/stream)
|
|
114
|
-
- [Supervisor agents](https://mastra.ai/docs/
|
|
114
|
+
- [Supervisor agents](https://mastra.ai/docs/capabilities/subagents)
|
|
115
115
|
- [createScorer](https://mastra.ai/reference/evals/create-scorer)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Mastra configures [observability](https://mastra.ai/docs/observability/overview) from an `observability.ts` file directly under `src/mastra/`. The file default-exports an `Observability` instance that sets up tracing, logging, metrics, and feedback for the project.
|
|
6
6
|
|
|
7
|
-
Use this page for the file-based convention. For the signal model, exporters, storage, and multi-config setup, see [
|
|
7
|
+
Use this page for the file-based convention. For the signal model, exporters, storage, and multi-config setup, see the [observability overview](https://mastra.ai/docs/observability/overview) and [observability configuration](https://mastra.ai/docs/observability/overview).
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ export default new Observability({
|
|
|
25
25
|
|
|
26
26
|
## Observability and storage
|
|
27
27
|
|
|
28
|
-
`observability.ts` configures which signals are collected and where they're exported. [`storage.ts`](https://mastra.ai/reference/file-based-agents/storage) configures the project store that can persist observability records. For storage support by signal, see [
|
|
28
|
+
`observability.ts` configures which signals are collected and where they're exported. [`storage.ts`](https://mastra.ai/reference/file-based-agents/storage) configures the project store that can persist observability records. For storage support by signal, see [observability signal support](https://mastra.ai/docs/observability/overview).
|
|
29
29
|
|
|
30
30
|
## Precedence with code
|
|
31
31
|
|
|
@@ -23,7 +23,7 @@ Mastra registers the store before file-based agents and workflows, so storage-de
|
|
|
23
23
|
|
|
24
24
|
## Production backends
|
|
25
25
|
|
|
26
|
-
`storage.ts` can export any Mastra storage adapter, such as LibSQL, PostgreSQL, or MongoDB. For setup patterns, provider support, and schema details, see [storage overview](https://mastra.ai/docs/storage/overview), [observability
|
|
26
|
+
`storage.ts` can export any Mastra storage adapter, such as LibSQL, PostgreSQL, or MongoDB. For setup patterns, provider support, and schema details, see [storage overview](https://mastra.ai/docs/storage/overview), [observability signal support](https://mastra.ai/docs/observability/overview), and the [storage reference](https://mastra.ai/reference/storage/overview).
|
|
27
27
|
|
|
28
28
|
## Precedence with code
|
|
29
29
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
A file-based agent can declare **subagents**, specialist child agents it delegates to. The parent model sees each subagent as a delegation tool named after the subagent directory and calls that tool to hand off a task. The subagent's result returns to the parent conversation.
|
|
6
6
|
|
|
7
|
-
Use this page for the file-based convention. For broader delegation patterns, hooks, memory isolation, tool approval propagation, and scoring, see [Supervisor agents](https://mastra.ai/docs/
|
|
7
|
+
Use this page for the file-based convention. For broader delegation patterns, hooks, memory isolation, tool approval propagation, and scoring, see [Supervisor agents](https://mastra.ai/docs/capabilities/subagents).
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
@@ -51,7 +51,7 @@ The file-based convention only controls where the tool lives and how it's regist
|
|
|
51
51
|
- Use `toModelOutput` when the model should see a different shape than the raw value returned from `execute`.
|
|
52
52
|
- Use `requireApproval` when a tool needs human confirmation before execution.
|
|
53
53
|
|
|
54
|
-
See the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool) for all options and [tool approval](https://mastra.ai/docs/agent-controller
|
|
54
|
+
See the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool) for all options and [tool approval](https://mastra.ai/docs/harness/agent-controller) for the approval flow.
|
|
55
55
|
|
|
56
56
|
## Runtime boundary
|
|
57
57
|
|
package/.docs/reference/index.md
CHANGED
|
@@ -83,6 +83,8 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
83
83
|
- [Mastra Class](https://mastra.ai/reference/core/mastra-class)
|
|
84
84
|
- [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway)
|
|
85
85
|
- [.addGateway()](https://mastra.ai/reference/core/addGateway)
|
|
86
|
+
- [.addStoredWorkflow()](https://mastra.ai/reference/core/addStoredWorkflow)
|
|
87
|
+
- [.addStoredWorkflows()](https://mastra.ai/reference/core/addStoredWorkflows)
|
|
86
88
|
- [.getAgent()](https://mastra.ai/reference/core/getAgent)
|
|
87
89
|
- [.getAgentById()](https://mastra.ai/reference/core/getAgentById)
|
|
88
90
|
- [.getDeployer()](https://mastra.ai/reference/core/getDeployer)
|
|
@@ -364,8 +366,10 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
364
366
|
- [Overview](https://mastra.ai/reference/workers/overview)
|
|
365
367
|
- [Run Class](https://mastra.ai/reference/workflows/run)
|
|
366
368
|
- [Step Class](https://mastra.ai/reference/workflows/step)
|
|
369
|
+
- [Stored Workflow Definition](https://mastra.ai/reference/workflows/stored-workflow-definition)
|
|
367
370
|
- [Workflow Class](https://mastra.ai/reference/workflows/workflow)
|
|
368
371
|
- [Workflow State Reader](https://mastra.ai/reference/workflows/workflow-state-reader)
|
|
372
|
+
- [.agent()](https://mastra.ai/reference/workflows/workflow-methods/agent)
|
|
369
373
|
- [.branch()](https://mastra.ai/reference/workflows/workflow-methods/branch)
|
|
370
374
|
- [.commit()](https://mastra.ai/reference/workflows/workflow-methods/commit)
|
|
371
375
|
- [.createRun()](https://mastra.ai/reference/workflows/workflow-methods/create-run)
|
|
@@ -377,6 +381,7 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
377
381
|
- [.sleep()](https://mastra.ai/reference/workflows/workflow-methods/sleep)
|
|
378
382
|
- [.sleepUntil()](https://mastra.ai/reference/workflows/workflow-methods/sleepUntil)
|
|
379
383
|
- [.then()](https://mastra.ai/reference/workflows/workflow-methods/then)
|
|
384
|
+
- [.tool()](https://mastra.ai/reference/workflows/workflow-methods/tool)
|
|
380
385
|
- [.cancel()](https://mastra.ai/reference/workflows/run-methods/cancel)
|
|
381
386
|
- [.restart()](https://mastra.ai/reference/workflows/run-methods/restart)
|
|
382
387
|
- [.resume()](https://mastra.ai/reference/workflows/run-methods/resume)
|
|
@@ -196,7 +196,7 @@ Shuts down all observability instances and clears the registry.
|
|
|
196
196
|
|
|
197
197
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview): Concepts and usage guide
|
|
198
198
|
- [Sampling Strategies](https://mastra.ai/docs/observability/tracing/overview): Sampling configuration details
|
|
199
|
-
- [Multi-Config Setup](https://mastra.ai/docs/observability/
|
|
199
|
+
- [Multi-Config Setup](https://mastra.ai/docs/observability/overview): Using multiple configurations
|
|
200
200
|
|
|
201
201
|
### Reference
|
|
202
202
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# DeepEvalExporter
|
|
4
|
+
|
|
5
|
+
Sends Tracing data to [Confident AI](https://www.confident-ai.com/) for evaluation and observability. Exported by `@mastra/deepeval`, which builds on the DeepEval SDK.
|
|
6
|
+
|
|
7
|
+
See [Confident AI exporter](https://mastra.ai/docs/observability/integrations/exporters/confident-ai) for setup and usage.
|
|
8
|
+
|
|
9
|
+
## Constructor
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
new DeepEvalExporter(config?: DeepEvalExporterConfig)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## `DeepEvalExporterConfig`
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
interface DeepEvalExporterConfig extends BaseExporterConfig {
|
|
19
|
+
apiKey?: string
|
|
20
|
+
environment?: string
|
|
21
|
+
name?: string
|
|
22
|
+
tags?: string[]
|
|
23
|
+
metadata?: Record<string, any>
|
|
24
|
+
threadId?: string
|
|
25
|
+
userId?: string
|
|
26
|
+
testCaseId?: string
|
|
27
|
+
turnId?: string
|
|
28
|
+
metricCollection?: string
|
|
29
|
+
traceMetricCollection?: string
|
|
30
|
+
llmMetricCollection?: string
|
|
31
|
+
agentMetricCollection?: string
|
|
32
|
+
toolMetricCollectionMap?: Record<string, string>
|
|
33
|
+
prompt?: Prompt
|
|
34
|
+
debug?: boolean
|
|
35
|
+
traceCaptureSink?: (trace: Trace) => void
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Extends `BaseExporterConfig`, which includes:
|
|
40
|
+
|
|
41
|
+
- `logger?: IMastraLogger` - Logger instance
|
|
42
|
+
- `logLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'` - Log level (default: INFO)
|
|
43
|
+
|
|
44
|
+
**apiKey** (`string`): Confident AI API key. Falls back to the CONFIDENT\_API\_KEY env var. The exporter disables itself when no key is found.
|
|
45
|
+
|
|
46
|
+
**environment** (`string`): Trace environment. Falls back to CONFIDENT\_TRACE\_ENVIRONMENT, then 'development'.
|
|
47
|
+
|
|
48
|
+
**name** (`string`): Trace name applied to every trace. Defaults to the Mastra serviceName.
|
|
49
|
+
|
|
50
|
+
**tags** (`string[]`): Tags applied to every trace.
|
|
51
|
+
|
|
52
|
+
**metadata** (`Record<string, any>`): Metadata applied to every trace.
|
|
53
|
+
|
|
54
|
+
**threadId** (`string`): Thread ID applied to every trace. A threadId in the root span metadata overrides it per request.
|
|
55
|
+
|
|
56
|
+
**userId** (`string`): User ID applied to every trace. A userId in the root span metadata overrides it per request.
|
|
57
|
+
|
|
58
|
+
**testCaseId** (`string`): Test case ID applied to every trace. A testCaseId in the root span metadata overrides it per request.
|
|
59
|
+
|
|
60
|
+
**turnId** (`string`): Turn ID applied to every trace. A turnId in the root span metadata overrides it per request.
|
|
61
|
+
|
|
62
|
+
**metricCollection** (`string`): Trace-level metric collection.
|
|
63
|
+
|
|
64
|
+
**traceMetricCollection** (`string`): Trace-level metric collection. Takes precedence over metricCollection.
|
|
65
|
+
|
|
66
|
+
**llmMetricCollection** (`string`): Metric collection applied to LLM spans.
|
|
67
|
+
|
|
68
|
+
**agentMetricCollection** (`string`): Metric collection applied to agent spans.
|
|
69
|
+
|
|
70
|
+
**toolMetricCollectionMap** (`Record<string, string>`): Metric collection applied per tool name.
|
|
71
|
+
|
|
72
|
+
**prompt** (`Prompt`): Confident AI managed prompt linkage attached to LLM spans.
|
|
73
|
+
|
|
74
|
+
**debug** (`boolean`): Logs exporter configuration and export errors to the console.
|
|
75
|
+
|
|
76
|
+
**traceCaptureSink** (`(trace: Trace) => void`): Receives completed traces locally instead of posting them to Confident AI. Use for offline evaluation.
|
|
77
|
+
|
|
78
|
+
**logLevel** (`'debug' | 'info' | 'warn' | 'error'`): Logger level (default: 'info')
|
|
79
|
+
|
|
80
|
+
## Methods
|
|
81
|
+
|
|
82
|
+
### `exportTracingEvent`
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
async exportTracingEvent(event: TracingEvent): Promise<void>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Exports a tracing event to Confident AI. Builds the trace tree from the Mastra span stream and posts the trace when the root span ends.
|
|
89
|
+
|
|
90
|
+
### `flush`
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
async flush(): Promise<void>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Waits for any in-flight trace posts to settle without shutting down the exporter.
|
|
97
|
+
|
|
98
|
+
### `shutdown`
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
async shutdown(): Promise<void>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Finalizes any open traces and flushes pending posts.
|
|
105
|
+
|
|
106
|
+
## Usage
|
|
107
|
+
|
|
108
|
+
### Zero-Config (using environment variables)
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
import { DeepEvalExporter } from '@mastra/deepeval'
|
|
112
|
+
|
|
113
|
+
// Reads from CONFIDENT_API_KEY, CONFIDENT_TRACE_ENVIRONMENT
|
|
114
|
+
const exporter = new DeepEvalExporter()
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Explicit Configuration
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { DeepEvalExporter } from '@mastra/deepeval'
|
|
121
|
+
|
|
122
|
+
const exporter = new DeepEvalExporter({
|
|
123
|
+
apiKey: process.env.CONFIDENT_API_KEY,
|
|
124
|
+
environment: 'production',
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Span type mapping
|
|
129
|
+
|
|
130
|
+
| Mastra span type | Confident AI span type |
|
|
131
|
+
| ---------------------------------------------------------------------- | ---------------------- |
|
|
132
|
+
| `AGENT_RUN`, `WORKFLOW_RUN` | `AGENT` |
|
|
133
|
+
| `MODEL_GENERATION` | `LLM` |
|
|
134
|
+
| `TOOL_CALL`, `MCP_TOOL_CALL`, `PROVIDER_TOOL_CALL`, `CLIENT_TOOL_CALL` | `TOOL` |
|
|
135
|
+
| `RAG_EMBEDDING`, `RAG_VECTOR_OPERATION` | `RETRIEVER` |
|
|
136
|
+
| All other exported span types | `CUSTOM` |
|
|
137
|
+
|
|
138
|
+
Event spans (for example `MODEL_CHUNK`) are dropped.
|
|
@@ -396,6 +396,14 @@ interface ModelGenerationAttributes {
|
|
|
396
396
|
/** Model provider (e.g., 'openai', 'anthropic') */
|
|
397
397
|
provider?: string
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Definitions of the tools made available to the model for this generation
|
|
401
|
+
* (name, description, and JSON-schema parameters), captured once per
|
|
402
|
+
* generation. Per-step tool names live on MODEL_INFERENCE spans as
|
|
403
|
+
* `availableTools`.
|
|
404
|
+
*/
|
|
405
|
+
tools?: ModelToolDefinition[]
|
|
406
|
+
|
|
399
407
|
/** Type of result/output this model call produced */
|
|
400
408
|
resultType?: 'tool_selection' | 'response_generation' | 'reasoning' | 'planning'
|
|
401
409
|
|
|
@@ -429,6 +437,27 @@ interface ModelGenerationAttributes {
|
|
|
429
437
|
}
|
|
430
438
|
```
|
|
431
439
|
|
|
440
|
+
### `ModelToolDefinition`
|
|
441
|
+
|
|
442
|
+
Serialized definition of one tool made available to the model, attached to `MODEL_GENERATION` spans so observability exporters can surface tool schemas.
|
|
443
|
+
|
|
444
|
+
```typescript
|
|
445
|
+
interface ModelToolDefinition {
|
|
446
|
+
/** Tool type: 'function' for standard tools, or the provider tool type (e.g. 'provider-defined') */
|
|
447
|
+
type: string
|
|
448
|
+
|
|
449
|
+
name: string
|
|
450
|
+
|
|
451
|
+
description?: string
|
|
452
|
+
|
|
453
|
+
/** JSON schema of the tool's input parameters (function tools) */
|
|
454
|
+
parameters?: Record<string, unknown>
|
|
455
|
+
|
|
456
|
+
/** Provider tool id (e.g. 'anthropic.web_search_20250305') for provider-defined tools */
|
|
457
|
+
id?: string
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
432
461
|
### `ModelStepAttributes`
|
|
433
462
|
|
|
434
463
|
Model Step attributes - for a single model execution within a generation.
|