@mastra/client-js 0.0.0-vnext-inngest-20250508131921 → 0.0.0-vnext-20251104230439
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.
- package/CHANGELOG.md +2389 -2
- package/LICENSE.md +11 -42
- package/README.md +12 -15
- package/dist/client.d.ts +254 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/example.d.ts +2 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/index.cjs +2594 -548
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -730
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2593 -553
- package/dist/index.js.map +1 -0
- package/dist/resources/a2a.d.ts +41 -0
- package/dist/resources/a2a.d.ts.map +1 -0
- package/dist/resources/agent-builder.d.ts +186 -0
- package/dist/resources/agent-builder.d.ts.map +1 -0
- package/dist/resources/agent.d.ts +181 -0
- package/dist/resources/agent.d.ts.map +1 -0
- package/dist/resources/base.d.ts +13 -0
- package/dist/resources/base.d.ts.map +1 -0
- package/dist/resources/index.d.ts +11 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/mcp-tool.d.ts +28 -0
- package/dist/resources/mcp-tool.d.ts.map +1 -0
- package/dist/resources/memory-thread.d.ts +61 -0
- package/dist/resources/memory-thread.d.ts.map +1 -0
- package/dist/resources/observability.d.ts +35 -0
- package/dist/resources/observability.d.ts.map +1 -0
- package/dist/resources/tool.d.ts +24 -0
- package/dist/resources/tool.d.ts.map +1 -0
- package/dist/resources/vector.d.ts +51 -0
- package/dist/resources/vector.d.ts.map +1 -0
- package/dist/resources/workflow.d.ts +216 -0
- package/dist/resources/workflow.d.ts.map +1 -0
- package/dist/tools.d.ts +22 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/types.d.ts +457 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/process-client-tools.d.ts +3 -0
- package/dist/utils/process-client-tools.d.ts.map +1 -0
- package/dist/utils/process-mastra-stream.d.ts +11 -0
- package/dist/utils/process-mastra-stream.d.ts.map +1 -0
- package/dist/utils/zod-to-json-schema.d.ts +3 -0
- package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
- package/package.json +38 -20
- package/dist/index.d.cts +0 -730
- package/eslint.config.js +0 -6
- package/src/adapters/agui.test.ts +0 -167
- package/src/adapters/agui.ts +0 -219
- package/src/client.ts +0 -259
- package/src/example.ts +0 -65
- package/src/index.test.ts +0 -710
- package/src/index.ts +0 -2
- package/src/resources/agent.ts +0 -206
- package/src/resources/base.ts +0 -70
- package/src/resources/index.ts +0 -8
- package/src/resources/memory-thread.ts +0 -53
- package/src/resources/network.ts +0 -92
- package/src/resources/tool.ts +0 -38
- package/src/resources/vector.ts +0 -83
- package/src/resources/vnext-workflow.ts +0 -257
- package/src/resources/workflow.ts +0 -251
- package/src/types.ts +0 -262
- package/tsconfig.json +0 -5
- package/vitest.config.js +0 -8
package/src/types.ts
DELETED
|
@@ -1,262 +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
|
-
provider: string;
|
|
46
|
-
modelId: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
50
|
-
messages: string | string[] | CoreMessage[] | AiMessageType[];
|
|
51
|
-
} & Partial<AgentGenerateOptions<T>>;
|
|
52
|
-
|
|
53
|
-
export type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
54
|
-
messages: string | string[] | CoreMessage[] | AiMessageType[];
|
|
55
|
-
} & Omit<AgentStreamOptions<T>, 'onFinish' | 'onStepFinish' | 'telemetry'>;
|
|
56
|
-
|
|
57
|
-
export interface GetEvalsByAgentIdResponse extends GetAgentResponse {
|
|
58
|
-
evals: any[];
|
|
59
|
-
instructions: string;
|
|
60
|
-
name: string;
|
|
61
|
-
id: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface GetToolResponse {
|
|
65
|
-
id: string;
|
|
66
|
-
description: string;
|
|
67
|
-
inputSchema: string;
|
|
68
|
-
outputSchema: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface GetWorkflowResponse {
|
|
72
|
-
name: string;
|
|
73
|
-
triggerSchema: string;
|
|
74
|
-
steps: Record<string, StepAction<any, any, any, any>>;
|
|
75
|
-
stepGraph: StepGraph;
|
|
76
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
77
|
-
workflowId?: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface GetWorkflowRunsParams {
|
|
81
|
-
fromDate?: Date;
|
|
82
|
-
toDate?: Date;
|
|
83
|
-
limit?: number;
|
|
84
|
-
offset?: number;
|
|
85
|
-
resourceId?: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export type GetWorkflowRunsResponse = WorkflowRuns;
|
|
89
|
-
|
|
90
|
-
export type WorkflowRunResult = {
|
|
91
|
-
activePaths: Record<string, { status: string; suspendPayload?: any; stepPath: string[] }>;
|
|
92
|
-
results: CoreWorkflowRunResult<any, any, any>['results'];
|
|
93
|
-
timestamp: number;
|
|
94
|
-
runId: string;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export interface GetVNextWorkflowResponse {
|
|
98
|
-
name: string;
|
|
99
|
-
steps: {
|
|
100
|
-
[key: string]: {
|
|
101
|
-
id: string;
|
|
102
|
-
description: string;
|
|
103
|
-
inputSchema: string;
|
|
104
|
-
outputSchema: string;
|
|
105
|
-
resumeSchema: string;
|
|
106
|
-
suspendSchema: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
stepGraph: NewWorkflow['serializedStepGraph'];
|
|
110
|
-
inputSchema: string;
|
|
111
|
-
outputSchema: string;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export type VNextWorkflowWatchResult = WatchEvent & { runId: string };
|
|
115
|
-
|
|
116
|
-
export type VNextWorkflowRunResult = VNextWorkflowResult<any, any>;
|
|
117
|
-
export interface UpsertVectorParams {
|
|
118
|
-
indexName: string;
|
|
119
|
-
vectors: number[][];
|
|
120
|
-
metadata?: Record<string, any>[];
|
|
121
|
-
ids?: string[];
|
|
122
|
-
}
|
|
123
|
-
export interface CreateIndexParams {
|
|
124
|
-
indexName: string;
|
|
125
|
-
dimension: number;
|
|
126
|
-
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface QueryVectorParams {
|
|
130
|
-
indexName: string;
|
|
131
|
-
queryVector: number[];
|
|
132
|
-
topK?: number;
|
|
133
|
-
filter?: Record<string, any>;
|
|
134
|
-
includeVector?: boolean;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export interface QueryVectorResponse {
|
|
138
|
-
results: QueryResult[];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface GetVectorIndexResponse {
|
|
142
|
-
dimension: number;
|
|
143
|
-
metric: 'cosine' | 'euclidean' | 'dotproduct';
|
|
144
|
-
count: number;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface SaveMessageToMemoryParams {
|
|
148
|
-
messages: MessageType[];
|
|
149
|
-
agentId: string;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export type SaveMessageToMemoryResponse = MessageType[];
|
|
153
|
-
|
|
154
|
-
export interface CreateMemoryThreadParams {
|
|
155
|
-
title: string;
|
|
156
|
-
metadata: Record<string, any>;
|
|
157
|
-
resourceId: string;
|
|
158
|
-
threadId: string;
|
|
159
|
-
agentId: string;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export type CreateMemoryThreadResponse = StorageThreadType;
|
|
163
|
-
|
|
164
|
-
export interface GetMemoryThreadParams {
|
|
165
|
-
resourceId: string;
|
|
166
|
-
agentId: string;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export type GetMemoryThreadResponse = StorageThreadType[];
|
|
170
|
-
|
|
171
|
-
export interface UpdateMemoryThreadParams {
|
|
172
|
-
title: string;
|
|
173
|
-
metadata: Record<string, any>;
|
|
174
|
-
resourceId: string;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export interface GetMemoryThreadMessagesResponse {
|
|
178
|
-
messages: CoreMessage[];
|
|
179
|
-
uiMessages: AiMessageType[];
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export interface GetLogsParams {
|
|
183
|
-
transportId: string;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface GetLogParams {
|
|
187
|
-
runId: string;
|
|
188
|
-
transportId: string;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export type GetLogsResponse = BaseLogMessage[];
|
|
192
|
-
|
|
193
|
-
export type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
|
|
194
|
-
|
|
195
|
-
type SpanStatus = {
|
|
196
|
-
code: number;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
type SpanOther = {
|
|
200
|
-
droppedAttributesCount: number;
|
|
201
|
-
droppedEventsCount: number;
|
|
202
|
-
droppedLinksCount: number;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
type SpanEventAttributes = {
|
|
206
|
-
key: string;
|
|
207
|
-
value: { [key: string]: string | number | boolean | null };
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
type SpanEvent = {
|
|
211
|
-
attributes: SpanEventAttributes[];
|
|
212
|
-
name: string;
|
|
213
|
-
timeUnixNano: string;
|
|
214
|
-
droppedAttributesCount: number;
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
type Span = {
|
|
218
|
-
id: string;
|
|
219
|
-
parentSpanId: string | null;
|
|
220
|
-
traceId: string;
|
|
221
|
-
name: string;
|
|
222
|
-
scope: string;
|
|
223
|
-
kind: number;
|
|
224
|
-
status: SpanStatus;
|
|
225
|
-
events: SpanEvent[];
|
|
226
|
-
links: any[];
|
|
227
|
-
attributes: Record<string, string | number | boolean | null>;
|
|
228
|
-
startTime: number;
|
|
229
|
-
endTime: number;
|
|
230
|
-
duration: number;
|
|
231
|
-
other: SpanOther;
|
|
232
|
-
createdAt: string;
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
export interface GetTelemetryResponse {
|
|
236
|
-
traces: Span[];
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export interface GetTelemetryParams {
|
|
240
|
-
name?: string;
|
|
241
|
-
scope?: string;
|
|
242
|
-
page?: number;
|
|
243
|
-
perPage?: number;
|
|
244
|
-
attribute?: Record<string, string>;
|
|
245
|
-
fromDate?: Date;
|
|
246
|
-
toDate?: Date;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export interface GetNetworkResponse {
|
|
250
|
-
name: string;
|
|
251
|
-
instructions: string;
|
|
252
|
-
agents: Array<{
|
|
253
|
-
name: string;
|
|
254
|
-
provider: string;
|
|
255
|
-
modelId: string;
|
|
256
|
-
}>;
|
|
257
|
-
routingModel: {
|
|
258
|
-
provider: string;
|
|
259
|
-
modelId: string;
|
|
260
|
-
};
|
|
261
|
-
state?: Record<string, any>;
|
|
262
|
-
}
|
package/tsconfig.json
DELETED