@mastra/client-js 0.0.0-scorers-api-v2-20250801171841 → 0.0.0-scorers-ui-refactored-20250916094952

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 (89) hide show
  1. package/CHANGELOG.md +671 -3
  2. package/README.md +5 -3
  3. package/dist/client.d.ts +30 -11
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/index.cjs +1459 -413
  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 +1459 -415
  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 +78 -15
  16. package/dist/resources/agent.d.ts.map +1 -1
  17. package/dist/resources/base.d.ts +1 -1
  18. package/dist/resources/base.d.ts.map +1 -1
  19. package/dist/resources/index.d.ts +12 -10
  20. package/dist/resources/index.d.ts.map +1 -1
  21. package/dist/resources/legacy-workflow.d.ts +7 -4
  22. package/dist/resources/legacy-workflow.d.ts.map +1 -1
  23. package/dist/resources/mcp-tool.d.ts +4 -3
  24. package/dist/resources/mcp-tool.d.ts.map +1 -1
  25. package/dist/resources/memory-thread.d.ts +3 -3
  26. package/dist/resources/memory-thread.d.ts.map +1 -1
  27. package/dist/resources/network-memory-thread.d.ts +3 -3
  28. package/dist/resources/network-memory-thread.d.ts.map +1 -1
  29. package/dist/resources/network.d.ts +6 -4
  30. package/dist/resources/network.d.ts.map +1 -1
  31. package/dist/resources/observability.d.ts +19 -0
  32. package/dist/resources/observability.d.ts.map +1 -0
  33. package/dist/resources/tool.d.ts +4 -3
  34. package/dist/resources/tool.d.ts.map +1 -1
  35. package/dist/resources/vNextNetwork.d.ts +5 -4
  36. package/dist/resources/vNextNetwork.d.ts.map +1 -1
  37. package/dist/resources/vector.d.ts +7 -4
  38. package/dist/resources/vector.d.ts.map +1 -1
  39. package/dist/resources/workflow.d.ts +80 -6
  40. package/dist/resources/workflow.d.ts.map +1 -1
  41. package/dist/tools.d.ts +22 -0
  42. package/dist/tools.d.ts.map +1 -0
  43. package/dist/types.d.ts +49 -2
  44. package/dist/types.d.ts.map +1 -1
  45. package/dist/utils/index.d.ts +2 -0
  46. package/dist/utils/index.d.ts.map +1 -1
  47. package/dist/utils/process-client-tools.d.ts.map +1 -1
  48. package/dist/utils/process-mastra-stream.d.ts +11 -0
  49. package/dist/utils/process-mastra-stream.d.ts.map +1 -0
  50. package/dist/utils/zod-to-json-schema.d.ts +2 -104
  51. package/dist/utils/zod-to-json-schema.d.ts.map +1 -1
  52. package/package.json +25 -16
  53. package/dist/adapters/agui.d.ts +0 -23
  54. package/dist/adapters/agui.d.ts.map +0 -1
  55. package/eslint.config.js +0 -6
  56. package/integration-tests/agui-adapter.test.ts +0 -122
  57. package/integration-tests/package.json +0 -18
  58. package/integration-tests/src/mastra/index.ts +0 -35
  59. package/integration-tests/vitest.config.ts +0 -9
  60. package/src/adapters/agui.test.ts +0 -322
  61. package/src/adapters/agui.ts +0 -239
  62. package/src/client.ts +0 -623
  63. package/src/example.ts +0 -95
  64. package/src/index.test.ts +0 -1226
  65. package/src/index.ts +0 -3
  66. package/src/resources/a2a.ts +0 -88
  67. package/src/resources/agent.ts +0 -785
  68. package/src/resources/base.ts +0 -76
  69. package/src/resources/index.ts +0 -10
  70. package/src/resources/legacy-workflow.ts +0 -242
  71. package/src/resources/mcp-tool.ts +0 -48
  72. package/src/resources/memory-thread.test.ts +0 -285
  73. package/src/resources/memory-thread.ts +0 -99
  74. package/src/resources/network-memory-thread.test.ts +0 -269
  75. package/src/resources/network-memory-thread.ts +0 -81
  76. package/src/resources/network.ts +0 -86
  77. package/src/resources/tool.ts +0 -45
  78. package/src/resources/vNextNetwork.ts +0 -194
  79. package/src/resources/vector.ts +0 -83
  80. package/src/resources/workflow.ts +0 -410
  81. package/src/types.ts +0 -502
  82. package/src/utils/index.ts +0 -11
  83. package/src/utils/process-client-tools.ts +0 -32
  84. package/src/utils/zod-to-json-schema.ts +0 -10
  85. package/src/v2-messages.test.ts +0 -180
  86. package/tsconfig.build.json +0 -9
  87. package/tsconfig.json +0 -5
  88. package/tsup.config.ts +0 -22
  89. package/vitest.config.js +0 -8
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './client';
2
- export * from './types';
3
- export type { UIMessageWithMetadata } from '@mastra/core/agent';
@@ -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
- }