@mastra/client-js 0.0.0-add-save-score-validation-on-stores-20250911031242 → 0.0.0-add-crumb-action-20251028111500
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 +527 -3
- package/README.md +6 -10
- package/dist/client.d.ts +45 -45
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +645 -646
- 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 +639 -642
- 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 +86 -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 +119 -19
- 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 +98 -97
- 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.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,7 +188,19 @@ 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;
|
|
@@ -130,14 +212,19 @@ export declare class Workflow extends BaseResource {
|
|
|
130
212
|
*/
|
|
131
213
|
streamVNext(params: {
|
|
132
214
|
runId?: string;
|
|
133
|
-
inputData
|
|
215
|
+
inputData?: Record<string, any>;
|
|
134
216
|
runtimeContext?: RuntimeContext;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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: {
|
|
138
226
|
runId: string;
|
|
139
|
-
|
|
140
|
-
}>>;
|
|
227
|
+
}): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
|
|
141
228
|
/**
|
|
142
229
|
* Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
|
|
143
230
|
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
@@ -148,7 +235,20 @@ export declare class Workflow extends BaseResource {
|
|
|
148
235
|
step: string | string[];
|
|
149
236
|
resumeData?: Record<string, any>;
|
|
150
237
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
238
|
+
tracingOptions?: TracingOptions;
|
|
151
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>;
|
|
152
252
|
/**
|
|
153
253
|
* Watches workflow transitions in real-time
|
|
154
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,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK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c,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, MultiPrimitiveExecutionOptions, AgentGenerateOptions, AgentStreamOptions,
|
|
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 {
|
|
@@ -47,7 +47,7 @@ export type NetworkStreamParams = {
|
|
|
47
47
|
} & MultiPrimitiveExecutionOptions;
|
|
48
48
|
export interface GetAgentResponse {
|
|
49
49
|
name: string;
|
|
50
|
-
instructions:
|
|
50
|
+
instructions: AgentInstructions;
|
|
51
51
|
tools: Record<string, GetToolResponse>;
|
|
52
52
|
workflows: Record<string, GetWorkflowResponse>;
|
|
53
53
|
agents: Record<string, {
|
|
@@ -59,32 +59,53 @@ export interface GetAgentResponse {
|
|
|
59
59
|
modelVersion: string;
|
|
60
60
|
defaultGenerateOptions: WithoutMethods<AgentGenerateOptions>;
|
|
61
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;
|
|
62
72
|
}
|
|
63
|
-
export type
|
|
73
|
+
export type GenerateLegacyParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
64
74
|
messages: string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[];
|
|
65
75
|
output?: T;
|
|
66
76
|
experimental_output?: T;
|
|
67
77
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
68
78
|
clientTools?: ToolsInput;
|
|
69
79
|
} & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
|
|
70
|
-
export type
|
|
80
|
+
export type StreamLegacyParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
71
81
|
messages: string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[];
|
|
72
82
|
output?: T;
|
|
73
83
|
experimental_output?: T;
|
|
74
84
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
75
85
|
clientTools?: ToolsInput;
|
|
76
86
|
} & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
|
|
77
|
-
export type
|
|
87
|
+
export type StreamParams<OUTPUT extends OutputSchema = undefined> = {
|
|
78
88
|
messages: MessageListInput;
|
|
79
|
-
|
|
89
|
+
structuredOutput?: SerializableStructuredOutputOptions<OUTPUT>;
|
|
80
90
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
81
91
|
clientTools?: ToolsInput;
|
|
82
|
-
|
|
83
|
-
} & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT, STRUCTURED_OUTPUT>, 'output' | 'runtimeContext' | 'clientTools' | 'options' | 'structuredOutput'>>;
|
|
92
|
+
} & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT>, 'runtimeContext' | 'clientTools' | 'options' | 'abortSignal' | 'structuredOutput'>>;
|
|
84
93
|
export type UpdateModelParams = {
|
|
85
94
|
modelId: string;
|
|
86
95
|
provider: 'openai' | 'anthropic' | 'groq' | 'xai' | 'google';
|
|
87
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
|
+
};
|
|
88
109
|
export interface GetEvalsByAgentIdResponse extends GetAgentResponse {
|
|
89
110
|
evals: any[];
|
|
90
111
|
instructions: string;
|
|
@@ -97,14 +118,6 @@ export interface GetToolResponse {
|
|
|
97
118
|
inputSchema: string;
|
|
98
119
|
outputSchema: string;
|
|
99
120
|
}
|
|
100
|
-
export interface GetLegacyWorkflowResponse {
|
|
101
|
-
name: string;
|
|
102
|
-
triggerSchema: string;
|
|
103
|
-
steps: Record<string, StepAction<any, any, any, any>>;
|
|
104
|
-
stepGraph: StepGraph;
|
|
105
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
106
|
-
workflowId?: string;
|
|
107
|
-
}
|
|
108
121
|
export interface GetWorkflowRunsParams {
|
|
109
122
|
fromDate?: Date;
|
|
110
123
|
toDate?: Date;
|
|
@@ -112,20 +125,9 @@ export interface GetWorkflowRunsParams {
|
|
|
112
125
|
offset?: number;
|
|
113
126
|
resourceId?: string;
|
|
114
127
|
}
|
|
115
|
-
export type GetLegacyWorkflowRunsResponse = LegacyWorkflowRuns;
|
|
116
128
|
export type GetWorkflowRunsResponse = WorkflowRuns;
|
|
117
129
|
export type GetWorkflowRunByIdResponse = WorkflowRun;
|
|
118
130
|
export type GetWorkflowRunExecutionResultResponse = WatchEvent['payload']['workflowState'];
|
|
119
|
-
export type LegacyWorkflowRunResult = {
|
|
120
|
-
activePaths: Record<string, {
|
|
121
|
-
status: string;
|
|
122
|
-
suspendPayload?: any;
|
|
123
|
-
stepPath: string[];
|
|
124
|
-
}>;
|
|
125
|
-
results: CoreLegacyWorkflowRunResult<any, any, any>['results'];
|
|
126
|
-
timestamp: number;
|
|
127
|
-
runId: string;
|
|
128
|
-
};
|
|
129
131
|
export interface GetWorkflowResponse {
|
|
130
132
|
name: string;
|
|
131
133
|
description?: string;
|
|
@@ -157,7 +159,7 @@ export interface GetWorkflowResponse {
|
|
|
157
159
|
export type WorkflowWatchResult = WatchEvent & {
|
|
158
160
|
runId: string;
|
|
159
161
|
};
|
|
160
|
-
export type WorkflowRunResult = WorkflowResult<any, any>;
|
|
162
|
+
export type WorkflowRunResult = WorkflowResult<any, any, any, any>;
|
|
161
163
|
export interface UpsertVectorParams {
|
|
162
164
|
indexName: string;
|
|
163
165
|
vectors: number[][];
|
|
@@ -212,6 +214,12 @@ export interface GetMemoryThreadParams {
|
|
|
212
214
|
resourceId: string;
|
|
213
215
|
agentId: string;
|
|
214
216
|
}
|
|
217
|
+
export interface GetMemoryConfigParams {
|
|
218
|
+
agentId: string;
|
|
219
|
+
}
|
|
220
|
+
export type GetMemoryConfigResponse = {
|
|
221
|
+
config: MemoryConfig;
|
|
222
|
+
};
|
|
215
223
|
export interface GetNetworkMemoryThreadParams {
|
|
216
224
|
resourceId: string;
|
|
217
225
|
networkId: string;
|
|
@@ -231,7 +239,8 @@ export interface GetMemoryThreadMessagesParams {
|
|
|
231
239
|
export type GetMemoryThreadMessagesPaginatedParams = Omit<StorageGetMessagesArg, 'threadConfig' | 'threadId'>;
|
|
232
240
|
export interface GetMemoryThreadMessagesResponse {
|
|
233
241
|
messages: CoreMessage[];
|
|
234
|
-
|
|
242
|
+
legacyMessages: AiMessageType[];
|
|
243
|
+
uiMessages: UIMessage[];
|
|
235
244
|
}
|
|
236
245
|
export type GetMemoryThreadMessagesPaginatedResponse = PaginationInfo & {
|
|
237
246
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
@@ -263,70 +272,6 @@ export type GetLogsResponse = {
|
|
|
263
272
|
hasMore: boolean;
|
|
264
273
|
};
|
|
265
274
|
export type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
|
|
266
|
-
type SpanStatus = {
|
|
267
|
-
code: number;
|
|
268
|
-
};
|
|
269
|
-
type SpanOther = {
|
|
270
|
-
droppedAttributesCount: number;
|
|
271
|
-
droppedEventsCount: number;
|
|
272
|
-
droppedLinksCount: number;
|
|
273
|
-
};
|
|
274
|
-
type SpanEventAttributes = {
|
|
275
|
-
key: string;
|
|
276
|
-
value: {
|
|
277
|
-
[key: string]: string | number | boolean | null;
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
type SpanEvent = {
|
|
281
|
-
attributes: SpanEventAttributes[];
|
|
282
|
-
name: string;
|
|
283
|
-
timeUnixNano: string;
|
|
284
|
-
droppedAttributesCount: number;
|
|
285
|
-
};
|
|
286
|
-
type Span = {
|
|
287
|
-
id: string;
|
|
288
|
-
parentSpanId: string | null;
|
|
289
|
-
traceId: string;
|
|
290
|
-
name: string;
|
|
291
|
-
scope: string;
|
|
292
|
-
kind: number;
|
|
293
|
-
status: SpanStatus;
|
|
294
|
-
events: SpanEvent[];
|
|
295
|
-
links: any[];
|
|
296
|
-
attributes: Record<string, string | number | boolean | null>;
|
|
297
|
-
startTime: number;
|
|
298
|
-
endTime: number;
|
|
299
|
-
duration: number;
|
|
300
|
-
other: SpanOther;
|
|
301
|
-
createdAt: string;
|
|
302
|
-
};
|
|
303
|
-
export interface GetTelemetryResponse {
|
|
304
|
-
traces: Span[];
|
|
305
|
-
}
|
|
306
|
-
export interface GetTelemetryParams {
|
|
307
|
-
name?: string;
|
|
308
|
-
scope?: string;
|
|
309
|
-
page?: number;
|
|
310
|
-
perPage?: number;
|
|
311
|
-
attribute?: Record<string, string>;
|
|
312
|
-
fromDate?: Date;
|
|
313
|
-
toDate?: Date;
|
|
314
|
-
}
|
|
315
|
-
export interface GetNetworkResponse {
|
|
316
|
-
id: string;
|
|
317
|
-
name: string;
|
|
318
|
-
instructions: string;
|
|
319
|
-
agents: Array<{
|
|
320
|
-
name: string;
|
|
321
|
-
provider: string;
|
|
322
|
-
modelId: string;
|
|
323
|
-
}>;
|
|
324
|
-
routingModel: {
|
|
325
|
-
provider: string;
|
|
326
|
-
modelId: string;
|
|
327
|
-
};
|
|
328
|
-
state?: Record<string, any>;
|
|
329
|
-
}
|
|
330
275
|
export interface GetVNextNetworkResponse {
|
|
331
276
|
id: string;
|
|
332
277
|
name: string;
|
|
@@ -385,7 +330,7 @@ export interface LoopVNextNetworkResponse {
|
|
|
385
330
|
isComplete?: boolean | undefined;
|
|
386
331
|
completionReason?: string | undefined;
|
|
387
332
|
};
|
|
388
|
-
steps: WorkflowResult<any, any>['steps'];
|
|
333
|
+
steps: WorkflowResult<any, any, any, any>['steps'];
|
|
389
334
|
}
|
|
390
335
|
export interface McpServerListResponse {
|
|
391
336
|
servers: ServerInfo[];
|
|
@@ -405,6 +350,8 @@ export interface McpServerToolListResponse {
|
|
|
405
350
|
export type ClientScoreRowData = Omit<ScoreRowData, 'createdAt' | 'updatedAt'> & {
|
|
406
351
|
createdAt: string;
|
|
407
352
|
updatedAt: string;
|
|
353
|
+
} & {
|
|
354
|
+
spanId?: string;
|
|
408
355
|
};
|
|
409
356
|
export interface GetScoresByRunIdParams {
|
|
410
357
|
runId: string;
|
|
@@ -424,6 +371,12 @@ export interface GetScoresByEntityIdParams {
|
|
|
424
371
|
page?: number;
|
|
425
372
|
perPage?: number;
|
|
426
373
|
}
|
|
374
|
+
export interface GetScoresBySpanParams {
|
|
375
|
+
traceId: string;
|
|
376
|
+
spanId: string;
|
|
377
|
+
page?: number;
|
|
378
|
+
perPage?: number;
|
|
379
|
+
}
|
|
427
380
|
export interface SaveScoreParams {
|
|
428
381
|
score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>;
|
|
429
382
|
}
|
|
@@ -441,7 +394,9 @@ export interface SaveScoreResponse {
|
|
|
441
394
|
}
|
|
442
395
|
export type GetScorerResponse = MastraScorerEntry & {
|
|
443
396
|
agentIds: string[];
|
|
397
|
+
agentNames: string[];
|
|
444
398
|
workflowIds: string[];
|
|
399
|
+
isRegistered: boolean;
|
|
445
400
|
};
|
|
446
401
|
export interface GetScorersResponse {
|
|
447
402
|
scorers: Array<GetScorerResponse>;
|
|
@@ -465,5 +420,51 @@ export interface GetAITracesResponse {
|
|
|
465
420
|
spans: AISpanRecord[];
|
|
466
421
|
pagination: PaginationInfo;
|
|
467
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
|
+
}
|
|
468
469
|
export {};
|
|
469
470
|
//# sourceMappingURL=types.d.ts.map
|