@mastra/mcp-docs-server 1.0.0-beta.13 → 1.0.0-beta.14
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 +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +98 -98
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +30 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +171 -171
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Freact.md +9 -2
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +94 -94
- package/.docs/organized/changelogs/create-mastra.md +3 -3
- package/.docs/organized/changelogs/mastra.md +17 -17
- package/.docs/organized/code-examples/agent-v6.md +151 -0
- package/.docs/organized/code-examples/ai-elements.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +2 -3
- package/.docs/raw/agents/agent-approval.mdx +5 -6
- package/.docs/raw/agents/agent-memory.mdx +22 -30
- package/.docs/raw/agents/guardrails.mdx +60 -50
- package/.docs/raw/agents/networks.mdx +8 -12
- package/.docs/raw/agents/overview.mdx +39 -23
- package/.docs/raw/agents/processors.mdx +20 -19
- package/.docs/raw/agents/structured-output.mdx +11 -7
- package/.docs/raw/agents/using-tools.mdx +4 -5
- package/.docs/raw/deployment/mastra-server.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +7 -0
- package/.docs/raw/deployment/web-framework.mdx +4 -6
- package/.docs/raw/evals/custom-scorers.mdx +9 -6
- package/.docs/raw/evals/overview.mdx +3 -6
- package/.docs/raw/evals/running-in-ci.mdx +2 -2
- package/.docs/raw/getting-started/manual-install.mdx +20 -20
- package/.docs/raw/getting-started/mcp-docs-server.mdx +2 -2
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +4 -4
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +30 -30
- package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +11 -11
- package/.docs/raw/guides/deployment/amazon-ec2.mdx +9 -9
- package/.docs/raw/guides/deployment/aws-lambda.mdx +11 -11
- package/.docs/raw/guides/deployment/azure-app-services.mdx +2 -2
- package/.docs/raw/guides/deployment/cloudflare-deployer.mdx +5 -6
- package/.docs/raw/guides/deployment/digital-ocean.mdx +10 -10
- package/.docs/raw/guides/deployment/index.mdx +1 -1
- package/.docs/raw/guides/deployment/inngest.mdx +386 -0
- package/.docs/raw/guides/deployment/netlify-deployer.mdx +4 -4
- package/.docs/raw/guides/deployment/vercel-deployer.mdx +5 -6
- package/.docs/raw/guides/getting-started/astro.mdx +292 -451
- package/.docs/raw/guides/getting-started/express.mdx +7 -7
- package/.docs/raw/guides/getting-started/hono.mdx +18 -18
- package/.docs/raw/guides/getting-started/next-js.mdx +19 -20
- package/.docs/raw/guides/getting-started/quickstart.mdx +4 -4
- package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
- package/.docs/raw/guides/getting-started/vite-react.mdx +21 -21
- package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
- package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
- package/.docs/raw/guides/guide/research-assistant.mdx +13 -13
- package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
- package/.docs/raw/guides/guide/web-search.mdx +8 -8
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +0 -2
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/mastra-cloud/setting-up.mdx +6 -2
- package/.docs/raw/mcp/overview.mdx +31 -13
- package/.docs/raw/mcp/publishing-mcp-server.mdx +2 -2
- package/.docs/raw/memory/memory-processors.mdx +9 -9
- package/.docs/raw/memory/message-history.mdx +69 -0
- package/.docs/raw/memory/overview.mdx +34 -76
- package/.docs/raw/memory/semantic-recall.mdx +58 -49
- package/.docs/raw/memory/storage.mdx +188 -0
- package/.docs/raw/memory/working-memory.mdx +7 -7
- package/.docs/raw/observability/logging.mdx +9 -10
- package/.docs/raw/observability/overview.mdx +0 -1
- package/.docs/raw/observability/tracing/bridges/otel.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/default.mdx +3 -3
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -2
- package/.docs/raw/observability/tracing/overview.mdx +23 -25
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +3 -3
- package/.docs/raw/rag/chunking-and-embedding.mdx +6 -6
- package/.docs/raw/rag/graph-rag.mdx +7 -7
- package/.docs/raw/rag/overview.mdx +1 -1
- package/.docs/raw/rag/retrieval.mdx +21 -22
- package/.docs/raw/rag/vector-databases.mdx +22 -22
- package/.docs/raw/reference/agents/agent.mdx +3 -3
- package/.docs/raw/reference/agents/generate.mdx +1 -1
- package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +2 -2
- package/.docs/raw/reference/agents/getLLM.mdx +2 -2
- package/.docs/raw/reference/agents/getMemory.mdx +2 -2
- package/.docs/raw/reference/agents/getModel.mdx +2 -2
- package/.docs/raw/reference/agents/getTools.mdx +2 -2
- package/.docs/raw/reference/agents/getVoice.mdx +2 -2
- package/.docs/raw/reference/agents/listAgents.mdx +2 -2
- package/.docs/raw/reference/agents/listScorers.mdx +2 -2
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +2 -2
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/network-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +6 -6
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +2 -2
- package/.docs/raw/reference/auth/auth0.mdx +1 -2
- package/.docs/raw/reference/auth/clerk.mdx +1 -2
- package/.docs/raw/reference/auth/firebase.mdx +2 -4
- package/.docs/raw/reference/auth/jwt.mdx +1 -2
- package/.docs/raw/reference/auth/supabase.mdx +1 -2
- package/.docs/raw/reference/auth/workos.mdx +1 -2
- package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
- package/.docs/raw/reference/cli/mastra.mdx +9 -9
- package/.docs/raw/reference/client-js/agents.mdx +1 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +1 -1
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +1 -1
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServerById.mdx +1 -1
- package/.docs/raw/reference/core/getMemory.mdx +2 -2
- package/.docs/raw/reference/core/getServer.mdx +1 -1
- package/.docs/raw/reference/core/getStorage.mdx +2 -2
- package/.docs/raw/reference/core/getStoredAgentById.mdx +3 -3
- package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
- package/.docs/raw/reference/core/getVector.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +1 -1
- package/.docs/raw/reference/core/listMemory.mdx +2 -2
- package/.docs/raw/reference/core/listStoredAgents.mdx +4 -4
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +2 -2
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -2
- package/.docs/raw/reference/deployer/deployer.mdx +0 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -1
- package/.docs/raw/reference/deployer/vercel.mdx +2 -4
- package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/bias.mdx +1 -1
- package/.docs/raw/reference/evals/completeness.mdx +1 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/context-precision.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
- package/.docs/raw/reference/evals/hallucination.mdx +1 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
- package/.docs/raw/reference/evals/prompt-alignment.mdx +7 -7
- package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +10 -10
- package/.docs/raw/reference/evals/toxicity.mdx +1 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +6 -7
- package/.docs/raw/reference/memory/createThread.mdx +2 -2
- package/.docs/raw/reference/memory/deleteMessages.mdx +2 -2
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +2 -2
- package/.docs/raw/reference/memory/memory-class.mdx +3 -3
- package/.docs/raw/reference/memory/query.mdx +2 -2
- package/.docs/raw/reference/memory/recall.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
- package/.docs/raw/reference/processors/language-detector.mdx +2 -2
- package/.docs/raw/reference/processors/message-history-processor.mdx +2 -2
- package/.docs/raw/reference/processors/moderation-processor.mdx +3 -3
- package/.docs/raw/reference/processors/pii-detector.mdx +3 -3
- package/.docs/raw/reference/processors/processor-interface.mdx +13 -13
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +2 -2
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +2 -2
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +2 -2
- package/.docs/raw/reference/processors/tool-call-filter.mdx +3 -3
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
- package/.docs/raw/reference/processors/working-memory-processor.mdx +3 -3
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/extract-params.mdx +2 -2
- package/.docs/raw/reference/rag/metadata-filters.mdx +7 -7
- package/.docs/raw/reference/server/create-route.mdx +13 -13
- package/.docs/raw/reference/server/express-adapter.mdx +6 -7
- package/.docs/raw/reference/server/hono-adapter.mdx +6 -7
- package/.docs/raw/reference/server/mastra-server.mdx +20 -20
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +3 -3
- package/.docs/raw/reference/storage/cloudflare.mdx +2 -2
- package/.docs/raw/reference/storage/convex.mdx +6 -6
- package/.docs/raw/reference/storage/dynamodb.mdx +4 -4
- package/.docs/raw/reference/storage/lance.mdx +3 -3
- package/.docs/raw/reference/storage/libsql.mdx +69 -54
- package/.docs/raw/reference/storage/mongodb.mdx +80 -7
- package/.docs/raw/reference/storage/mssql.mdx +4 -4
- package/.docs/raw/{memory → reference}/storage/overview.mdx +12 -110
- package/.docs/raw/reference/storage/postgresql.mdx +78 -7
- package/.docs/raw/reference/storage/upstash.mdx +74 -2
- package/.docs/raw/reference/streaming/agents/stream.mdx +5 -5
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +4 -4
- package/.docs/raw/reference/templates/overview.mdx +1 -2
- package/.docs/raw/reference/tools/create-tool.mdx +1 -4
- package/.docs/raw/reference/tools/vector-query-tool.mdx +1 -1
- package/.docs/raw/reference/vectors/astra.mdx +3 -3
- package/.docs/raw/reference/vectors/chroma.mdx +3 -3
- package/.docs/raw/reference/vectors/convex.mdx +12 -12
- package/.docs/raw/reference/vectors/couchbase.mdx +5 -5
- package/.docs/raw/reference/vectors/duckdb.mdx +10 -10
- package/.docs/raw/reference/vectors/elasticsearch.mdx +4 -4
- package/.docs/raw/reference/vectors/lance.mdx +4 -4
- package/.docs/raw/reference/vectors/libsql.mdx +61 -11
- package/.docs/raw/reference/vectors/mongodb.mdx +58 -5
- package/.docs/raw/reference/vectors/pg.mdx +53 -6
- package/.docs/raw/reference/vectors/pinecone.mdx +3 -3
- package/.docs/raw/reference/vectors/qdrant.mdx +3 -3
- package/.docs/raw/reference/vectors/s3vectors.mdx +6 -6
- package/.docs/raw/reference/vectors/turbopuffer.mdx +4 -4
- package/.docs/raw/reference/vectors/upstash.mdx +55 -6
- package/.docs/raw/reference/vectors/vectorize.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +1 -3
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/start.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +5 -5
- package/.docs/raw/reference/workflows/run.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +6 -6
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +7 -7
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow.mdx +3 -3
- package/.docs/raw/server/auth/auth0.mdx +20 -14
- package/.docs/raw/server/auth/clerk.mdx +16 -9
- package/.docs/raw/server/auth/firebase.mdx +21 -15
- package/.docs/raw/server/auth/jwt.mdx +14 -7
- package/.docs/raw/server/auth/supabase.mdx +16 -9
- package/.docs/raw/server/auth/workos.mdx +19 -13
- package/.docs/raw/server/custom-adapters.mdx +10 -10
- package/.docs/raw/server/custom-api-routes.mdx +2 -4
- package/.docs/raw/server/mastra-client.mdx +24 -13
- package/.docs/raw/server/mastra-server.mdx +3 -3
- package/.docs/raw/server/middleware.mdx +7 -7
- package/.docs/raw/server/request-context.mdx +31 -30
- package/.docs/raw/server/server-adapters.mdx +6 -6
- package/.docs/raw/streaming/events.mdx +14 -7
- package/.docs/raw/streaming/overview.mdx +21 -10
- package/.docs/raw/streaming/tool-streaming.mdx +6 -6
- package/.docs/raw/streaming/workflow-streaming.mdx +6 -8
- package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +31 -12
- package/.docs/raw/tools-mcp/overview.mdx +9 -10
- package/.docs/raw/voice/overview.mdx +1 -1
- package/.docs/raw/workflows/agents-and-tools.mdx +28 -19
- package/.docs/raw/workflows/control-flow.mdx +27 -40
- package/.docs/raw/workflows/error-handling.mdx +15 -22
- package/.docs/raw/workflows/human-in-the-loop.mdx +6 -7
- package/.docs/raw/workflows/inngest-workflow.mdx +8 -9
- package/.docs/raw/workflows/input-data-mapping.mdx +7 -7
- package/.docs/raw/workflows/overview.mdx +33 -22
- package/.docs/raw/workflows/snapshots.mdx +14 -44
- package/.docs/raw/workflows/suspend-and-resume.mdx +7 -7
- package/.docs/raw/workflows/time-travel.mdx +16 -16
- package/.docs/raw/workflows/workflow-state.mdx +5 -8
- package/CHANGELOG.md +9 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/stdio.js +53 -0
- package/package.json +4 -4
- package/.docs/raw/memory/conversation-history.mdx +0 -24
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
- package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
- package/.docs/raw/memory/threads-and-resources.mdx +0 -95
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/react-hooks
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`66741d1`](https://github.com/mastra-ai/mastra/commit/66741d1a99c4f42cf23a16109939e8348ac6852e), [`a7ce182`](https://github.com/mastra-ai/mastra/commit/a7ce1822a8785ce45d62dd5c911af465e144f7d7)]:
|
|
8
|
+
- @mastra/client-js@1.0.0-beta.14
|
|
9
|
+
|
|
3
10
|
## 0.1.0-beta.13
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -491,5 +498,5 @@
|
|
|
491
498
|
|
|
492
499
|
### Patch Changes
|
|
493
500
|
|
|
494
|
-
|
|
495
|
-
|
|
501
|
+
|
|
502
|
+
... 3 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,98 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add execution metadata to A2A message/send responses. The A2A protocol now returns detailed execution information including tool calls, tool results, token usage, and finish reason in the task metadata. This allows clients to inspect which tools were invoked during agent execution and access execution statistics without additional queries. ([#11241](https://github.com/mastra-ai/mastra/pull/11241))
|
|
8
|
+
|
|
9
|
+
- feat: Add field filtering and nested workflow control to workflow execution result endpoint ([#11246](https://github.com/mastra-ai/mastra/pull/11246))
|
|
10
|
+
|
|
11
|
+
Adds two optional query parameters to `/api/workflows/:workflowId/runs/:runId/execution-result` endpoint:
|
|
12
|
+
- `fields`: Request only specific fields (e.g., `status`, `result`, `error`)
|
|
13
|
+
- `withNestedWorkflows`: Control whether to fetch nested workflow data
|
|
14
|
+
|
|
15
|
+
This significantly reduces response payload size and improves response times for large workflows.
|
|
16
|
+
|
|
17
|
+
## Server Endpoint Usage
|
|
18
|
+
|
|
19
|
+
```http
|
|
20
|
+
# Get only status (minimal payload - fastest)
|
|
21
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status
|
|
22
|
+
|
|
23
|
+
# Get status and result
|
|
24
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,result
|
|
25
|
+
|
|
26
|
+
# Get all fields but without nested workflow data (faster)
|
|
27
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?withNestedWorkflows=false
|
|
28
|
+
|
|
29
|
+
# Get only specific fields without nested workflow data
|
|
30
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,steps&withNestedWorkflows=false
|
|
31
|
+
|
|
32
|
+
# Get full data (default behavior)
|
|
33
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Client SDK Usage
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { MastraClient } from '@mastra/client-js';
|
|
40
|
+
|
|
41
|
+
const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
|
|
42
|
+
const workflow = client.getWorkflow('myWorkflow');
|
|
43
|
+
|
|
44
|
+
// Get only status (minimal payload - fastest)
|
|
45
|
+
const statusOnly = await workflow.runExecutionResult(runId, {
|
|
46
|
+
fields: ['status'],
|
|
47
|
+
});
|
|
48
|
+
console.log(statusOnly.status); // 'success' | 'failed' | 'running' | etc.
|
|
49
|
+
|
|
50
|
+
// Get status and result
|
|
51
|
+
const statusAndResult = await workflow.runExecutionResult(runId, {
|
|
52
|
+
fields: ['status', 'result'],
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Get all fields but without nested workflow data (faster)
|
|
56
|
+
const resultWithoutNested = await workflow.runExecutionResult(runId, {
|
|
57
|
+
withNestedWorkflows: false,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Get specific fields without nested workflow data
|
|
61
|
+
const optimized = await workflow.runExecutionResult(runId, {
|
|
62
|
+
fields: ['status', 'steps'],
|
|
63
|
+
withNestedWorkflows: false,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Get full execution result (default behavior)
|
|
67
|
+
const fullResult = await workflow.runExecutionResult(runId);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Core API Changes
|
|
71
|
+
|
|
72
|
+
The `Workflow.getWorkflowRunExecutionResult` method now accepts an options object:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
await workflow.getWorkflowRunExecutionResult(runId, {
|
|
76
|
+
withNestedWorkflows: false, // default: true, set to false to skip nested workflow data
|
|
77
|
+
fields: ['status', 'result'], // optional field filtering
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Inngest Compatibility
|
|
82
|
+
|
|
83
|
+
The `@mastra/inngest` package has been updated to use the new options object API. This is a non-breaking internal change - no action required from inngest workflow users.
|
|
84
|
+
|
|
85
|
+
## Performance Impact
|
|
86
|
+
|
|
87
|
+
For workflows with large step outputs:
|
|
88
|
+
- Requesting only `status`: ~99% reduction in payload size
|
|
89
|
+
- Requesting `status,result,error`: ~95% reduction in payload size
|
|
90
|
+
- Using `withNestedWorkflows=false`: Avoids expensive nested workflow data fetching
|
|
91
|
+
- Combining both: Maximum performance optimization
|
|
92
|
+
|
|
93
|
+
- Updated dependencies [[`4f94ed8`](https://github.com/mastra-ai/mastra/commit/4f94ed8177abfde3ec536e3574883e075423350c), [`ac3cc23`](https://github.com/mastra-ai/mastra/commit/ac3cc2397d1966bc0fc2736a223abc449d3c7719), [`a86f4df`](https://github.com/mastra-ai/mastra/commit/a86f4df0407311e0d2ea49b9a541f0938810d6a9), [`029540c`](https://github.com/mastra-ai/mastra/commit/029540ca1e582fc2dd8d288ecd4a9b0f31a954ef), [`66741d1`](https://github.com/mastra-ai/mastra/commit/66741d1a99c4f42cf23a16109939e8348ac6852e), [`01b20fe`](https://github.com/mastra-ai/mastra/commit/01b20fefb7c67c2b7d79417598ef4e60256d1225), [`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119), [`a7ce182`](https://github.com/mastra-ai/mastra/commit/a7ce1822a8785ce45d62dd5c911af465e144f7d7)]:
|
|
94
|
+
- @mastra/core@1.0.0-beta.14
|
|
95
|
+
|
|
3
96
|
## 1.0.0-beta.13
|
|
4
97
|
|
|
5
98
|
### Patch Changes
|
|
@@ -405,98 +498,5 @@
|
|
|
405
498
|
|
|
406
499
|
// After
|
|
407
500
|
const response = await client.listThreadMessages(threadId, { agentId });
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
The response format remains the same.
|
|
411
|
-
|
|
412
|
-
## Type Changes
|
|
413
|
-
|
|
414
|
-
### BREAKING: Removed `StorageGetMessagesArg` type
|
|
415
|
-
|
|
416
|
-
Use `StorageListMessagesInput` instead:
|
|
417
|
-
|
|
418
|
-
```typescript
|
|
419
|
-
// Before
|
|
420
|
-
import type { StorageGetMessagesArg } from '@mastra/core';
|
|
421
|
-
|
|
422
|
-
// After
|
|
423
|
-
import type { StorageListMessagesInput } from '@mastra/core';
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
- Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
|
|
427
|
-
|
|
428
|
-
- Replace `getThreadsByResourceIdPaginated` with `listThreadsByResourceId` across memory handlers. Update client SDK to use `listThreads()` with `offset`/`limit` parameters instead of deprecated `getMemoryThreads()`. Consolidate `/api/memory/threads` routes to single paginated endpoint. ([#9508](https://github.com/mastra-ai/mastra/pull/9508))
|
|
429
|
-
|
|
430
|
-
- This simplifies the Memory API by removing the confusing rememberMessages method and renaming query to recall for better clarity. ([#9701](https://github.com/mastra-ai/mastra/pull/9701))
|
|
431
|
-
|
|
432
|
-
The rememberMessages method name implied it might persist data when it was actually just retrieving messages, same as query. Having two methods that did essentially the same thing was unnecessary.
|
|
433
|
-
|
|
434
|
-
Before:
|
|
435
|
-
|
|
436
|
-
```typescript
|
|
437
|
-
// Two methods that did the same thing
|
|
438
|
-
memory.rememberMessages({ threadId, resourceId, config, vectorMessageSearch });
|
|
439
|
-
memory.query({ threadId, resourceId, perPage, vectorSearchString });
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
After:
|
|
443
|
-
|
|
444
|
-
```typescript
|
|
445
|
-
// Single unified method with clear purpose
|
|
446
|
-
memory.recall({ threadId, resourceId, perPage, vectorMessageSearch, threadConfig });
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
All usages have been updated across the codebase including tests. The agent now calls recall directly with the appropriate parameters.
|
|
450
|
-
|
|
451
|
-
- Rename RuntimeContext to RequestContext ([#9511](https://github.com/mastra-ai/mastra/pull/9511))
|
|
452
|
-
|
|
453
|
-
- Rename `defaultVNextStreamOptions` to `defaultOptions`. Add "Legacy" suffix to v1 option properties and methods (`defaultGenerateOptions` → `defaultGenerateOptionsLegacy`, `defaultStreamOptions` → `defaultStreamOptionsLegacy`). ([#9535](https://github.com/mastra-ai/mastra/pull/9535))
|
|
454
|
-
|
|
455
|
-
- Remove `getThreadsByResourceId` and `getThreadsByResourceIdPaginated` methods from storage interfaces in favor of `listThreadsByResourceId`. The new method uses `offset`/`limit` pagination and a nested `orderBy` object structure (`{ field, direction }`). ([#9536](https://github.com/mastra-ai/mastra/pull/9536))
|
|
456
|
-
|
|
457
|
-
- Renamed a bunch of observability/tracing-related things to drop the AI prefix. ([#9744](https://github.com/mastra-ai/mastra/pull/9744))
|
|
458
|
-
|
|
459
|
-
- **Breaking Change**: Remove legacy v1 watch events and consolidate on v2 implementation. ([#9252](https://github.com/mastra-ai/mastra/pull/9252))
|
|
460
|
-
|
|
461
|
-
This change simplifies the workflow watching API by removing the legacy v1 event system and promoting v2 as the standard (renamed to just `watch`).
|
|
462
|
-
|
|
463
|
-
### What's Changed
|
|
464
|
-
- Removed legacy v1 watch event handlers and types
|
|
465
|
-
- Renamed `watch-v2` to `watch` throughout the codebase
|
|
466
|
-
- Removed `.watch()` method from client-js SDK (`Workflow` and `AgentBuilder` classes)
|
|
467
|
-
- Removed `/watch` HTTP endpoints from server and deployer
|
|
468
|
-
- Removed `WorkflowWatchResult` and v1 `WatchEvent` types
|
|
469
|
-
|
|
470
|
-
- **BREAKING CHANGE**: Pagination APIs now use `page`/`perPage` instead of `offset`/`limit` ([#9592](https://github.com/mastra-ai/mastra/pull/9592))
|
|
471
|
-
|
|
472
|
-
All storage and memory pagination APIs have been updated to use `page` (0-indexed) and `perPage` instead of `offset` and `limit`, aligning with standard REST API patterns.
|
|
473
|
-
|
|
474
|
-
**Affected APIs:**
|
|
475
|
-
- `Memory.listThreadsByResourceId()`
|
|
476
|
-
- `Memory.listMessages()`
|
|
477
|
-
- `Storage.listWorkflowRuns()`
|
|
478
|
-
|
|
479
|
-
**Migration:**
|
|
480
|
-
|
|
481
|
-
```typescript
|
|
482
|
-
// Before
|
|
483
|
-
await memory.listThreadsByResourceId({
|
|
484
|
-
resourceId: 'user-123',
|
|
485
|
-
offset: 20,
|
|
486
|
-
limit: 10,
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
// After
|
|
490
|
-
await memory.listThreadsByResourceId({
|
|
491
|
-
resourceId: 'user-123',
|
|
492
|
-
page: 2, // page = Math.floor(offset / limit)
|
|
493
|
-
perPage: 10,
|
|
494
|
-
});
|
|
495
|
-
|
|
496
|
-
// Before
|
|
497
|
-
await memory.listMessages({
|
|
498
|
-
threadId: 'thread-456',
|
|
499
|
-
offset: 20,
|
|
500
|
-
limit: 10,
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 4410 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.11
|
|
4
|
+
|
|
3
5
|
## 1.0.0-beta.10
|
|
4
6
|
|
|
5
7
|
### Patch Changes
|
|
@@ -496,7 +498,5 @@
|
|
|
496
498
|
|
|
497
499
|
### Patch Changes
|
|
498
500
|
|
|
499
|
-
- fix minor playground stuff for observability ([#7765](https://github.com/mastra-ai/mastra/pull/7765))
|
|
500
|
-
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 1690 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# mastra
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Set `externals: true` as the default for `mastra build` and cloud-deployer to reduce bundle issues with native dependencies. ([`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119))
|
|
8
|
+
|
|
9
|
+
**Note:** If you previously relied on the default bundling behavior (all dependencies bundled), you can explicitly set `externals: false` in your bundler configuration.
|
|
10
|
+
|
|
11
|
+
- Two smaller quality of life improvements: ([#11232](https://github.com/mastra-ai/mastra/pull/11232))
|
|
12
|
+
- The default `create-mastra` project no longer defines a LibSQLStore storage for the weather agent memory. It uses the root level `storage` option now (which is memory). This way no `mastra.db` files are created outside of the project
|
|
13
|
+
- When running `mastra init` inside a project that already has git initialized, the prompt to initialize git is skipped
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`4f94ed8`](https://github.com/mastra-ai/mastra/commit/4f94ed8177abfde3ec536e3574883e075423350c), [`ac3cc23`](https://github.com/mastra-ai/mastra/commit/ac3cc2397d1966bc0fc2736a223abc449d3c7719), [`a86f4df`](https://github.com/mastra-ai/mastra/commit/a86f4df0407311e0d2ea49b9a541f0938810d6a9), [`029540c`](https://github.com/mastra-ai/mastra/commit/029540ca1e582fc2dd8d288ecd4a9b0f31a954ef), [`66741d1`](https://github.com/mastra-ai/mastra/commit/66741d1a99c4f42cf23a16109939e8348ac6852e), [`01b20fe`](https://github.com/mastra-ai/mastra/commit/01b20fefb7c67c2b7d79417598ef4e60256d1225), [`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119), [`a7ce182`](https://github.com/mastra-ai/mastra/commit/a7ce1822a8785ce45d62dd5c911af465e144f7d7)]:
|
|
16
|
+
- @mastra/core@1.0.0-beta.14
|
|
17
|
+
- @mastra/deployer@1.0.0-beta.14
|
|
18
|
+
|
|
3
19
|
## 1.0.0-beta.10
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -482,21 +498,5 @@
|
|
|
482
498
|
|
|
483
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)]:
|
|
484
500
|
- @mastra/core@0.21.0-alpha.1
|
|
485
|
-
- @mastra/deployer@0.21.0-alpha.1
|
|
486
|
-
|
|
487
|
-
## 0.15.2-alpha.0
|
|
488
|
-
|
|
489
|
-
### Patch Changes
|
|
490
|
-
|
|
491
|
-
- Use model-router in create-mastra starter template ([#8631](https://github.com/mastra-ai/mastra/pull/8631))
|
|
492
|
-
|
|
493
|
-
- Fix typo in playground causing semantic recall to always be false when enabled. ([#8640](https://github.com/mastra-ai/mastra/pull/8640))
|
|
494
|
-
|
|
495
|
-
- Update peer dependencies to match core package version bump (0.21.0) ([#8619](https://github.com/mastra-ai/mastra/pull/8619))
|
|
496
|
-
|
|
497
|
-
- Update peer dependencies to match core package version bump (0.21.0) ([#8557](https://github.com/mastra-ai/mastra/pull/8557))
|
|
498
|
-
|
|
499
|
-
- Update peer dependencies to match core package version bump (0.21.0) ([#8626](https://github.com/mastra-ai/mastra/pull/8626))
|
|
500
|
-
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 6420 more lines hidden. See full changelog in package directory.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
### package.json
|
|
2
|
+
```json
|
|
3
|
+
{
|
|
4
|
+
"name": "examples-agent",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"zod": "^3",
|
|
7
|
+
"typescript": "^5.8.3",
|
|
8
|
+
"@ai-sdk/openai": "3.0.0-beta.96",
|
|
9
|
+
"@ai-sdk/provider": "3.0.0-beta.26",
|
|
10
|
+
"ai": "^6.0.0-beta.149",
|
|
11
|
+
"@mastra/client-js": "beta",
|
|
12
|
+
"@mastra/core": "beta",
|
|
13
|
+
"@mastra/evals": "beta",
|
|
14
|
+
"@mastra/libsql": "beta",
|
|
15
|
+
"@mastra/loggers": "beta",
|
|
16
|
+
"@mastra/mcp": "beta",
|
|
17
|
+
"@mastra/memory": "beta",
|
|
18
|
+
"@mastra/observability": "beta",
|
|
19
|
+
"@mastra/voice-openai": "beta"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"mastra": "beta",
|
|
23
|
+
"msw": "^2.12.2"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### js-client-structured-output-example.ts
|
|
29
|
+
```typescript
|
|
30
|
+
import z from 'zod';
|
|
31
|
+
import { MastraClient } from '@mastra/client-js';
|
|
32
|
+
|
|
33
|
+
const client = new MastraClient({
|
|
34
|
+
baseUrl: 'http://localhost:4111',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const agent = client.getAgent('weather-agent');
|
|
38
|
+
|
|
39
|
+
const result = await agent.generate('weather in new york', {
|
|
40
|
+
structuredOutput: {
|
|
41
|
+
schema: z.object({
|
|
42
|
+
weather: z.string(),
|
|
43
|
+
temperature: z.number(),
|
|
44
|
+
humidity: z.number(),
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
console.log(result.object);
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### mastra/agents/index.ts
|
|
54
|
+
```typescript
|
|
55
|
+
import { Memory } from '@mastra/memory';
|
|
56
|
+
import { Agent } from '@mastra/core/agent';
|
|
57
|
+
import { openai } from '@ai-sdk/openai';
|
|
58
|
+
import { weatherInfo } from '../tools';
|
|
59
|
+
|
|
60
|
+
const memory = new Memory();
|
|
61
|
+
|
|
62
|
+
export const weatherAgent = new Agent({
|
|
63
|
+
id: 'weather-agent',
|
|
64
|
+
name: 'Weather Agent v6',
|
|
65
|
+
instructions: `Your goal is to provide weather information for cities when requested`,
|
|
66
|
+
description: `An agent that can help you get weather information for a given city`,
|
|
67
|
+
model: openai('gpt-4o-mini'),
|
|
68
|
+
tools: { weatherInfo },
|
|
69
|
+
memory,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### mastra/index.ts
|
|
75
|
+
```typescript
|
|
76
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
77
|
+
import { PinoLogger } from '@mastra/loggers';
|
|
78
|
+
import { LibSQLStore } from '@mastra/libsql';
|
|
79
|
+
import { Observability } from '@mastra/observability';
|
|
80
|
+
|
|
81
|
+
import { weatherAgent } from './agents';
|
|
82
|
+
|
|
83
|
+
const storage = new LibSQLStore({
|
|
84
|
+
id: 'mastra-storage',
|
|
85
|
+
url: 'file:./mastra.db',
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export const mastra = new Mastra({
|
|
89
|
+
storage,
|
|
90
|
+
agents: {
|
|
91
|
+
weatherAgent,
|
|
92
|
+
},
|
|
93
|
+
bundler: {
|
|
94
|
+
sourcemap: true,
|
|
95
|
+
},
|
|
96
|
+
server: {
|
|
97
|
+
build: {
|
|
98
|
+
swaggerUI: true,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
logger: new PinoLogger({ name: 'Chef', level: 'debug' }),
|
|
102
|
+
observability: new Observability({
|
|
103
|
+
default: { enabled: true },
|
|
104
|
+
}),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### mastra/tools/index.ts
|
|
110
|
+
```typescript
|
|
111
|
+
import { createTool } from '@mastra/core/tools';
|
|
112
|
+
import { z } from 'zod';
|
|
113
|
+
|
|
114
|
+
export const weatherInfo = createTool({
|
|
115
|
+
id: 'weather-info',
|
|
116
|
+
description: 'Fetches the current weather information for a given city',
|
|
117
|
+
inputSchema: z.object({
|
|
118
|
+
city: z.string(),
|
|
119
|
+
}),
|
|
120
|
+
execute: async ({ city }) => {
|
|
121
|
+
return {
|
|
122
|
+
city,
|
|
123
|
+
weather: 'sunny',
|
|
124
|
+
temperature_celsius: 19,
|
|
125
|
+
temperature_fahrenheit: 66,
|
|
126
|
+
humidity: 50,
|
|
127
|
+
wind: '10 mph',
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### structured-output-example.ts
|
|
135
|
+
```typescript
|
|
136
|
+
import z from 'zod';
|
|
137
|
+
import { weatherAgent } from './mastra/agents';
|
|
138
|
+
|
|
139
|
+
const result = await weatherAgent.generate('weather in new york', {
|
|
140
|
+
structuredOutput: {
|
|
141
|
+
schema: z.object({
|
|
142
|
+
weather: z.string(),
|
|
143
|
+
temperature: z.number(),
|
|
144
|
+
humidity: z.number(),
|
|
145
|
+
}),
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
console.log(result.object);
|
|
150
|
+
|
|
151
|
+
```
|
|
@@ -168,7 +168,7 @@ The following files are created:
|
|
|
168
168
|
- **hybrid-question.mp3** – Hybrid agent's spoken question.
|
|
169
169
|
- **unified-response.mp3** – Unified agent's spoken response.
|
|
170
170
|
|
|
171
|
-
```typescript title="src/test-voice-agents.ts"
|
|
171
|
+
```typescript title="src/test-voice-agents.ts"
|
|
172
172
|
import "dotenv/config";
|
|
173
173
|
|
|
174
174
|
import path from "path";
|
|
@@ -232,7 +232,6 @@ export const unifiedVoiceAgent = new Agent({
|
|
|
232
232
|
});
|
|
233
233
|
|
|
234
234
|
export const mastra = new Mastra({
|
|
235
|
-
// ...
|
|
236
235
|
agents: { hybridVoiceAgent, unifiedVoiceAgent },
|
|
237
236
|
});
|
|
238
237
|
|
|
@@ -297,7 +296,7 @@ export const agent = new Agent({
|
|
|
297
296
|
id: "aisdk-voice-agent",
|
|
298
297
|
name: "AI SDK Voice Agent",
|
|
299
298
|
instructions: `You are a helpful assistant with voice capabilities.`,
|
|
300
|
-
model: openai
|
|
299
|
+
model: "openai/gpt-5.1",
|
|
301
300
|
|
|
302
301
|
// Pass AI SDK models directly to CompositeVoice
|
|
303
302
|
voice: new CompositeVoice({
|
|
@@ -20,7 +20,6 @@ import { Mastra } from "@mastra/core/mastra";
|
|
|
20
20
|
import { LibSQLStore } from "@mastra/libsql";
|
|
21
21
|
|
|
22
22
|
export const mastra = new Mastra({
|
|
23
|
-
// ...
|
|
24
23
|
storage: new LibSQLStore({
|
|
25
24
|
id: "mastra-storage",
|
|
26
25
|
url: ":memory:"
|
|
@@ -33,7 +32,7 @@ export const mastra = new Mastra({
|
|
|
33
32
|
|
|
34
33
|
When calling an agent using `.stream()` set `requireToolApproval` to `true` which will prevent the agent from calling any of the tools defined in its configuration.
|
|
35
34
|
|
|
36
|
-
```typescript
|
|
35
|
+
```typescript
|
|
37
36
|
const stream = await agent.stream("What's the weather in London?", {
|
|
38
37
|
requireToolApproval: true
|
|
39
38
|
});
|
|
@@ -43,7 +42,7 @@ const stream = await agent.stream("What's the weather in London?", {
|
|
|
43
42
|
|
|
44
43
|
To approve a tool call, access `approveToolCall` from the `agent`, passing in the `runId` of the stream. This will let the agent know its now OK to call its tools.
|
|
45
44
|
|
|
46
|
-
```typescript
|
|
45
|
+
```typescript
|
|
47
46
|
const handleApproval = async () => {
|
|
48
47
|
const approvedStream = await agent.approveToolCall({ runId: stream.runId });
|
|
49
48
|
|
|
@@ -58,7 +57,7 @@ const handleApproval = async () => {
|
|
|
58
57
|
|
|
59
58
|
To decline a tool call, access the `declineToolCall` from the `agent`. You will see the streamed response from the agent, but it won't call its tools.
|
|
60
59
|
|
|
61
|
-
```typescript
|
|
60
|
+
```typescript
|
|
62
61
|
const handleDecline = async () => {
|
|
63
62
|
const declinedStream = await agent.declineToolCall({ runId: stream.runId });
|
|
64
63
|
|
|
@@ -218,7 +217,7 @@ When `autoResumeSuspendedTools` is enabled:
|
|
|
218
217
|
1. A tool suspends execution by calling `suspend()` with a payload (e.g., requesting more information)
|
|
219
218
|
2. The suspension is persisted to memory along with the conversation
|
|
220
219
|
3. When the user sends their next message on the same thread, the agent:
|
|
221
|
-
- Detects the suspended tool from
|
|
220
|
+
- Detects the suspended tool from message history
|
|
222
221
|
- Extracts `resumeData` from the user's message based on the tool's `resumeSchema`
|
|
223
222
|
- Automatically resumes the tool with the extracted data
|
|
224
223
|
|
|
@@ -312,7 +311,7 @@ For automatic tool resumption to work:
|
|
|
312
311
|
| Manual (`resumeStream()`) | Programmatic control, webhooks, button clicks, external triggers |
|
|
313
312
|
| Automatic (`autoResumeSuspendedTools`) | Conversational flows where users provide resume data in natural language |
|
|
314
313
|
|
|
315
|
-
Both approaches work with the same tool definitions. Automatic resumption triggers only when suspended tools exist in the
|
|
314
|
+
Both approaches work with the same tool definitions. Automatic resumption triggers only when suspended tools exist in the message history and the user sends a new message on the same thread.
|
|
316
315
|
|
|
317
316
|
## Related
|
|
318
317
|
|