@mastra/mcp-docs-server 1.2.8-alpha.0 → 1.2.8-alpha.19
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/deploying.md +1 -0
- package/.docs/docs/agent-builder/integrations.md +1 -3
- package/.docs/docs/agent-builder/overview.md +1 -1
- package/.docs/docs/agent-controller/overview.md +1 -1
- package/.docs/docs/agents/overview.md +17 -13
- package/.docs/docs/agents/skills.md +1 -3
- package/.docs/docs/agents/structured-output.md +14 -7
- package/.docs/docs/agents/using-tools.md +80 -26
- package/.docs/docs/browser/agent-browser.md +1 -0
- package/.docs/docs/browser/firecrawl.md +129 -0
- package/.docs/docs/browser/overview.md +16 -2
- package/.docs/docs/capabilities/channels/other-adapters.md +1 -1
- package/.docs/docs/capabilities/channels/overview.md +1 -0
- package/.docs/docs/capabilities/channels/slack.md +113 -3
- package/.docs/docs/deployment/mastra-server.md +35 -0
- package/.docs/docs/deployment/monorepo.md +2 -0
- package/.docs/docs/deployment/overview.md +6 -0
- package/.docs/docs/deployment/sandbox.md +277 -0
- package/.docs/docs/editor/overview.md +2 -6
- package/.docs/docs/editor/tools.md +2 -6
- package/.docs/docs/evals/multi-turn.md +178 -0
- package/.docs/docs/evals/overview.md +1 -0
- package/.docs/docs/evals/running-in-ci.md +3 -9
- package/.docs/docs/getting-started/file-based-agents.md +2 -2
- package/.docs/docs/index.md +17 -13
- package/.docs/docs/long-running-agents/background-tasks.md +2 -2
- package/.docs/docs/long-running-agents/durable-agents.md +2 -1
- package/.docs/docs/long-running-agents/schedules.md +2 -2
- package/.docs/docs/mastra-platform/database.md +13 -6
- package/.docs/docs/mastra-platform/deploy.md +17 -8
- package/.docs/docs/mastra-platform/environments.md +5 -4
- package/.docs/docs/mastra-platform/overview.md +1 -1
- package/.docs/docs/mastra-platform/regions.md +73 -0
- package/.docs/docs/mastra-platform/workspace.md +111 -0
- package/.docs/docs/mcp/overview.md +1 -1
- package/.docs/docs/memory/multi-user-threads.md +4 -4
- package/.docs/docs/memory/observational-memory.md +78 -3
- package/.docs/docs/memory/overview.md +4 -0
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/integrations/bridges/otel.md +1 -3
- package/.docs/docs/observability/integrations/exporters/braintrust.md +34 -2
- package/.docs/docs/observability/integrations/exporters/otel.md +1 -3
- package/.docs/docs/server/auth/simple-auth.md +1 -3
- package/.docs/docs/server/request-context.md +2 -0
- package/.docs/docs/studio/overview.md +2 -0
- package/.docs/docs/voice/livekit.md +1 -1
- package/.docs/docs/workflows/control-flow.md +1 -3
- package/.docs/docs/workspace/filesystem.md +1 -0
- package/.docs/docs/workspace/sandbox.md +1 -0
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +1 -0
- package/.docs/guides/guide/signal-provider.md +2 -0
- package/.docs/guides/migrations/vnext-to-standard-apis.md +1 -3
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/gateways/openrouter.md +340 -345
- package/.docs/models/gateways/vercel.md +6 -5
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/alibaba-token-plan-cn.md +22 -21
- package/.docs/models/providers/alibaba-token-plan.md +22 -21
- package/.docs/models/providers/ambient.md +12 -10
- package/.docs/models/providers/baseten.md +3 -2
- package/.docs/models/providers/crossmodel.md +2 -1
- package/.docs/models/providers/deepinfra.md +4 -7
- package/.docs/models/providers/empiriolabs.md +2 -1
- package/.docs/models/providers/evroc.md +3 -2
- package/.docs/models/providers/google.md +2 -2
- package/.docs/models/providers/kilo.md +1 -1
- package/.docs/models/providers/kimi-for-coding.md +10 -11
- package/.docs/models/providers/llmgateway.md +3 -8
- package/.docs/models/providers/moonshotai-cn.md +3 -2
- package/.docs/models/providers/moonshotai.md +3 -2
- package/.docs/models/providers/nebius.md +3 -1
- package/.docs/models/providers/novita-ai.md +3 -1
- package/.docs/models/providers/ollama-cloud.md +25 -42
- package/.docs/models/providers/opencode-go.md +5 -3
- package/.docs/models/providers/orcarouter.md +1 -1
- package/.docs/models/providers/privatemode-ai.md +10 -10
- package/.docs/models/providers/thinkingmachines.md +73 -0
- package/.docs/models/providers/togetherai.md +2 -6
- package/.docs/models/providers/zenmux.md +3 -1
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/acp/acp-agent.md +2 -0
- package/.docs/reference/acp/create-acp-tool.md +28 -0
- package/.docs/reference/agent-controller/agent-controller-class.md +1 -1
- package/.docs/reference/agent-controller/session.md +15 -0
- package/.docs/reference/agents/agent.md +14 -2
- package/.docs/reference/agents/durable-agent.md +23 -0
- package/.docs/reference/agents/generate.md +19 -1
- package/.docs/reference/browser/firecrawl-browser.md +71 -0
- package/.docs/reference/cli/mastra.md +14 -6
- package/.docs/reference/code-sdk/mount-agent-controller.md +1 -3
- package/.docs/reference/core/getMCPServer.md +1 -3
- package/.docs/reference/core/getMCPServerById.md +1 -3
- package/.docs/reference/core/getTool.md +33 -0
- package/.docs/reference/core/getToolById.md +48 -0
- package/.docs/reference/core/getWorkflow.md +1 -3
- package/.docs/reference/core/listMCPServers.md +2 -6
- package/.docs/reference/core/listTools.md +38 -0
- package/.docs/reference/core/mastra-class.md +1 -1
- package/.docs/reference/datasets/addItem.md +1 -3
- package/.docs/reference/datasets/addItems.md +1 -3
- package/.docs/reference/datasets/compareExperiments.md +1 -3
- package/.docs/reference/datasets/create.md +1 -3
- package/.docs/reference/datasets/dataset.md +2 -6
- package/.docs/reference/datasets/datasets-manager.md +5 -15
- package/.docs/reference/datasets/delete.md +1 -3
- package/.docs/reference/datasets/deleteExperiment.md +1 -3
- package/.docs/reference/datasets/deleteItem.md +1 -3
- package/.docs/reference/datasets/deleteItems.md +1 -3
- package/.docs/reference/datasets/get.md +1 -3
- package/.docs/reference/datasets/getDetails.md +1 -3
- package/.docs/reference/datasets/getExperiment.md +1 -3
- package/.docs/reference/datasets/getItem.md +1 -3
- package/.docs/reference/datasets/getItemHistory.md +1 -3
- package/.docs/reference/datasets/list.md +1 -3
- package/.docs/reference/datasets/listExperimentResults.md +1 -3
- package/.docs/reference/datasets/listExperiments.md +1 -3
- package/.docs/reference/datasets/listItems.md +1 -3
- package/.docs/reference/datasets/listVersions.md +1 -3
- package/.docs/reference/datasets/startExperiment.md +1 -3
- package/.docs/reference/datasets/startExperimentAsync.md +1 -3
- package/.docs/reference/datasets/update.md +1 -3
- package/.docs/reference/datasets/updateItem.md +1 -3
- package/.docs/reference/editor/mastra-editor.md +1 -3
- package/.docs/reference/evals/context-recall.md +205 -0
- package/.docs/reference/evals/create-scorer.md +4 -10
- package/.docs/reference/evals/mastra-scorer.md +1 -3
- package/.docs/reference/evals/run-evals.md +94 -2
- package/.docs/reference/file-based-agents/logger.md +1 -1
- package/.docs/reference/file-based-agents/tools.md +7 -6
- package/.docs/reference/index.md +8 -0
- package/.docs/reference/memory/observational-memory.md +21 -0
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -3
- package/.docs/reference/processors/token-limiter-processor.md +1 -3
- package/.docs/reference/rag/database-config.md +12 -0
- package/.docs/reference/storage/clickhouse.md +1 -1
- package/.docs/reference/storage/convex.md +17 -10
- package/.docs/reference/storage/retention.md +1 -1
- package/.docs/reference/streaming/agents/stream.md +3 -1
- package/.docs/reference/tools/create-tool.md +78 -52
- package/.docs/reference/tools/mcp-client.md +104 -24
- package/.docs/reference/tools/mcp-server.md +143 -44
- package/.docs/reference/tools/task-tools.md +2 -2
- package/.docs/reference/tools/tavily.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +22 -0
- package/.docs/reference/vectors/mongodb.md +2 -0
- package/.docs/reference/vectors/turbopuffer.md +4 -0
- package/.docs/reference/voice/mistral.md +127 -0
- package/.docs/reference/workspace/daytona-sandbox.md +2 -6
- package/.docs/reference/workspace/platform-filesystem.md +182 -0
- package/.docs/reference/workspace/platform-sandbox.md +200 -0
- package/CHANGELOG.md +71 -0
- package/dist/{chunk-GLPCVXXO.js → chunk-HGADBLKG.js} +2 -2
- package/dist/{chunk-GLPCVXXO.js.map → chunk-HGADBLKG.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/stdio.js +1 -1
- package/dist/tools/docs.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -361,7 +361,7 @@ File to write. Defaults to `.env`.
|
|
|
361
361
|
|
|
362
362
|
Manages databases attached to a project on Mastra platform. Databases are provisioned from a managed provider (for example Turso or Neon) and inject their connection env vars into deploys automatically.
|
|
363
363
|
|
|
364
|
-
A database is either **environment-scoped** (its env vars only go to one environment) or **shared** (project-scoped: its env vars go to all environments). Pass the environment argument to work with environment-scoped databases
|
|
364
|
+
A database is either **environment-scoped** (its env vars only go to one environment) or **shared** (project-scoped: its env vars go to all environments). Environment-scoped is the default for `mastra env db create` — pass an environment argument, or let the CLI pick or prompt for one. Pass `--shared` on create to attach a shared database instead. For other subcommands (`list`, `delete`, `keys`), pass the environment argument to work with environment-scoped databases and omit it for shared databases.
|
|
365
365
|
|
|
366
366
|
Creating and deleting databases requires the `admin` role in the organization.
|
|
367
367
|
|
|
@@ -382,11 +382,15 @@ Emit machine-readable JSON.
|
|
|
382
382
|
|
|
383
383
|
Provisions a managed database, attaches it, and polls until it's ready. Provisioning errors are printed with the provider's error detail.
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
By default the database is scoped to a single environment: pass an environment argument to pick it, or omit the argument to have the CLI pick for you. When the project has one environment, that environment is used. When it has several, the CLI prompts you to select one interactively; in non-interactive contexts (CI, `--json`) an environment argument is required. Pass `--shared` to attach a project-scoped database that's shared by every environment instead.
|
|
386
|
+
|
|
387
|
+
Environment-scoped databases inherit their provider region from the environment. Shared databases accept `--region`.
|
|
386
388
|
|
|
387
389
|
```bash
|
|
388
|
-
mastra env db create
|
|
389
|
-
mastra env db create --kind
|
|
390
|
+
mastra env db create --kind turso # picks or prompts for an environment
|
|
391
|
+
mastra env db create staging --kind turso # scoped to the "staging" environment
|
|
392
|
+
mastra env db create --kind turso --shared # shared by all environments
|
|
393
|
+
mastra env db create --kind neon --name my-app-db --region aws-us-east-1 --shared
|
|
390
394
|
```
|
|
391
395
|
|
|
392
396
|
#### `--kind`
|
|
@@ -401,13 +405,17 @@ Database name. Defaults to a name derived from the project slug (for example `my
|
|
|
401
405
|
|
|
402
406
|
Provider region ID for shared databases. Ignored for environment-scoped databases.
|
|
403
407
|
|
|
408
|
+
#### `--shared`
|
|
409
|
+
|
|
410
|
+
Attach as a project-scoped database that's shared by every environment. Cannot be combined with an environment argument.
|
|
411
|
+
|
|
404
412
|
#### `--no-wait`
|
|
405
413
|
|
|
406
414
|
Return immediately after the attach is queued instead of polling until the database is ready. Check progress later with `mastra env db show`.
|
|
407
415
|
|
|
408
416
|
#### `--json`
|
|
409
417
|
|
|
410
|
-
Emit machine-readable JSON.
|
|
418
|
+
Emit machine-readable JSON. In this mode, an environment argument or `--shared` is required when the project has more than one environment (no interactive prompt).
|
|
411
419
|
|
|
412
420
|
### `mastra env db show`
|
|
413
421
|
|
|
@@ -429,7 +437,7 @@ Emit machine-readable JSON. Secret values are masked unless `--show-secrets` is
|
|
|
429
437
|
|
|
430
438
|
### `mastra env db delete`
|
|
431
439
|
|
|
432
|
-
Permanently deletes a database with the provider, including all of its data. This
|
|
440
|
+
Permanently deletes a database with the provider, including all of its data. This can't be undone. The CLI prompts for confirmation unless `--yes` is passed. After deletion, deploys no longer receive the database's env vars.
|
|
433
441
|
|
|
434
442
|
```bash
|
|
435
443
|
mastra env db delete <database>
|
|
@@ -27,9 +27,7 @@ Pass an existing `mastra` to mount the controller onto a Mastra instance that al
|
|
|
27
27
|
import { Mastra } from '@mastra/core/mastra'
|
|
28
28
|
import { mountAgentControllerOnMastra } from '@mastra/code-sdk'
|
|
29
29
|
|
|
30
|
-
const mastra = new Mastra({
|
|
31
|
-
/* ... */
|
|
32
|
-
})
|
|
30
|
+
const mastra = new Mastra({/* ... */})
|
|
33
31
|
|
|
34
32
|
const { controller } = await mountAgentControllerOnMastra({ mastra })
|
|
35
33
|
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Mastra.getTool()
|
|
4
|
+
|
|
5
|
+
The `.getTool()` method retrieves a tool from the Mastra-level registry by its registration key.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
Register a tool under the `weather` key, then use that key to retrieve it.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
13
|
+
import { weatherTool } from './tools/weather-tool'
|
|
14
|
+
|
|
15
|
+
export const mastra = new Mastra({
|
|
16
|
+
tools: {
|
|
17
|
+
weather: weatherTool,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const tool = mastra.getTool('weather')
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
|
|
26
|
+
**name** (`TToolName extends keyof TTools`): The registration key of the tool in the Mastra tools registry.
|
|
27
|
+
|
|
28
|
+
## Related
|
|
29
|
+
|
|
30
|
+
- [Share tools across agents](https://mastra.ai/docs/agents/using-tools)
|
|
31
|
+
- [Mastra class](https://mastra.ai/reference/core/mastra-class)
|
|
32
|
+
- [Mastra.getToolById()](https://mastra.ai/reference/core/getToolById)
|
|
33
|
+
- [Mastra.listTools()](https://mastra.ai/reference/core/listTools)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Mastra.getToolById()
|
|
4
|
+
|
|
5
|
+
The `.getToolById()` method first searches the Mastra-level registry for a tool with a matching intrinsic `id`. If no intrinsic ID matches, it treats the value as a registration key.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
This example uses `weather` as the registration key and `weather-tool` as the tool's intrinsic ID.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
13
|
+
import { createTool } from '@mastra/core/tools'
|
|
14
|
+
import { z } from 'zod'
|
|
15
|
+
|
|
16
|
+
const weatherTool = createTool({
|
|
17
|
+
id: 'weather-tool',
|
|
18
|
+
description: 'Fetches weather for a location',
|
|
19
|
+
inputSchema: z.object({
|
|
20
|
+
location: z.string(),
|
|
21
|
+
}),
|
|
22
|
+
outputSchema: z.object({
|
|
23
|
+
weather: z.string(),
|
|
24
|
+
}),
|
|
25
|
+
execute: async ({ location }) => ({
|
|
26
|
+
weather: `Weather for ${location}`,
|
|
27
|
+
}),
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export const mastra = new Mastra({
|
|
31
|
+
tools: {
|
|
32
|
+
weather: weatherTool,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const toolById = mastra.getToolById('weather-tool')
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Parameters
|
|
40
|
+
|
|
41
|
+
**id** (`TTools[TToolName]['id']`): The intrinsic tool ID to find. When no tool has that ID, Mastra uses the value as a registration key.
|
|
42
|
+
|
|
43
|
+
## Related
|
|
44
|
+
|
|
45
|
+
- [Share tools across agents](https://mastra.ai/docs/agents/using-tools)
|
|
46
|
+
- [Mastra class](https://mastra.ai/reference/core/mastra-class)
|
|
47
|
+
- [Mastra.getTool()](https://mastra.ai/reference/core/getTool)
|
|
48
|
+
- [Mastra.listTools()](https://mastra.ai/reference/core/listTools)
|
|
@@ -12,18 +12,14 @@ const server1 = new MCPServer({
|
|
|
12
12
|
id: 'server-one',
|
|
13
13
|
name: 'Server One',
|
|
14
14
|
version: '1.0.0',
|
|
15
|
-
tools: {
|
|
16
|
-
/* ... */
|
|
17
|
-
},
|
|
15
|
+
tools: {/* ... */},
|
|
18
16
|
})
|
|
19
17
|
|
|
20
18
|
const server2 = new MCPServer({
|
|
21
19
|
id: 'server-two',
|
|
22
20
|
name: 'Server Two',
|
|
23
21
|
version: '1.0.0',
|
|
24
|
-
tools: {
|
|
25
|
-
/* ... */
|
|
26
|
-
},
|
|
22
|
+
tools: {/* ... */},
|
|
27
23
|
})
|
|
28
24
|
|
|
29
25
|
export const mastra = new Mastra({
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Mastra.listTools()
|
|
4
|
+
|
|
5
|
+
The `.listTools()` method returns the tools configured on a Mastra instance. The returned record uses Mastra registration keys and tool instances as values.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
11
|
+
import { weatherTool } from './tools/weather-tool'
|
|
12
|
+
|
|
13
|
+
export const mastra = new Mastra({
|
|
14
|
+
tools: {
|
|
15
|
+
weather: weatherTool,
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const tools = mastra.listTools()
|
|
20
|
+
const weather = tools?.weather
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Parameters
|
|
24
|
+
|
|
25
|
+
This method doesn't accept any parameters.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
**tools** (`TTools | undefined`): The Mastra-level tool registry, where each key is a registration key and each value is a tool instance. Returns undefined when no registry is available.
|
|
30
|
+
|
|
31
|
+
This method lists the Mastra-level registry. It doesn't include tools that exist only in a function-based Agent `tools` callback.
|
|
32
|
+
|
|
33
|
+
## Related
|
|
34
|
+
|
|
35
|
+
- [Share tools across agents](https://mastra.ai/docs/agents/using-tools)
|
|
36
|
+
- [Mastra class](https://mastra.ai/reference/core/mastra-class)
|
|
37
|
+
- [Mastra.getTool()](https://mastra.ai/reference/core/getTool)
|
|
38
|
+
- [Mastra.getToolById()](https://mastra.ai/reference/core/getToolById)
|
|
@@ -53,7 +53,7 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
53
53
|
|
|
54
54
|
**agents** (`Record<string, Agent>`): Agent instances to register, keyed by name (Default: `{}`)
|
|
55
55
|
|
|
56
|
-
**tools** (`Record<string, ToolApi>`):
|
|
56
|
+
**tools** (`Record<string, ToolApi>`): Tool instances to register. Keys are registration keys used by \`getTool()\`, and values are tool instances. Use \`getToolById()\` for intrinsic ID lookup and \`listTools()\` to read the registry. (Default: `{}`)
|
|
57
57
|
|
|
58
58
|
**storage** (`MastraCompositeStore`): Storage engine instance for persisting data
|
|
59
59
|
|
|
@@ -11,9 +11,7 @@ Adds a single item to the dataset. Each item has an input, optional ground truth
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Adds multiple items to the dataset in a single bulk operation.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Compares two or more experiments, producing per-item and per-scorer comparisons.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const comparison = await mastra.datasets.compareExperiments({
|
|
19
17
|
experimentIds: ['exp-baseline', 'exp-new'],
|
|
@@ -12,9 +12,7 @@ Creates a new dataset. Use Standard JSON Schema (Zod, Valibot, ArkType, etc.) fo
|
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
import { z } from 'zod'
|
|
14
14
|
|
|
15
|
-
const mastra = new Mastra({
|
|
16
|
-
/* storage config */
|
|
17
|
-
})
|
|
15
|
+
const mastra = new Mastra({/* storage config */})
|
|
18
16
|
|
|
19
17
|
// Create with metadata
|
|
20
18
|
const dataset = await mastra.datasets.create({
|
|
@@ -13,9 +13,7 @@ The `Dataset` class provides methods for item CRUD, versioning, and experiment m
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { Mastra } from '@mastra/core'
|
|
15
15
|
|
|
16
|
-
const mastra = new Mastra({
|
|
17
|
-
/* storage config */
|
|
18
|
-
})
|
|
16
|
+
const mastra = new Mastra({/* storage config */})
|
|
19
17
|
|
|
20
18
|
const dataset = await mastra.datasets.create({
|
|
21
19
|
name: 'QA pairs',
|
|
@@ -44,9 +42,7 @@ console.log(`${summary.succeededCount}/${summary.totalItems} succeeded`)
|
|
|
44
42
|
```typescript
|
|
45
43
|
import { Mastra } from '@mastra/core'
|
|
46
44
|
|
|
47
|
-
const mastra = new Mastra({
|
|
48
|
-
/* storage config */
|
|
49
|
-
})
|
|
45
|
+
const mastra = new Mastra({/* storage config */})
|
|
50
46
|
|
|
51
47
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
52
48
|
|
|
@@ -13,9 +13,7 @@ The `DatasetsManager` class provides the public API for managing datasets, inclu
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { Mastra } from '@mastra/core'
|
|
15
15
|
|
|
16
|
-
const mastra = new Mastra({
|
|
17
|
-
/* storage config */
|
|
18
|
-
})
|
|
16
|
+
const mastra = new Mastra({/* storage config */})
|
|
19
17
|
|
|
20
18
|
// Create a dataset
|
|
21
19
|
const dataset = await mastra.datasets.create({
|
|
@@ -32,9 +30,7 @@ const { datasets } = await mastra.datasets.list()
|
|
|
32
30
|
```typescript
|
|
33
31
|
import { Mastra } from '@mastra/core'
|
|
34
32
|
|
|
35
|
-
const mastra = new Mastra({
|
|
36
|
-
/* storage config */
|
|
37
|
-
})
|
|
33
|
+
const mastra = new Mastra({/* storage config */})
|
|
38
34
|
|
|
39
35
|
// Get by ID
|
|
40
36
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
@@ -50,9 +46,7 @@ Retrieves a specific experiment (run) by ID. Unlike `dataset.getExperiment()`, t
|
|
|
50
46
|
```typescript
|
|
51
47
|
import { Mastra } from '@mastra/core'
|
|
52
48
|
|
|
53
|
-
const mastra = new Mastra({
|
|
54
|
-
/* storage config */
|
|
55
|
-
})
|
|
49
|
+
const mastra = new Mastra({/* storage config */})
|
|
56
50
|
|
|
57
51
|
// Get experiment directly without knowing the dataset
|
|
58
52
|
const experiment = await mastra.datasets.getExperiment({
|
|
@@ -68,9 +62,7 @@ console.log(`Status: ${experiment.status}`)
|
|
|
68
62
|
```typescript
|
|
69
63
|
import { Mastra } from '@mastra/core'
|
|
70
64
|
|
|
71
|
-
const mastra = new Mastra({
|
|
72
|
-
/* storage config */
|
|
73
|
-
})
|
|
65
|
+
const mastra = new Mastra({/* storage config */})
|
|
74
66
|
|
|
75
67
|
const comparison = await mastra.datasets.compareExperiments({
|
|
76
68
|
experimentIds: ['exp-1', 'exp-2'],
|
|
@@ -83,9 +75,7 @@ const comparison = await mastra.datasets.compareExperiments({
|
|
|
83
75
|
`DatasetsManager` isn't instantiated directly. Access it from a `Mastra` instance:
|
|
84
76
|
|
|
85
77
|
```typescript
|
|
86
|
-
const mastra = new Mastra({
|
|
87
|
-
/* storage config */
|
|
88
|
-
})
|
|
78
|
+
const mastra = new Mastra({/* storage config */})
|
|
89
79
|
const datasetsManager = mastra.datasets
|
|
90
80
|
```
|
|
91
81
|
|
|
@@ -11,9 +11,7 @@ Deletes a dataset by ID, including all items, versions, and experiments.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
await mastra.datasets.delete({ id: 'dataset-id' })
|
|
19
17
|
```
|
|
@@ -11,9 +11,7 @@ Deletes an experiment (run) by ID, including all associated results.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Deletes a single item from the dataset by ID.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Deletes multiple items from the dataset in a single bulk operation.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Retrieves an existing dataset by ID. Throws a `MastraError` if the dataset doesn
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Retrieves the full dataset record from storage, including metadata, schemas, and
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Retrieves a specific experiment (run) by its ID.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Retrieves a single dataset item by ID, optionally at a specific dataset version.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Retrieves the full SCD-2 (Slowly Changing Dimension Type 2) history of a specifi
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Lists datasets with pagination and optional filters. Filters are applied at the
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const { datasets, pagination } = await mastra.datasets.list({ page: 0, perPage: 10 })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Lists individual item results for a specific experiment with optional filters an
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Lists experiments (runs) for this dataset with optional filters and pagination.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Lists items in the dataset. When only `version` is provided, returns a bare `Dat
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Lists all versions of the dataset with pagination.
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Runs an experiment on the dataset and waits for completion. Executes all items a
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -11,9 +11,7 @@ Starts an experiment asynchronously (fire-and-forget). Returns immediately with
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -12,9 +12,7 @@ Updates dataset metadata, name, description, and/or schemas. Use Standard JSON S
|
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
import { z } from 'zod'
|
|
14
14
|
|
|
15
|
-
const mastra = new Mastra({
|
|
16
|
-
/* storage config */
|
|
17
|
-
})
|
|
15
|
+
const mastra = new Mastra({/* storage config */})
|
|
18
16
|
|
|
19
17
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
20
18
|
|
|
@@ -11,9 +11,7 @@ Updates an existing item in the dataset. Only the provided fields are updated. U
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { Mastra } from '@mastra/core'
|
|
13
13
|
|
|
14
|
-
const mastra = new Mastra({
|
|
15
|
-
/* storage config */
|
|
16
|
-
})
|
|
14
|
+
const mastra = new Mastra({/* storage config */})
|
|
17
15
|
|
|
18
16
|
const dataset = await mastra.datasets.get({ id: 'dataset-id' })
|
|
19
17
|
|
|
@@ -14,9 +14,7 @@ import { MastraEditor } from '@mastra/editor'
|
|
|
14
14
|
import { ComposioToolProvider } from '@mastra/editor/providers/composio'
|
|
15
15
|
|
|
16
16
|
export const mastra = new Mastra({
|
|
17
|
-
agents: {
|
|
18
|
-
/* your agents */
|
|
19
|
-
},
|
|
17
|
+
agents: {/* your agents */},
|
|
20
18
|
editor: new MastraEditor({
|
|
21
19
|
toolProviders: {
|
|
22
20
|
composio: new ComposioToolProvider({
|