@mastra/client-js 0.0.0-vnextAgentNetwork-20250602084555 → 0.0.0-vnextAgentNetwork-20250602134426
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 +82 -2
- package/dist/index.cjs +23 -1
- package/dist/index.d.cts +30 -5
- package/dist/index.d.ts +30 -5
- package/dist/index.js +23 -1
- package/package.json +4 -4
- package/src/resources/agent.ts +8 -0
- package/src/resources/vNextNetwork.ts +18 -1
- package/src/resources/workflow.ts +5 -1
- package/src/types.ts +15 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,61 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
-
## 0.0.0-vnextAgentNetwork-
|
|
3
|
+
## 0.0.0-vnextAgentNetwork-20250602134426
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 592a2db: Added different icons for agents and workflows in mcp tools list
|
|
8
|
+
- c5bf1ce: Add backwards compat code for new MessageList in storage
|
|
9
|
+
- f0d559f: Fix peerdeps for alpha channel
|
|
10
|
+
- Updated dependencies [ee77e78]
|
|
11
|
+
- Updated dependencies [592a2db]
|
|
12
|
+
- Updated dependencies [e5dc18d]
|
|
13
|
+
- Updated dependencies [ab5adbe]
|
|
14
|
+
- Updated dependencies [1e8bb40]
|
|
15
|
+
- Updated dependencies [195c428]
|
|
16
|
+
- Updated dependencies [f73e11b]
|
|
17
|
+
- Updated dependencies [c5bf1ce]
|
|
18
|
+
- Updated dependencies [12b7002]
|
|
19
|
+
- Updated dependencies [2901125]
|
|
20
|
+
- @mastra/core@0.0.0-vnextAgentNetwork-20250602134426
|
|
21
|
+
|
|
22
|
+
## 0.10.2-alpha.2
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- c5bf1ce: Add backwards compat code for new MessageList in storage
|
|
27
|
+
- Updated dependencies [c5bf1ce]
|
|
28
|
+
- Updated dependencies [12b7002]
|
|
29
|
+
- @mastra/core@0.10.2-alpha.4
|
|
30
|
+
|
|
31
|
+
## 0.10.2-alpha.1
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- f0d559f: Fix peerdeps for alpha channel
|
|
36
|
+
- Updated dependencies [1e8bb40]
|
|
37
|
+
- @mastra/core@0.10.2-alpha.2
|
|
38
|
+
|
|
39
|
+
## 0.10.2-alpha.0
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- 592a2db: Added different icons for agents and workflows in mcp tools list
|
|
44
|
+
- Updated dependencies [592a2db]
|
|
45
|
+
- Updated dependencies [e5dc18d]
|
|
46
|
+
- @mastra/core@0.10.2-alpha.0
|
|
47
|
+
|
|
48
|
+
## 0.10.1
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 267773e: Show map config on workflow graph
|
|
53
|
+
Highlight borders for conditions too on workflow graph
|
|
54
|
+
Fix watch stream
|
|
7
55
|
- 5343f93: Move emitter to symbol to make private
|
|
8
56
|
- f622cfa: Make some properties of CreateMemoryThreadParams optional
|
|
57
|
+
- 6015bdf: Leverage defaultAgentStreamOption, defaultAgentGenerateOption in playground
|
|
58
|
+
- Updated dependencies [d70b807]
|
|
9
59
|
- Updated dependencies [6d16390]
|
|
10
60
|
- Updated dependencies [1e4a421]
|
|
11
61
|
- Updated dependencies [200d0da]
|
|
@@ -14,7 +64,37 @@
|
|
|
14
64
|
- Updated dependencies [38aee50]
|
|
15
65
|
- Updated dependencies [5c41100]
|
|
16
66
|
- Updated dependencies [d6a759b]
|
|
17
|
-
|
|
67
|
+
- Updated dependencies [6015bdf]
|
|
68
|
+
- @mastra/core@0.10.1
|
|
69
|
+
|
|
70
|
+
## 0.10.1-alpha.3
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- 267773e: Show map config on workflow graph
|
|
75
|
+
Highlight borders for conditions too on workflow graph
|
|
76
|
+
Fix watch stream
|
|
77
|
+
|
|
78
|
+
## 0.10.1-alpha.2
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- 6015bdf: Leverage defaultAgentStreamOption, defaultAgentGenerateOption in playground
|
|
83
|
+
- Updated dependencies [6015bdf]
|
|
84
|
+
- @mastra/core@0.10.1-alpha.2
|
|
85
|
+
|
|
86
|
+
## 0.10.1-alpha.1
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- 5343f93: Move emitter to symbol to make private
|
|
91
|
+
- Updated dependencies [200d0da]
|
|
92
|
+
- Updated dependencies [bf5f17b]
|
|
93
|
+
- Updated dependencies [5343f93]
|
|
94
|
+
- Updated dependencies [38aee50]
|
|
95
|
+
- Updated dependencies [5c41100]
|
|
96
|
+
- Updated dependencies [d6a759b]
|
|
97
|
+
- @mastra/core@0.10.1-alpha.1
|
|
18
98
|
|
|
19
99
|
## 0.10.1-alpha.0
|
|
20
100
|
|
package/dist/index.cjs
CHANGED
|
@@ -318,6 +318,13 @@ var AgentVoice = class extends BaseResource {
|
|
|
318
318
|
getSpeakers() {
|
|
319
319
|
return this.request(`/api/agents/${this.agentId}/voice/speakers`);
|
|
320
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Get the listener configuration for the agent's voice provider
|
|
323
|
+
* @returns Promise containing a check if the agent has listening capabilities
|
|
324
|
+
*/
|
|
325
|
+
getListener() {
|
|
326
|
+
return this.request(`/api/agents/${this.agentId}/voice/listener`);
|
|
327
|
+
}
|
|
321
328
|
};
|
|
322
329
|
var Agent = class extends BaseResource {
|
|
323
330
|
constructor(options, agentId) {
|
|
@@ -1033,7 +1040,11 @@ var Workflow = class extends BaseResource {
|
|
|
1033
1040
|
throw new Error("Response body is null");
|
|
1034
1041
|
}
|
|
1035
1042
|
for await (const record of this.streamProcessor(response.body)) {
|
|
1036
|
-
|
|
1043
|
+
if (typeof record === "string") {
|
|
1044
|
+
onRecord(JSON.parse(record));
|
|
1045
|
+
} else {
|
|
1046
|
+
onRecord(record);
|
|
1047
|
+
}
|
|
1037
1048
|
}
|
|
1038
1049
|
}
|
|
1039
1050
|
/**
|
|
@@ -1194,6 +1205,17 @@ var VNextNetwork = class extends BaseResource {
|
|
|
1194
1205
|
body: params
|
|
1195
1206
|
});
|
|
1196
1207
|
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Generates a response from the v-next network
|
|
1210
|
+
* @param params - Generation parameters including message
|
|
1211
|
+
* @returns Promise containing the generated response
|
|
1212
|
+
*/
|
|
1213
|
+
loop(params) {
|
|
1214
|
+
return this.request(`/api/networks/${this.networkId}/loop`, {
|
|
1215
|
+
method: "POST",
|
|
1216
|
+
body: params
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1197
1219
|
/**
|
|
1198
1220
|
* Streams a response from the v-next network
|
|
1199
1221
|
* @param params - Stream parameters including message
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractAgent } from '@ag-ui/client';
|
|
2
|
-
import { ServerInfo, ServerDetailInfo } from '@mastra/core/mcp';
|
|
2
|
+
import { ServerInfo, MCPToolType, ServerDetailInfo } from '@mastra/core/mcp';
|
|
3
3
|
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
4
|
-
import { CoreMessage, AiMessageType, StorageThreadType,
|
|
4
|
+
import { CoreMessage, AiMessageType, StorageThreadType, MastraMessageV1, LegacyWorkflowRuns, WorkflowRuns, QueryResult, GenerateReturn } from '@mastra/core';
|
|
5
5
|
import { JSONSchema7 } from 'json-schema';
|
|
6
6
|
import { ZodSchema } from 'zod';
|
|
7
7
|
import { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
|
|
@@ -43,6 +43,8 @@ interface GetAgentResponse {
|
|
|
43
43
|
workflows: Record<string, GetWorkflowResponse>;
|
|
44
44
|
provider: string;
|
|
45
45
|
modelId: string;
|
|
46
|
+
defaultGenerateOptions: WithoutMethods<AgentGenerateOptions>;
|
|
47
|
+
defaultStreamOptions: WithoutMethods<AgentStreamOptions>;
|
|
46
48
|
}
|
|
47
49
|
type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
48
50
|
messages: string | string[] | CoreMessage[] | AiMessageType[];
|
|
@@ -143,10 +145,10 @@ interface GetVectorIndexResponse {
|
|
|
143
145
|
count: number;
|
|
144
146
|
}
|
|
145
147
|
interface SaveMessageToMemoryParams {
|
|
146
|
-
messages:
|
|
148
|
+
messages: MastraMessageV1[];
|
|
147
149
|
agentId: string;
|
|
148
150
|
}
|
|
149
|
-
type SaveMessageToMemoryResponse =
|
|
151
|
+
type SaveMessageToMemoryResponse = MastraMessageV1[];
|
|
150
152
|
interface CreateMemoryThreadParams {
|
|
151
153
|
title?: string;
|
|
152
154
|
metadata?: Record<string, any>;
|
|
@@ -273,6 +275,13 @@ interface GenerateVNextNetworkResponse {
|
|
|
273
275
|
resourceId: string;
|
|
274
276
|
resourceType: 'none' | 'tool' | 'agent' | 'workflow';
|
|
275
277
|
}
|
|
278
|
+
interface LoopVNextNetworkResponse {
|
|
279
|
+
status: 'success';
|
|
280
|
+
result: {
|
|
281
|
+
text: string;
|
|
282
|
+
};
|
|
283
|
+
steps: WorkflowResult<any, any>['steps'];
|
|
284
|
+
}
|
|
276
285
|
interface McpServerListResponse {
|
|
277
286
|
servers: ServerInfo[];
|
|
278
287
|
next: string | null;
|
|
@@ -283,6 +292,7 @@ interface McpToolInfo {
|
|
|
283
292
|
name: string;
|
|
284
293
|
description?: string;
|
|
285
294
|
inputSchema: string;
|
|
295
|
+
toolType?: MCPToolType;
|
|
286
296
|
}
|
|
287
297
|
interface McpServerToolListResponse {
|
|
288
298
|
tools: McpToolInfo[];
|
|
@@ -330,6 +340,13 @@ declare class AgentVoice extends BaseResource {
|
|
|
330
340
|
voiceId: string;
|
|
331
341
|
[key: string]: any;
|
|
332
342
|
}>>;
|
|
343
|
+
/**
|
|
344
|
+
* Get the listener configuration for the agent's voice provider
|
|
345
|
+
* @returns Promise containing a check if the agent has listening capabilities
|
|
346
|
+
*/
|
|
347
|
+
getListener(): Promise<{
|
|
348
|
+
enabled: boolean;
|
|
349
|
+
}>;
|
|
333
350
|
}
|
|
334
351
|
declare class Agent extends BaseResource {
|
|
335
352
|
private agentId;
|
|
@@ -774,6 +791,14 @@ declare class VNextNetwork extends BaseResource {
|
|
|
774
791
|
generate(params: {
|
|
775
792
|
message: string;
|
|
776
793
|
}): Promise<GenerateVNextNetworkResponse>;
|
|
794
|
+
/**
|
|
795
|
+
* Generates a response from the v-next network
|
|
796
|
+
* @param params - Generation parameters including message
|
|
797
|
+
* @returns Promise containing the generated response
|
|
798
|
+
*/
|
|
799
|
+
loop(params: {
|
|
800
|
+
message: string;
|
|
801
|
+
}): Promise<LoopVNextNetworkResponse>;
|
|
777
802
|
/**
|
|
778
803
|
* Streams a response from the v-next network
|
|
779
804
|
* @param params - Stream parameters including message
|
|
@@ -957,4 +982,4 @@ declare class MastraClient extends BaseResource {
|
|
|
957
982
|
getA2A(agentId: string): A2A;
|
|
958
983
|
}
|
|
959
984
|
|
|
960
|
-
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, 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 GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextNetworkResponse, type GetVectorIndexResponse, type GetWorkflowResponse, 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 };
|
|
985
|
+
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, 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 GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextNetworkResponse, type GetVectorIndexResponse, type GetWorkflowResponse, 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 StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult, type WorkflowWatchResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractAgent } from '@ag-ui/client';
|
|
2
|
-
import { ServerInfo, ServerDetailInfo } from '@mastra/core/mcp';
|
|
2
|
+
import { ServerInfo, MCPToolType, ServerDetailInfo } from '@mastra/core/mcp';
|
|
3
3
|
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
4
|
-
import { CoreMessage, AiMessageType, StorageThreadType,
|
|
4
|
+
import { CoreMessage, AiMessageType, StorageThreadType, MastraMessageV1, LegacyWorkflowRuns, WorkflowRuns, QueryResult, GenerateReturn } from '@mastra/core';
|
|
5
5
|
import { JSONSchema7 } from 'json-schema';
|
|
6
6
|
import { ZodSchema } from 'zod';
|
|
7
7
|
import { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
|
|
@@ -43,6 +43,8 @@ interface GetAgentResponse {
|
|
|
43
43
|
workflows: Record<string, GetWorkflowResponse>;
|
|
44
44
|
provider: string;
|
|
45
45
|
modelId: string;
|
|
46
|
+
defaultGenerateOptions: WithoutMethods<AgentGenerateOptions>;
|
|
47
|
+
defaultStreamOptions: WithoutMethods<AgentStreamOptions>;
|
|
46
48
|
}
|
|
47
49
|
type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
48
50
|
messages: string | string[] | CoreMessage[] | AiMessageType[];
|
|
@@ -143,10 +145,10 @@ interface GetVectorIndexResponse {
|
|
|
143
145
|
count: number;
|
|
144
146
|
}
|
|
145
147
|
interface SaveMessageToMemoryParams {
|
|
146
|
-
messages:
|
|
148
|
+
messages: MastraMessageV1[];
|
|
147
149
|
agentId: string;
|
|
148
150
|
}
|
|
149
|
-
type SaveMessageToMemoryResponse =
|
|
151
|
+
type SaveMessageToMemoryResponse = MastraMessageV1[];
|
|
150
152
|
interface CreateMemoryThreadParams {
|
|
151
153
|
title?: string;
|
|
152
154
|
metadata?: Record<string, any>;
|
|
@@ -273,6 +275,13 @@ interface GenerateVNextNetworkResponse {
|
|
|
273
275
|
resourceId: string;
|
|
274
276
|
resourceType: 'none' | 'tool' | 'agent' | 'workflow';
|
|
275
277
|
}
|
|
278
|
+
interface LoopVNextNetworkResponse {
|
|
279
|
+
status: 'success';
|
|
280
|
+
result: {
|
|
281
|
+
text: string;
|
|
282
|
+
};
|
|
283
|
+
steps: WorkflowResult<any, any>['steps'];
|
|
284
|
+
}
|
|
276
285
|
interface McpServerListResponse {
|
|
277
286
|
servers: ServerInfo[];
|
|
278
287
|
next: string | null;
|
|
@@ -283,6 +292,7 @@ interface McpToolInfo {
|
|
|
283
292
|
name: string;
|
|
284
293
|
description?: string;
|
|
285
294
|
inputSchema: string;
|
|
295
|
+
toolType?: MCPToolType;
|
|
286
296
|
}
|
|
287
297
|
interface McpServerToolListResponse {
|
|
288
298
|
tools: McpToolInfo[];
|
|
@@ -330,6 +340,13 @@ declare class AgentVoice extends BaseResource {
|
|
|
330
340
|
voiceId: string;
|
|
331
341
|
[key: string]: any;
|
|
332
342
|
}>>;
|
|
343
|
+
/**
|
|
344
|
+
* Get the listener configuration for the agent's voice provider
|
|
345
|
+
* @returns Promise containing a check if the agent has listening capabilities
|
|
346
|
+
*/
|
|
347
|
+
getListener(): Promise<{
|
|
348
|
+
enabled: boolean;
|
|
349
|
+
}>;
|
|
333
350
|
}
|
|
334
351
|
declare class Agent extends BaseResource {
|
|
335
352
|
private agentId;
|
|
@@ -774,6 +791,14 @@ declare class VNextNetwork extends BaseResource {
|
|
|
774
791
|
generate(params: {
|
|
775
792
|
message: string;
|
|
776
793
|
}): Promise<GenerateVNextNetworkResponse>;
|
|
794
|
+
/**
|
|
795
|
+
* Generates a response from the v-next network
|
|
796
|
+
* @param params - Generation parameters including message
|
|
797
|
+
* @returns Promise containing the generated response
|
|
798
|
+
*/
|
|
799
|
+
loop(params: {
|
|
800
|
+
message: string;
|
|
801
|
+
}): Promise<LoopVNextNetworkResponse>;
|
|
777
802
|
/**
|
|
778
803
|
* Streams a response from the v-next network
|
|
779
804
|
* @param params - Stream parameters including message
|
|
@@ -957,4 +982,4 @@ declare class MastraClient extends BaseResource {
|
|
|
957
982
|
getA2A(agentId: string): A2A;
|
|
958
983
|
}
|
|
959
984
|
|
|
960
|
-
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, 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 GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextNetworkResponse, type GetVectorIndexResponse, type GetWorkflowResponse, 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 };
|
|
985
|
+
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, 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 GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextNetworkResponse, type GetVectorIndexResponse, type GetWorkflowResponse, 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 StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult, type WorkflowWatchResult };
|
package/dist/index.js
CHANGED
|
@@ -312,6 +312,13 @@ var AgentVoice = class extends BaseResource {
|
|
|
312
312
|
getSpeakers() {
|
|
313
313
|
return this.request(`/api/agents/${this.agentId}/voice/speakers`);
|
|
314
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Get the listener configuration for the agent's voice provider
|
|
317
|
+
* @returns Promise containing a check if the agent has listening capabilities
|
|
318
|
+
*/
|
|
319
|
+
getListener() {
|
|
320
|
+
return this.request(`/api/agents/${this.agentId}/voice/listener`);
|
|
321
|
+
}
|
|
315
322
|
};
|
|
316
323
|
var Agent = class extends BaseResource {
|
|
317
324
|
constructor(options, agentId) {
|
|
@@ -1027,7 +1034,11 @@ var Workflow = class extends BaseResource {
|
|
|
1027
1034
|
throw new Error("Response body is null");
|
|
1028
1035
|
}
|
|
1029
1036
|
for await (const record of this.streamProcessor(response.body)) {
|
|
1030
|
-
|
|
1037
|
+
if (typeof record === "string") {
|
|
1038
|
+
onRecord(JSON.parse(record));
|
|
1039
|
+
} else {
|
|
1040
|
+
onRecord(record);
|
|
1041
|
+
}
|
|
1031
1042
|
}
|
|
1032
1043
|
}
|
|
1033
1044
|
/**
|
|
@@ -1188,6 +1199,17 @@ var VNextNetwork = class extends BaseResource {
|
|
|
1188
1199
|
body: params
|
|
1189
1200
|
});
|
|
1190
1201
|
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Generates a response from the v-next network
|
|
1204
|
+
* @param params - Generation parameters including message
|
|
1205
|
+
* @returns Promise containing the generated response
|
|
1206
|
+
*/
|
|
1207
|
+
loop(params) {
|
|
1208
|
+
return this.request(`/api/networks/${this.networkId}/loop`, {
|
|
1209
|
+
method: "POST",
|
|
1210
|
+
body: params
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1191
1213
|
/**
|
|
1192
1214
|
* Streams a response from the v-next network
|
|
1193
1215
|
* @param params - Stream parameters including message
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "0.0.0-vnextAgentNetwork-
|
|
3
|
+
"version": "0.0.0-vnextAgentNetwork-20250602134426",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"zod": "^3.0.0",
|
|
34
|
-
"@mastra/core": "^0.10.0"
|
|
34
|
+
"@mastra/core": "^0.10.0-alpha.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/preset-env": "^7.26.9",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"tsup": "^8.4.0",
|
|
43
43
|
"typescript": "^5.8.2",
|
|
44
44
|
"vitest": "^3.1.2",
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
45
|
+
"@internal/lint": "0.0.0-vnextAgentNetwork-20250602134426",
|
|
46
|
+
"@mastra/core": "0.0.0-vnextAgentNetwork-20250602134426"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting",
|
package/src/resources/agent.ts
CHANGED
|
@@ -70,6 +70,14 @@ export class AgentVoice extends BaseResource {
|
|
|
70
70
|
getSpeakers(): Promise<Array<{ voiceId: string; [key: string]: any }>> {
|
|
71
71
|
return this.request(`/api/agents/${this.agentId}/voice/speakers`);
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get the listener configuration for the agent's voice provider
|
|
76
|
+
* @returns Promise containing a check if the agent has listening capabilities
|
|
77
|
+
*/
|
|
78
|
+
getListener(): Promise<{ enabled: boolean }> {
|
|
79
|
+
return this.request(`/api/agents/${this.agentId}/voice/listener`);
|
|
80
|
+
}
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
export class Agent extends BaseResource {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ClientOptions,
|
|
3
|
+
GetVNextNetworkResponse,
|
|
4
|
+
GenerateVNextNetworkResponse,
|
|
5
|
+
LoopVNextNetworkResponse,
|
|
6
|
+
} from '../types';
|
|
2
7
|
|
|
3
8
|
import { BaseResource } from './base';
|
|
4
9
|
|
|
@@ -32,6 +37,18 @@ export class VNextNetwork extends BaseResource {
|
|
|
32
37
|
});
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Generates a response from the v-next network
|
|
42
|
+
* @param params - Generation parameters including message
|
|
43
|
+
* @returns Promise containing the generated response
|
|
44
|
+
*/
|
|
45
|
+
loop(params: { message: string }): Promise<LoopVNextNetworkResponse> {
|
|
46
|
+
return this.request(`/api/networks/${this.networkId}/loop`, {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
body: params,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
35
52
|
/**
|
|
36
53
|
* Streams a response from the v-next network
|
|
37
54
|
* @param params - Stream parameters including message
|
|
@@ -319,7 +319,11 @@ export class Workflow extends BaseResource {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
for await (const record of this.streamProcessor(response.body)) {
|
|
322
|
-
|
|
322
|
+
if (typeof record === 'string') {
|
|
323
|
+
onRecord(JSON.parse(record));
|
|
324
|
+
} else {
|
|
325
|
+
onRecord(record);
|
|
326
|
+
}
|
|
323
327
|
}
|
|
324
328
|
}
|
|
325
329
|
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
2
|
+
MastraMessageV1,
|
|
3
3
|
AiMessageType,
|
|
4
4
|
CoreMessage,
|
|
5
5
|
QueryResult,
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
import type { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
|
|
11
11
|
import type { BaseLogMessage } from '@mastra/core/logger';
|
|
12
12
|
|
|
13
|
-
import type { ServerInfo } from '@mastra/core/mcp';
|
|
13
|
+
import type { MCPToolType, ServerInfo } from '@mastra/core/mcp';
|
|
14
14
|
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
15
15
|
import type { Workflow, WatchEvent, WorkflowResult } from '@mastra/core/workflows';
|
|
16
16
|
import type {
|
|
@@ -60,6 +60,8 @@ export interface GetAgentResponse {
|
|
|
60
60
|
workflows: Record<string, GetWorkflowResponse>;
|
|
61
61
|
provider: string;
|
|
62
62
|
modelId: string;
|
|
63
|
+
defaultGenerateOptions: WithoutMethods<AgentGenerateOptions>;
|
|
64
|
+
defaultStreamOptions: WithoutMethods<AgentStreamOptions>;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
export type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
@@ -170,11 +172,11 @@ export interface GetVectorIndexResponse {
|
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
export interface SaveMessageToMemoryParams {
|
|
173
|
-
messages:
|
|
175
|
+
messages: MastraMessageV1[];
|
|
174
176
|
agentId: string;
|
|
175
177
|
}
|
|
176
178
|
|
|
177
|
-
export type SaveMessageToMemoryResponse =
|
|
179
|
+
export type SaveMessageToMemoryResponse = MastraMessageV1[];
|
|
178
180
|
|
|
179
181
|
export interface CreateMemoryThreadParams {
|
|
180
182
|
title?: string;
|
|
@@ -321,6 +323,14 @@ export interface GenerateVNextNetworkResponse {
|
|
|
321
323
|
resourceType: 'none' | 'tool' | 'agent' | 'workflow';
|
|
322
324
|
}
|
|
323
325
|
|
|
326
|
+
export interface LoopVNextNetworkResponse {
|
|
327
|
+
status: 'success';
|
|
328
|
+
result: {
|
|
329
|
+
text: string;
|
|
330
|
+
};
|
|
331
|
+
steps: WorkflowResult<any, any>['steps'];
|
|
332
|
+
}
|
|
333
|
+
|
|
324
334
|
export interface McpServerListResponse {
|
|
325
335
|
servers: ServerInfo[];
|
|
326
336
|
next: string | null;
|
|
@@ -332,6 +342,7 @@ export interface McpToolInfo {
|
|
|
332
342
|
name: string;
|
|
333
343
|
description?: string;
|
|
334
344
|
inputSchema: string;
|
|
345
|
+
toolType?: MCPToolType;
|
|
335
346
|
}
|
|
336
347
|
|
|
337
348
|
export interface McpServerToolListResponse {
|