@mastra/mcp-docs-server 0.0.13 → 0.0.14-alpha.1

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.
Files changed (83) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fastra.md +34 -34
  2. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +35 -35
  3. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +34 -34
  4. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +39 -39
  5. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +33 -0
  6. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +33 -0
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +34 -34
  8. package/.docs/organized/changelogs/%40mastra%2Fcore.md +32 -32
  9. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +34 -0
  10. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +38 -38
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +38 -38
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +39 -39
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +43 -43
  14. package/.docs/organized/changelogs/%40mastra%2Fevals.md +34 -34
  15. package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +7 -0
  16. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +37 -37
  17. package/.docs/organized/changelogs/%40mastra%2Fgithub.md +34 -34
  18. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +33 -0
  19. package/.docs/organized/changelogs/%40mastra%2Floggers.md +34 -34
  20. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +39 -39
  21. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +34 -34
  22. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +49 -49
  23. package/.docs/organized/changelogs/%40mastra%2Fmem0.md +34 -34
  24. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +34 -34
  25. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +33 -0
  26. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +35 -1
  27. package/.docs/organized/changelogs/%40mastra%2Fpg.md +34 -34
  28. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +35 -35
  29. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +45 -45
  30. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +35 -35
  31. package/.docs/organized/changelogs/%40mastra%2Frag.md +34 -34
  32. package/.docs/organized/changelogs/%40mastra%2Fragie.md +34 -34
  33. package/.docs/organized/changelogs/%40mastra%2Fserver.md +39 -39
  34. package/.docs/organized/changelogs/%40mastra%2Fspeech-azure.md +34 -34
  35. package/.docs/organized/changelogs/%40mastra%2Fspeech-deepgram.md +34 -34
  36. package/.docs/organized/changelogs/%40mastra%2Fspeech-elevenlabs.md +34 -34
  37. package/.docs/organized/changelogs/%40mastra%2Fspeech-google.md +34 -34
  38. package/.docs/organized/changelogs/%40mastra%2Fspeech-ibm.md +34 -34
  39. package/.docs/organized/changelogs/%40mastra%2Fspeech-murf.md +34 -34
  40. package/.docs/organized/changelogs/%40mastra%2Fspeech-openai.md +34 -34
  41. package/.docs/organized/changelogs/%40mastra%2Fspeech-playai.md +34 -34
  42. package/.docs/organized/changelogs/%40mastra%2Fspeech-replicate.md +34 -34
  43. package/.docs/organized/changelogs/%40mastra%2Fspeech-speechify.md +34 -34
  44. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +34 -34
  45. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +34 -34
  46. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +35 -35
  47. package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +34 -34
  48. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +34 -34
  49. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +34 -34
  50. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +34 -34
  51. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +34 -34
  52. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +34 -34
  53. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +34 -34
  54. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +34 -34
  55. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +34 -34
  56. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +34 -34
  57. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +34 -34
  58. package/.docs/organized/changelogs/create-mastra.md +12 -12
  59. package/.docs/organized/changelogs/mastra.md +46 -46
  60. package/.docs/organized/code-examples/a2a.md +202 -0
  61. package/.docs/organized/code-examples/agent-network.md +1 -1
  62. package/.docs/organized/code-examples/agent.md +113 -26
  63. package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -2
  64. package/.docs/organized/code-examples/client-side-tools.md +1 -1
  65. package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
  66. package/.docs/organized/code-examples/fireworks-r1.md +2 -2
  67. package/.docs/organized/code-examples/mcp-configuration.md +579 -0
  68. package/.docs/organized/code-examples/mcp-registry-registry.md +1 -1
  69. package/.docs/organized/code-examples/memory-with-context.md +1 -1
  70. package/.docs/organized/code-examples/memory-with-processors.md +609 -0
  71. package/.docs/organized/code-examples/openapi-spec-writer.md +588 -0
  72. package/.docs/organized/code-examples/quick-start.md +1 -1
  73. package/.docs/raw/agents/dynamic-agents.mdx +47 -0
  74. package/.docs/raw/agents/using-tools-and-mcp.mdx +19 -0
  75. package/.docs/raw/memory/working-memory.mdx +78 -1
  76. package/.docs/raw/reference/cli/mcp-docs-server.mdx +82 -0
  77. package/.docs/raw/reference/deployer/cloudflare.mdx +7 -0
  78. package/.docs/raw/reference/deployer/netlify.mdx +5 -0
  79. package/.docs/raw/reference/deployer/vercel.mdx +6 -0
  80. package/dist/{chunk-OKBMABZO.js → chunk-JWLYN5OI.js} +3 -2
  81. package/dist/prepare-docs/prepare.js +1 -1
  82. package/dist/stdio.js +1 -1
  83. package/package.json +3 -3
@@ -1,5 +1,38 @@
1
1
  # @mastra/voice-playai
2
2
 
3
+ ## 0.1.18-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ab80e7e]
8
+ - Updated dependencies [6fa1ad1]
9
+ - Updated dependencies [c28d7a0]
10
+ - Updated dependencies [edf1e88]
11
+ - @mastra/core@0.9.4-alpha.1
12
+
13
+ ## 0.1.18-alpha.0
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [daf942f]
18
+ - Updated dependencies [0b8b868]
19
+ - @mastra/core@0.9.4-alpha.0
20
+
21
+ ## 0.1.17
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [e450778]
26
+ - Updated dependencies [8902157]
27
+ - Updated dependencies [ca0dc88]
28
+ - Updated dependencies [526c570]
29
+ - Updated dependencies [d7a6a33]
30
+ - Updated dependencies [9cd1a46]
31
+ - Updated dependencies [b5d2de0]
32
+ - Updated dependencies [644f8ad]
33
+ - Updated dependencies [70dbf51]
34
+ - @mastra/core@0.9.3
35
+
3
36
  ## 0.1.17-alpha.1
4
37
 
5
38
  ### Patch Changes
@@ -265,38 +298,5 @@
265
298
 
266
299
  ## 0.1.14-alpha.3
267
300
 
268
- ### Patch Changes
269
-
270
- - Updated dependencies [fe3ae4d]
271
- - @mastra/core@0.9.0-alpha.3
272
-
273
- ## 0.1.14-alpha.2
274
-
275
- ### Patch Changes
276
-
277
- - Updated dependencies [9ee4293]
278
- - @mastra/core@0.8.4-alpha.2
279
-
280
- ## 0.1.14-alpha.1
281
-
282
- ### Patch Changes
283
-
284
- - Updated dependencies [8a8a73b]
285
- - Updated dependencies [6f92295]
286
- - @mastra/core@0.8.4-alpha.1
287
-
288
- ## 0.1.14-alpha.0
289
-
290
- ### Patch Changes
291
-
292
- - Updated dependencies [03f3cd0]
293
- - @mastra/core@0.8.4-alpha.0
294
-
295
- ## 0.1.13
296
-
297
- ### Patch Changes
298
-
299
- - 37bb612: Add Elastic-2.0 licensing for packages
300
- - Updated dependencies [d72318f]
301
301
 
302
- ... 702 more lines hidden. See full changelog in package directory.
302
+ ... 735 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,38 @@
1
1
  # @mastra/voice-sarvam
2
2
 
3
+ ## 0.1.13-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ab80e7e]
8
+ - Updated dependencies [6fa1ad1]
9
+ - Updated dependencies [c28d7a0]
10
+ - Updated dependencies [edf1e88]
11
+ - @mastra/core@0.9.4-alpha.1
12
+
13
+ ## 0.1.13-alpha.0
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [daf942f]
18
+ - Updated dependencies [0b8b868]
19
+ - @mastra/core@0.9.4-alpha.0
20
+
21
+ ## 0.1.12
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [e450778]
26
+ - Updated dependencies [8902157]
27
+ - Updated dependencies [ca0dc88]
28
+ - Updated dependencies [526c570]
29
+ - Updated dependencies [d7a6a33]
30
+ - Updated dependencies [9cd1a46]
31
+ - Updated dependencies [b5d2de0]
32
+ - Updated dependencies [644f8ad]
33
+ - Updated dependencies [70dbf51]
34
+ - @mastra/core@0.9.3
35
+
3
36
  ## 0.1.12-alpha.1
4
37
 
5
38
  ### Patch Changes
@@ -265,38 +298,5 @@
265
298
  - Updated dependencies [7e92011]
266
299
  - @mastra/core@0.9.0-alpha.4
267
300
 
268
- ## 0.1.9-alpha.3
269
-
270
- ### Patch Changes
271
-
272
- - Updated dependencies [fe3ae4d]
273
- - @mastra/core@0.9.0-alpha.3
274
-
275
- ## 0.1.9-alpha.2
276
-
277
- ### Patch Changes
278
-
279
- - Updated dependencies [9ee4293]
280
- - @mastra/core@0.8.4-alpha.2
281
-
282
- ## 0.1.9-alpha.1
283
-
284
- ### Patch Changes
285
-
286
- - Updated dependencies [8a8a73b]
287
- - Updated dependencies [6f92295]
288
- - @mastra/core@0.8.4-alpha.1
289
-
290
- ## 0.1.9-alpha.0
291
-
292
- ### Patch Changes
293
-
294
- - Updated dependencies [03f3cd0]
295
- - @mastra/core@0.8.4-alpha.0
296
-
297
- ## 0.1.8
298
-
299
- ### Patch Changes
300
-
301
301
 
302
- ... 352 more lines hidden. See full changelog in package directory.
302
+ ... 385 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,38 @@
1
1
  # @mastra/voice-speechify
2
2
 
3
+ ## 0.1.18-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ab80e7e]
8
+ - Updated dependencies [6fa1ad1]
9
+ - Updated dependencies [c28d7a0]
10
+ - Updated dependencies [edf1e88]
11
+ - @mastra/core@0.9.4-alpha.1
12
+
13
+ ## 0.1.18-alpha.0
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [daf942f]
18
+ - Updated dependencies [0b8b868]
19
+ - @mastra/core@0.9.4-alpha.0
20
+
21
+ ## 0.1.17
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [e450778]
26
+ - Updated dependencies [8902157]
27
+ - Updated dependencies [ca0dc88]
28
+ - Updated dependencies [526c570]
29
+ - Updated dependencies [d7a6a33]
30
+ - Updated dependencies [9cd1a46]
31
+ - Updated dependencies [b5d2de0]
32
+ - Updated dependencies [644f8ad]
33
+ - Updated dependencies [70dbf51]
34
+ - @mastra/core@0.9.3
35
+
3
36
  ## 0.1.17-alpha.1
4
37
 
5
38
  ### Patch Changes
@@ -265,38 +298,5 @@
265
298
 
266
299
  ## 0.1.14-alpha.3
267
300
 
268
- ### Patch Changes
269
-
270
- - Updated dependencies [fe3ae4d]
271
- - @mastra/core@0.9.0-alpha.3
272
-
273
- ## 0.1.14-alpha.2
274
-
275
- ### Patch Changes
276
-
277
- - Updated dependencies [9ee4293]
278
- - @mastra/core@0.8.4-alpha.2
279
-
280
- ## 0.1.14-alpha.1
281
-
282
- ### Patch Changes
283
-
284
- - Updated dependencies [8a8a73b]
285
- - Updated dependencies [6f92295]
286
- - @mastra/core@0.8.4-alpha.1
287
-
288
- ## 0.1.14-alpha.0
289
-
290
- ### Patch Changes
291
-
292
- - Updated dependencies [03f3cd0]
293
- - @mastra/core@0.8.4-alpha.0
294
-
295
- ## 0.1.13
296
-
297
- ### Patch Changes
298
-
299
- - 37bb612: Add Elastic-2.0 licensing for packages
300
- - Updated dependencies [d72318f]
301
301
 
302
- ... 689 more lines hidden. See full changelog in package directory.
302
+ ... 722 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,16 @@
1
1
  # create-mastra
2
2
 
3
+ ## 0.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0db0992: - add new --mcp option to cli
8
+ - add support for mcp in vscode
9
+ - include examples with --default flag
10
+ - b5d2de0: In vNext workflow serializedStepGraph, return only serializedStepFlow for steps created from a workflow
11
+ allow viewing inner nested workflows in a multi-layered nested vnext workflow on the playground
12
+ - 62c9e7d: Fix disappearing tool calls in streaming
13
+
3
14
  ## 0.3.2-alpha.1
4
15
 
5
16
  ### Patch Changes
@@ -288,15 +299,4 @@
288
299
 
289
300
  ## 0.2.4-alpha.1
290
301
 
291
- ### Patch Changes
292
-
293
- - 789bef3: Make runId optional for workflow startAsync api
294
- - 8393832: Handle nested workflow view on workflow graph
295
-
296
- ## 0.2.4-alpha.0
297
-
298
- ### Patch Changes
299
-
300
- - 8076ecf: Unify workflow watch/start response
301
-
302
- ... 615 more lines hidden. See full changelog in package directory.
302
+ ... 626 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,50 @@
1
1
  # mastra
2
2
 
3
+ ## 0.6.3-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ab80e7e]
8
+ - Updated dependencies [6fa1ad1]
9
+ - Updated dependencies [c28d7a0]
10
+ - Updated dependencies [edf1e88]
11
+ - @mastra/core@0.9.4-alpha.1
12
+ - @mastra/deployer@0.3.4-alpha.1
13
+
14
+ ## 0.6.3-alpha.0
15
+
16
+ ### Patch Changes
17
+
18
+ - 15dc8e4: Use detected package manager in post-create instructions
19
+ - cb1f698: Set runtimeContext from playground for agents, tools, workflows
20
+ - Updated dependencies [cb1f698]
21
+ - Updated dependencies [daf942f]
22
+ - Updated dependencies [0b8b868]
23
+ - @mastra/deployer@0.3.4-alpha.0
24
+ - @mastra/core@0.9.4-alpha.0
25
+
26
+ ## 0.6.2
27
+
28
+ ### Patch Changes
29
+
30
+ - 0db0992: - add new --mcp option to cli
31
+ - add support for mcp in vscode
32
+ - include examples with --default flag
33
+ - b5d2de0: In vNext workflow serializedStepGraph, return only serializedStepFlow for steps created from a workflow
34
+ allow viewing inner nested workflows in a multi-layered nested vnext workflow on the playground
35
+ - 62c9e7d: Fix disappearing tool calls in streaming
36
+ - Updated dependencies [e450778]
37
+ - Updated dependencies [8902157]
38
+ - Updated dependencies [ca0dc88]
39
+ - Updated dependencies [526c570]
40
+ - Updated dependencies [d7a6a33]
41
+ - Updated dependencies [9cd1a46]
42
+ - Updated dependencies [b5d2de0]
43
+ - Updated dependencies [644f8ad]
44
+ - Updated dependencies [70dbf51]
45
+ - @mastra/core@0.9.3
46
+ - @mastra/deployer@0.3.3
47
+
3
48
  ## 0.6.2-alpha.1
4
49
 
5
50
  ### Patch Changes
@@ -254,49 +299,4 @@
254
299
 
255
300
  ### Patch Changes
256
301
 
257
- - 3b74a74: add badge for failure / successful traces
258
- - 5a66ced: add click on trace row
259
- - Updated dependencies [e4943b8]
260
- - Updated dependencies [479f490]
261
- - @mastra/core@0.9.1-alpha.4
262
- - @mastra/deployer@0.3.1-alpha.4
263
-
264
- ## 0.6.0-alpha.4
265
-
266
- ### Patch Changes
267
-
268
- - 5ebe2aa: Adds ability to add a global configuration for cursor for the Mastra docs MCP server during creation of a Mastra project. Allowing all cursor projects to have access to the MCP server.
269
-
270
- ## 0.6.0-alpha.3
271
-
272
- ### Patch Changes
273
-
274
- - 34a76ca: Call workflow cleanup function when closing watch stream controller
275
- - 0c3c4f4: Playground routing model settings for AgentNetworks
276
- - 1700eca: fixing overflow on agent traces
277
- - Updated dependencies [6262bd5]
278
- - @mastra/deployer@0.3.1-alpha.3
279
- - @mastra/core@0.9.1-alpha.3
280
-
281
- ## 0.6.0-alpha.2
282
-
283
- ### Patch Changes
284
-
285
- - 70124e1: revamp the ui for traces
286
- - 926821d: Fix triggerSchema default not showing in workflow ui
287
- - 57b25ed: Use resumeSchema to show inputs on the playground for suspended workflows
288
- - f1d4b7a: Add x-mastra-dev-playground header to all playground requests
289
- - Updated dependencies [405b63d]
290
- - Updated dependencies [61e92f5]
291
- - Updated dependencies [c71013a]
292
- - @mastra/core@0.9.1-alpha.2
293
- - @mastra/deployer@0.3.1-alpha.2
294
-
295
- ## 0.6.0-alpha.1
296
-
297
- ### Minor Changes
298
-
299
- - e126a44: improve non-interactive mode of the mastra cli and create-mastra by adding --no-example and --dir flags
300
-
301
-
302
- ... 3040 more lines hidden. See full changelog in package directory.
302
+ ... 3085 more lines hidden. See full changelog in package directory.
@@ -0,0 +1,202 @@
1
+ ### package.json
2
+ ```json
3
+ {
4
+ "name": "examples-a2a",
5
+ "version": "1.0.0",
6
+ "type": "module",
7
+ "private": true,
8
+ "description": "Example of using Mastra's A2A protocol with the client SDK",
9
+ "main": "dist/index.js",
10
+ "scripts": {
11
+ "start": "tsx src/index.ts",
12
+ "mastra:dev": "mastra dev",
13
+ "build": "tsc",
14
+ "dev": "tsx watch src/index.ts"
15
+ },
16
+ "keywords": [
17
+ "mastra",
18
+ "a2a",
19
+ "agent-to-agent",
20
+ "example"
21
+ ],
22
+ "author": "Mastra Team",
23
+ "license": "MIT",
24
+ "dependencies": {
25
+ "@ai-sdk/openai": "^1.3.22",
26
+ "@mastra/client-js": "latest",
27
+ "@mastra/core": "latest",
28
+ "dotenv": "^16.3.1",
29
+ "zod": "^3.22.2"
30
+ },
31
+ "devDependencies": {
32
+ "mastra": "latest",
33
+ "tsx": "^4.7.0",
34
+ "typescript": "^5.3.3"
35
+ },
36
+ "pnpm": {
37
+ "overrides": {
38
+ "@mastra/core": "link:../../packages/core",
39
+ "mastra": "link:../../packages/cli",
40
+ "@mastra/client-js": "link:../../client-sdks/client-js"
41
+ }
42
+ },
43
+ "packageManager": "pnpm@10.9.0+sha512.0486e394640d3c1fb3c9d43d49cf92879ff74f8516959c235308f5a8f62e2e19528a65cdc2a3058f587cde71eba3d5b56327c8c33a97e4c4051ca48a10ca2d5f"
44
+ }
45
+
46
+ ```
47
+
48
+ ### index.ts
49
+ ```typescript
50
+ import { MastraClient } from '@mastra/client-js';
51
+
52
+ // Initialize the Mastra client
53
+ const client = new MastraClient({
54
+ baseUrl: process.env.MASTRA_BASE_URL || 'http://localhost:4111',
55
+ });
56
+
57
+ /**
58
+ * Example of using the A2A protocol to interact with agents
59
+ */
60
+ async function main() {
61
+ try {
62
+ // Get the agent ID - this would be the ID of an agent you've created
63
+ const agentId = 'myAgent';
64
+
65
+ console.log(`šŸ¤– Connecting to agent: ${agentId} via A2A protocol\n`);
66
+
67
+ // Get the A2A client for the agent
68
+ const a2aClient = client.getA2A(agentId);
69
+
70
+ // Step 1: Get the agent card to see its capabilities
71
+ console.log('šŸ“‹ Fetching agent card...');
72
+ const agentCard = await a2aClient.getCard();
73
+
74
+ console.log(`\nAgent Name: ${agentCard.name}`);
75
+ console.log(`Description: ${agentCard.description}`);
76
+ console.log(`Capabilities: ${JSON.stringify(agentCard.capabilities)}`);
77
+ console.log(`API Version: ${agentCard.version}`);
78
+ console.log('\n-------------------\n');
79
+
80
+ // Step 2: Send a message to the agent
81
+ const taskId = `task-${Date.now()}`;
82
+ console.log(`šŸ“¤ Sending message to agent (Task ID: ${taskId})...`);
83
+
84
+ const query = 'What are the latest developments in AI agent networks?';
85
+ console.log(`Query: ${query}`);
86
+
87
+ const response = await a2aClient.sendMessage({
88
+ id: taskId,
89
+ message: {
90
+ role: 'user',
91
+ parts: [{ type: 'text', text: query }],
92
+ },
93
+ });
94
+
95
+ console.log(response);
96
+
97
+ console.log(`\nTask Status: ${response.task.status}`);
98
+ console.log('\nšŸ¤– Agent Response:');
99
+ console.log(
100
+ response.task.status.message?.parts[0]?.type === 'text'
101
+ ? response.task.status.message.parts[0].text
102
+ : 'No response content',
103
+ );
104
+
105
+ console.log('\n-------------------\n');
106
+
107
+ // Step 3: Get task status
108
+ console.log(`šŸ“„ Checking task status (Task ID: ${taskId})...`);
109
+
110
+ const taskStatus = await a2aClient.getTask({
111
+ id: taskId,
112
+ });
113
+
114
+ console.log(`Task Status: ${taskStatus.status}`);
115
+ console.log('\n-------------------\n');
116
+
117
+ // Step 4: Demonstrate agent-to-agent communication
118
+ console.log('šŸ”„ Demonstrating agent-to-agent communication...');
119
+
120
+ // Get another agent for A2A communication
121
+ const secondAgentId = process.env.SECOND_AGENT_ID || 'contentCreatorAgent';
122
+ console.log(`Connecting to second agent: ${secondAgentId}`);
123
+
124
+ const secondA2aClient = client.getA2A(secondAgentId);
125
+
126
+ // First agent gathers information
127
+ const researchTaskId = `research-${Date.now()}`;
128
+ console.log(`\nStep 1: First agent (${agentId}) researches the topic...`);
129
+
130
+ const researchQuery = 'Provide a brief summary of agent networks in AI';
131
+ const researchResponse = await a2aClient.sendMessage({
132
+ id: researchTaskId,
133
+ message: {
134
+ role: 'user',
135
+ parts: [{ type: 'text', text: researchQuery }],
136
+ },
137
+ });
138
+
139
+ const researchResult =
140
+ researchResponse.task.status.message?.parts[0]?.type === 'text'
141
+ ? researchResponse.task.status.message.parts[0].text
142
+ : '';
143
+ console.log('\nResearch Results:');
144
+ console.log(researchResult.substring(0, 150) + '...');
145
+
146
+ // Second agent transforms the research into content
147
+ const contentTaskId = `content-${Date.now()}`;
148
+ console.log(`\nStep 2: Second agent (${secondAgentId}) transforms research into content...`);
149
+
150
+ const contentPrompt = `Transform this research into an engaging blog post introduction:\n\n${researchResult}`;
151
+ const contentResponse = await secondA2aClient.sendMessage({
152
+ id: contentTaskId,
153
+ message: {
154
+ role: 'user',
155
+ parts: [{ type: 'text', text: contentPrompt }],
156
+ },
157
+ });
158
+
159
+ console.log('\nFinal Content:');
160
+ console.log(
161
+ contentResponse.task.status.message?.parts[0]?.type === 'text'
162
+ ? contentResponse.task.status.message.parts[0].text
163
+ : 'No content generated',
164
+ );
165
+
166
+ console.log('\n-------------------\n');
167
+ console.log('āœ… A2A example completed successfully!');
168
+ } catch (error) {
169
+ console.error('āŒ Error in A2A example:', error);
170
+ }
171
+ }
172
+
173
+ // Run the example
174
+ main();
175
+
176
+ ```
177
+
178
+ ### mastra/agents/index.ts
179
+ ```typescript
180
+ import { Agent } from '@mastra/core/agent';
181
+ import { openai } from '@ai-sdk/openai';
182
+
183
+ export const myAgent = new Agent({
184
+ name: 'myAgent',
185
+ instructions: 'My Agent Instructions',
186
+ model: openai('gpt-4o'),
187
+ });
188
+
189
+ ```
190
+
191
+ ### mastra/index.ts
192
+ ```typescript
193
+ import { Mastra } from '@mastra/core/mastra';
194
+ import { myAgent } from './agents';
195
+
196
+ export const mastra = new Mastra({
197
+ agents: {
198
+ myAgent,
199
+ },
200
+ });
201
+
202
+ ```
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@ai-sdk/openai": "^1.2.5",
17
+ "@ai-sdk/openai": "^1.3.22",
18
18
  "@mastra/client-js": "latest",
19
19
  "@mastra/core": "latest",
20
20
  "zod": "^3.24.3"