@mastra/mcp-docs-server 1.2.23-alpha.1 → 1.2.23-alpha.10
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/code-mode.md +1 -1
- package/.docs/docs/agents/human-in-the-loop.md +1 -1
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/processors.md +1 -1
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/auth/fga.md +16 -16
- package/.docs/docs/channels.md +2 -2
- package/.docs/docs/connections/mcp.md +1 -1
- package/.docs/docs/datasets/running-experiments.md +1 -1
- package/.docs/docs/deployment/sandbox.md +2 -2
- package/.docs/docs/deployment/workers.md +2 -2
- package/.docs/docs/evals/custom-scorers.md +3 -4
- package/.docs/docs/evals/multi-turn.md +1 -1
- package/.docs/docs/evals/overview.md +11 -11
- package/.docs/docs/evals/quick-checks.md +1 -1
- package/.docs/docs/evals/vitest-integration.md +136 -0
- package/.docs/docs/guides/context-engineering.md +1 -1
- package/.docs/docs/guides/multi-agent-systems.md +1 -1
- package/.docs/docs/guides/streaming.md +72 -52
- package/.docs/docs/harness/agent-controller.md +49 -1
- package/.docs/docs/harness/background-tasks.md +1 -1
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/harness/overview.md +10 -11
- package/.docs/docs/harness/schedules.md +1 -1
- package/.docs/docs/harness/signal-providers.md +1 -1
- package/.docs/docs/harness/signals.md +1 -1
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/mastra-platform/deploy.md +15 -15
- package/.docs/docs/mastra-platform/environments.md +2 -2
- package/.docs/docs/mastra-platform/github.md +2 -2
- package/.docs/docs/mastra-platform/regions.md +1 -1
- package/.docs/docs/mastra-platform/server.md +4 -4
- package/.docs/docs/mastra-platform/studio.md +1 -1
- package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
- package/.docs/docs/mastra-platform/workspaces.md +1 -1
- package/.docs/docs/memory/message-history.md +3 -3
- package/.docs/docs/memory/observational-memory.md +18 -18
- package/.docs/docs/memory/overview.md +1 -1
- package/.docs/docs/memory/semantic-recall.md +0 -2
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/feedback.md +2 -2
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/metrics/overview.md +1 -1
- package/.docs/docs/observability/overview.md +13 -11
- package/.docs/docs/observability/tracing/overview.md +13 -13
- package/.docs/docs/sandbox/lsp.md +1 -1
- package/.docs/docs/sandbox/overview.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/overview.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +2 -2
- package/.docs/docs/server/server-adapters.md +1 -1
- package/.docs/docs/skills.md +1 -1
- package/.docs/docs/studio/deployment.md +1 -1
- package/.docs/docs/studio/editor.md +1 -1
- package/.docs/docs/studio/observability.md +2 -2
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/subagents.md +2 -2
- package/.docs/docs/workflows/agents-and-tools.md +0 -4
- package/.docs/docs/workflows/control-flow.md +1 -3
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/scheduled-workflows.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +2 -2
- package/.docs/integrations/sandboxes/agentcore.md +2 -0
- package/.docs/integrations/sandboxes/apple-container.md +5 -3
- package/.docs/integrations/sandboxes/blaxel.md +2 -0
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +1 -1
- package/.docs/integrations/sandboxes/daytona.md +2 -0
- package/.docs/integrations/sandboxes/docker.md +3 -1
- package/.docs/integrations/sandboxes/e2b.md +4 -0
- package/.docs/integrations/sandboxes/modal.md +3 -1
- package/.docs/integrations/sandboxes/railway.md +2 -0
- package/.docs/integrations/sandboxes/vercel.md +4 -0
- package/.docs/models/environment-variables.md +5 -0
- package/.docs/models/gateways/merge-gateway.md +2 -1
- package/.docs/models/gateways/netlify.md +6 -2
- package/.docs/models/gateways/openrouter.md +3 -5
- package/.docs/models/gateways/vercel.md +4 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/abliteration-ai.md +7 -6
- package/.docs/models/providers/above.md +83 -0
- package/.docs/models/providers/aiand.md +4 -2
- package/.docs/models/providers/anthropic.md +2 -1
- package/.docs/models/providers/berget.md +4 -2
- package/.docs/models/providers/bothub.md +76 -0
- package/.docs/models/providers/chutes.md +1 -1
- package/.docs/models/providers/coralbricks.md +4 -4
- package/.docs/models/providers/cortecs.md +3 -3
- package/.docs/models/providers/crossmodel.md +4 -3
- package/.docs/models/providers/edenai.md +8 -6
- package/.docs/models/providers/empiriolabs.md +1 -2
- package/.docs/models/providers/fireworks-ai.md +2 -1
- package/.docs/models/providers/friendli.md +3 -2
- package/.docs/models/providers/google.md +1 -2
- package/.docs/models/providers/groq.md +2 -1
- package/.docs/models/providers/hyper.md +8 -6
- package/.docs/models/providers/iteracompute.md +8 -7
- package/.docs/models/providers/kilo.md +29 -32
- package/.docs/models/providers/klokintegration.md +77 -0
- package/.docs/models/providers/llmgateway-providers.md +2 -26
- package/.docs/models/providers/llmgateway.md +3 -14
- package/.docs/models/providers/nano-gpt.md +75 -92
- package/.docs/models/providers/neuralwatt.md +2 -1
- package/.docs/models/providers/ollama-cloud.md +2 -1
- package/.docs/models/providers/opencode-go.md +1 -1
- package/.docs/models/providers/opencode.md +2 -2
- package/.docs/models/providers/orcarouter.md +3 -2
- package/.docs/models/providers/requesty.md +5 -7
- package/.docs/models/providers/sensenova.md +77 -0
- package/.docs/models/providers/synthetic.md +3 -2
- package/.docs/models/providers/tokenrouter.md +75 -0
- package/.docs/models/providers/trustedrouter.md +13 -13
- package/.docs/models/providers/vancine.md +13 -11
- package/.docs/models/providers.md +5 -0
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
- package/.docs/reference/agent-controller/session.md +3 -3
- package/.docs/reference/agents/durable-agent.md +77 -9
- package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +2 -2
- package/.docs/reference/ai-sdk/chat-route.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/ai-sdk/workflow-route.md +1 -1
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/cli/mastra.md +4 -4
- package/.docs/reference/core/mastra-class.md +1 -1
- package/.docs/reference/datasets/createExperiment.md +1 -1
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/editor/versioning.md +1 -1
- package/.docs/reference/evals/multi-turn-judge.md +1 -1
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/schedules.md +2 -2
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/manual-install.md +3 -3
- package/.docs/reference/memory/observational-memory.md +4 -4
- package/.docs/reference/memory/settled.md +1 -1
- package/.docs/reference/migrations/mastra-cloud.md +9 -9
- package/.docs/reference/migrations/upgrade-to-v1/overview.md +1 -1
- package/.docs/reference/observability/tracing/configuration.md +2 -2
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +1 -1
- package/.docs/reference/processors/processor-interface.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +3 -3
- package/.docs/reference/processors/token-cost-control.md +2 -2
- package/.docs/reference/processors/token-limiter-processor.md +1 -1
- package/.docs/reference/processors/tool-search-processor.md +1 -1
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/pubsub/base.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +2 -2
- package/.docs/reference/rag/vector-databases.md +33 -33
- package/.docs/reference/server/create-route.md +1 -1
- package/.docs/reference/signals/task-signal-provider.md +1 -1
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/retention.md +4 -4
- package/.docs/reference/streaming/ChunkType.md +1 -1
- package/.docs/reference/tools/isolated-vm-transport.md +1 -1
- package/.docs/reference/tools/mcp-client.md +2 -2
- package/.docs/reference/vectors/couchbase.md +1 -1
- package/.docs/reference/vectors/mongodb.md +2 -2
- package/.docs/reference/voice/overview.md +1 -1
- package/.docs/reference/workflows/workflow-methods/agent.md +4 -4
- package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
- package/.docs/reference/workflows/workflow-methods/tool.md +2 -2
- package/.docs/reference/workspace/platform-sandbox.md +6 -2
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/sandbox.md +20 -3
- package/.docs/reference/workspace/workspace-class.md +3 -3
- package/package.json +5 -6
- package/CHANGELOG.md +0 -5929
|
@@ -35,11 +35,11 @@ MongoDB Vector Search is a good solution for teams who want to consolidate vecto
|
|
|
35
35
|
|
|
36
36
|
### Using VoyageAI with MongoDB
|
|
37
37
|
|
|
38
|
-
MongoDB works
|
|
38
|
+
MongoDB works directly with VoyageAI's embedding models, which are optimized for retrieval tasks. For complete examples and specialized models, see the [VoyageAI embeddings documentation](https://mastra.ai/models/embeddings) and [MongoDB vector reference](https://mastra.ai/reference/vectors/mongodb).
|
|
39
39
|
|
|
40
40
|
### Hybrid Search (Vector + Full-Text)
|
|
41
41
|
|
|
42
|
-
MongoDB supports hybrid search that
|
|
42
|
+
MongoDB supports hybrid search that combines vector similarity with BM25 full-text search through server-side `$rankFusion`. It requires MongoDB 8.0 or later, is generally available from 8.1, and is enabled on MongoDB Atlas 8.0.x. Use it to combine semantic retrieval with keyword-based results:
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
45
|
await store.createSearchIndex({ indexName: 'myCollection', fields: ['text'] })
|
|
@@ -107,7 +107,7 @@ await store.upsert({
|
|
|
107
107
|
|
|
108
108
|
### Using Oracle Database Vector Search
|
|
109
109
|
|
|
110
|
-
OracleDB stores embeddings in native `VECTOR` columns and metadata in Oracle JSON. Exact search is the default
|
|
110
|
+
OracleDB stores embeddings in native `VECTOR` columns and metadata in Oracle JSON. Exact search is the default. HNSW and IVF indexes can be configured for tuned deployments.
|
|
111
111
|
|
|
112
112
|
**Pinecone**:
|
|
113
113
|
|
|
@@ -239,8 +239,8 @@ const store = new UpstashVector({
|
|
|
239
239
|
token: process.env.UPSTASH_TOKEN,
|
|
240
240
|
})
|
|
241
241
|
|
|
242
|
-
//
|
|
243
|
-
// when you upsert if that namespace
|
|
242
|
+
// Upstash creates indexes (known as namespaces) automatically, so no store.createIndex call is needed here
|
|
243
|
+
// when you upsert if that namespace doesn't exist yet.
|
|
244
244
|
await store.upsert({
|
|
245
245
|
indexName: 'myCollection', // the namespace name in Upstash
|
|
246
246
|
vectors: embeddings,
|
|
@@ -426,20 +426,20 @@ Collection and index names must:
|
|
|
426
426
|
|
|
427
427
|
- Start with a letter or underscore
|
|
428
428
|
- Be up to 120 bytes long
|
|
429
|
-
- Contain only letters, numbers,
|
|
430
|
-
-
|
|
429
|
+
- Contain only letters, numbers, underscore characters, or dots
|
|
430
|
+
- Can't contain `$` or the null character
|
|
431
431
|
- Example: `my_collection.123` is valid
|
|
432
|
-
- Example: `my-index`
|
|
433
|
-
- Example: `My$Collection`
|
|
432
|
+
- Example: `my-index` isn't valid (contains hyphen)
|
|
433
|
+
- Example: `My$Collection` isn't valid (contains `$`)
|
|
434
434
|
|
|
435
435
|
**PgVector**:
|
|
436
436
|
|
|
437
437
|
Index names must:
|
|
438
438
|
|
|
439
439
|
- Start with a letter or underscore
|
|
440
|
-
- Contain only letters, numbers, and
|
|
440
|
+
- Contain only letters, numbers, and underscore characters
|
|
441
441
|
- Example: `my_index_123` is valid
|
|
442
|
-
- Example: `my-index`
|
|
442
|
+
- Example: `my-index` isn't valid (contains hyphen)
|
|
443
443
|
|
|
444
444
|
**OracleDB**:
|
|
445
445
|
|
|
@@ -466,7 +466,7 @@ Index names must:
|
|
|
466
466
|
- Have a combined length (with project ID) under 52 characters
|
|
467
467
|
|
|
468
468
|
- Example: `my-index-123` is valid
|
|
469
|
-
- Example: `my.index`
|
|
469
|
+
- Example: `my.index` isn't valid (contains dot)
|
|
470
470
|
|
|
471
471
|
**Qdrant**:
|
|
472
472
|
|
|
@@ -482,7 +482,7 @@ Collection names must:
|
|
|
482
482
|
|
|
483
483
|
- Example: `my_collection_123` is valid
|
|
484
484
|
|
|
485
|
-
- Example: `my/collection`
|
|
485
|
+
- Example: `my/collection` isn't valid (contains slash)
|
|
486
486
|
|
|
487
487
|
**Chroma**:
|
|
488
488
|
|
|
@@ -490,11 +490,11 @@ Collection names must:
|
|
|
490
490
|
|
|
491
491
|
- Be 3-63 characters long
|
|
492
492
|
- Start and end with a letter or number
|
|
493
|
-
- Contain only letters, numbers,
|
|
493
|
+
- Contain only letters, numbers, underscore characters, or hyphens
|
|
494
494
|
- Not contain consecutive periods (..)
|
|
495
495
|
- Not be a valid IPv4 address
|
|
496
496
|
- Example: `my-collection-123` is valid
|
|
497
|
-
- Example: `my..collection`
|
|
497
|
+
- Example: `my..collection` isn't valid (consecutive periods)
|
|
498
498
|
|
|
499
499
|
**Astra**:
|
|
500
500
|
|
|
@@ -502,18 +502,18 @@ Collection names must:
|
|
|
502
502
|
|
|
503
503
|
- Not be empty
|
|
504
504
|
- Be 48 characters or less
|
|
505
|
-
- Contain only letters, numbers, and
|
|
505
|
+
- Contain only letters, numbers, and `_` characters
|
|
506
506
|
- Example: `my_collection_123` is valid
|
|
507
|
-
- Example: `my-collection`
|
|
507
|
+
- Example: `my-collection` isn't valid (contains hyphen)
|
|
508
508
|
|
|
509
509
|
**libSQL**:
|
|
510
510
|
|
|
511
511
|
Index names must:
|
|
512
512
|
|
|
513
513
|
- Start with a letter or underscore
|
|
514
|
-
- Contain only letters, numbers, and
|
|
514
|
+
- Contain only letters, numbers, and `_` characters
|
|
515
515
|
- Example: `my_index_123` is valid
|
|
516
|
-
- Example: `my-index`
|
|
516
|
+
- Example: `my-index` isn't valid (contains hyphen)
|
|
517
517
|
|
|
518
518
|
**Upstash**:
|
|
519
519
|
|
|
@@ -532,7 +532,7 @@ Namespace names must:
|
|
|
532
532
|
|
|
533
533
|
- Example: `MyNamespace123` is valid
|
|
534
534
|
|
|
535
|
-
- Example: `_namespace`
|
|
535
|
+
- Example: `_namespace` isn't valid (starts with underscore)
|
|
536
536
|
|
|
537
537
|
**Cloudflare**:
|
|
538
538
|
|
|
@@ -543,19 +543,19 @@ Index names must:
|
|
|
543
543
|
- Contain only lowercase ASCII letters, numbers, and dashes
|
|
544
544
|
- Use dashes instead of spaces
|
|
545
545
|
- Example: `my-index-123` is valid
|
|
546
|
-
- Example: `My_Index`
|
|
546
|
+
- Example: `My_Index` isn't valid (uppercase and underscore)
|
|
547
547
|
|
|
548
548
|
**OpenSearch**:
|
|
549
549
|
|
|
550
550
|
Index names must:
|
|
551
551
|
|
|
552
552
|
- Use only lowercase letters
|
|
553
|
-
- Not begin with
|
|
553
|
+
- Not begin with underscore characters or hyphens
|
|
554
554
|
- Not contain spaces, commas
|
|
555
555
|
- Not contain special characters (e.g. `:`, `"`, `*`, `+`, `/`, `\`, `|`, `?`, `#`, `>`, `<`)
|
|
556
556
|
- Example: `my-index-123` is valid
|
|
557
|
-
- Example: `My_Index`
|
|
558
|
-
- Example: `_myindex`
|
|
557
|
+
- Example: `My_Index` isn't valid (contains uppercase letters)
|
|
558
|
+
- Example: `_myindex` isn't valid (begins with underscore)
|
|
559
559
|
|
|
560
560
|
**Elasticsearch**:
|
|
561
561
|
|
|
@@ -563,29 +563,29 @@ Index names must:
|
|
|
563
563
|
|
|
564
564
|
- Use only lowercase letters
|
|
565
565
|
- Not exceed 255 bytes (counting multi-byte characters)
|
|
566
|
-
- Not begin with
|
|
566
|
+
- Not begin with underscore characters, hyphens, or plus signs
|
|
567
567
|
- Not contain spaces, commas
|
|
568
568
|
- Not contain special characters (e.g. `:`, `"`, `*`, `+`, `/`, `\`, `|`, `?`, `#`, `>`, `<`)
|
|
569
569
|
- Not be "." or ".."
|
|
570
570
|
- Not start with "." (deprecated except for system/hidden indices)
|
|
571
571
|
- Example: `my-index-123` is valid
|
|
572
|
-
- Example: `My_Index`
|
|
573
|
-
- Example: `_myindex`
|
|
574
|
-
- Example: `.myindex`
|
|
572
|
+
- Example: `My_Index` isn't valid (contains uppercase letters)
|
|
573
|
+
- Example: `_myindex` isn't valid (begins with underscore)
|
|
574
|
+
- Example: `.myindex` isn't valid (begins with dot, deprecated)
|
|
575
575
|
|
|
576
576
|
**S3 Vectors**:
|
|
577
577
|
|
|
578
578
|
Index names must:
|
|
579
579
|
|
|
580
580
|
- Be unique within the same vector bucket
|
|
581
|
-
- Be 3
|
|
581
|
+
- Be between 3 and 63 characters long
|
|
582
582
|
- Use only lowercase letters (`a–z`), numbers (`0–9`), hyphens (`-`), and dots (`.`)
|
|
583
583
|
- Begin and end with a letter or number
|
|
584
584
|
- Example: `my-index.123` is valid
|
|
585
|
-
- Example: `my_index`
|
|
586
|
-
- Example: `-myindex`
|
|
587
|
-
- Example: `myindex-`
|
|
588
|
-
- Example: `MyIndex`
|
|
585
|
+
- Example: `my_index` isn't valid (contains underscore)
|
|
586
|
+
- Example: `-myindex` isn't valid (begins with hyphen)
|
|
587
|
+
- Example: `myindex-` isn't valid (ends with hyphen)
|
|
588
|
+
- Example: `MyIndex` isn't valid (contains uppercase letters)
|
|
589
589
|
|
|
590
590
|
### Upserting Embeddings
|
|
591
591
|
|
|
@@ -80,7 +80,7 @@ Returns a `ServerRoute` object that can be registered with an adapter or passed
|
|
|
80
80
|
|
|
81
81
|
### Register through `server.apiRoutes`
|
|
82
82
|
|
|
83
|
-
Routes created with `createRoute()` can be passed to `server.apiRoutes
|
|
83
|
+
Routes created with `createRoute()` can be passed to `server.apiRoutes`, where the adapter adds runtime validation and typed handler parameters while generating OpenAPI metadata. See [Custom API routes](https://mastra.ai/docs/server/custom-api-routes) for details.
|
|
84
84
|
|
|
85
85
|
```typescript
|
|
86
86
|
import { Mastra } from '@mastra/core'
|
|
@@ -44,7 +44,7 @@ Task tracking requires a memory-backed thread (`threadId` + `resourceId`). Witho
|
|
|
44
44
|
|
|
45
45
|
### Agent integration
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
The Agent calls these methods automatically when the provider is passed to `signals`, so you normally don't call them directly.
|
|
48
48
|
|
|
49
49
|
#### `getTools()`
|
|
50
50
|
|
|
@@ -255,7 +255,7 @@ const thread = await memoryStore?.getThreadById({ threadId: '...' })
|
|
|
255
255
|
|
|
256
256
|
## Closing connections
|
|
257
257
|
|
|
258
|
-
`close()` releases
|
|
258
|
+
`close()` releases connections for the stores used by a composite, including the `default` and `editor` stores and any domain with its own client. Each store closes once even if it backs several domains. When the composite is passed to the Mastra class, `shutdown()` calls `close()`:
|
|
259
259
|
|
|
260
260
|
```typescript
|
|
261
261
|
import { MastraCompositeStore } from '@mastra/core/storage'
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Storage retention
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Because storage grows without bound by default, Mastra provides an opt-in, age-based retention system. Declare per-table `maxAge` policies in the `retention` config, then call `storage.prune()` to delete rows older than their configured age. Unconfigured data is kept forever, so behavior doesn't change until you opt in.
|
|
8
8
|
|
|
9
9
|
`prune()` deletes rows. It caps growth and is safe to run against large tables (batched, bounded, resumable, cancellable). It never reclaims disk: on SQLite/libSQL the freed pages are reused by future writes so the file stops growing, but handing disk back to the OS (for example a `VACUUM`) is left to the underlying database and the operator to manage.
|
|
10
10
|
|
|
@@ -37,7 +37,7 @@ const storage = new LibSQLStore({
|
|
|
37
37
|
const results = await storage.prune()
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
`retention` is fully typed.
|
|
40
|
+
`retention` is fully typed. Domain keys must exist, and their table keys must be declared retention-eligible. Store configs type-check objects passed directly. When building an object separately, use `satisfies RetentionConfig` so unknown domains or tables produce compile errors:
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
43
|
import type { RetentionConfig } from '@mastra/core/storage'
|
|
@@ -67,7 +67,7 @@ Set the `retention` field on the store config.
|
|
|
67
67
|
|
|
68
68
|
### Retention-eligible tables
|
|
69
69
|
|
|
70
|
-
Each domain
|
|
70
|
+
Each domain specifies its age-prunable tables and the timestamp column that anchors comparison, chosen so `maxAge` matches the meaning of the data. Append-only logs use creation time, live state uses last activity, and jobs or runs use completion time so in-flight work isn't pruned.
|
|
71
71
|
|
|
72
72
|
| Domain | Table key | Anchor column | `maxAge` measures |
|
|
73
73
|
| ----------------- | ------------------ | ---------------- | ---------------------------------------------------------------- |
|
|
@@ -158,7 +158,7 @@ interface PruneResult {
|
|
|
158
158
|
|
|
159
159
|
## Running prune on a schedule
|
|
160
160
|
|
|
161
|
-
`prune()` has no built-in scheduler
|
|
161
|
+
`prune()` has no built-in scheduler, so you decide when it runs. A bounded call may leave eligible rows, indicated by any result with `done: false`. Call it again on the next tick. Short invocations let a large backlog drain over several runs.
|
|
162
162
|
|
|
163
163
|
```typescript
|
|
164
164
|
// Runs on your own cron (node-cron, a workflow schedule, an external job, etc.).
|
|
@@ -354,7 +354,7 @@ Signals the completion of a processing step.
|
|
|
354
354
|
|
|
355
355
|
### raw
|
|
356
356
|
|
|
357
|
-
Contains raw data from the provider
|
|
357
|
+
Contains raw data from the provider, including content types Mastra doesn't recognize, which are emitted as `raw` chunks rather than discarded. Raw chunks only appear when `includeRawChunks` is enabled.
|
|
358
358
|
|
|
359
359
|
**type** (`"raw"`): Chunk type identifier
|
|
360
360
|
|
|
@@ -38,7 +38,7 @@ bun add @mastra/isolated-vm
|
|
|
38
38
|
|
|
39
39
|
`isolated-vm` is a native addon. It provides prebuilt binaries for common platforms, so installation usually needs no extra setup. A C++ toolchain is only needed on platforms without a matching prebuild, where it falls back to compiling from source.
|
|
40
40
|
|
|
41
|
-
On Node.js 20 and later, the host process
|
|
41
|
+
On Node.js 20 and later, creating an isolate crashes unless the host process starts with `--no-node-snapshot`. The constructor reports the missing flag as an error. Pass it when starting the server or through `NODE_OPTIONS`:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
NODE_OPTIONS=--no-node-snapshot npm run dev
|
|
@@ -349,7 +349,7 @@ console.log(instructionsByServer.db)
|
|
|
349
349
|
|
|
350
350
|
### `authenticate()`
|
|
351
351
|
|
|
352
|
-
Runs the interactive OAuth authorization-code flow for a server
|
|
352
|
+
Runs the interactive OAuth authorization-code flow for a server whose `MCPOAuthClientProvider` uses a loopback redirect URL. A local callback server passes the authorization URL to the provider's `onRedirectToAuthorization` callback and waits for the browser to return the code. It then exchanges the code for tokens and reconnects. See [Interactive browser authentication](#interactive-browser-authentication).
|
|
353
353
|
|
|
354
354
|
The optional `timeoutMs` bounds how long the flow waits for the browser to return the authorization code before rejecting, and defaults to 5 minutes.
|
|
355
355
|
|
|
@@ -1056,7 +1056,7 @@ try {
|
|
|
1056
1056
|
|
|
1057
1057
|
Concurrent `authenticate()` calls for the same server join the pending flow. Different servers authenticate independently. With valid stored tokens the call reconnects without opening a browser.
|
|
1058
1058
|
|
|
1059
|
-
Hosts that drive the flow
|
|
1059
|
+
Hosts that drive the flow can capture the authorization code with the exported `createOAuthCallbackServer` helper. It creates a one-shot loopback server that validates the OAuth `state` parameter before resolving with the code. Because the server uses plain HTTP, use it only for local loopback redirects. Web applications with an HTTPS redirect URL must host their own callback endpoint and drive the provider directly:
|
|
1060
1060
|
|
|
1061
1061
|
```typescript
|
|
1062
1062
|
import { createOAuthCallbackServer, getCallbackUrlCandidates } from '@mastra/mcp'
|
|
@@ -216,7 +216,7 @@ try {
|
|
|
216
216
|
|
|
217
217
|
- **Index Deletion Caveat:** Deleting a Search index doesn't delete the vectors/documents in the associated Couchbase collection. Data remains unless explicitly removed.
|
|
218
218
|
- **Required Permissions:** The Couchbase user must have permissions to connect, read/write documents in the target collection (`kv` role), and manage Search Indexes (`search_admin` role on the relevant bucket/scope).
|
|
219
|
-
- **Index Definition Details & Document Structure:** The `createIndex` method
|
|
219
|
+
- **Index Definition Details & Document Structure:** The `createIndex` method builds a Search Index definition for documents in `scopeName.collectionName`. It indexes the `embedding` field as a vector and the `content` field as text. Each document stores its vector in `embedding`, with metadata kept in `metadata`. A `text` property within `metadata` is also copied to the top-level `content` field for text search.
|
|
220
220
|
- **Replication & Durability:** Consider using Couchbase's built-in replication and persistence features for data durability. Monitor index statistics regularly to ensure efficient search.
|
|
221
221
|
|
|
222
222
|
## Limitations
|
|
@@ -222,7 +222,7 @@ const results = await store.textQuery({
|
|
|
222
222
|
|
|
223
223
|
### `hybridQuery()`
|
|
224
224
|
|
|
225
|
-
Runs a hybrid search that fuses vector similarity
|
|
225
|
+
Runs a hybrid search that fuses vector similarity with full-text results through MongoDB's server-side `$rankFusion`. The feature requires MongoDB 8.0 or later and is generally available from 8.1. MongoDB Atlas 8.0.x supports it where enabled, although enablement may require a support case. A full-text search index must exist. Managed indexes create one automatically, while bring-your-own collections require an explicit `createSearchIndex()` call.
|
|
226
226
|
|
|
227
227
|
**indexName** (`string`): Name of the Mastra index to search
|
|
228
228
|
|
|
@@ -255,7 +255,7 @@ const results = await store.hybridQuery({
|
|
|
255
255
|
})
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
`hybridQuery()` requires MongoDB
|
|
258
|
+
`hybridQuery()` requires MongoDB 8.0 or later for the `$rankFusion` stage, which is generally available from 8.1. On 8.0.x, the stage runs where enabled, including MongoDB Atlas, but enablement may require a support case. If your deployment is older or lacks `$rankFusion`, run `query()` and `textQuery()` separately before merging the results client-side.
|
|
259
259
|
|
|
260
260
|
### `describeIndex()`
|
|
261
261
|
|
|
@@ -1090,7 +1090,7 @@ const voice = new CompositeVoice({
|
|
|
1090
1090
|
output: elevenlabs.speech('eleven_turbo_v2'), // AI SDK speech
|
|
1091
1091
|
})
|
|
1092
1092
|
|
|
1093
|
-
// Works
|
|
1093
|
+
// Works directly with your agent
|
|
1094
1094
|
const voiceAgent = new Agent({
|
|
1095
1095
|
id: 'aisdk-voice-agent',
|
|
1096
1096
|
name: 'AI SDK Voice Agent',
|
|
@@ -12,9 +12,9 @@ Unlike wrapping an agent with `createStep()`, `.agent()` records a declarative e
|
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
workflow
|
|
15
|
-
.map({ prompt: mapVariable({ initData: workflow, path:
|
|
15
|
+
.map({ prompt: mapVariable({ initData: workflow, path: 'topic' }) })
|
|
16
16
|
.agent(testAgent)
|
|
17
|
-
.commit()
|
|
17
|
+
.commit()
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Parameters
|
|
@@ -42,7 +42,7 @@ workflow
|
|
|
42
42
|
}),
|
|
43
43
|
},
|
|
44
44
|
})
|
|
45
|
-
.commit()
|
|
45
|
+
.commit()
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Referencing an agent by ID
|
|
@@ -50,7 +50,7 @@ workflow
|
|
|
50
50
|
Pass a string to reference a registered agent without importing it. The agent must be registered on the Mastra instance when the workflow runs:
|
|
51
51
|
|
|
52
52
|
```typescript
|
|
53
|
-
workflow.agent(
|
|
53
|
+
workflow.agent('test-agent', { maxSteps: 3 }).commit()
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
## Persisting agent steps
|
|
@@ -26,7 +26,7 @@ workflow.foreach(step1, { concurrency: 2 })
|
|
|
26
26
|
|
|
27
27
|
### Execution and waiting
|
|
28
28
|
|
|
29
|
-
The `.foreach()` method processes
|
|
29
|
+
The `.foreach()` method processes every item before the next step executes, regardless of concurrency settings. The default `concurrency: 1` processes items sequentially. Higher values use parallel batches, but the next step still waits for every batch to finish.
|
|
30
30
|
|
|
31
31
|
If you need to run multiple operations per item, use a nested workflow as the step. This keeps all operations for each item together and is cleaner than chaining multiple `.foreach()` calls. See [Nested workflows inside foreach](https://mastra.ai/docs/workflows/control-flow) for examples.
|
|
32
32
|
|
|
@@ -11,7 +11,7 @@ Unlike wrapping a tool with `createStep()`, `.tool()` records a declarative entr
|
|
|
11
11
|
## Usage example
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
workflow.tool(testTool).commit()
|
|
14
|
+
workflow.tool(testTool).commit()
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Parameters
|
|
@@ -31,7 +31,7 @@ workflow.tool(testTool).commit();
|
|
|
31
31
|
Pass a string to reference a registered tool without importing it. The tool must be registered on the Mastra instance when the workflow runs:
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
|
-
workflow.tool(
|
|
34
|
+
workflow.tool('lookup-customer', { retries: 2 }).commit()
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Persisting tool steps
|
|
@@ -175,9 +175,11 @@ await sandbox.start()
|
|
|
175
175
|
|
|
176
176
|
`createRepoTemplate()` accepts the same `cpuCount` and `memoryMB` sizing as the `Template()` builder methods, as plain options. They carry the identity and stale-fallback semantics described above. Omit them for the provider defaults.
|
|
177
177
|
|
|
178
|
-
`
|
|
178
|
+
`setupCommand` also accepts an array. Each entry runs as its own cached build step. `workingDirectory` sets the cwd for the build and the sandbox, and the repository is cloned to `<workingDirectory>/<repo>`. `buildEnv` passes environment variables to the build steps only. They never enter the serialized definition.
|
|
179
179
|
|
|
180
|
-
`
|
|
180
|
+
`getRepositoryAccess` mirrors the resolver a Factory sandbox context carries, so a host can pass its context straight through; when it's absent, `createRepoTemplate()` returns `undefined` and the sandbox boots the provider default. The resolver skips reattachment to an existing `sandboxId`; on a fresh start, it resolves the repository's default-branch head before Platform starts or reuses the corresponding template build. If the repository head can't be resolved or the provider build fails, sandbox creation continues with the provider's default template so runtime setup can perform a cold checkout. For private repositories, the short-lived authorization token is sent as an ephemeral build environment value that stays out of the serialized definition and the persisted template record. It has no effect on content identity.
|
|
181
|
+
|
|
182
|
+
`createRepoTemplate()` also attaches a commit-independent `family` key (`repo:<cloneUrl>:<workingDirectory>/<repo>`) to the definition. `family` groups successive builds of the "same thing", so every commit of the same repository belongs to the same family. Platform uses it to find a prior ready build in the same family and boot the new commit on that warm filesystem while the exact commit template builds in the background. For E2B, stale lookup is also partitioned by the effective CPU and memory settings so a fallback can't silently change the requested machine size. Callers using the raw `Template()` builder can attach their own family key with `.withFamily(key)` (any non-empty string up to 200 characters). Omit it to opt out of family fallback. The family key never influences the content-addressed template identity: two definitions that differ only in `family` share the same cache slot.
|
|
181
183
|
|
|
182
184
|
Platform stores build state under the definition's server-derived content hash within the selected environment and provider.
|
|
183
185
|
|
|
@@ -289,6 +291,8 @@ console.log(result.exitCode)
|
|
|
289
291
|
|
|
290
292
|
**env** (`Record<string, string>`): Environment variables baked into the sandbox at creation time. Per-command environment variables can also be passed to executeCommand.
|
|
291
293
|
|
|
294
|
+
**workingDirectory** (`string`): Default directory for command execution when no per-command cwd is given. A per-command cwd always wins. Use an absolute path.
|
|
295
|
+
|
|
292
296
|
**timeout** (`number`): Default command execution timeout in milliseconds. Overridable per call via ExecuteCommandOptions.timeout.
|
|
293
297
|
|
|
294
298
|
**instructions** (`string | ((opts: { defaultInstructions: string; requestContext?: RequestContext }) => string)`): Custom instructions returned by getInstructions(). A string fully replaces the defaults; a function receives the defaults and can extend or customize them per-request.
|
|
@@ -60,7 +60,7 @@ const handle = await sandbox.processes.spawn('npm run dev', {
|
|
|
60
60
|
|
|
61
61
|
**options.env** (`NodeJS.ProcessEnv`): Environment variables for the process.
|
|
62
62
|
|
|
63
|
-
**options.cwd** (`string`): Working directory for the process.
|
|
63
|
+
**options.cwd** (`string`): Working directory for the process. Defaults to the sandbox's configured workingDirectory, then the provider default.
|
|
64
64
|
|
|
65
65
|
**options.onStdout** (`(data: string) => void`): Callback for stdout chunks. Called as data arrives.
|
|
66
66
|
|
|
@@ -41,7 +41,7 @@ Provider implementations plug into the start lifecycle at one of three rungs; th
|
|
|
41
41
|
2. **`start()` override returning `SandboxStartResult`**: for providers whose API is a fused get-or-create where decomposition would add round-trips (`PlatformSandbox`, `RailwaySandbox`).
|
|
42
42
|
3. **`start()` override returning `void`**: legacy providers, where the outcome is unknown.
|
|
43
43
|
|
|
44
|
-
Concurrent `start()` calls on one instance coalesce onto a single in-flight attempt, and joined callers share that attempt's result (all observe `outcome: 'created'` when the shared attempt created the VM). The in-flight slot is cleared when the attempt settles, so a failed start can be retried.
|
|
44
|
+
Concurrent `start()` calls on one instance coalesce onto a single in-flight attempt, and joined callers share that attempt's result (all observe `outcome: 'created'` when the shared attempt created the VM). The in-flight slot is cleared when the attempt settles, so a failed start can be retried. For a sandbox already in the `running` state, `start()` resolves `{ outcome: 'connected' }` without re-invoking the provider.
|
|
45
45
|
|
|
46
46
|
The result is also forwarded to the `onStart` lifecycle hook as `{ sandbox, outcome }`.
|
|
47
47
|
|
|
@@ -94,6 +94,23 @@ Semantics:
|
|
|
94
94
|
- Each call wraps the current hook, so attach once per sandbox instance. Attaching on a path that runs per request stacks duplicate work on every start.
|
|
95
95
|
- Only starts that begin after the call see the new hook.
|
|
96
96
|
|
|
97
|
+
### `workingDirectory` (constructor option)
|
|
98
|
+
|
|
99
|
+
Sets the default directory for command execution and process spawns. When a command provides no per-command `cwd`, the sandbox runs it from this directory. A per-command `cwd` always wins. When neither is provided, each provider keeps its own default (E2B home, Docker `/workspace`, Vercel serverless `/tmp`, and so on).
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
const sandbox = new E2BSandbox({ workingDirectory: '/home/user/my-repo' })
|
|
103
|
+
await sandbox.executeCommand('pwd') // /home/user/my-repo
|
|
104
|
+
await sandbox.executeCommand('pwd', [], { cwd: '/tmp' }) // /tmp
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The effective value is readable through the `sandbox.workingDirectory` getter. Providers that compute their value, such as Daytona's automatic probe or Docker's `/workspace` default, report the effective directory through the same getter.
|
|
108
|
+
|
|
109
|
+
Semantics:
|
|
110
|
+
|
|
111
|
+
- The value passes to the provider as-is, and the sandbox doesn't create the directory. Absolute paths are recommended: `~`-prefixed paths only work where the provider documents expansion.
|
|
112
|
+
- Some providers keep earlier option names as deprecated aliases feeding the same field: `workingDir` on Docker and Apple container, `workdir` on Modal. When both the alias and `workingDirectory` are set, `workingDirectory` wins.
|
|
113
|
+
|
|
97
114
|
### `stop()`
|
|
98
115
|
|
|
99
116
|
Stop the sandbox.
|
|
@@ -139,7 +156,7 @@ const result = await sandbox.executeCommand('npm', ['install', 'lodash'])
|
|
|
139
156
|
|
|
140
157
|
**options.timeout** (`number`): Execution timeout in milliseconds
|
|
141
158
|
|
|
142
|
-
**options.cwd** (`string`): Working directory for the
|
|
159
|
+
**options.cwd** (`string`): Working directory for this command. Defaults to the sandbox's configured workingDirectory, then the provider default.
|
|
143
160
|
|
|
144
161
|
**options.env** (`Record<string, string>`): Additional environment variables for this command. These take precedence over the sandbox environment for this command execution only.
|
|
145
162
|
|
|
@@ -167,7 +184,7 @@ The runtime environment applies to commands executed through the sandbox rather
|
|
|
167
184
|
|
|
168
185
|
### `getEnv()`
|
|
169
186
|
|
|
170
|
-
Returns a copy of the sandbox's current runtime environment
|
|
187
|
+
Returns a copy of the sandbox's current runtime environment; because mutations to the returned object don't change the sandbox, use `setEnv()` for updates.
|
|
171
188
|
|
|
172
189
|
```typescript
|
|
173
190
|
const token = sandbox.getEnv().GH_TOKEN
|
|
@@ -243,7 +243,7 @@ Stop the workspace's live resources without destroying them.
|
|
|
243
243
|
await workspace.stop()
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
-
`stop()` shuts down language servers and
|
|
246
|
+
`stop()` shuts down language servers and the browser before stopping the sandbox provider. Remote providers suspend or pause the sandbox for later resumption, while `LocalSandbox` kills background processes and unmounts filesystems. Stopping isn't a teardown. The filesystem and search index remain available along with skills, and the next sandbox operation starts the sandbox again.
|
|
247
247
|
|
|
248
248
|
`mastra.shutdown()` calls `stop()` for registered workspaces, so a process restart suspends remote sandboxes instead of deleting them. To fully tear a workspace down, call `destroy()` or `mastra.removeWorkspace(id, { destroy: true })` explicitly.
|
|
249
249
|
|
|
@@ -390,7 +390,7 @@ if (workspace.hasFilesystemConfig()) {
|
|
|
390
390
|
|
|
391
391
|
#### `resolveFilesystem({ requestContext })`
|
|
392
392
|
|
|
393
|
-
Resolve the filesystem for a request context
|
|
393
|
+
Resolve the filesystem for a request context by calling a configured resolver with `requestContext` or returning a configured static filesystem directly. Returns `undefined` when no filesystem is configured.
|
|
394
394
|
|
|
395
395
|
```typescript
|
|
396
396
|
import { RequestContext } from '@mastra/core/request-context'
|
|
@@ -421,7 +421,7 @@ if (workspace.hasSandboxConfig()) {
|
|
|
421
421
|
|
|
422
422
|
#### `resolveSandbox({ requestContext })`
|
|
423
423
|
|
|
424
|
-
Resolve the sandbox for a request context
|
|
424
|
+
Resolve the sandbox for a request context by calling a configured resolver with `requestContext` or returning a configured static sandbox directly. Returns `undefined` when no sandbox is configured.
|
|
425
425
|
|
|
426
426
|
```typescript
|
|
427
427
|
import { RequestContext } from '@mastra/core/request-context'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.2.23-alpha.
|
|
3
|
+
"version": "1.2.23-alpha.10",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
".docs",
|
|
11
|
-
"README.md"
|
|
12
|
-
"CHANGELOG.md"
|
|
11
|
+
"README.md"
|
|
13
12
|
],
|
|
14
13
|
"exports": {
|
|
15
14
|
".": {
|
|
@@ -28,8 +27,8 @@
|
|
|
28
27
|
"jsdom": "^26.1.0",
|
|
29
28
|
"local-pkg": "^1.1.2",
|
|
30
29
|
"zod": "^4.4.3",
|
|
31
|
-
"@mastra/core": "1.
|
|
32
|
-
"@mastra/mcp": "^1.17.
|
|
30
|
+
"@mastra/core": "1.64.0-alpha.4",
|
|
31
|
+
"@mastra/mcp": "^1.17.3-alpha.0"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@hono/node-server": "^2.0.0",
|
|
@@ -45,8 +44,8 @@
|
|
|
45
44
|
"tsx": "^4.23.1",
|
|
46
45
|
"typescript": "^7.0.2",
|
|
47
46
|
"vitest": "4.1.10",
|
|
48
|
-
"@mastra/core": "1.63.3-alpha.0",
|
|
49
47
|
"@internal/lint": "0.0.129",
|
|
48
|
+
"@mastra/core": "1.64.0-alpha.4",
|
|
50
49
|
"@internal/types-builder": "0.0.104"
|
|
51
50
|
},
|
|
52
51
|
"homepage": "https://mastra.ai",
|