@mastra/mcp-docs-server 1.0.0-beta.14 → 1.0.0-beta.16
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/organized/changelogs/%40mastra%2Fagent-builder.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +51 -51
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +85 -85
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +258 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +338 -338
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +67 -67
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +168 -168
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +259 -259
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +259 -259
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +279 -279
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +108 -108
- package/.docs/organized/changelogs/%40mastra%2Freact.md +77 -77
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +180 -180
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +235 -235
- package/.docs/organized/changelogs/create-mastra.md +11 -11
- package/.docs/organized/changelogs/mastra.md +40 -40
- package/.docs/organized/code-examples/agent-v6.md +70 -11
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +8 -3
- package/.docs/raw/deployment/overview.mdx +3 -4
- package/.docs/raw/deployment/workflow-runners.mdx +14 -0
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/guides/deployment/inngest.mdx +198 -140
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +11 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +68 -0
- package/.docs/raw/mastra-cloud/deployment.mdx +39 -0
- package/.docs/raw/mastra-cloud/observability.mdx +9 -15
- package/.docs/raw/mastra-cloud/overview.mdx +14 -44
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/reference/client-js/workflows.mdx +15 -0
- package/.docs/raw/reference/logging/pino-logger.mdx +1 -1
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +39 -18
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +4 -2
- package/.docs/raw/reference/storage/composite.mdx +223 -0
- package/.docs/raw/reference/storage/lance.mdx +3 -2
- package/.docs/raw/reference/storage/libsql.mdx +5 -2
- package/.docs/raw/reference/storage/mongodb.mdx +4 -2
- package/.docs/raw/reference/storage/mssql.mdx +4 -2
- package/.docs/raw/reference/storage/postgresql.mdx +4 -2
- package/.docs/raw/reference/tools/mcp-server.mdx +9 -0
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +51 -3
- package/.docs/raw/reference/workflows/run.mdx +8 -2
- package/.docs/raw/voice/overview.mdx +1 -1
- package/.docs/raw/workflows/overview.mdx +1 -1
- package/.docs/raw/workflows/snapshots.mdx +2 -1
- package/CHANGELOG.md +15 -0
- package/package.json +5 -5
- package/.docs/raw/mastra-cloud/dashboard.mdx +0 -96
- package/.docs/raw/mastra-cloud/setting-up.mdx +0 -106
- package/.docs/raw/workflows/inngest-workflow.mdx +0 -362
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# mastra
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.12
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add Antigravity IDE support to create-mastra CLI. Users can now select Antigravity during project initialization and automatically configure the global Mastra MCP server for the IDE, reducing manual setup and enabling immediate use of Mastra agents. ([#11374](https://github.com/mastra-ai/mastra/pull/11374))
|
|
8
|
+
|
|
9
|
+
- Add --studio flag to bundle playground UI with mastra build ([#11327](https://github.com/mastra-ai/mastra/pull/11327))
|
|
10
|
+
|
|
11
|
+
Enables bundling the studio/playground UI into the build output so it can be served from the deployed server.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
mastra build --studio
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- Added CLI options to configure Mastra Studio runtime settings, allowing you to customize the server connection details, and protocol. ([#11265](https://github.com/mastra-ai/mastra/pull/11265))
|
|
18
|
+
|
|
19
|
+
You can now override the default studio configuration using command-line arguments:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
mastra studio \
|
|
23
|
+
--server-host api.example.com \
|
|
24
|
+
--server-port 8080 \
|
|
25
|
+
--server-protocol https
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
These options configure the `window.MASTRA_*` environment variables that the Studio frontend uses to connect to your API server.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Extract getDurationMs helper method to simplify command execution timing in CLI analytics. Replaces repeated process.hrtime logic with a reusable private helper method, improving code maintainability and reducing duplication. ([#11316](https://github.com/mastra-ai/mastra/pull/11316))
|
|
33
|
+
|
|
34
|
+
- Add debugger-like click-through UI to workflow graph ([#11350](https://github.com/mastra-ai/mastra/pull/11350))
|
|
35
|
+
|
|
36
|
+
- Detect installed Mastra packages during dev and pass version information to the playground server via `MASTRA_PACKAGES_FILE` env var ([#11211](https://github.com/mastra-ai/mastra/pull/11211))
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [[`403c643`](https://github.com/mastra-ai/mastra/commit/403c643ea02862f3177d4b92e85b09f83aed3eb3), [`33a4d2e`](https://github.com/mastra-ai/mastra/commit/33a4d2e4ed8af51f69256232f00c34d6b6b51d48), [`4aaa844`](https://github.com/mastra-ai/mastra/commit/4aaa844a4f19d054490f43638a990cc57bda8d2f), [`4a1a6cb`](https://github.com/mastra-ai/mastra/commit/4a1a6cb3facad54b2bb6780b00ce91d6de1edc08), [`31d13d5`](https://github.com/mastra-ai/mastra/commit/31d13d5fdc2e2380e2e3ee3ec9fb29d2a00f265d), [`2fe69cb`](https://github.com/mastra-ai/mastra/commit/2fe69cbfda1025a7cf440308eed26c77ec553e1a), [`4c62166`](https://github.com/mastra-ai/mastra/commit/4c621669f4a29b1f443eca3ba70b814afa286266), [`7bcbf10`](https://github.com/mastra-ai/mastra/commit/7bcbf10133516e03df964b941f9a34e9e4ab4177), [`4353600`](https://github.com/mastra-ai/mastra/commit/43536005a65988a8eede236f69122e7f5a284ba2), [`6986fb0`](https://github.com/mastra-ai/mastra/commit/6986fb064f5db6ecc24aa655e1d26529087b43b3), [`4da09a4`](https://github.com/mastra-ai/mastra/commit/4da09a4b95262be57c912821d6d8108868ae59db), [`053e979`](https://github.com/mastra-ai/mastra/commit/053e9793b28e970086b0507f7f3b76ea32c1e838), [`e26dc9c`](https://github.com/mastra-ai/mastra/commit/e26dc9c3ccfec54ae3dc3e2b2589f741f9ae60a6), [`55edf73`](https://github.com/mastra-ai/mastra/commit/55edf7302149d6c964fbb7908b43babfc2b52145), [`27c0009`](https://github.com/mastra-ai/mastra/commit/27c0009777a6073d7631b0eb7b481d94e165b5ca), [`dee388d`](https://github.com/mastra-ai/mastra/commit/dee388dde02f2e63c53385ae69252a47ab6825cc), [`3f3fc30`](https://github.com/mastra-ai/mastra/commit/3f3fc3096f24c4a26cffeecfe73085928f72aa63), [`d90ea65`](https://github.com/mastra-ai/mastra/commit/d90ea6536f7aa51c6545a4e9215b55858e98e16d), [`d171e55`](https://github.com/mastra-ai/mastra/commit/d171e559ead9f52ec728d424844c8f7b164c4510), [`10c2735`](https://github.com/mastra-ai/mastra/commit/10c27355edfdad1ee2b826b897df74125eb81fb8), [`1924cf0`](https://github.com/mastra-ai/mastra/commit/1924cf06816e5e4d4d5333065ec0f4bb02a97799), [`b339816`](https://github.com/mastra-ai/mastra/commit/b339816df0984d0243d944ac2655d6ba5f809cde)]:
|
|
39
|
+
- @mastra/deployer@1.0.0-beta.15
|
|
40
|
+
- @mastra/core@1.0.0-beta.15
|
|
41
|
+
|
|
3
42
|
## 1.0.0-beta.11
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
|
@@ -460,43 +499,4 @@
|
|
|
460
499
|
|
|
461
500
|
- Customize AITraces type to seamlessly work on Cloud too ([#8759](https://github.com/mastra-ai/mastra/pull/8759))
|
|
462
501
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
- Stream finalResult from network loop ([#8795](https://github.com/mastra-ai/mastra/pull/8795))
|
|
466
|
-
|
|
467
|
-
- Improve README ([#8819](https://github.com/mastra-ai/mastra/pull/8819))
|
|
468
|
-
|
|
469
|
-
- Update peer dependencies to match core package version bump (0.21.0) ([#8686](https://github.com/mastra-ai/mastra/pull/8686))
|
|
470
|
-
|
|
471
|
-
- Updated dependencies [[`0fb6616`](https://github.com/mastra-ai/mastra/commit/0fb66169600ed2a3dc1297b1bfa8a7693ebb6e3c), [`1ed9670`](https://github.com/mastra-ai/mastra/commit/1ed9670d3ca50cb60dc2e517738c5eef3968ed27), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`1dbd76a`](https://github.com/mastra-ai/mastra/commit/1dbd76aff29cc764d3a1ac7bb01172fe59cb5992), [`f59fc1e`](https://github.com/mastra-ai/mastra/commit/f59fc1e406b8912e692f6bff6cfd4754cc8d165c), [`ca5a01f`](https://github.com/mastra-ai/mastra/commit/ca5a01f0dd4dabdbfde3beeaf92c7333e0f9bb39), [`158381d`](https://github.com/mastra-ai/mastra/commit/158381d39335be934b81ef8a1947bccace492c25), [`a1799bc`](https://github.com/mastra-ai/mastra/commit/a1799bcc1b5a1cdc188f2ac0165f17a1c4ac6f7b), [`6ff6094`](https://github.com/mastra-ai/mastra/commit/6ff60946f4ecfebdeef6e21d2b230c2204f2c9b8), [`2ddb851`](https://github.com/mastra-ai/mastra/commit/2ddb8519c4b6f1d31be10ffd33b41d2b649a04ff), [`fb703b9`](https://github.com/mastra-ai/mastra/commit/fb703b9634eeaff1a6eb2b5531ce0f9e8fb04727), [`dfe856f`](https://github.com/mastra-ai/mastra/commit/dfe856f7f60ff4765b75930e7b5d82dd0f0f7d89), [`37a2314`](https://github.com/mastra-ai/mastra/commit/37a23148e0e5a3b40d4f9f098b194671a8a49faf), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`05a9dee`](https://github.com/mastra-ai/mastra/commit/05a9dee3d355694d28847bfffb6289657fcf7dfa), [`e3c1077`](https://github.com/mastra-ai/mastra/commit/e3c107763aedd1643d3def5df450c235da9ff76c), [`1908ca0`](https://github.com/mastra-ai/mastra/commit/1908ca0521f90e43779cc29ab590173ca560443c), [`1bccdb3`](https://github.com/mastra-ai/mastra/commit/1bccdb33eb90cbeba2dc5ece1c2561fb774b26b6), [`5ef944a`](https://github.com/mastra-ai/mastra/commit/5ef944a3721d93105675cac2b2311432ff8cc393), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`d6b186f`](https://github.com/mastra-ai/mastra/commit/d6b186fb08f1caf1b86f73d3a5ee88fb999ca3be), [`ee68e82`](https://github.com/mastra-ai/mastra/commit/ee68e8289ea4408d29849e899bc6e78b3bd4e843), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`ea33930`](https://github.com/mastra-ai/mastra/commit/ea339301e82d6318257720d811b043014ee44064), [`65493b3`](https://github.com/mastra-ai/mastra/commit/65493b31c36f6fdb78f9679f7e1ecf0c250aa5ee), [`a998b8f`](https://github.com/mastra-ai/mastra/commit/a998b8f858091c2ec47683e60766cf12d03001e4), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`8a37bdd`](https://github.com/mastra-ai/mastra/commit/8a37bddb6d8614a32c5b70303d583d80c620ea61), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`e0e1cf1`](https://github.com/mastra-ai/mastra/commit/e0e1cf1e37b9dc61099ab331a6d386e44b816310), [`135d6f2`](https://github.com/mastra-ai/mastra/commit/135d6f22a326ed1dffff858700669dff09d2c9eb)]:
|
|
472
|
-
- @mastra/deployer@0.21.0
|
|
473
|
-
- @mastra/core@0.21.0
|
|
474
|
-
- @mastra/loggers@0.10.16
|
|
475
|
-
- @mastra/mcp@0.13.5
|
|
476
|
-
|
|
477
|
-
## 0.16.0-alpha.1
|
|
478
|
-
|
|
479
|
-
### Minor Changes
|
|
480
|
-
|
|
481
|
-
- Update peer dependencies to match core package version bump (0.21.0) ([#8795](https://github.com/mastra-ai/mastra/pull/8795))
|
|
482
|
-
|
|
483
|
-
### Patch Changes
|
|
484
|
-
|
|
485
|
-
- Create unified Sidebar component to use on Playground and Cloud ([#8655](https://github.com/mastra-ai/mastra/pull/8655))
|
|
486
|
-
|
|
487
|
-
- Use only zod validation in dynamic form ([#8802](https://github.com/mastra-ai/mastra/pull/8802))
|
|
488
|
-
|
|
489
|
-
- Add support for --debug options to build/dev commands to add more logging ([#8792](https://github.com/mastra-ai/mastra/pull/8792))
|
|
490
|
-
|
|
491
|
-
- Add div wrapper around entity tables to fix table vertical position ([#8758](https://github.com/mastra-ai/mastra/pull/8758))
|
|
492
|
-
|
|
493
|
-
- Customize AITraces type to seamlessly work on Cloud too ([#8759](https://github.com/mastra-ai/mastra/pull/8759))
|
|
494
|
-
|
|
495
|
-
- Stream finalResult from network loop ([#8795](https://github.com/mastra-ai/mastra/pull/8795))
|
|
496
|
-
|
|
497
|
-
- Improve README ([#8819](https://github.com/mastra-ai/mastra/pull/8819))
|
|
498
|
-
|
|
499
|
-
- Updated dependencies [[`1ed9670`](https://github.com/mastra-ai/mastra/commit/1ed9670d3ca50cb60dc2e517738c5eef3968ed27), [`ca5a01f`](https://github.com/mastra-ai/mastra/commit/ca5a01f0dd4dabdbfde3beeaf92c7333e0f9bb39), [`158381d`](https://github.com/mastra-ai/mastra/commit/158381d39335be934b81ef8a1947bccace492c25), [`fb703b9`](https://github.com/mastra-ai/mastra/commit/fb703b9634eeaff1a6eb2b5531ce0f9e8fb04727), [`dfe856f`](https://github.com/mastra-ai/mastra/commit/dfe856f7f60ff4765b75930e7b5d82dd0f0f7d89), [`37a2314`](https://github.com/mastra-ai/mastra/commit/37a23148e0e5a3b40d4f9f098b194671a8a49faf), [`05a9dee`](https://github.com/mastra-ai/mastra/commit/05a9dee3d355694d28847bfffb6289657fcf7dfa), [`e3c1077`](https://github.com/mastra-ai/mastra/commit/e3c107763aedd1643d3def5df450c235da9ff76c), [`1bccdb3`](https://github.com/mastra-ai/mastra/commit/1bccdb33eb90cbeba2dc5ece1c2561fb774b26b6), [`5ef944a`](https://github.com/mastra-ai/mastra/commit/5ef944a3721d93105675cac2b2311432ff8cc393), [`d6b186f`](https://github.com/mastra-ai/mastra/commit/d6b186fb08f1caf1b86f73d3a5ee88fb999ca3be), [`65493b3`](https://github.com/mastra-ai/mastra/commit/65493b31c36f6fdb78f9679f7e1ecf0c250aa5ee), [`a998b8f`](https://github.com/mastra-ai/mastra/commit/a998b8f858091c2ec47683e60766cf12d03001e4), [`8a37bdd`](https://github.com/mastra-ai/mastra/commit/8a37bddb6d8614a32c5b70303d583d80c620ea61), [`e0e1cf1`](https://github.com/mastra-ai/mastra/commit/e0e1cf1e37b9dc61099ab331a6d386e44b816310)]:
|
|
500
|
-
- @mastra/core@0.21.0-alpha.1
|
|
501
|
-
|
|
502
|
-
... 6420 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 6459 more lines hidden. See full changelog in package directory.
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"zod": "^3",
|
|
7
7
|
"typescript": "^5.8.3",
|
|
8
|
-
"@ai-sdk/openai": "3.0.0
|
|
9
|
-
"@ai-sdk/provider": "3.0.0
|
|
10
|
-
"ai": "^6.0.
|
|
8
|
+
"@ai-sdk/openai": "^3.0.0",
|
|
9
|
+
"@ai-sdk/provider": "^3.0.0",
|
|
10
|
+
"ai": "^6.0.1",
|
|
11
11
|
"@mastra/client-js": "beta",
|
|
12
12
|
"@mastra/core": "beta",
|
|
13
13
|
"@mastra/evals": "beta",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"@mastra/mcp": "beta",
|
|
17
17
|
"@mastra/memory": "beta",
|
|
18
18
|
"@mastra/observability": "beta",
|
|
19
|
-
"@mastra/voice-openai": "beta"
|
|
19
|
+
"@mastra/voice-openai": "beta",
|
|
20
|
+
"@mastra/ai-sdk": "beta"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"mastra": "beta",
|
|
@@ -54,8 +55,9 @@ console.log(result.object);
|
|
|
54
55
|
```typescript
|
|
55
56
|
import { Memory } from '@mastra/memory';
|
|
56
57
|
import { Agent } from '@mastra/core/agent';
|
|
58
|
+
import { stepCountIs, ToolLoopAgent } from 'ai';
|
|
57
59
|
import { openai } from '@ai-sdk/openai';
|
|
58
|
-
import { weatherInfo } from '../tools';
|
|
60
|
+
import { weatherInfo, weatherTool } from '../tools';
|
|
59
61
|
|
|
60
62
|
const memory = new Memory();
|
|
61
63
|
|
|
@@ -65,21 +67,51 @@ export const weatherAgent = new Agent({
|
|
|
65
67
|
instructions: `Your goal is to provide weather information for cities when requested`,
|
|
66
68
|
description: `An agent that can help you get weather information for a given city`,
|
|
67
69
|
model: openai('gpt-4o-mini'),
|
|
68
|
-
|
|
70
|
+
defaultOptions: {
|
|
71
|
+
stopWhen: stepCountIs(1),
|
|
72
|
+
},
|
|
73
|
+
tools: {
|
|
74
|
+
weatherInfo,
|
|
75
|
+
},
|
|
69
76
|
memory,
|
|
70
77
|
});
|
|
71
78
|
|
|
79
|
+
// AI SDK ToolLoopAgent
|
|
80
|
+
export const weatherToolLoopAgent = new ToolLoopAgent({
|
|
81
|
+
model: openai('gpt-4o-mini'),
|
|
82
|
+
instructions: 'You are a helpful weather assistant. Use the weather tool to get current conditions.',
|
|
83
|
+
stopWhen: stepCountIs(1),
|
|
84
|
+
tools: {
|
|
85
|
+
weather: weatherTool,
|
|
86
|
+
},
|
|
87
|
+
// temperature: 0.7,
|
|
88
|
+
// maxRetries: 2,
|
|
89
|
+
// stopWhen: stepCountIs(1),
|
|
90
|
+
// prepareCall: async args => {
|
|
91
|
+
// console.log('prepareCall', args);
|
|
92
|
+
// return args;
|
|
93
|
+
// },
|
|
94
|
+
// prepareStep: args => {
|
|
95
|
+
// console.log('prepareStep', args);
|
|
96
|
+
// return args;
|
|
97
|
+
// },
|
|
98
|
+
// onStepFinish: event => {
|
|
99
|
+
// console.log('onStepFinish', event);
|
|
100
|
+
// },
|
|
101
|
+
// onFinish: event => {
|
|
102
|
+
// console.log('onFinish', event);
|
|
103
|
+
// },
|
|
104
|
+
});
|
|
105
|
+
|
|
72
106
|
```
|
|
73
107
|
|
|
74
108
|
### mastra/index.ts
|
|
75
109
|
```typescript
|
|
76
110
|
import { Mastra } from '@mastra/core/mastra';
|
|
77
|
-
import { PinoLogger } from '@mastra/loggers';
|
|
78
111
|
import { LibSQLStore } from '@mastra/libsql';
|
|
112
|
+
import { weatherAgent, weatherToolLoopAgent } from './agents';
|
|
79
113
|
import { Observability } from '@mastra/observability';
|
|
80
114
|
|
|
81
|
-
import { weatherAgent } from './agents';
|
|
82
|
-
|
|
83
115
|
const storage = new LibSQLStore({
|
|
84
116
|
id: 'mastra-storage',
|
|
85
117
|
url: 'file:./mastra.db',
|
|
@@ -88,6 +120,7 @@ const storage = new LibSQLStore({
|
|
|
88
120
|
export const mastra = new Mastra({
|
|
89
121
|
storage,
|
|
90
122
|
agents: {
|
|
123
|
+
weatherToolLoopAgent,
|
|
91
124
|
weatherAgent,
|
|
92
125
|
},
|
|
93
126
|
bundler: {
|
|
@@ -98,7 +131,6 @@ export const mastra = new Mastra({
|
|
|
98
131
|
swaggerUI: true,
|
|
99
132
|
},
|
|
100
133
|
},
|
|
101
|
-
logger: new PinoLogger({ name: 'Chef', level: 'debug' }),
|
|
102
134
|
observability: new Observability({
|
|
103
135
|
default: { enabled: true },
|
|
104
136
|
}),
|
|
@@ -109,6 +141,7 @@ export const mastra = new Mastra({
|
|
|
109
141
|
### mastra/tools/index.ts
|
|
110
142
|
```typescript
|
|
111
143
|
import { createTool } from '@mastra/core/tools';
|
|
144
|
+
import { tool } from 'ai';
|
|
112
145
|
import { z } from 'zod';
|
|
113
146
|
|
|
114
147
|
export const weatherInfo = createTool({
|
|
@@ -129,12 +162,38 @@ export const weatherInfo = createTool({
|
|
|
129
162
|
},
|
|
130
163
|
});
|
|
131
164
|
|
|
165
|
+
// Create a tool using AI SDK's tool() helper
|
|
166
|
+
export const weatherTool = tool({
|
|
167
|
+
description: 'Get the current weather for a city',
|
|
168
|
+
inputSchema: z.object({
|
|
169
|
+
city: z.string().describe('The city to get weather for'),
|
|
170
|
+
}),
|
|
171
|
+
outputSchema: z.object({
|
|
172
|
+
city: z.string(),
|
|
173
|
+
weather: z.string(),
|
|
174
|
+
temperature: z.number(),
|
|
175
|
+
unit: z.string(),
|
|
176
|
+
}),
|
|
177
|
+
execute: async ({ city }) => {
|
|
178
|
+
// Simulated weather data
|
|
179
|
+
return {
|
|
180
|
+
city,
|
|
181
|
+
weather: 'sunny',
|
|
182
|
+
temperature: 72,
|
|
183
|
+
unit: 'fahrenheit',
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
132
188
|
```
|
|
133
189
|
|
|
134
190
|
### structured-output-example.ts
|
|
135
191
|
```typescript
|
|
136
192
|
import z from 'zod';
|
|
137
|
-
import {
|
|
193
|
+
import { mastra } from './mastra/index';
|
|
194
|
+
// import { weatherAgent } from './mastra/agents';
|
|
195
|
+
|
|
196
|
+
const weatherAgent = mastra.getAgent('weatherToolLoopAgent');
|
|
138
197
|
|
|
139
198
|
const result = await weatherAgent.generate('weather in new york', {
|
|
140
199
|
structuredOutput: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Voice | Agents"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Voice
|
|
6
6
|
|
|
7
7
|
Mastra agents can be enhanced with voice capabilities, allowing them to speak responses and listen to user input. You can configure an agent to use either a single voice provider or combine multiple providers for different operations.
|
|
8
8
|
|
|
@@ -348,4 +348,9 @@ Mastra supports multiple voice providers for text-to-speech (TTS) and speech-to-
|
|
|
348
348
|
| Azure | `@mastra/voice-azure` | TTS, STT | [Documentation](/reference/v1/voice/mastra-voice) |
|
|
349
349
|
| Cloudflare | `@mastra/voice-cloudflare` | TTS | [Documentation](/reference/v1/voice/mastra-voice) |
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
## Next Steps
|
|
352
|
+
|
|
353
|
+
- [Voice API Reference](/reference/v1/voice/mastra-voice) - Detailed API documentation for voice capabilities
|
|
354
|
+
- [Text to Speech Examples](https://github.com/mastra-ai/voice-examples/tree/main/text-to-speech) - Interactive story generator and other TTS implementations
|
|
355
|
+
- [Speech to Text Examples](https://github.com/mastra-ai/voice-examples/tree/main/speech-to-text) - Voice memo app and other STT implementations
|
|
356
|
+
- [Speech to Speech Examples](https://github.com/mastra-ai/voice-examples/tree/main/speech-to-speech) - Real-time voice conversation with call analysis
|
|
@@ -22,7 +22,7 @@ Mastra can run against any of these runtime environments:
|
|
|
22
22
|
|
|
23
23
|
Mastra provides a [server](/docs/v1/server/mastra-server) powered by Hono that can be deployed independently. Use the `mastra build` command to build your application and deploy the output to your preferred VM, container, or PaaS platform.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Visit the [Mastra server deployment guide](/docs/v1/deployment/mastra-server).
|
|
26
26
|
|
|
27
27
|
### Monorepo
|
|
28
28
|
|
|
@@ -58,7 +58,6 @@ Learn more in the [Mastra Cloud docs](/docs/v1/mastra-cloud/overview).
|
|
|
58
58
|
|
|
59
59
|
## Workflow Runners
|
|
60
60
|
|
|
61
|
-
Mastra
|
|
61
|
+
Mastra workflows run using the built-in execution engine by default. For production workloads requiring managed infrastructure, workflows can also be deployed to specialized platforms like [Inngest](https://www.inngest.com) that provide step memoization, automatic retries, and real-time monitoring.
|
|
62
62
|
|
|
63
|
-
- [Inngest deployment guide](/guides/v1/deployment/inngest)
|
|
64
|
-
- [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest)
|
|
63
|
+
Visit the [Workflow Runners guide](/docs/v1/deployment/workflow-runners) for execution options and the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Workflow Runners | Deployment"
|
|
3
|
+
description: "Deploy Mastra workflows to specialized workflow execution platforms"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Runners
|
|
7
|
+
|
|
8
|
+
Mastra [workflows](../workflows/overview.mdx) can be executed using the built-in workflow runner or deployed to specialized workflow execution platforms that handle orchestration, monitoring, and reliability.
|
|
9
|
+
|
|
10
|
+
## Inngest
|
|
11
|
+
|
|
12
|
+
Inngest is a developer platform for running background workflows without managing infrastructure. Mastra workflows can be deployed to Inngest, which provides step memoization, automatic retries, real-time monitoring, and suspend/resume capabilities.
|
|
13
|
+
|
|
14
|
+
Visit the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions and the [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest) for a complete implementation.
|
|
@@ -14,7 +14,7 @@ Studio provides an interactive UI for building and testing your agents, along wi
|
|
|
14
14
|
|
|
15
15
|
As your project evolves, Studio's development environment helps you iterate on your agent quickly. Meanwhile, Observability and Scorer features give you visibility into performance at every stage.
|
|
16
16
|
|
|
17
|
-
To get started, run Studio locally using the instructions below, or [create a project in Mastra Cloud](
|
|
17
|
+
To get started, run Studio locally using the instructions below, or [create a project in Mastra Cloud](/docs/v1/mastra-cloud/setup) to collaborate with your team.
|
|
18
18
|
|
|
19
19
|
<YouTube id="ojGu6Bi4wYk" />
|
|
20
20
|
|