@mastra/client-js 0.0.0-pgvector-index-fix-20250905222058 → 0.0.0-playground-studio-cloud-20251031080052
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 +590 -10
- package/README.md +6 -10
- package/dist/client.d.ts +45 -45
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +802 -690
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +801 -691
- package/dist/index.js.map +1 -1
- package/dist/resources/agent-builder.d.ts +5 -6
- package/dist/resources/agent-builder.d.ts.map +1 -1
- package/dist/resources/agent.d.ts +91 -42
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/index.d.ts +0 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/mcp-tool.d.ts +2 -1
- package/dist/resources/mcp-tool.d.ts.map +1 -1
- package/dist/resources/observability.d.ts +17 -1
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/resources/tool.d.ts +2 -1
- package/dist/resources/tool.d.ts.map +1 -1
- package/dist/resources/vector.d.ts +5 -2
- package/dist/resources/vector.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +128 -13
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/tools.d.ts +22 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/types.d.ts +105 -96
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/process-mastra-stream.d.ts +5 -1
- package/dist/utils/process-mastra-stream.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/resources/legacy-workflow.d.ts +0 -87
- package/dist/resources/legacy-workflow.d.ts.map +0 -1
- package/dist/resources/network.d.ts +0 -30
- package/dist/resources/network.d.ts.map +0 -1
- package/dist/resources/vNextNetwork.d.ts +0 -42
- package/dist/resources/vNextNetwork.d.ts.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { TracingOptions } from '@mastra/core/ai-tracing';
|
|
1
2
|
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
2
|
-
import type { ClientOptions, GetWorkflowResponse, GetWorkflowRunsResponse, GetWorkflowRunsParams, WorkflowRunResult, WorkflowWatchResult, GetWorkflowRunByIdResponse, GetWorkflowRunExecutionResultResponse } from '../types.js';
|
|
3
|
+
import type { ClientOptions, GetWorkflowResponse, GetWorkflowRunsResponse, GetWorkflowRunsParams, WorkflowRunResult, WorkflowWatchResult, GetWorkflowRunByIdResponse, GetWorkflowRunExecutionResultResponse, StreamVNextChunkType } from '../types.js';
|
|
3
4
|
import { BaseResource } from './base.js';
|
|
4
5
|
export declare class Workflow extends BaseResource {
|
|
5
6
|
private workflowId;
|
|
@@ -14,27 +15,31 @@ export declare class Workflow extends BaseResource {
|
|
|
14
15
|
private streamProcessor;
|
|
15
16
|
/**
|
|
16
17
|
* Retrieves details about the workflow
|
|
18
|
+
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
17
19
|
* @returns Promise containing workflow details including steps and graphs
|
|
18
20
|
*/
|
|
19
|
-
details(): Promise<GetWorkflowResponse>;
|
|
21
|
+
details(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowResponse>;
|
|
20
22
|
/**
|
|
21
23
|
* Retrieves all runs for a workflow
|
|
22
24
|
* @param params - Parameters for filtering runs
|
|
25
|
+
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
23
26
|
* @returns Promise containing workflow runs array
|
|
24
27
|
*/
|
|
25
|
-
runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
|
|
28
|
+
runs(params?: GetWorkflowRunsParams, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunsResponse>;
|
|
26
29
|
/**
|
|
27
30
|
* Retrieves a specific workflow run by its ID
|
|
28
31
|
* @param runId - The ID of the workflow run to retrieve
|
|
32
|
+
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
29
33
|
* @returns Promise containing the workflow run details
|
|
30
34
|
*/
|
|
31
|
-
runById(runId: string): Promise<GetWorkflowRunByIdResponse>;
|
|
35
|
+
runById(runId: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunByIdResponse>;
|
|
32
36
|
/**
|
|
33
37
|
* Retrieves the execution result for a specific workflow run by its ID
|
|
34
38
|
* @param runId - The ID of the workflow run to retrieve the execution result for
|
|
39
|
+
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
35
40
|
* @returns Promise containing the workflow run execution result
|
|
36
41
|
*/
|
|
37
|
-
runExecutionResult(runId: string): Promise<GetWorkflowRunExecutionResultResponse>;
|
|
42
|
+
runExecutionResult(runId: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunExecutionResultResponse>;
|
|
38
43
|
/**
|
|
39
44
|
* Cancels a specific workflow run by its ID
|
|
40
45
|
* @param runId - The ID of the workflow run to cancel
|
|
@@ -56,24 +61,86 @@ export declare class Workflow extends BaseResource {
|
|
|
56
61
|
message: string;
|
|
57
62
|
}>;
|
|
58
63
|
/**
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
61
|
-
* @returns Promise containing the runId of the created run
|
|
64
|
+
* @deprecated Use createRunAsync() instead.
|
|
65
|
+
* @throws {Error} Always throws an error directing users to use createRunAsync()
|
|
62
66
|
*/
|
|
63
|
-
createRun(
|
|
67
|
+
createRun(_params?: {
|
|
64
68
|
runId?: string;
|
|
65
69
|
}): Promise<{
|
|
66
70
|
runId: string;
|
|
71
|
+
start: (params: {
|
|
72
|
+
inputData: Record<string, any>;
|
|
73
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
74
|
+
}) => Promise<{
|
|
75
|
+
message: string;
|
|
76
|
+
}>;
|
|
77
|
+
watch: (onRecord: (record: WorkflowWatchResult) => void) => Promise<void>;
|
|
78
|
+
resume: (params: {
|
|
79
|
+
step: string | string[];
|
|
80
|
+
resumeData?: Record<string, any>;
|
|
81
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
82
|
+
}) => Promise<{
|
|
83
|
+
message: string;
|
|
84
|
+
}>;
|
|
85
|
+
stream: (params: {
|
|
86
|
+
inputData: Record<string, any>;
|
|
87
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
88
|
+
}) => Promise<ReadableStream>;
|
|
89
|
+
startAsync: (params: {
|
|
90
|
+
inputData: Record<string, any>;
|
|
91
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
92
|
+
}) => Promise<WorkflowRunResult>;
|
|
93
|
+
resumeAsync: (params: {
|
|
94
|
+
step: string | string[];
|
|
95
|
+
resumeData?: Record<string, any>;
|
|
96
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
97
|
+
}) => Promise<WorkflowRunResult>;
|
|
67
98
|
}>;
|
|
68
99
|
/**
|
|
69
|
-
* Creates a new workflow run
|
|
100
|
+
* Creates a new workflow run
|
|
70
101
|
* @param params - Optional object containing the optional runId
|
|
71
|
-
* @returns Promise containing the runId of the created run
|
|
102
|
+
* @returns Promise containing the runId of the created run with methods to control execution
|
|
72
103
|
*/
|
|
73
104
|
createRunAsync(params?: {
|
|
74
105
|
runId?: string;
|
|
75
106
|
}): Promise<{
|
|
76
107
|
runId: string;
|
|
108
|
+
start: (params: {
|
|
109
|
+
inputData: Record<string, any>;
|
|
110
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
111
|
+
tracingOptions?: TracingOptions;
|
|
112
|
+
}) => Promise<{
|
|
113
|
+
message: string;
|
|
114
|
+
}>;
|
|
115
|
+
watch: (onRecord: (record: WorkflowWatchResult) => void) => Promise<void>;
|
|
116
|
+
resume: (params: {
|
|
117
|
+
step: string | string[];
|
|
118
|
+
resumeData?: Record<string, any>;
|
|
119
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
120
|
+
tracingOptions?: TracingOptions;
|
|
121
|
+
}) => Promise<{
|
|
122
|
+
message: string;
|
|
123
|
+
}>;
|
|
124
|
+
stream: (params: {
|
|
125
|
+
inputData: Record<string, any>;
|
|
126
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
127
|
+
}) => Promise<ReadableStream>;
|
|
128
|
+
startAsync: (params: {
|
|
129
|
+
inputData: Record<string, any>;
|
|
130
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
131
|
+
tracingOptions?: TracingOptions;
|
|
132
|
+
}) => Promise<WorkflowRunResult>;
|
|
133
|
+
resumeAsync: (params: {
|
|
134
|
+
step: string | string[];
|
|
135
|
+
resumeData?: Record<string, any>;
|
|
136
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
137
|
+
tracingOptions?: TracingOptions;
|
|
138
|
+
}) => Promise<WorkflowRunResult>;
|
|
139
|
+
resumeStreamVNext: (params: {
|
|
140
|
+
step: string | string[];
|
|
141
|
+
resumeData?: Record<string, any>;
|
|
142
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
143
|
+
}) => Promise<ReadableStream>;
|
|
77
144
|
}>;
|
|
78
145
|
/**
|
|
79
146
|
* Starts a workflow run synchronously without waiting for the workflow to complete
|
|
@@ -84,6 +151,7 @@ export declare class Workflow extends BaseResource {
|
|
|
84
151
|
runId: string;
|
|
85
152
|
inputData: Record<string, any>;
|
|
86
153
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
154
|
+
tracingOptions?: TracingOptions;
|
|
87
155
|
}): Promise<{
|
|
88
156
|
message: string;
|
|
89
157
|
}>;
|
|
@@ -92,11 +160,12 @@ export declare class Workflow extends BaseResource {
|
|
|
92
160
|
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
93
161
|
* @returns Promise containing success message
|
|
94
162
|
*/
|
|
95
|
-
resume({ step, runId, resumeData, ...rest }: {
|
|
163
|
+
resume({ step, runId, resumeData, tracingOptions, ...rest }: {
|
|
96
164
|
step: string | string[];
|
|
97
165
|
runId: string;
|
|
98
166
|
resumeData?: Record<string, any>;
|
|
99
167
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
168
|
+
tracingOptions?: TracingOptions;
|
|
100
169
|
}): Promise<{
|
|
101
170
|
message: string;
|
|
102
171
|
}>;
|
|
@@ -109,6 +178,7 @@ export declare class Workflow extends BaseResource {
|
|
|
109
178
|
runId?: string;
|
|
110
179
|
inputData: Record<string, any>;
|
|
111
180
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
181
|
+
tracingOptions?: TracingOptions;
|
|
112
182
|
}): Promise<WorkflowRunResult>;
|
|
113
183
|
/**
|
|
114
184
|
* Starts a workflow run and returns a stream
|
|
@@ -118,11 +188,43 @@ export declare class Workflow extends BaseResource {
|
|
|
118
188
|
stream(params: {
|
|
119
189
|
runId?: string;
|
|
120
190
|
inputData: Record<string, any>;
|
|
121
|
-
runtimeContext?: RuntimeContext
|
|
191
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
192
|
+
tracingOptions?: TracingOptions;
|
|
193
|
+
}): Promise<import("stream/web").ReadableStream<{
|
|
194
|
+
type: string;
|
|
195
|
+
payload: any;
|
|
196
|
+
}>>;
|
|
197
|
+
/**
|
|
198
|
+
* Observes workflow stream for a workflow run
|
|
199
|
+
* @param params - Object containing the runId
|
|
200
|
+
* @returns Promise containing the workflow execution results
|
|
201
|
+
*/
|
|
202
|
+
observeStream(params: {
|
|
203
|
+
runId: string;
|
|
122
204
|
}): Promise<import("stream/web").ReadableStream<{
|
|
123
205
|
type: string;
|
|
124
206
|
payload: any;
|
|
125
207
|
}>>;
|
|
208
|
+
/**
|
|
209
|
+
* Starts a workflow run and returns a stream
|
|
210
|
+
* @param params - Object containing the optional runId, inputData and runtimeContext
|
|
211
|
+
* @returns Promise containing the workflow execution results
|
|
212
|
+
*/
|
|
213
|
+
streamVNext(params: {
|
|
214
|
+
runId?: string;
|
|
215
|
+
inputData?: Record<string, any>;
|
|
216
|
+
runtimeContext?: RuntimeContext;
|
|
217
|
+
closeOnSuspend?: boolean;
|
|
218
|
+
tracingOptions?: TracingOptions;
|
|
219
|
+
}): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
|
|
220
|
+
/**
|
|
221
|
+
* Observes workflow vNext stream for a workflow run
|
|
222
|
+
* @param params - Object containing the runId
|
|
223
|
+
* @returns Promise containing the workflow execution results
|
|
224
|
+
*/
|
|
225
|
+
observeStreamVNext(params: {
|
|
226
|
+
runId: string;
|
|
227
|
+
}): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
|
|
126
228
|
/**
|
|
127
229
|
* Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
|
|
128
230
|
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
@@ -133,7 +235,20 @@ export declare class Workflow extends BaseResource {
|
|
|
133
235
|
step: string | string[];
|
|
134
236
|
resumeData?: Record<string, any>;
|
|
135
237
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
238
|
+
tracingOptions?: TracingOptions;
|
|
136
239
|
}): Promise<WorkflowRunResult>;
|
|
240
|
+
/**
|
|
241
|
+
* Resumes a suspended workflow step that uses streamVNext asynchronously and returns a promise that resolves when the workflow is complete
|
|
242
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
243
|
+
* @returns Promise containing the workflow resume results
|
|
244
|
+
*/
|
|
245
|
+
resumeStreamVNext(params: {
|
|
246
|
+
runId: string;
|
|
247
|
+
step: string | string[];
|
|
248
|
+
resumeData?: Record<string, any>;
|
|
249
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
250
|
+
tracingOptions?: TracingOptions;
|
|
251
|
+
}): Promise<ReadableStream>;
|
|
137
252
|
/**
|
|
138
253
|
* Watches workflow transitions in real-time
|
|
139
254
|
* @param runId - Optional run ID to filter the watch stream
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/resources/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,E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C,MAAM,EAAE,GAAG,CAAC,CAAC;QACjC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACtD,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,GAAG,OAAO,CAAC,cAAc,CAAC;IA8D3B;;;;OAIG;IACG,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI;IAsB1F;;;;;;OAMG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,cAAc;CAgBvF"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ToolExecutionOptions } from 'ai';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
export interface ClientToolExecutionContext<TSchemaIn extends z.ZodSchema | undefined = undefined> {
|
|
4
|
+
context: TSchemaIn extends z.ZodSchema ? z.infer<TSchemaIn> : unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface ClientToolAction<TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined> {
|
|
7
|
+
id: string;
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema?: TSchemaIn;
|
|
10
|
+
outputSchema?: TSchemaOut;
|
|
11
|
+
execute?: (context: ClientToolExecutionContext<TSchemaIn>, options?: ToolExecutionOptions) => Promise<TSchemaOut extends z.ZodSchema ? z.infer<TSchemaOut> : unknown>;
|
|
12
|
+
}
|
|
13
|
+
export declare class ClientTool<TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined> implements ClientToolAction<TSchemaIn, TSchemaOut> {
|
|
14
|
+
id: string;
|
|
15
|
+
description: string;
|
|
16
|
+
inputSchema?: TSchemaIn;
|
|
17
|
+
outputSchema?: TSchemaOut;
|
|
18
|
+
execute?: ClientToolAction<TSchemaIn, TSchemaOut>['execute'];
|
|
19
|
+
constructor(opts: ClientToolAction<TSchemaIn, TSchemaOut>);
|
|
20
|
+
}
|
|
21
|
+
export declare function createTool<TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined>(opts: ClientToolAction<TSchemaIn, TSchemaOut>): ClientTool<TSchemaIn, TSchemaOut>;
|
|
22
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,MAAM,WAAW,0BAA0B,CAAC,SAAS,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS;IAC/F,OAAO,EAAE,SAAS,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;CACvE;AAGD,MAAM,WAAW,gBAAgB,CAC/B,SAAS,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,EACrD,UAAU,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS;IAEtD,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,OAAO,CAAC,EAAE,CACR,OAAO,EAAE,0BAA0B,CAAC,SAAS,CAAC,EAC9C,OAAO,CAAC,EAAE,oBAAoB,KAC3B,OAAO,CAAC,UAAU,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC;CAC9E;AAGD,qBAAa,UAAU,CACrB,SAAS,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,EACrD,UAAU,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,CACtD,YAAW,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC;IAElD,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;gBAEjD,IAAI,EAAE,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC;CAO1D;AAGD,wBAAgB,UAAU,CACxB,SAAS,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,EACrD,UAAU,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,EACtD,IAAI,EAAE,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAElF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { AgentExecutionOptions, AgentGenerateOptions, AgentStreamOptions, ToolsInput, UIMessageWithMetadata } from '@mastra/core/agent';
|
|
1
|
+
import type { AgentExecutionOptions, MultiPrimitiveExecutionOptions, AgentGenerateOptions, AgentStreamOptions, SerializableStructuredOutputOptions, ToolsInput, UIMessageWithMetadata, AgentInstructions } from '@mastra/core/agent';
|
|
2
2
|
import type { MessageListInput } from '@mastra/core/agent/message-list';
|
|
3
3
|
import type { CoreMessage } from '@mastra/core/llm';
|
|
4
4
|
import type { BaseLogMessage, LogLevel } from '@mastra/core/logger';
|
|
5
5
|
import type { MCPToolType, ServerInfo } from '@mastra/core/mcp';
|
|
6
|
-
import type { AiMessageType, MastraMessageV1, MastraMessageV2, StorageThreadType } from '@mastra/core/memory';
|
|
6
|
+
import type { AiMessageType, MastraMessageV1, MastraMessageV2, MemoryConfig, StorageThreadType } from '@mastra/core/memory';
|
|
7
7
|
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
8
8
|
import type { MastraScorerEntry, ScoreRowData } from '@mastra/core/scores';
|
|
9
|
-
import type { AITraceRecord, AISpanRecord,
|
|
9
|
+
import type { AITraceRecord, AISpanRecord, StorageGetMessagesArg, PaginationInfo, WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
10
10
|
import type { OutputSchema } from '@mastra/core/stream';
|
|
11
11
|
import type { QueryResult } from '@mastra/core/vector';
|
|
12
12
|
import type { Workflow, WatchEvent, WorkflowResult } from '@mastra/core/workflows';
|
|
13
|
-
import type {
|
|
13
|
+
import type { UIMessage } from 'ai';
|
|
14
14
|
import type { JSONSchema7 } from 'json-schema';
|
|
15
15
|
import type { ZodSchema } from 'zod';
|
|
16
16
|
export interface ClientOptions {
|
|
@@ -42,41 +42,70 @@ type WithoutMethods<T> = {
|
|
|
42
42
|
(): any;
|
|
43
43
|
} ? never : T[K] extends undefined | ((...args: any[]) => any) ? never : K]: T[K];
|
|
44
44
|
};
|
|
45
|
+
export type NetworkStreamParams = {
|
|
46
|
+
messages: MessageListInput;
|
|
47
|
+
} & MultiPrimitiveExecutionOptions;
|
|
45
48
|
export interface GetAgentResponse {
|
|
46
49
|
name: string;
|
|
47
|
-
instructions:
|
|
50
|
+
instructions: AgentInstructions;
|
|
48
51
|
tools: Record<string, GetToolResponse>;
|
|
49
52
|
workflows: Record<string, GetWorkflowResponse>;
|
|
53
|
+
agents: Record<string, {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
}>;
|
|
50
57
|
provider: string;
|
|
51
58
|
modelId: string;
|
|
52
59
|
modelVersion: string;
|
|
53
60
|
defaultGenerateOptions: WithoutMethods<AgentGenerateOptions>;
|
|
54
61
|
defaultStreamOptions: WithoutMethods<AgentStreamOptions>;
|
|
62
|
+
modelList: Array<{
|
|
63
|
+
id: string;
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
maxRetries: number;
|
|
66
|
+
model: {
|
|
67
|
+
modelId: string;
|
|
68
|
+
provider: string;
|
|
69
|
+
modelVersion: string;
|
|
70
|
+
};
|
|
71
|
+
}> | undefined;
|
|
55
72
|
}
|
|
56
|
-
export type
|
|
73
|
+
export type GenerateLegacyParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
57
74
|
messages: string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[];
|
|
58
75
|
output?: T;
|
|
59
76
|
experimental_output?: T;
|
|
60
77
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
61
78
|
clientTools?: ToolsInput;
|
|
62
79
|
} & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
|
|
63
|
-
export type
|
|
80
|
+
export type StreamLegacyParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
64
81
|
messages: string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[];
|
|
65
82
|
output?: T;
|
|
66
83
|
experimental_output?: T;
|
|
67
84
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
68
85
|
clientTools?: ToolsInput;
|
|
69
86
|
} & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
|
|
70
|
-
export type
|
|
87
|
+
export type StreamParams<OUTPUT extends OutputSchema = undefined> = {
|
|
71
88
|
messages: MessageListInput;
|
|
72
|
-
|
|
89
|
+
structuredOutput?: SerializableStructuredOutputOptions<OUTPUT>;
|
|
73
90
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
74
91
|
clientTools?: ToolsInput;
|
|
75
|
-
} & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT>, '
|
|
92
|
+
} & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT>, 'runtimeContext' | 'clientTools' | 'options' | 'abortSignal' | 'structuredOutput'>>;
|
|
76
93
|
export type UpdateModelParams = {
|
|
77
94
|
modelId: string;
|
|
78
95
|
provider: 'openai' | 'anthropic' | 'groq' | 'xai' | 'google';
|
|
79
96
|
};
|
|
97
|
+
export type UpdateModelInModelListParams = {
|
|
98
|
+
modelConfigId: string;
|
|
99
|
+
model?: {
|
|
100
|
+
modelId: string;
|
|
101
|
+
provider: 'openai' | 'anthropic' | 'groq' | 'xai' | 'google';
|
|
102
|
+
};
|
|
103
|
+
maxRetries?: number;
|
|
104
|
+
enabled?: boolean;
|
|
105
|
+
};
|
|
106
|
+
export type ReorderModelListParams = {
|
|
107
|
+
reorderedModelIds: string[];
|
|
108
|
+
};
|
|
80
109
|
export interface GetEvalsByAgentIdResponse extends GetAgentResponse {
|
|
81
110
|
evals: any[];
|
|
82
111
|
instructions: string;
|
|
@@ -89,14 +118,6 @@ export interface GetToolResponse {
|
|
|
89
118
|
inputSchema: string;
|
|
90
119
|
outputSchema: string;
|
|
91
120
|
}
|
|
92
|
-
export interface GetLegacyWorkflowResponse {
|
|
93
|
-
name: string;
|
|
94
|
-
triggerSchema: string;
|
|
95
|
-
steps: Record<string, StepAction<any, any, any, any>>;
|
|
96
|
-
stepGraph: StepGraph;
|
|
97
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
98
|
-
workflowId?: string;
|
|
99
|
-
}
|
|
100
121
|
export interface GetWorkflowRunsParams {
|
|
101
122
|
fromDate?: Date;
|
|
102
123
|
toDate?: Date;
|
|
@@ -104,20 +125,9 @@ export interface GetWorkflowRunsParams {
|
|
|
104
125
|
offset?: number;
|
|
105
126
|
resourceId?: string;
|
|
106
127
|
}
|
|
107
|
-
export type GetLegacyWorkflowRunsResponse = LegacyWorkflowRuns;
|
|
108
128
|
export type GetWorkflowRunsResponse = WorkflowRuns;
|
|
109
129
|
export type GetWorkflowRunByIdResponse = WorkflowRun;
|
|
110
130
|
export type GetWorkflowRunExecutionResultResponse = WatchEvent['payload']['workflowState'];
|
|
111
|
-
export type LegacyWorkflowRunResult = {
|
|
112
|
-
activePaths: Record<string, {
|
|
113
|
-
status: string;
|
|
114
|
-
suspendPayload?: any;
|
|
115
|
-
stepPath: string[];
|
|
116
|
-
}>;
|
|
117
|
-
results: CoreLegacyWorkflowRunResult<any, any, any>['results'];
|
|
118
|
-
timestamp: number;
|
|
119
|
-
runId: string;
|
|
120
|
-
};
|
|
121
131
|
export interface GetWorkflowResponse {
|
|
122
132
|
name: string;
|
|
123
133
|
description?: string;
|
|
@@ -149,7 +159,7 @@ export interface GetWorkflowResponse {
|
|
|
149
159
|
export type WorkflowWatchResult = WatchEvent & {
|
|
150
160
|
runId: string;
|
|
151
161
|
};
|
|
152
|
-
export type WorkflowRunResult = WorkflowResult<any, any>;
|
|
162
|
+
export type WorkflowRunResult = WorkflowResult<any, any, any, any>;
|
|
153
163
|
export interface UpsertVectorParams {
|
|
154
164
|
indexName: string;
|
|
155
165
|
vectors: number[][];
|
|
@@ -204,6 +214,12 @@ export interface GetMemoryThreadParams {
|
|
|
204
214
|
resourceId: string;
|
|
205
215
|
agentId: string;
|
|
206
216
|
}
|
|
217
|
+
export interface GetMemoryConfigParams {
|
|
218
|
+
agentId: string;
|
|
219
|
+
}
|
|
220
|
+
export type GetMemoryConfigResponse = {
|
|
221
|
+
config: MemoryConfig;
|
|
222
|
+
};
|
|
207
223
|
export interface GetNetworkMemoryThreadParams {
|
|
208
224
|
resourceId: string;
|
|
209
225
|
networkId: string;
|
|
@@ -223,7 +239,8 @@ export interface GetMemoryThreadMessagesParams {
|
|
|
223
239
|
export type GetMemoryThreadMessagesPaginatedParams = Omit<StorageGetMessagesArg, 'threadConfig' | 'threadId'>;
|
|
224
240
|
export interface GetMemoryThreadMessagesResponse {
|
|
225
241
|
messages: CoreMessage[];
|
|
226
|
-
|
|
242
|
+
legacyMessages: AiMessageType[];
|
|
243
|
+
uiMessages: UIMessage[];
|
|
227
244
|
}
|
|
228
245
|
export type GetMemoryThreadMessagesPaginatedResponse = PaginationInfo & {
|
|
229
246
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
@@ -255,70 +272,6 @@ export type GetLogsResponse = {
|
|
|
255
272
|
hasMore: boolean;
|
|
256
273
|
};
|
|
257
274
|
export type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
|
|
258
|
-
type SpanStatus = {
|
|
259
|
-
code: number;
|
|
260
|
-
};
|
|
261
|
-
type SpanOther = {
|
|
262
|
-
droppedAttributesCount: number;
|
|
263
|
-
droppedEventsCount: number;
|
|
264
|
-
droppedLinksCount: number;
|
|
265
|
-
};
|
|
266
|
-
type SpanEventAttributes = {
|
|
267
|
-
key: string;
|
|
268
|
-
value: {
|
|
269
|
-
[key: string]: string | number | boolean | null;
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
type SpanEvent = {
|
|
273
|
-
attributes: SpanEventAttributes[];
|
|
274
|
-
name: string;
|
|
275
|
-
timeUnixNano: string;
|
|
276
|
-
droppedAttributesCount: number;
|
|
277
|
-
};
|
|
278
|
-
type Span = {
|
|
279
|
-
id: string;
|
|
280
|
-
parentSpanId: string | null;
|
|
281
|
-
traceId: string;
|
|
282
|
-
name: string;
|
|
283
|
-
scope: string;
|
|
284
|
-
kind: number;
|
|
285
|
-
status: SpanStatus;
|
|
286
|
-
events: SpanEvent[];
|
|
287
|
-
links: any[];
|
|
288
|
-
attributes: Record<string, string | number | boolean | null>;
|
|
289
|
-
startTime: number;
|
|
290
|
-
endTime: number;
|
|
291
|
-
duration: number;
|
|
292
|
-
other: SpanOther;
|
|
293
|
-
createdAt: string;
|
|
294
|
-
};
|
|
295
|
-
export interface GetTelemetryResponse {
|
|
296
|
-
traces: Span[];
|
|
297
|
-
}
|
|
298
|
-
export interface GetTelemetryParams {
|
|
299
|
-
name?: string;
|
|
300
|
-
scope?: string;
|
|
301
|
-
page?: number;
|
|
302
|
-
perPage?: number;
|
|
303
|
-
attribute?: Record<string, string>;
|
|
304
|
-
fromDate?: Date;
|
|
305
|
-
toDate?: Date;
|
|
306
|
-
}
|
|
307
|
-
export interface GetNetworkResponse {
|
|
308
|
-
id: string;
|
|
309
|
-
name: string;
|
|
310
|
-
instructions: string;
|
|
311
|
-
agents: Array<{
|
|
312
|
-
name: string;
|
|
313
|
-
provider: string;
|
|
314
|
-
modelId: string;
|
|
315
|
-
}>;
|
|
316
|
-
routingModel: {
|
|
317
|
-
provider: string;
|
|
318
|
-
modelId: string;
|
|
319
|
-
};
|
|
320
|
-
state?: Record<string, any>;
|
|
321
|
-
}
|
|
322
275
|
export interface GetVNextNetworkResponse {
|
|
323
276
|
id: string;
|
|
324
277
|
name: string;
|
|
@@ -377,7 +330,7 @@ export interface LoopVNextNetworkResponse {
|
|
|
377
330
|
isComplete?: boolean | undefined;
|
|
378
331
|
completionReason?: string | undefined;
|
|
379
332
|
};
|
|
380
|
-
steps: WorkflowResult<any, any>['steps'];
|
|
333
|
+
steps: WorkflowResult<any, any, any, any>['steps'];
|
|
381
334
|
}
|
|
382
335
|
export interface McpServerListResponse {
|
|
383
336
|
servers: ServerInfo[];
|
|
@@ -397,6 +350,8 @@ export interface McpServerToolListResponse {
|
|
|
397
350
|
export type ClientScoreRowData = Omit<ScoreRowData, 'createdAt' | 'updatedAt'> & {
|
|
398
351
|
createdAt: string;
|
|
399
352
|
updatedAt: string;
|
|
353
|
+
} & {
|
|
354
|
+
spanId?: string;
|
|
400
355
|
};
|
|
401
356
|
export interface GetScoresByRunIdParams {
|
|
402
357
|
runId: string;
|
|
@@ -416,6 +371,12 @@ export interface GetScoresByEntityIdParams {
|
|
|
416
371
|
page?: number;
|
|
417
372
|
perPage?: number;
|
|
418
373
|
}
|
|
374
|
+
export interface GetScoresBySpanParams {
|
|
375
|
+
traceId: string;
|
|
376
|
+
spanId: string;
|
|
377
|
+
page?: number;
|
|
378
|
+
perPage?: number;
|
|
379
|
+
}
|
|
419
380
|
export interface SaveScoreParams {
|
|
420
381
|
score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>;
|
|
421
382
|
}
|
|
@@ -433,7 +394,9 @@ export interface SaveScoreResponse {
|
|
|
433
394
|
}
|
|
434
395
|
export type GetScorerResponse = MastraScorerEntry & {
|
|
435
396
|
agentIds: string[];
|
|
397
|
+
agentNames: string[];
|
|
436
398
|
workflowIds: string[];
|
|
399
|
+
isRegistered: boolean;
|
|
437
400
|
};
|
|
438
401
|
export interface GetScorersResponse {
|
|
439
402
|
scorers: Array<GetScorerResponse>;
|
|
@@ -457,5 +420,51 @@ export interface GetAITracesResponse {
|
|
|
457
420
|
spans: AISpanRecord[];
|
|
458
421
|
pagination: PaginationInfo;
|
|
459
422
|
}
|
|
423
|
+
export interface StreamVNextChunkType {
|
|
424
|
+
type: string;
|
|
425
|
+
payload: any;
|
|
426
|
+
runId: string;
|
|
427
|
+
from: 'AGENT' | 'WORKFLOW';
|
|
428
|
+
}
|
|
429
|
+
export interface MemorySearchResponse {
|
|
430
|
+
results: MemorySearchResult[];
|
|
431
|
+
count: number;
|
|
432
|
+
query: string;
|
|
433
|
+
searchType?: string;
|
|
434
|
+
searchScope?: 'thread' | 'resource';
|
|
435
|
+
}
|
|
436
|
+
export interface MemorySearchResult {
|
|
437
|
+
id: string;
|
|
438
|
+
role: string;
|
|
439
|
+
content: string;
|
|
440
|
+
createdAt: string;
|
|
441
|
+
threadId?: string;
|
|
442
|
+
threadTitle?: string;
|
|
443
|
+
context?: {
|
|
444
|
+
before?: Array<{
|
|
445
|
+
id: string;
|
|
446
|
+
role: string;
|
|
447
|
+
content: string;
|
|
448
|
+
createdAt: string;
|
|
449
|
+
}>;
|
|
450
|
+
after?: Array<{
|
|
451
|
+
id: string;
|
|
452
|
+
role: string;
|
|
453
|
+
content: string;
|
|
454
|
+
createdAt: string;
|
|
455
|
+
}>;
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
export interface GetAgentsModelProvidersResponse {
|
|
459
|
+
providers: Provider[];
|
|
460
|
+
}
|
|
461
|
+
export interface Provider {
|
|
462
|
+
id: string;
|
|
463
|
+
name: string;
|
|
464
|
+
envVar: string;
|
|
465
|
+
connected: boolean;
|
|
466
|
+
docUrl?: string;
|
|
467
|
+
models: string[];
|
|
468
|
+
}
|
|
460
469
|
export {};
|
|
461
470
|
//# sourceMappingURL=types.d.ts.map
|