@mastra/client-js 0.10.6-alpha.1 → 0.10.6-alpha.3
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +24 -0
- package/dist/index.cjs +606 -13
- package/dist/index.d.cts +166 -4
- package/dist/index.d.ts +166 -4
- package/dist/index.js +607 -14
- package/package.json +4 -4
- package/src/client.ts +71 -1
- package/src/example.ts +4 -1
- package/src/resources/agent.ts +533 -12
- package/src/resources/base.ts +1 -0
- package/src/resources/network-memory-thread.ts +63 -0
- package/src/resources/network.ts +2 -3
- package/src/resources/vNextNetwork.ts +147 -0
- package/src/resources/workflow.ts +2 -2
- package/src/types.ts +61 -0
- package/src/utils/process-client-tools.ts +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -152,6 +152,10 @@ interface SaveMessageToMemoryParams {
|
|
|
152
152
|
messages: MastraMessageV1[];
|
|
153
153
|
agentId: string;
|
|
154
154
|
}
|
|
155
|
+
interface SaveNetworkMessageToMemoryParams {
|
|
156
|
+
messages: MastraMessageV1[];
|
|
157
|
+
networkId: string;
|
|
158
|
+
}
|
|
155
159
|
type SaveMessageToMemoryResponse = MastraMessageV1[];
|
|
156
160
|
interface CreateMemoryThreadParams {
|
|
157
161
|
title?: string;
|
|
@@ -160,11 +164,22 @@ interface CreateMemoryThreadParams {
|
|
|
160
164
|
threadId?: string;
|
|
161
165
|
agentId: string;
|
|
162
166
|
}
|
|
167
|
+
interface CreateNetworkMemoryThreadParams {
|
|
168
|
+
title?: string;
|
|
169
|
+
metadata?: Record<string, any>;
|
|
170
|
+
resourceId: string;
|
|
171
|
+
threadId?: string;
|
|
172
|
+
networkId: string;
|
|
173
|
+
}
|
|
163
174
|
type CreateMemoryThreadResponse = StorageThreadType;
|
|
164
175
|
interface GetMemoryThreadParams {
|
|
165
176
|
resourceId: string;
|
|
166
177
|
agentId: string;
|
|
167
178
|
}
|
|
179
|
+
interface GetNetworkMemoryThreadParams {
|
|
180
|
+
resourceId: string;
|
|
181
|
+
networkId: string;
|
|
182
|
+
}
|
|
168
183
|
type GetMemoryThreadResponse = StorageThreadType[];
|
|
169
184
|
interface UpdateMemoryThreadParams {
|
|
170
185
|
title: string;
|
|
@@ -258,6 +273,7 @@ interface GetTelemetryParams {
|
|
|
258
273
|
toDate?: Date;
|
|
259
274
|
}
|
|
260
275
|
interface GetNetworkResponse {
|
|
276
|
+
id: string;
|
|
261
277
|
name: string;
|
|
262
278
|
instructions: string;
|
|
263
279
|
agents: Array<{
|
|
@@ -271,6 +287,44 @@ interface GetNetworkResponse {
|
|
|
271
287
|
};
|
|
272
288
|
state?: Record<string, any>;
|
|
273
289
|
}
|
|
290
|
+
interface GetVNextNetworkResponse {
|
|
291
|
+
id: string;
|
|
292
|
+
name: string;
|
|
293
|
+
instructions: string;
|
|
294
|
+
agents: Array<{
|
|
295
|
+
name: string;
|
|
296
|
+
provider: string;
|
|
297
|
+
modelId: string;
|
|
298
|
+
}>;
|
|
299
|
+
routingModel: {
|
|
300
|
+
provider: string;
|
|
301
|
+
modelId: string;
|
|
302
|
+
};
|
|
303
|
+
workflows: Array<{
|
|
304
|
+
name: string;
|
|
305
|
+
description: string;
|
|
306
|
+
inputSchema: string | undefined;
|
|
307
|
+
outputSchema: string | undefined;
|
|
308
|
+
}>;
|
|
309
|
+
}
|
|
310
|
+
interface GenerateVNextNetworkResponse {
|
|
311
|
+
task: string;
|
|
312
|
+
result: string;
|
|
313
|
+
resourceId: string;
|
|
314
|
+
resourceType: 'none' | 'tool' | 'agent' | 'workflow';
|
|
315
|
+
}
|
|
316
|
+
interface GenerateOrStreamVNextNetworkParams {
|
|
317
|
+
message: string;
|
|
318
|
+
threadId?: string;
|
|
319
|
+
resourceId?: string;
|
|
320
|
+
}
|
|
321
|
+
interface LoopVNextNetworkResponse {
|
|
322
|
+
status: 'success';
|
|
323
|
+
result: {
|
|
324
|
+
text: string;
|
|
325
|
+
};
|
|
326
|
+
steps: WorkflowResult<any, any>['steps'];
|
|
327
|
+
}
|
|
274
328
|
interface McpServerListResponse {
|
|
275
329
|
servers: ServerInfo[];
|
|
276
330
|
next: string | null;
|
|
@@ -363,6 +417,7 @@ declare class Agent extends BaseResource {
|
|
|
363
417
|
output?: never;
|
|
364
418
|
experimental_output: T;
|
|
365
419
|
}): Promise<GenerateReturn<T>>;
|
|
420
|
+
private processChatResponse;
|
|
366
421
|
/**
|
|
367
422
|
* Streams a response from the agent
|
|
368
423
|
* @param params - Stream parameters including prompt
|
|
@@ -371,6 +426,10 @@ declare class Agent extends BaseResource {
|
|
|
371
426
|
stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
|
|
372
427
|
processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
|
|
373
428
|
}>;
|
|
429
|
+
/**
|
|
430
|
+
* Processes the stream response and handles tool calls
|
|
431
|
+
*/
|
|
432
|
+
private processStreamResponse;
|
|
374
433
|
/**
|
|
375
434
|
* Gets details about a specific tool available to the agent
|
|
376
435
|
* @param toolId - ID of the tool to retrieve
|
|
@@ -684,9 +743,9 @@ declare class Workflow extends BaseResource {
|
|
|
684
743
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
685
744
|
}): Promise<WorkflowRunResult>;
|
|
686
745
|
/**
|
|
687
|
-
* Starts a
|
|
746
|
+
* Starts a workflow run and returns a stream
|
|
688
747
|
* @param params - Object containing the optional runId, inputData and runtimeContext
|
|
689
|
-
* @returns Promise containing the
|
|
748
|
+
* @returns Promise containing the workflow execution results
|
|
690
749
|
*/
|
|
691
750
|
stream(params: {
|
|
692
751
|
runId?: string;
|
|
@@ -787,6 +846,67 @@ declare class MCPTool extends BaseResource {
|
|
|
787
846
|
}): Promise<any>;
|
|
788
847
|
}
|
|
789
848
|
|
|
849
|
+
declare class VNextNetwork extends BaseResource {
|
|
850
|
+
private networkId;
|
|
851
|
+
constructor(options: ClientOptions, networkId: string);
|
|
852
|
+
/**
|
|
853
|
+
* Retrieves details about the network
|
|
854
|
+
* @returns Promise containing vNext network details
|
|
855
|
+
*/
|
|
856
|
+
details(): Promise<GetVNextNetworkResponse>;
|
|
857
|
+
/**
|
|
858
|
+
* Generates a response from the v-next network
|
|
859
|
+
* @param params - Generation parameters including message
|
|
860
|
+
* @returns Promise containing the generated response
|
|
861
|
+
*/
|
|
862
|
+
generate(params: GenerateOrStreamVNextNetworkParams): Promise<GenerateVNextNetworkResponse>;
|
|
863
|
+
/**
|
|
864
|
+
* Generates a response from the v-next network using multiple primitives
|
|
865
|
+
* @param params - Generation parameters including message
|
|
866
|
+
* @returns Promise containing the generated response
|
|
867
|
+
*/
|
|
868
|
+
loop(params: {
|
|
869
|
+
message: string;
|
|
870
|
+
}): Promise<LoopVNextNetworkResponse>;
|
|
871
|
+
private streamProcessor;
|
|
872
|
+
/**
|
|
873
|
+
* Streams a response from the v-next network
|
|
874
|
+
* @param params - Stream parameters including message
|
|
875
|
+
* @returns Promise containing the results
|
|
876
|
+
*/
|
|
877
|
+
stream(params: GenerateOrStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
declare class NetworkMemoryThread extends BaseResource {
|
|
881
|
+
private threadId;
|
|
882
|
+
private networkId;
|
|
883
|
+
constructor(options: ClientOptions, threadId: string, networkId: string);
|
|
884
|
+
/**
|
|
885
|
+
* Retrieves the memory thread details
|
|
886
|
+
* @returns Promise containing thread details including title and metadata
|
|
887
|
+
*/
|
|
888
|
+
get(): Promise<StorageThreadType>;
|
|
889
|
+
/**
|
|
890
|
+
* Updates the memory thread properties
|
|
891
|
+
* @param params - Update parameters including title and metadata
|
|
892
|
+
* @returns Promise containing updated thread details
|
|
893
|
+
*/
|
|
894
|
+
update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
|
|
895
|
+
/**
|
|
896
|
+
* Deletes the memory thread
|
|
897
|
+
* @returns Promise containing deletion result
|
|
898
|
+
*/
|
|
899
|
+
delete(): Promise<{
|
|
900
|
+
result: string;
|
|
901
|
+
}>;
|
|
902
|
+
/**
|
|
903
|
+
* Retrieves messages associated with the thread
|
|
904
|
+
* @param params - Optional parameters including limit for number of messages to retrieve
|
|
905
|
+
* @returns Promise containing thread messages and UI messages
|
|
906
|
+
*/
|
|
907
|
+
getMessages(params?: GetMemoryThreadMessagesParams): Promise<GetMemoryThreadMessagesResponse>;
|
|
908
|
+
}
|
|
909
|
+
|
|
790
910
|
declare class MastraClient extends BaseResource {
|
|
791
911
|
constructor(options: ClientOptions);
|
|
792
912
|
/**
|
|
@@ -834,6 +954,37 @@ declare class MastraClient extends BaseResource {
|
|
|
834
954
|
getMemoryStatus(agentId: string): Promise<{
|
|
835
955
|
result: boolean;
|
|
836
956
|
}>;
|
|
957
|
+
/**
|
|
958
|
+
* Retrieves memory threads for a resource
|
|
959
|
+
* @param params - Parameters containing the resource ID
|
|
960
|
+
* @returns Promise containing array of memory threads
|
|
961
|
+
*/
|
|
962
|
+
getNetworkMemoryThreads(params: GetNetworkMemoryThreadParams): Promise<GetMemoryThreadResponse>;
|
|
963
|
+
/**
|
|
964
|
+
* Creates a new memory thread
|
|
965
|
+
* @param params - Parameters for creating the memory thread
|
|
966
|
+
* @returns Promise containing the created memory thread
|
|
967
|
+
*/
|
|
968
|
+
createNetworkMemoryThread(params: CreateNetworkMemoryThreadParams): Promise<CreateMemoryThreadResponse>;
|
|
969
|
+
/**
|
|
970
|
+
* Gets a memory thread instance by ID
|
|
971
|
+
* @param threadId - ID of the memory thread to retrieve
|
|
972
|
+
* @returns MemoryThread instance
|
|
973
|
+
*/
|
|
974
|
+
getNetworkMemoryThread(threadId: string, networkId: string): NetworkMemoryThread;
|
|
975
|
+
/**
|
|
976
|
+
* Saves messages to memory
|
|
977
|
+
* @param params - Parameters containing messages to save
|
|
978
|
+
* @returns Promise containing the saved messages
|
|
979
|
+
*/
|
|
980
|
+
saveNetworkMessageToMemory(params: SaveNetworkMessageToMemoryParams): Promise<SaveMessageToMemoryResponse>;
|
|
981
|
+
/**
|
|
982
|
+
* Gets the status of the memory system
|
|
983
|
+
* @returns Promise containing memory system status
|
|
984
|
+
*/
|
|
985
|
+
getNetworkMemoryStatus(networkId: string): Promise<{
|
|
986
|
+
result: boolean;
|
|
987
|
+
}>;
|
|
837
988
|
/**
|
|
838
989
|
* Retrieves all available tools
|
|
839
990
|
* @returns Promise containing map of tool IDs to tool details
|
|
@@ -902,13 +1053,24 @@ declare class MastraClient extends BaseResource {
|
|
|
902
1053
|
* Retrieves all available networks
|
|
903
1054
|
* @returns Promise containing map of network IDs to network details
|
|
904
1055
|
*/
|
|
905
|
-
getNetworks(): Promise<
|
|
1056
|
+
getNetworks(): Promise<Array<GetNetworkResponse>>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Retrieves all available vNext networks
|
|
1059
|
+
* @returns Promise containing map of vNext network IDs to vNext network details
|
|
1060
|
+
*/
|
|
1061
|
+
getVNextNetworks(): Promise<Array<GetVNextNetworkResponse>>;
|
|
906
1062
|
/**
|
|
907
1063
|
* Gets a network instance by ID
|
|
908
1064
|
* @param networkId - ID of the network to retrieve
|
|
909
1065
|
* @returns Network instance
|
|
910
1066
|
*/
|
|
911
1067
|
getNetwork(networkId: string): Network;
|
|
1068
|
+
/**
|
|
1069
|
+
* Gets a vNext network instance by ID
|
|
1070
|
+
* @param networkId - ID of the vNext network to retrieve
|
|
1071
|
+
* @returns vNext Network instance
|
|
1072
|
+
*/
|
|
1073
|
+
getVNextNetwork(networkId: string): VNextNetwork;
|
|
912
1074
|
/**
|
|
913
1075
|
* Retrieves a list of available MCP servers.
|
|
914
1076
|
* @param params - Optional parameters for pagination (limit, offset).
|
|
@@ -949,4 +1111,4 @@ declare class MastraClient extends BaseResource {
|
|
|
949
1111
|
getA2A(agentId: string): A2A;
|
|
950
1112
|
}
|
|
951
1113
|
|
|
952
|
-
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type GenerateParams, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLegacyWorkflowResponse, type GetLegacyWorkflowRunsResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesParams, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunByIdResponse, type GetWorkflowRunExecutionResultResponse, type GetWorkflowRunsParams, type GetWorkflowRunsResponse, type LegacyWorkflowRunResult, MastraClient, type McpServerListResponse, type McpServerToolListResponse, type McpToolInfo, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult, type WorkflowWatchResult };
|
|
1114
|
+
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type CreateNetworkMemoryThreadParams, type GenerateOrStreamVNextNetworkParams, type GenerateParams, type GenerateVNextNetworkResponse, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLegacyWorkflowResponse, type GetLegacyWorkflowRunsResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesParams, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkMemoryThreadParams, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextNetworkResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunByIdResponse, type GetWorkflowRunExecutionResultResponse, type GetWorkflowRunsParams, type GetWorkflowRunsResponse, type LegacyWorkflowRunResult, type LoopVNextNetworkResponse, MastraClient, type McpServerListResponse, type McpServerToolListResponse, type McpToolInfo, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type SaveNetworkMessageToMemoryParams, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult, type WorkflowWatchResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -152,6 +152,10 @@ interface SaveMessageToMemoryParams {
|
|
|
152
152
|
messages: MastraMessageV1[];
|
|
153
153
|
agentId: string;
|
|
154
154
|
}
|
|
155
|
+
interface SaveNetworkMessageToMemoryParams {
|
|
156
|
+
messages: MastraMessageV1[];
|
|
157
|
+
networkId: string;
|
|
158
|
+
}
|
|
155
159
|
type SaveMessageToMemoryResponse = MastraMessageV1[];
|
|
156
160
|
interface CreateMemoryThreadParams {
|
|
157
161
|
title?: string;
|
|
@@ -160,11 +164,22 @@ interface CreateMemoryThreadParams {
|
|
|
160
164
|
threadId?: string;
|
|
161
165
|
agentId: string;
|
|
162
166
|
}
|
|
167
|
+
interface CreateNetworkMemoryThreadParams {
|
|
168
|
+
title?: string;
|
|
169
|
+
metadata?: Record<string, any>;
|
|
170
|
+
resourceId: string;
|
|
171
|
+
threadId?: string;
|
|
172
|
+
networkId: string;
|
|
173
|
+
}
|
|
163
174
|
type CreateMemoryThreadResponse = StorageThreadType;
|
|
164
175
|
interface GetMemoryThreadParams {
|
|
165
176
|
resourceId: string;
|
|
166
177
|
agentId: string;
|
|
167
178
|
}
|
|
179
|
+
interface GetNetworkMemoryThreadParams {
|
|
180
|
+
resourceId: string;
|
|
181
|
+
networkId: string;
|
|
182
|
+
}
|
|
168
183
|
type GetMemoryThreadResponse = StorageThreadType[];
|
|
169
184
|
interface UpdateMemoryThreadParams {
|
|
170
185
|
title: string;
|
|
@@ -258,6 +273,7 @@ interface GetTelemetryParams {
|
|
|
258
273
|
toDate?: Date;
|
|
259
274
|
}
|
|
260
275
|
interface GetNetworkResponse {
|
|
276
|
+
id: string;
|
|
261
277
|
name: string;
|
|
262
278
|
instructions: string;
|
|
263
279
|
agents: Array<{
|
|
@@ -271,6 +287,44 @@ interface GetNetworkResponse {
|
|
|
271
287
|
};
|
|
272
288
|
state?: Record<string, any>;
|
|
273
289
|
}
|
|
290
|
+
interface GetVNextNetworkResponse {
|
|
291
|
+
id: string;
|
|
292
|
+
name: string;
|
|
293
|
+
instructions: string;
|
|
294
|
+
agents: Array<{
|
|
295
|
+
name: string;
|
|
296
|
+
provider: string;
|
|
297
|
+
modelId: string;
|
|
298
|
+
}>;
|
|
299
|
+
routingModel: {
|
|
300
|
+
provider: string;
|
|
301
|
+
modelId: string;
|
|
302
|
+
};
|
|
303
|
+
workflows: Array<{
|
|
304
|
+
name: string;
|
|
305
|
+
description: string;
|
|
306
|
+
inputSchema: string | undefined;
|
|
307
|
+
outputSchema: string | undefined;
|
|
308
|
+
}>;
|
|
309
|
+
}
|
|
310
|
+
interface GenerateVNextNetworkResponse {
|
|
311
|
+
task: string;
|
|
312
|
+
result: string;
|
|
313
|
+
resourceId: string;
|
|
314
|
+
resourceType: 'none' | 'tool' | 'agent' | 'workflow';
|
|
315
|
+
}
|
|
316
|
+
interface GenerateOrStreamVNextNetworkParams {
|
|
317
|
+
message: string;
|
|
318
|
+
threadId?: string;
|
|
319
|
+
resourceId?: string;
|
|
320
|
+
}
|
|
321
|
+
interface LoopVNextNetworkResponse {
|
|
322
|
+
status: 'success';
|
|
323
|
+
result: {
|
|
324
|
+
text: string;
|
|
325
|
+
};
|
|
326
|
+
steps: WorkflowResult<any, any>['steps'];
|
|
327
|
+
}
|
|
274
328
|
interface McpServerListResponse {
|
|
275
329
|
servers: ServerInfo[];
|
|
276
330
|
next: string | null;
|
|
@@ -363,6 +417,7 @@ declare class Agent extends BaseResource {
|
|
|
363
417
|
output?: never;
|
|
364
418
|
experimental_output: T;
|
|
365
419
|
}): Promise<GenerateReturn<T>>;
|
|
420
|
+
private processChatResponse;
|
|
366
421
|
/**
|
|
367
422
|
* Streams a response from the agent
|
|
368
423
|
* @param params - Stream parameters including prompt
|
|
@@ -371,6 +426,10 @@ declare class Agent extends BaseResource {
|
|
|
371
426
|
stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
|
|
372
427
|
processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
|
|
373
428
|
}>;
|
|
429
|
+
/**
|
|
430
|
+
* Processes the stream response and handles tool calls
|
|
431
|
+
*/
|
|
432
|
+
private processStreamResponse;
|
|
374
433
|
/**
|
|
375
434
|
* Gets details about a specific tool available to the agent
|
|
376
435
|
* @param toolId - ID of the tool to retrieve
|
|
@@ -684,9 +743,9 @@ declare class Workflow extends BaseResource {
|
|
|
684
743
|
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
685
744
|
}): Promise<WorkflowRunResult>;
|
|
686
745
|
/**
|
|
687
|
-
* Starts a
|
|
746
|
+
* Starts a workflow run and returns a stream
|
|
688
747
|
* @param params - Object containing the optional runId, inputData and runtimeContext
|
|
689
|
-
* @returns Promise containing the
|
|
748
|
+
* @returns Promise containing the workflow execution results
|
|
690
749
|
*/
|
|
691
750
|
stream(params: {
|
|
692
751
|
runId?: string;
|
|
@@ -787,6 +846,67 @@ declare class MCPTool extends BaseResource {
|
|
|
787
846
|
}): Promise<any>;
|
|
788
847
|
}
|
|
789
848
|
|
|
849
|
+
declare class VNextNetwork extends BaseResource {
|
|
850
|
+
private networkId;
|
|
851
|
+
constructor(options: ClientOptions, networkId: string);
|
|
852
|
+
/**
|
|
853
|
+
* Retrieves details about the network
|
|
854
|
+
* @returns Promise containing vNext network details
|
|
855
|
+
*/
|
|
856
|
+
details(): Promise<GetVNextNetworkResponse>;
|
|
857
|
+
/**
|
|
858
|
+
* Generates a response from the v-next network
|
|
859
|
+
* @param params - Generation parameters including message
|
|
860
|
+
* @returns Promise containing the generated response
|
|
861
|
+
*/
|
|
862
|
+
generate(params: GenerateOrStreamVNextNetworkParams): Promise<GenerateVNextNetworkResponse>;
|
|
863
|
+
/**
|
|
864
|
+
* Generates a response from the v-next network using multiple primitives
|
|
865
|
+
* @param params - Generation parameters including message
|
|
866
|
+
* @returns Promise containing the generated response
|
|
867
|
+
*/
|
|
868
|
+
loop(params: {
|
|
869
|
+
message: string;
|
|
870
|
+
}): Promise<LoopVNextNetworkResponse>;
|
|
871
|
+
private streamProcessor;
|
|
872
|
+
/**
|
|
873
|
+
* Streams a response from the v-next network
|
|
874
|
+
* @param params - Stream parameters including message
|
|
875
|
+
* @returns Promise containing the results
|
|
876
|
+
*/
|
|
877
|
+
stream(params: GenerateOrStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
declare class NetworkMemoryThread extends BaseResource {
|
|
881
|
+
private threadId;
|
|
882
|
+
private networkId;
|
|
883
|
+
constructor(options: ClientOptions, threadId: string, networkId: string);
|
|
884
|
+
/**
|
|
885
|
+
* Retrieves the memory thread details
|
|
886
|
+
* @returns Promise containing thread details including title and metadata
|
|
887
|
+
*/
|
|
888
|
+
get(): Promise<StorageThreadType>;
|
|
889
|
+
/**
|
|
890
|
+
* Updates the memory thread properties
|
|
891
|
+
* @param params - Update parameters including title and metadata
|
|
892
|
+
* @returns Promise containing updated thread details
|
|
893
|
+
*/
|
|
894
|
+
update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
|
|
895
|
+
/**
|
|
896
|
+
* Deletes the memory thread
|
|
897
|
+
* @returns Promise containing deletion result
|
|
898
|
+
*/
|
|
899
|
+
delete(): Promise<{
|
|
900
|
+
result: string;
|
|
901
|
+
}>;
|
|
902
|
+
/**
|
|
903
|
+
* Retrieves messages associated with the thread
|
|
904
|
+
* @param params - Optional parameters including limit for number of messages to retrieve
|
|
905
|
+
* @returns Promise containing thread messages and UI messages
|
|
906
|
+
*/
|
|
907
|
+
getMessages(params?: GetMemoryThreadMessagesParams): Promise<GetMemoryThreadMessagesResponse>;
|
|
908
|
+
}
|
|
909
|
+
|
|
790
910
|
declare class MastraClient extends BaseResource {
|
|
791
911
|
constructor(options: ClientOptions);
|
|
792
912
|
/**
|
|
@@ -834,6 +954,37 @@ declare class MastraClient extends BaseResource {
|
|
|
834
954
|
getMemoryStatus(agentId: string): Promise<{
|
|
835
955
|
result: boolean;
|
|
836
956
|
}>;
|
|
957
|
+
/**
|
|
958
|
+
* Retrieves memory threads for a resource
|
|
959
|
+
* @param params - Parameters containing the resource ID
|
|
960
|
+
* @returns Promise containing array of memory threads
|
|
961
|
+
*/
|
|
962
|
+
getNetworkMemoryThreads(params: GetNetworkMemoryThreadParams): Promise<GetMemoryThreadResponse>;
|
|
963
|
+
/**
|
|
964
|
+
* Creates a new memory thread
|
|
965
|
+
* @param params - Parameters for creating the memory thread
|
|
966
|
+
* @returns Promise containing the created memory thread
|
|
967
|
+
*/
|
|
968
|
+
createNetworkMemoryThread(params: CreateNetworkMemoryThreadParams): Promise<CreateMemoryThreadResponse>;
|
|
969
|
+
/**
|
|
970
|
+
* Gets a memory thread instance by ID
|
|
971
|
+
* @param threadId - ID of the memory thread to retrieve
|
|
972
|
+
* @returns MemoryThread instance
|
|
973
|
+
*/
|
|
974
|
+
getNetworkMemoryThread(threadId: string, networkId: string): NetworkMemoryThread;
|
|
975
|
+
/**
|
|
976
|
+
* Saves messages to memory
|
|
977
|
+
* @param params - Parameters containing messages to save
|
|
978
|
+
* @returns Promise containing the saved messages
|
|
979
|
+
*/
|
|
980
|
+
saveNetworkMessageToMemory(params: SaveNetworkMessageToMemoryParams): Promise<SaveMessageToMemoryResponse>;
|
|
981
|
+
/**
|
|
982
|
+
* Gets the status of the memory system
|
|
983
|
+
* @returns Promise containing memory system status
|
|
984
|
+
*/
|
|
985
|
+
getNetworkMemoryStatus(networkId: string): Promise<{
|
|
986
|
+
result: boolean;
|
|
987
|
+
}>;
|
|
837
988
|
/**
|
|
838
989
|
* Retrieves all available tools
|
|
839
990
|
* @returns Promise containing map of tool IDs to tool details
|
|
@@ -902,13 +1053,24 @@ declare class MastraClient extends BaseResource {
|
|
|
902
1053
|
* Retrieves all available networks
|
|
903
1054
|
* @returns Promise containing map of network IDs to network details
|
|
904
1055
|
*/
|
|
905
|
-
getNetworks(): Promise<
|
|
1056
|
+
getNetworks(): Promise<Array<GetNetworkResponse>>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Retrieves all available vNext networks
|
|
1059
|
+
* @returns Promise containing map of vNext network IDs to vNext network details
|
|
1060
|
+
*/
|
|
1061
|
+
getVNextNetworks(): Promise<Array<GetVNextNetworkResponse>>;
|
|
906
1062
|
/**
|
|
907
1063
|
* Gets a network instance by ID
|
|
908
1064
|
* @param networkId - ID of the network to retrieve
|
|
909
1065
|
* @returns Network instance
|
|
910
1066
|
*/
|
|
911
1067
|
getNetwork(networkId: string): Network;
|
|
1068
|
+
/**
|
|
1069
|
+
* Gets a vNext network instance by ID
|
|
1070
|
+
* @param networkId - ID of the vNext network to retrieve
|
|
1071
|
+
* @returns vNext Network instance
|
|
1072
|
+
*/
|
|
1073
|
+
getVNextNetwork(networkId: string): VNextNetwork;
|
|
912
1074
|
/**
|
|
913
1075
|
* Retrieves a list of available MCP servers.
|
|
914
1076
|
* @param params - Optional parameters for pagination (limit, offset).
|
|
@@ -949,4 +1111,4 @@ declare class MastraClient extends BaseResource {
|
|
|
949
1111
|
getA2A(agentId: string): A2A;
|
|
950
1112
|
}
|
|
951
1113
|
|
|
952
|
-
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type GenerateParams, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLegacyWorkflowResponse, type GetLegacyWorkflowRunsResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesParams, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunByIdResponse, type GetWorkflowRunExecutionResultResponse, type GetWorkflowRunsParams, type GetWorkflowRunsResponse, type LegacyWorkflowRunResult, MastraClient, type McpServerListResponse, type McpServerToolListResponse, type McpToolInfo, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult, type WorkflowWatchResult };
|
|
1114
|
+
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type CreateNetworkMemoryThreadParams, type GenerateOrStreamVNextNetworkParams, type GenerateParams, type GenerateVNextNetworkResponse, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLegacyWorkflowResponse, type GetLegacyWorkflowRunsResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesParams, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkMemoryThreadParams, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextNetworkResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunByIdResponse, type GetWorkflowRunExecutionResultResponse, type GetWorkflowRunsParams, type GetWorkflowRunsResponse, type LegacyWorkflowRunResult, type LoopVNextNetworkResponse, MastraClient, type McpServerListResponse, type McpServerToolListResponse, type McpToolInfo, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type SaveNetworkMessageToMemoryParams, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult, type WorkflowWatchResult };
|