@mastra/client-js 0.10.6 → 0.10.7-alpha.1
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 +17 -0
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +25 -0
- package/package.json +2 -2
- package/src/resources/vNextNetwork.ts +30 -0
- package/src/types.ts +7 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/client-js@0.10.
|
|
2
|
+
> @mastra/client-js@0.10.7-alpha.1 build /home/runner/work/mastra/mastra/client-sdks/client-js
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
[34mCLI[39m Cleaning output folder
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m67.49 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 1909ms
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m67.20 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 1910ms
|
|
16
16
|
[34mDTS[39m Build start
|
|
17
|
-
[32mDTS[39m ⚡️ Build success in
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m39.
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 15457ms
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.62 KB[39m
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m39.62 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.10.7-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b8f16b2]
|
|
8
|
+
- Updated dependencies [3e04487]
|
|
9
|
+
- Updated dependencies [dc4ca0a]
|
|
10
|
+
- @mastra/core@0.10.8-alpha.1
|
|
11
|
+
|
|
12
|
+
## 0.10.7-alpha.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- a344ac7: Fix tool streaming in agent network
|
|
17
|
+
- Updated dependencies [a344ac7]
|
|
18
|
+
- @mastra/core@0.10.8-alpha.0
|
|
19
|
+
|
|
3
20
|
## 0.10.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1708,6 +1708,31 @@ var VNextNetwork = class extends BaseResource {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
1710
|
}
|
|
1711
|
+
/**
|
|
1712
|
+
* Streams a response from the v-next network loop
|
|
1713
|
+
* @param params - Stream parameters including message
|
|
1714
|
+
* @returns Promise containing the results
|
|
1715
|
+
*/
|
|
1716
|
+
async loopStream(params, onRecord) {
|
|
1717
|
+
const response = await this.request(`/api/networks/v-next/${this.networkId}/loop-stream`, {
|
|
1718
|
+
method: "POST",
|
|
1719
|
+
body: params,
|
|
1720
|
+
stream: true
|
|
1721
|
+
});
|
|
1722
|
+
if (!response.ok) {
|
|
1723
|
+
throw new Error(`Failed to stream vNext network loop: ${response.statusText}`);
|
|
1724
|
+
}
|
|
1725
|
+
if (!response.body) {
|
|
1726
|
+
throw new Error("Response body is null");
|
|
1727
|
+
}
|
|
1728
|
+
for await (const record of this.streamProcessor(response.body)) {
|
|
1729
|
+
if (typeof record === "string") {
|
|
1730
|
+
onRecord(JSON.parse(record));
|
|
1731
|
+
} else {
|
|
1732
|
+
onRecord(record);
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1711
1736
|
};
|
|
1712
1737
|
|
|
1713
1738
|
// src/resources/network-memory-thread.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -318,6 +318,12 @@ interface GenerateOrStreamVNextNetworkParams {
|
|
|
318
318
|
threadId?: string;
|
|
319
319
|
resourceId?: string;
|
|
320
320
|
}
|
|
321
|
+
interface LoopStreamVNextNetworkParams {
|
|
322
|
+
message: string;
|
|
323
|
+
threadId?: string;
|
|
324
|
+
resourceId?: string;
|
|
325
|
+
maxIterations?: number;
|
|
326
|
+
}
|
|
321
327
|
interface LoopVNextNetworkResponse {
|
|
322
328
|
status: 'success';
|
|
323
329
|
result: {
|
|
@@ -875,6 +881,12 @@ declare class VNextNetwork extends BaseResource {
|
|
|
875
881
|
* @returns Promise containing the results
|
|
876
882
|
*/
|
|
877
883
|
stream(params: GenerateOrStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
884
|
+
/**
|
|
885
|
+
* Streams a response from the v-next network loop
|
|
886
|
+
* @param params - Stream parameters including message
|
|
887
|
+
* @returns Promise containing the results
|
|
888
|
+
*/
|
|
889
|
+
loopStream(params: LoopStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
878
890
|
}
|
|
879
891
|
|
|
880
892
|
declare class NetworkMemoryThread extends BaseResource {
|
|
@@ -1111,4 +1123,4 @@ declare class MastraClient extends BaseResource {
|
|
|
1111
1123
|
getA2A(agentId: string): A2A;
|
|
1112
1124
|
}
|
|
1113
1125
|
|
|
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 };
|
|
1126
|
+
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 LoopStreamVNextNetworkParams, 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
|
@@ -318,6 +318,12 @@ interface GenerateOrStreamVNextNetworkParams {
|
|
|
318
318
|
threadId?: string;
|
|
319
319
|
resourceId?: string;
|
|
320
320
|
}
|
|
321
|
+
interface LoopStreamVNextNetworkParams {
|
|
322
|
+
message: string;
|
|
323
|
+
threadId?: string;
|
|
324
|
+
resourceId?: string;
|
|
325
|
+
maxIterations?: number;
|
|
326
|
+
}
|
|
321
327
|
interface LoopVNextNetworkResponse {
|
|
322
328
|
status: 'success';
|
|
323
329
|
result: {
|
|
@@ -875,6 +881,12 @@ declare class VNextNetwork extends BaseResource {
|
|
|
875
881
|
* @returns Promise containing the results
|
|
876
882
|
*/
|
|
877
883
|
stream(params: GenerateOrStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
884
|
+
/**
|
|
885
|
+
* Streams a response from the v-next network loop
|
|
886
|
+
* @param params - Stream parameters including message
|
|
887
|
+
* @returns Promise containing the results
|
|
888
|
+
*/
|
|
889
|
+
loopStream(params: LoopStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
878
890
|
}
|
|
879
891
|
|
|
880
892
|
declare class NetworkMemoryThread extends BaseResource {
|
|
@@ -1111,4 +1123,4 @@ declare class MastraClient extends BaseResource {
|
|
|
1111
1123
|
getA2A(agentId: string): A2A;
|
|
1112
1124
|
}
|
|
1113
1125
|
|
|
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 };
|
|
1126
|
+
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 LoopStreamVNextNetworkParams, 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.js
CHANGED
|
@@ -1702,6 +1702,31 @@ var VNextNetwork = class extends BaseResource {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Streams a response from the v-next network loop
|
|
1707
|
+
* @param params - Stream parameters including message
|
|
1708
|
+
* @returns Promise containing the results
|
|
1709
|
+
*/
|
|
1710
|
+
async loopStream(params, onRecord) {
|
|
1711
|
+
const response = await this.request(`/api/networks/v-next/${this.networkId}/loop-stream`, {
|
|
1712
|
+
method: "POST",
|
|
1713
|
+
body: params,
|
|
1714
|
+
stream: true
|
|
1715
|
+
});
|
|
1716
|
+
if (!response.ok) {
|
|
1717
|
+
throw new Error(`Failed to stream vNext network loop: ${response.statusText}`);
|
|
1718
|
+
}
|
|
1719
|
+
if (!response.body) {
|
|
1720
|
+
throw new Error("Response body is null");
|
|
1721
|
+
}
|
|
1722
|
+
for await (const record of this.streamProcessor(response.body)) {
|
|
1723
|
+
if (typeof record === "string") {
|
|
1724
|
+
onRecord(JSON.parse(record));
|
|
1725
|
+
} else {
|
|
1726
|
+
onRecord(record);
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1705
1730
|
};
|
|
1706
1731
|
|
|
1707
1732
|
// src/resources/network-memory-thread.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.7-alpha.1",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"rxjs": "7.8.1",
|
|
34
34
|
"zod": "^3.25.67",
|
|
35
35
|
"zod-to-json-schema": "^3.24.5",
|
|
36
|
-
"@mastra/core": "0.10.
|
|
36
|
+
"@mastra/core": "0.10.8-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"zod": "^3.0.0"
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
GenerateVNextNetworkResponse,
|
|
7
7
|
LoopVNextNetworkResponse,
|
|
8
8
|
GenerateOrStreamVNextNetworkParams,
|
|
9
|
+
LoopStreamVNextNetworkParams,
|
|
9
10
|
} from '../types';
|
|
10
11
|
|
|
11
12
|
import { BaseResource } from './base';
|
|
@@ -144,4 +145,33 @@ export class VNextNetwork extends BaseResource {
|
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Streams a response from the v-next network loop
|
|
151
|
+
* @param params - Stream parameters including message
|
|
152
|
+
* @returns Promise containing the results
|
|
153
|
+
*/
|
|
154
|
+
async loopStream(params: LoopStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void) {
|
|
155
|
+
const response: Response = await this.request(`/api/networks/v-next/${this.networkId}/loop-stream`, {
|
|
156
|
+
method: 'POST',
|
|
157
|
+
body: params,
|
|
158
|
+
stream: true,
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
if (!response.ok) {
|
|
162
|
+
throw new Error(`Failed to stream vNext network loop: ${response.statusText}`);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (!response.body) {
|
|
166
|
+
throw new Error('Response body is null');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
for await (const record of this.streamProcessor(response.body)) {
|
|
170
|
+
if (typeof record === 'string') {
|
|
171
|
+
onRecord(JSON.parse(record));
|
|
172
|
+
} else {
|
|
173
|
+
onRecord(record);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
147
177
|
}
|
package/src/types.ts
CHANGED
|
@@ -373,6 +373,13 @@ export interface GenerateOrStreamVNextNetworkParams {
|
|
|
373
373
|
resourceId?: string;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
export interface LoopStreamVNextNetworkParams {
|
|
377
|
+
message: string;
|
|
378
|
+
threadId?: string;
|
|
379
|
+
resourceId?: string;
|
|
380
|
+
maxIterations?: number;
|
|
381
|
+
}
|
|
382
|
+
|
|
376
383
|
export interface LoopVNextNetworkResponse {
|
|
377
384
|
status: 'success';
|
|
378
385
|
result: {
|