@mastra/client-js 0.0.0-fix-tool-call-history-3-20250806004225 → 0.0.0-fix-zod-to-json-schema-ref-strategy-20250910193441

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