@mastra/client-js 0.0.0-ai-v5-20250801192614 → 0.0.0-ai-telementry-ui-20250908094819

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 (81) hide show
  1. package/CHANGELOG.md +541 -4
  2. package/README.md +5 -3
  3. package/dist/client.d.ts +23 -8
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/index.cjs +1171 -379
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +3 -2
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1170 -378
  10. package/dist/index.js.map +1 -1
  11. package/dist/resources/a2a.d.ts +15 -18
  12. package/dist/resources/a2a.d.ts.map +1 -1
  13. package/dist/resources/agent-builder.d.ts +161 -0
  14. package/dist/resources/agent-builder.d.ts.map +1 -0
  15. package/dist/resources/agent.d.ts +52 -9
  16. package/dist/resources/agent.d.ts.map +1 -1
  17. package/dist/resources/base.d.ts +1 -1
  18. package/dist/resources/index.d.ts +12 -10
  19. package/dist/resources/index.d.ts.map +1 -1
  20. package/dist/resources/legacy-workflow.d.ts +2 -2
  21. package/dist/resources/mcp-tool.d.ts +2 -2
  22. package/dist/resources/memory-thread.d.ts +3 -3
  23. package/dist/resources/memory-thread.d.ts.map +1 -1
  24. package/dist/resources/network-memory-thread.d.ts +3 -3
  25. package/dist/resources/network-memory-thread.d.ts.map +1 -1
  26. package/dist/resources/network.d.ts +4 -4
  27. package/dist/resources/network.d.ts.map +1 -1
  28. package/dist/resources/observability.d.ts +19 -0
  29. package/dist/resources/observability.d.ts.map +1 -0
  30. package/dist/resources/tool.d.ts +2 -2
  31. package/dist/resources/tool.d.ts.map +1 -1
  32. package/dist/resources/vNextNetwork.d.ts +3 -3
  33. package/dist/resources/vNextNetwork.d.ts.map +1 -1
  34. package/dist/resources/vector.d.ts +2 -2
  35. package/dist/resources/workflow.d.ts +2 -2
  36. package/dist/types.d.ts +44 -10
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/utils/process-client-tools.d.ts.map +1 -1
  39. package/dist/utils/process-mastra-stream.d.ts +7 -0
  40. package/dist/utils/process-mastra-stream.d.ts.map +1 -0
  41. package/dist/utils/zod-to-json-schema.d.ts +2 -104
  42. package/dist/utils/zod-to-json-schema.d.ts.map +1 -1
  43. package/package.json +27 -17
  44. package/.turbo/turbo-build.log +0 -4
  45. package/dist/adapters/agui.d.ts +0 -22
  46. package/dist/adapters/agui.d.ts.map +0 -1
  47. package/eslint.config.js +0 -6
  48. package/integration-tests/agui-adapter.test.ts +0 -122
  49. package/integration-tests/package.json +0 -17
  50. package/integration-tests/src/mastra/index.ts +0 -38
  51. package/integration-tests/vitest.config.ts +0 -9
  52. package/src/adapters/agui.test.ts +0 -322
  53. package/src/adapters/agui.ts +0 -251
  54. package/src/client.ts +0 -623
  55. package/src/example.ts +0 -95
  56. package/src/index.test.ts +0 -1226
  57. package/src/index.ts +0 -2
  58. package/src/resources/a2a.ts +0 -88
  59. package/src/resources/agent.ts +0 -781
  60. package/src/resources/base.ts +0 -77
  61. package/src/resources/index.ts +0 -10
  62. package/src/resources/legacy-workflow.ts +0 -242
  63. package/src/resources/mcp-tool.ts +0 -48
  64. package/src/resources/memory-thread.test.ts +0 -285
  65. package/src/resources/memory-thread.ts +0 -100
  66. package/src/resources/network-memory-thread.test.ts +0 -269
  67. package/src/resources/network-memory-thread.ts +0 -81
  68. package/src/resources/network.ts +0 -86
  69. package/src/resources/tool.ts +0 -45
  70. package/src/resources/vNextNetwork.ts +0 -194
  71. package/src/resources/vector.ts +0 -83
  72. package/src/resources/workflow.ts +0 -410
  73. package/src/types.ts +0 -506
  74. package/src/utils/index.ts +0 -11
  75. package/src/utils/process-client-tools.ts +0 -32
  76. package/src/utils/zod-to-json-schema.ts +0 -10
  77. package/src/v2-messages.test.ts +0 -180
  78. package/tsconfig.build.json +0 -9
  79. package/tsconfig.json +0 -5
  80. package/tsup.config.ts +0 -22
  81. package/vitest.config.js +0 -8
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './client';
2
- export * from './types';
@@ -1,88 +0,0 @@
1
- import type { TaskSendParams, TaskQueryParams, TaskIdParams, Task, AgentCard, JSONRPCResponse } from '@mastra/core/a2a';
2
- import type { ClientOptions } from '../types';
3
- import { BaseResource } from './base';
4
-
5
- /**
6
- * Class for interacting with an agent via the A2A protocol
7
- */
8
- export class A2A extends BaseResource {
9
- constructor(
10
- options: ClientOptions,
11
- private agentId: string,
12
- ) {
13
- super(options);
14
- }
15
-
16
- /**
17
- * Get the agent card with metadata about the agent
18
- * @returns Promise containing the agent card information
19
- */
20
- async getCard(): Promise<AgentCard> {
21
- return this.request(`/.well-known/${this.agentId}/agent.json`);
22
- }
23
-
24
- /**
25
- * Send a message to the agent and get a response
26
- * @param params - Parameters for the task
27
- * @returns Promise containing the task response
28
- */
29
- async sendMessage(params: TaskSendParams): Promise<{ task: Task }> {
30
- const response = await this.request<JSONRPCResponse<Task>>(`/a2a/${this.agentId}`, {
31
- method: 'POST',
32
- body: {
33
- method: 'tasks/send',
34
- params,
35
- },
36
- });
37
-
38
- return { task: response.result! };
39
- }
40
-
41
- /**
42
- * Get the status and result of a task
43
- * @param params - Parameters for querying the task
44
- * @returns Promise containing the task response
45
- */
46
- async getTask(params: TaskQueryParams): Promise<Task> {
47
- const response = await this.request<JSONRPCResponse<Task>>(`/a2a/${this.agentId}`, {
48
- method: 'POST',
49
- body: {
50
- method: 'tasks/get',
51
- params,
52
- },
53
- });
54
-
55
- return response.result!;
56
- }
57
-
58
- /**
59
- * Cancel a running task
60
- * @param params - Parameters identifying the task to cancel
61
- * @returns Promise containing the task response
62
- */
63
- async cancelTask(params: TaskIdParams): Promise<{ task: Task }> {
64
- return this.request(`/a2a/${this.agentId}`, {
65
- method: 'POST',
66
- body: {
67
- method: 'tasks/cancel',
68
- params,
69
- },
70
- });
71
- }
72
-
73
- /**
74
- * Send a message and subscribe to streaming updates (not fully implemented)
75
- * @param params - Parameters for the task
76
- * @returns Promise containing the task response
77
- */
78
- async sendAndSubscribe(params: TaskSendParams): Promise<Response> {
79
- return this.request(`/a2a/${this.agentId}`, {
80
- method: 'POST',
81
- body: {
82
- method: 'tasks/sendSubscribe',
83
- params,
84
- },
85
- stream: true,
86
- });
87
- }
88
- }