@mastra/client-js 0.0.0-add-libsql-changeset-20250910154739 → 0.0.0-add-crumb-action-20251028105537
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 +529 -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 +660 -619
- 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 +659 -620
- 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 +92 -43
- 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 +105 -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 +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,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,8B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,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,
|
|
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,42 +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
|
-
|
|
76
|
-
} & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT, STRUCTURED_OUTPUT>, 'output' | 'runtimeContext' | 'clientTools' | 'options' | 'structuredOutput'>>;
|
|
92
|
+
} & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT>, 'runtimeContext' | 'clientTools' | 'options' | 'abortSignal' | 'structuredOutput'>>;
|
|
77
93
|
export type UpdateModelParams = {
|
|
78
94
|
modelId: string;
|
|
79
95
|
provider: 'openai' | 'anthropic' | 'groq' | 'xai' | 'google';
|
|
80
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
|
+
};
|
|
81
109
|
export interface GetEvalsByAgentIdResponse extends GetAgentResponse {
|
|
82
110
|
evals: any[];
|
|
83
111
|
instructions: string;
|
|
@@ -90,14 +118,6 @@ export interface GetToolResponse {
|
|
|
90
118
|
inputSchema: string;
|
|
91
119
|
outputSchema: string;
|
|
92
120
|
}
|
|
93
|
-
export interface GetLegacyWorkflowResponse {
|
|
94
|
-
name: string;
|
|
95
|
-
triggerSchema: string;
|
|
96
|
-
steps: Record<string, StepAction<any, any, any, any>>;
|
|
97
|
-
stepGraph: StepGraph;
|
|
98
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
99
|
-
workflowId?: string;
|
|
100
|
-
}
|
|
101
121
|
export interface GetWorkflowRunsParams {
|
|
102
122
|
fromDate?: Date;
|
|
103
123
|
toDate?: Date;
|
|
@@ -105,20 +125,9 @@ export interface GetWorkflowRunsParams {
|
|
|
105
125
|
offset?: number;
|
|
106
126
|
resourceId?: string;
|
|
107
127
|
}
|
|
108
|
-
export type GetLegacyWorkflowRunsResponse = LegacyWorkflowRuns;
|
|
109
128
|
export type GetWorkflowRunsResponse = WorkflowRuns;
|
|
110
129
|
export type GetWorkflowRunByIdResponse = WorkflowRun;
|
|
111
130
|
export type GetWorkflowRunExecutionResultResponse = WatchEvent['payload']['workflowState'];
|
|
112
|
-
export type LegacyWorkflowRunResult = {
|
|
113
|
-
activePaths: Record<string, {
|
|
114
|
-
status: string;
|
|
115
|
-
suspendPayload?: any;
|
|
116
|
-
stepPath: string[];
|
|
117
|
-
}>;
|
|
118
|
-
results: CoreLegacyWorkflowRunResult<any, any, any>['results'];
|
|
119
|
-
timestamp: number;
|
|
120
|
-
runId: string;
|
|
121
|
-
};
|
|
122
131
|
export interface GetWorkflowResponse {
|
|
123
132
|
name: string;
|
|
124
133
|
description?: string;
|
|
@@ -150,7 +159,7 @@ export interface GetWorkflowResponse {
|
|
|
150
159
|
export type WorkflowWatchResult = WatchEvent & {
|
|
151
160
|
runId: string;
|
|
152
161
|
};
|
|
153
|
-
export type WorkflowRunResult = WorkflowResult<any, any>;
|
|
162
|
+
export type WorkflowRunResult = WorkflowResult<any, any, any, any>;
|
|
154
163
|
export interface UpsertVectorParams {
|
|
155
164
|
indexName: string;
|
|
156
165
|
vectors: number[][];
|
|
@@ -205,6 +214,12 @@ export interface GetMemoryThreadParams {
|
|
|
205
214
|
resourceId: string;
|
|
206
215
|
agentId: string;
|
|
207
216
|
}
|
|
217
|
+
export interface GetMemoryConfigParams {
|
|
218
|
+
agentId: string;
|
|
219
|
+
}
|
|
220
|
+
export type GetMemoryConfigResponse = {
|
|
221
|
+
config: MemoryConfig;
|
|
222
|
+
};
|
|
208
223
|
export interface GetNetworkMemoryThreadParams {
|
|
209
224
|
resourceId: string;
|
|
210
225
|
networkId: string;
|
|
@@ -224,7 +239,8 @@ export interface GetMemoryThreadMessagesParams {
|
|
|
224
239
|
export type GetMemoryThreadMessagesPaginatedParams = Omit<StorageGetMessagesArg, 'threadConfig' | 'threadId'>;
|
|
225
240
|
export interface GetMemoryThreadMessagesResponse {
|
|
226
241
|
messages: CoreMessage[];
|
|
227
|
-
|
|
242
|
+
legacyMessages: AiMessageType[];
|
|
243
|
+
uiMessages: UIMessage[];
|
|
228
244
|
}
|
|
229
245
|
export type GetMemoryThreadMessagesPaginatedResponse = PaginationInfo & {
|
|
230
246
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
@@ -256,70 +272,6 @@ export type GetLogsResponse = {
|
|
|
256
272
|
hasMore: boolean;
|
|
257
273
|
};
|
|
258
274
|
export type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
|
|
259
|
-
type SpanStatus = {
|
|
260
|
-
code: number;
|
|
261
|
-
};
|
|
262
|
-
type SpanOther = {
|
|
263
|
-
droppedAttributesCount: number;
|
|
264
|
-
droppedEventsCount: number;
|
|
265
|
-
droppedLinksCount: number;
|
|
266
|
-
};
|
|
267
|
-
type SpanEventAttributes = {
|
|
268
|
-
key: string;
|
|
269
|
-
value: {
|
|
270
|
-
[key: string]: string | number | boolean | null;
|
|
271
|
-
};
|
|
272
|
-
};
|
|
273
|
-
type SpanEvent = {
|
|
274
|
-
attributes: SpanEventAttributes[];
|
|
275
|
-
name: string;
|
|
276
|
-
timeUnixNano: string;
|
|
277
|
-
droppedAttributesCount: number;
|
|
278
|
-
};
|
|
279
|
-
type Span = {
|
|
280
|
-
id: string;
|
|
281
|
-
parentSpanId: string | null;
|
|
282
|
-
traceId: string;
|
|
283
|
-
name: string;
|
|
284
|
-
scope: string;
|
|
285
|
-
kind: number;
|
|
286
|
-
status: SpanStatus;
|
|
287
|
-
events: SpanEvent[];
|
|
288
|
-
links: any[];
|
|
289
|
-
attributes: Record<string, string | number | boolean | null>;
|
|
290
|
-
startTime: number;
|
|
291
|
-
endTime: number;
|
|
292
|
-
duration: number;
|
|
293
|
-
other: SpanOther;
|
|
294
|
-
createdAt: string;
|
|
295
|
-
};
|
|
296
|
-
export interface GetTelemetryResponse {
|
|
297
|
-
traces: Span[];
|
|
298
|
-
}
|
|
299
|
-
export interface GetTelemetryParams {
|
|
300
|
-
name?: string;
|
|
301
|
-
scope?: string;
|
|
302
|
-
page?: number;
|
|
303
|
-
perPage?: number;
|
|
304
|
-
attribute?: Record<string, string>;
|
|
305
|
-
fromDate?: Date;
|
|
306
|
-
toDate?: Date;
|
|
307
|
-
}
|
|
308
|
-
export interface GetNetworkResponse {
|
|
309
|
-
id: string;
|
|
310
|
-
name: string;
|
|
311
|
-
instructions: string;
|
|
312
|
-
agents: Array<{
|
|
313
|
-
name: string;
|
|
314
|
-
provider: string;
|
|
315
|
-
modelId: string;
|
|
316
|
-
}>;
|
|
317
|
-
routingModel: {
|
|
318
|
-
provider: string;
|
|
319
|
-
modelId: string;
|
|
320
|
-
};
|
|
321
|
-
state?: Record<string, any>;
|
|
322
|
-
}
|
|
323
275
|
export interface GetVNextNetworkResponse {
|
|
324
276
|
id: string;
|
|
325
277
|
name: string;
|
|
@@ -378,7 +330,7 @@ export interface LoopVNextNetworkResponse {
|
|
|
378
330
|
isComplete?: boolean | undefined;
|
|
379
331
|
completionReason?: string | undefined;
|
|
380
332
|
};
|
|
381
|
-
steps: WorkflowResult<any, any>['steps'];
|
|
333
|
+
steps: WorkflowResult<any, any, any, any>['steps'];
|
|
382
334
|
}
|
|
383
335
|
export interface McpServerListResponse {
|
|
384
336
|
servers: ServerInfo[];
|
|
@@ -398,6 +350,8 @@ export interface McpServerToolListResponse {
|
|
|
398
350
|
export type ClientScoreRowData = Omit<ScoreRowData, 'createdAt' | 'updatedAt'> & {
|
|
399
351
|
createdAt: string;
|
|
400
352
|
updatedAt: string;
|
|
353
|
+
} & {
|
|
354
|
+
spanId?: string;
|
|
401
355
|
};
|
|
402
356
|
export interface GetScoresByRunIdParams {
|
|
403
357
|
runId: string;
|
|
@@ -417,6 +371,12 @@ export interface GetScoresByEntityIdParams {
|
|
|
417
371
|
page?: number;
|
|
418
372
|
perPage?: number;
|
|
419
373
|
}
|
|
374
|
+
export interface GetScoresBySpanParams {
|
|
375
|
+
traceId: string;
|
|
376
|
+
spanId: string;
|
|
377
|
+
page?: number;
|
|
378
|
+
perPage?: number;
|
|
379
|
+
}
|
|
420
380
|
export interface SaveScoreParams {
|
|
421
381
|
score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>;
|
|
422
382
|
}
|
|
@@ -434,7 +394,9 @@ export interface SaveScoreResponse {
|
|
|
434
394
|
}
|
|
435
395
|
export type GetScorerResponse = MastraScorerEntry & {
|
|
436
396
|
agentIds: string[];
|
|
397
|
+
agentNames: string[];
|
|
437
398
|
workflowIds: string[];
|
|
399
|
+
isRegistered: boolean;
|
|
438
400
|
};
|
|
439
401
|
export interface GetScorersResponse {
|
|
440
402
|
scorers: Array<GetScorerResponse>;
|
|
@@ -458,5 +420,51 @@ export interface GetAITracesResponse {
|
|
|
458
420
|
spans: AISpanRecord[];
|
|
459
421
|
pagination: PaginationInfo;
|
|
460
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
|
+
}
|
|
461
469
|
export {};
|
|
462
470
|
//# sourceMappingURL=types.d.ts.map
|