@mastra/client-js 0.0.0-cloud-transporter-20250513033346 → 0.0.0-cloud-deployer-for-core-0.19.1-20251001164939

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 (74) hide show
  1. package/CHANGELOG.md +1892 -2
  2. package/LICENSE.md +11 -42
  3. package/README.md +8 -9
  4. package/dist/client.d.ts +290 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/example.d.ts +2 -0
  7. package/dist/example.d.ts.map +1 -0
  8. package/dist/index.cjs +2713 -629
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +5 -800
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +2714 -632
  13. package/dist/index.js.map +1 -0
  14. package/dist/resources/a2a.d.ts +41 -0
  15. package/dist/resources/a2a.d.ts.map +1 -0
  16. package/dist/resources/agent-builder.d.ts +160 -0
  17. package/dist/resources/agent-builder.d.ts.map +1 -0
  18. package/dist/resources/agent.d.ts +191 -0
  19. package/dist/resources/agent.d.ts.map +1 -0
  20. package/dist/resources/base.d.ts +13 -0
  21. package/dist/resources/base.d.ts.map +1 -0
  22. package/dist/resources/index.d.ts +11 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/mcp-tool.d.ts +28 -0
  25. package/dist/resources/mcp-tool.d.ts.map +1 -0
  26. package/dist/resources/memory-thread.d.ts +53 -0
  27. package/dist/resources/memory-thread.d.ts.map +1 -0
  28. package/dist/resources/network-memory-thread.d.ts +47 -0
  29. package/dist/resources/network-memory-thread.d.ts.map +1 -0
  30. package/dist/resources/observability.d.ts +35 -0
  31. package/dist/resources/observability.d.ts.map +1 -0
  32. package/dist/resources/tool.d.ts +24 -0
  33. package/dist/resources/tool.d.ts.map +1 -0
  34. package/dist/resources/vNextNetwork.d.ts +43 -0
  35. package/dist/resources/vNextNetwork.d.ts.map +1 -0
  36. package/dist/resources/vector.d.ts +51 -0
  37. package/dist/resources/vector.d.ts.map +1 -0
  38. package/dist/resources/workflow.d.ts +266 -0
  39. package/dist/resources/workflow.d.ts.map +1 -0
  40. package/dist/tools.d.ts +22 -0
  41. package/dist/tools.d.ts.map +1 -0
  42. package/dist/types.d.ts +478 -0
  43. package/dist/types.d.ts.map +1 -0
  44. package/dist/utils/index.d.ts +5 -0
  45. package/dist/utils/index.d.ts.map +1 -0
  46. package/dist/utils/process-client-tools.d.ts +3 -0
  47. package/dist/utils/process-client-tools.d.ts.map +1 -0
  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 +3 -0
  51. package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
  52. package/package.json +37 -20
  53. package/dist/index.d.cts +0 -800
  54. package/eslint.config.js +0 -6
  55. package/src/adapters/agui.test.ts +0 -180
  56. package/src/adapters/agui.ts +0 -239
  57. package/src/client.ts +0 -268
  58. package/src/example.ts +0 -65
  59. package/src/index.test.ts +0 -740
  60. package/src/index.ts +0 -2
  61. package/src/resources/a2a.ts +0 -88
  62. package/src/resources/agent.ts +0 -196
  63. package/src/resources/base.ts +0 -70
  64. package/src/resources/index.ts +0 -9
  65. package/src/resources/memory-thread.ts +0 -63
  66. package/src/resources/network.ts +0 -86
  67. package/src/resources/tool.ts +0 -44
  68. package/src/resources/vector.ts +0 -83
  69. package/src/resources/vnext-workflow.ts +0 -261
  70. package/src/resources/workflow.ts +0 -251
  71. package/src/types.ts +0 -270
  72. package/src/utils/zod-to-json-schema.ts +0 -10
  73. package/tsconfig.json +0 -5
  74. package/vitest.config.js +0 -8
package/src/types.ts DELETED
@@ -1,270 +0,0 @@
1
- import type {
2
- MessageType,
3
- AiMessageType,
4
- CoreMessage,
5
- QueryResult,
6
- StepAction,
7
- StepGraph,
8
- StorageThreadType,
9
- BaseLogMessage,
10
- WorkflowRunResult as CoreWorkflowRunResult,
11
- WorkflowRuns,
12
- } from '@mastra/core';
13
-
14
- import type { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
15
- import type { NewWorkflow, WatchEvent, WorkflowResult as VNextWorkflowResult } from '@mastra/core/workflows/vNext';
16
- import type { JSONSchema7 } from 'json-schema';
17
- import type { ZodSchema } from 'zod';
18
-
19
- export interface ClientOptions {
20
- /** Base URL for API requests */
21
- baseUrl: string;
22
- /** Number of retry attempts for failed requests */
23
- retries?: number;
24
- /** Initial backoff time in milliseconds between retries */
25
- backoffMs?: number;
26
- /** Maximum backoff time in milliseconds between retries */
27
- maxBackoffMs?: number;
28
- /** Custom headers to include with requests */
29
- headers?: Record<string, string>;
30
- /** Abort signal for request */
31
- }
32
-
33
- export interface RequestOptions {
34
- method?: string;
35
- headers?: Record<string, string>;
36
- body?: any;
37
- stream?: boolean;
38
- signal?: AbortSignal;
39
- }
40
-
41
- export interface GetAgentResponse {
42
- name: string;
43
- instructions: string;
44
- tools: Record<string, GetToolResponse>;
45
- workflows: Record<string, GetWorkflowResponse>;
46
- provider: string;
47
- modelId: string;
48
- }
49
-
50
- export type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
51
- messages: string | string[] | CoreMessage[] | AiMessageType[];
52
- } & Partial<Omit<AgentGenerateOptions<T>, 'experimental_generateMessageId'>>;
53
-
54
- export type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
55
- messages: string | string[] | CoreMessage[] | AiMessageType[];
56
- } & Omit<AgentStreamOptions<T>, 'onFinish' | 'onStepFinish' | 'telemetry' | 'experimental_generateMessageId'>;
57
-
58
- export interface GetEvalsByAgentIdResponse extends GetAgentResponse {
59
- evals: any[];
60
- instructions: string;
61
- name: string;
62
- id: string;
63
- }
64
-
65
- export interface GetToolResponse {
66
- id: string;
67
- description: string;
68
- inputSchema: string;
69
- outputSchema: string;
70
- }
71
-
72
- export interface GetWorkflowResponse {
73
- name: string;
74
- triggerSchema: string;
75
- steps: Record<string, StepAction<any, any, any, any>>;
76
- stepGraph: StepGraph;
77
- stepSubscriberGraph: Record<string, StepGraph>;
78
- workflowId?: string;
79
- }
80
-
81
- export interface GetWorkflowRunsParams {
82
- fromDate?: Date;
83
- toDate?: Date;
84
- limit?: number;
85
- offset?: number;
86
- resourceId?: string;
87
- }
88
-
89
- export type GetWorkflowRunsResponse = WorkflowRuns;
90
-
91
- export type WorkflowRunResult = {
92
- activePaths: Record<string, { status: string; suspendPayload?: any; stepPath: string[] }>;
93
- results: CoreWorkflowRunResult<any, any, any>['results'];
94
- timestamp: number;
95
- runId: string;
96
- };
97
-
98
- export interface GetVNextWorkflowResponse {
99
- name: string;
100
- steps: {
101
- [key: string]: {
102
- id: string;
103
- description: string;
104
- inputSchema: string;
105
- outputSchema: string;
106
- resumeSchema: string;
107
- suspendSchema: string;
108
- };
109
- };
110
- stepGraph: NewWorkflow['serializedStepGraph'];
111
- inputSchema: string;
112
- outputSchema: string;
113
- }
114
-
115
- export type VNextWorkflowWatchResult = WatchEvent & { runId: string };
116
-
117
- export type VNextWorkflowRunResult = VNextWorkflowResult<any, any>;
118
- export interface UpsertVectorParams {
119
- indexName: string;
120
- vectors: number[][];
121
- metadata?: Record<string, any>[];
122
- ids?: string[];
123
- }
124
- export interface CreateIndexParams {
125
- indexName: string;
126
- dimension: number;
127
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
128
- }
129
-
130
- export interface QueryVectorParams {
131
- indexName: string;
132
- queryVector: number[];
133
- topK?: number;
134
- filter?: Record<string, any>;
135
- includeVector?: boolean;
136
- }
137
-
138
- export interface QueryVectorResponse {
139
- results: QueryResult[];
140
- }
141
-
142
- export interface GetVectorIndexResponse {
143
- dimension: number;
144
- metric: 'cosine' | 'euclidean' | 'dotproduct';
145
- count: number;
146
- }
147
-
148
- export interface SaveMessageToMemoryParams {
149
- messages: MessageType[];
150
- agentId: string;
151
- }
152
-
153
- export type SaveMessageToMemoryResponse = MessageType[];
154
-
155
- export interface CreateMemoryThreadParams {
156
- title: string;
157
- metadata: Record<string, any>;
158
- resourceId: string;
159
- threadId: string;
160
- agentId: string;
161
- }
162
-
163
- export type CreateMemoryThreadResponse = StorageThreadType;
164
-
165
- export interface GetMemoryThreadParams {
166
- resourceId: string;
167
- agentId: string;
168
- }
169
-
170
- export type GetMemoryThreadResponse = StorageThreadType[];
171
-
172
- export interface UpdateMemoryThreadParams {
173
- title: string;
174
- metadata: Record<string, any>;
175
- resourceId: string;
176
- }
177
-
178
- export interface GetMemoryThreadMessagesParams {
179
- /**
180
- * Limit the number of messages to retrieve (default: 40)
181
- */
182
- limit?: number;
183
- }
184
-
185
- export interface GetMemoryThreadMessagesResponse {
186
- messages: CoreMessage[];
187
- uiMessages: AiMessageType[];
188
- }
189
-
190
- export interface GetLogsParams {
191
- transportId: string;
192
- }
193
-
194
- export interface GetLogParams {
195
- runId: string;
196
- transportId: string;
197
- }
198
-
199
- export type GetLogsResponse = BaseLogMessage[];
200
-
201
- export type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
202
-
203
- type SpanStatus = {
204
- code: number;
205
- };
206
-
207
- type SpanOther = {
208
- droppedAttributesCount: number;
209
- droppedEventsCount: number;
210
- droppedLinksCount: number;
211
- };
212
-
213
- type SpanEventAttributes = {
214
- key: string;
215
- value: { [key: string]: string | number | boolean | null };
216
- };
217
-
218
- type SpanEvent = {
219
- attributes: SpanEventAttributes[];
220
- name: string;
221
- timeUnixNano: string;
222
- droppedAttributesCount: number;
223
- };
224
-
225
- type Span = {
226
- id: string;
227
- parentSpanId: string | null;
228
- traceId: string;
229
- name: string;
230
- scope: string;
231
- kind: number;
232
- status: SpanStatus;
233
- events: SpanEvent[];
234
- links: any[];
235
- attributes: Record<string, string | number | boolean | null>;
236
- startTime: number;
237
- endTime: number;
238
- duration: number;
239
- other: SpanOther;
240
- createdAt: string;
241
- };
242
-
243
- export interface GetTelemetryResponse {
244
- traces: Span[];
245
- }
246
-
247
- export interface GetTelemetryParams {
248
- name?: string;
249
- scope?: string;
250
- page?: number;
251
- perPage?: number;
252
- attribute?: Record<string, string>;
253
- fromDate?: Date;
254
- toDate?: Date;
255
- }
256
-
257
- export interface GetNetworkResponse {
258
- name: string;
259
- instructions: string;
260
- agents: Array<{
261
- name: string;
262
- provider: string;
263
- modelId: string;
264
- }>;
265
- routingModel: {
266
- provider: string;
267
- modelId: string;
268
- };
269
- state?: Record<string, any>;
270
- }
@@ -1,10 +0,0 @@
1
- import { ZodSchema } from 'zod';
2
- import originalZodToJsonSchema from 'zod-to-json-schema';
3
-
4
- export function zodToJsonSchema<T extends ZodSchema | any>(zodSchema: T) {
5
- if (!(zodSchema instanceof ZodSchema)) {
6
- return zodSchema;
7
- }
8
-
9
- return originalZodToJsonSchema(zodSchema, { $refStrategy: 'none' });
10
- }
package/tsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.node.json",
3
- "include": ["src/**/*"],
4
- "exclude": ["node_modules", "**/*.test.ts"]
5
- }
package/vitest.config.js DELETED
@@ -1,8 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- environment: 'node',
6
- include: ['src/**/*.test.ts'],
7
- },
8
- });