@mastra/client-js 0.13.0-alpha.5 → 0.13.0-alpha.7
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 +22 -0
- package/dist/client.d.ts +2 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +49 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +49 -74
- package/dist/index.js.map +1 -1
- package/dist/resources/index.d.ts +0 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +11 -0
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/types.d.ts +2 -17
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/resources/network.d.ts +0 -32
- package/dist/resources/network.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.13.0-alpha.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689)]:
|
|
8
|
+
- @mastra/core@0.17.0-alpha.7
|
|
9
|
+
|
|
10
|
+
## 0.13.0-alpha.6
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
19
|
+
|
|
20
|
+
- Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e)]:
|
|
23
|
+
- @mastra/core@0.17.0-alpha.6
|
|
24
|
+
|
|
3
25
|
## 0.13.0-alpha.5
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AITraceRecord, AITracesPaginatedArg, WorkflowInfo } from '@mastra/core';
|
|
2
2
|
import type { ServerDetailInfo } from '@mastra/core/mcp';
|
|
3
3
|
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
4
|
-
import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource,
|
|
4
|
+
import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, A2A, MCPTool, LegacyWorkflow, AgentBuilder } from './resources/index.js';
|
|
5
5
|
import { NetworkMemoryThread } from './resources/network-memory-thread.js';
|
|
6
6
|
import { VNextNetwork } from './resources/vNextNetwork.js';
|
|
7
|
-
import type { ClientOptions, CreateMemoryThreadParams, CreateMemoryThreadResponse, GetAgentResponse, GetLogParams, GetLogsParams, GetLogsResponse, GetMemoryThreadParams, GetMemoryThreadResponse,
|
|
7
|
+
import type { ClientOptions, CreateMemoryThreadParams, CreateMemoryThreadResponse, GetAgentResponse, GetLogParams, GetLogsParams, GetLogsResponse, GetMemoryThreadParams, GetMemoryThreadResponse, GetTelemetryParams, GetTelemetryResponse, GetToolResponse, GetWorkflowResponse, SaveMessageToMemoryParams, SaveMessageToMemoryResponse, McpServerListResponse, McpServerToolListResponse, GetLegacyWorkflowResponse, GetVNextNetworkResponse, GetNetworkMemoryThreadParams, CreateNetworkMemoryThreadParams, SaveNetworkMessageToMemoryParams, GetScorerResponse, GetScoresByScorerIdParams, GetScoresResponse, GetScoresByRunIdParams, GetScoresByEntityIdParams, SaveScoreParams, SaveScoreResponse, GetAITracesResponse } from './types.js';
|
|
8
8
|
export declare class MastraClient extends BaseResource {
|
|
9
9
|
private observability;
|
|
10
10
|
constructor(options: ClientOptions);
|
|
@@ -158,22 +158,11 @@ export declare class MastraClient extends BaseResource {
|
|
|
158
158
|
* @returns Promise containing telemetry data
|
|
159
159
|
*/
|
|
160
160
|
getTelemetry(params?: GetTelemetryParams): Promise<GetTelemetryResponse>;
|
|
161
|
-
/**
|
|
162
|
-
* Retrieves all available networks
|
|
163
|
-
* @returns Promise containing map of network IDs to network details
|
|
164
|
-
*/
|
|
165
|
-
getNetworks(): Promise<Array<GetNetworkResponse>>;
|
|
166
161
|
/**
|
|
167
162
|
* Retrieves all available vNext networks
|
|
168
163
|
* @returns Promise containing map of vNext network IDs to vNext network details
|
|
169
164
|
*/
|
|
170
165
|
getVNextNetworks(): Promise<Array<GetVNextNetworkResponse>>;
|
|
171
|
-
/**
|
|
172
|
-
* Gets a network instance by ID
|
|
173
|
-
* @param networkId - ID of the network to retrieve
|
|
174
|
-
* @returns Network instance
|
|
175
|
-
*/
|
|
176
|
-
getNetwork(networkId: string): Network;
|
|
177
166
|
/**
|
|
178
167
|
* Gets a vNext network instance by ID
|
|
179
168
|
* @param networkId - ID of the vNext network to retrieve
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,GAAG,EACH,OAAO,EACP,cAAc,EACd,YAAY,EAEb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB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,EAAE,iBAAiB,CAAC,CAAC;IAI/D;;;;OAIG;IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIvD,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAqBzF;;;;OAIG;IACI,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAenF;;;;OAIG;IACI,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAezF;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOrE;;;OAGG;IACH,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAItC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAInD,WAAW,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAGxE"}
|
package/dist/index.cjs
CHANGED
|
@@ -97,7 +97,7 @@ async function sharedProcessMastraStream({
|
|
|
97
97
|
if (line.startsWith("data: ")) {
|
|
98
98
|
const data = line.slice(6);
|
|
99
99
|
if (data === "[DONE]") {
|
|
100
|
-
console.
|
|
100
|
+
console.info("\u{1F3C1} Stream finished");
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
try {
|
|
@@ -1338,63 +1338,6 @@ var Agent = class extends BaseResource {
|
|
|
1338
1338
|
});
|
|
1339
1339
|
}
|
|
1340
1340
|
};
|
|
1341
|
-
var Network = class extends BaseResource {
|
|
1342
|
-
constructor(options, networkId) {
|
|
1343
|
-
super(options);
|
|
1344
|
-
this.networkId = networkId;
|
|
1345
|
-
}
|
|
1346
|
-
/**
|
|
1347
|
-
* Retrieves details about the network
|
|
1348
|
-
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
1349
|
-
* @returns Promise containing network details
|
|
1350
|
-
*/
|
|
1351
|
-
details(runtimeContext) {
|
|
1352
|
-
return this.request(`/api/networks/${this.networkId}${runtimeContextQueryString(runtimeContext)}`);
|
|
1353
|
-
}
|
|
1354
|
-
/**
|
|
1355
|
-
* Generates a response from the agent
|
|
1356
|
-
* @param params - Generation parameters including prompt
|
|
1357
|
-
* @returns Promise containing the generated response
|
|
1358
|
-
*/
|
|
1359
|
-
generate(params) {
|
|
1360
|
-
const processedParams = {
|
|
1361
|
-
...params,
|
|
1362
|
-
output: zodToJsonSchema(params.output),
|
|
1363
|
-
experimental_output: zodToJsonSchema(params.experimental_output)
|
|
1364
|
-
};
|
|
1365
|
-
return this.request(`/api/networks/${this.networkId}/generate`, {
|
|
1366
|
-
method: "POST",
|
|
1367
|
-
body: processedParams
|
|
1368
|
-
});
|
|
1369
|
-
}
|
|
1370
|
-
/**
|
|
1371
|
-
* Streams a response from the agent
|
|
1372
|
-
* @param params - Stream parameters including prompt
|
|
1373
|
-
* @returns Promise containing the enhanced Response object with processDataStream method
|
|
1374
|
-
*/
|
|
1375
|
-
async stream(params) {
|
|
1376
|
-
const processedParams = {
|
|
1377
|
-
...params,
|
|
1378
|
-
output: zodToJsonSchema(params.output),
|
|
1379
|
-
experimental_output: zodToJsonSchema(params.experimental_output)
|
|
1380
|
-
};
|
|
1381
|
-
const response = await this.request(`/api/networks/${this.networkId}/stream`, {
|
|
1382
|
-
method: "POST",
|
|
1383
|
-
body: processedParams,
|
|
1384
|
-
stream: true
|
|
1385
|
-
});
|
|
1386
|
-
if (!response.body) {
|
|
1387
|
-
throw new Error("No response body");
|
|
1388
|
-
}
|
|
1389
|
-
response.processDataStream = async (options = {}) => {
|
|
1390
|
-
await uiUtils.processDataStream({
|
|
1391
|
-
stream: response.body,
|
|
1392
|
-
...options
|
|
1393
|
-
});
|
|
1394
|
-
};
|
|
1395
|
-
return response;
|
|
1396
|
-
}
|
|
1397
|
-
};
|
|
1398
1341
|
|
|
1399
1342
|
// src/resources/memory-thread.ts
|
|
1400
1343
|
var MemoryThread = class extends BaseResource {
|
|
@@ -2017,7 +1960,54 @@ var Workflow = class extends BaseResource {
|
|
|
2017
1960
|
}
|
|
2018
1961
|
);
|
|
2019
1962
|
if (!response.ok) {
|
|
2020
|
-
throw new Error(`Failed to stream
|
|
1963
|
+
throw new Error(`Failed to stream workflow: ${response.statusText}`);
|
|
1964
|
+
}
|
|
1965
|
+
if (!response.body) {
|
|
1966
|
+
throw new Error("Response body is null");
|
|
1967
|
+
}
|
|
1968
|
+
let failedChunk = void 0;
|
|
1969
|
+
const transformStream = new TransformStream({
|
|
1970
|
+
start() {
|
|
1971
|
+
},
|
|
1972
|
+
async transform(chunk, controller) {
|
|
1973
|
+
try {
|
|
1974
|
+
const decoded = new TextDecoder().decode(chunk);
|
|
1975
|
+
const chunks = decoded.split(RECORD_SEPARATOR2);
|
|
1976
|
+
for (const chunk2 of chunks) {
|
|
1977
|
+
if (chunk2) {
|
|
1978
|
+
const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
|
|
1979
|
+
try {
|
|
1980
|
+
const parsedChunk = JSON.parse(newChunk);
|
|
1981
|
+
controller.enqueue(parsedChunk);
|
|
1982
|
+
failedChunk = void 0;
|
|
1983
|
+
} catch {
|
|
1984
|
+
failedChunk = newChunk;
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
} catch {
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
return response.body.pipeThrough(transformStream);
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* Observes workflow stream for a workflow run
|
|
1996
|
+
* @param params - Object containing the runId
|
|
1997
|
+
* @returns Promise containing the workflow execution results
|
|
1998
|
+
*/
|
|
1999
|
+
async observeStream(params) {
|
|
2000
|
+
const searchParams = new URLSearchParams();
|
|
2001
|
+
searchParams.set("runId", params.runId);
|
|
2002
|
+
const response = await this.request(
|
|
2003
|
+
`/api/workflows/${this.workflowId}/observe-stream?${searchParams.toString()}`,
|
|
2004
|
+
{
|
|
2005
|
+
method: "POST",
|
|
2006
|
+
stream: true
|
|
2007
|
+
}
|
|
2008
|
+
);
|
|
2009
|
+
if (!response.ok) {
|
|
2010
|
+
throw new Error(`Failed to observe workflow stream: ${response.statusText}`);
|
|
2021
2011
|
}
|
|
2022
2012
|
if (!response.body) {
|
|
2023
2013
|
throw new Error("Response body is null");
|
|
@@ -3225,13 +3215,6 @@ var MastraClient = class extends BaseResource {
|
|
|
3225
3215
|
return this.request(`/api/telemetry`);
|
|
3226
3216
|
}
|
|
3227
3217
|
}
|
|
3228
|
-
/**
|
|
3229
|
-
* Retrieves all available networks
|
|
3230
|
-
* @returns Promise containing map of network IDs to network details
|
|
3231
|
-
*/
|
|
3232
|
-
getNetworks() {
|
|
3233
|
-
return this.request("/api/networks");
|
|
3234
|
-
}
|
|
3235
3218
|
/**
|
|
3236
3219
|
* Retrieves all available vNext networks
|
|
3237
3220
|
* @returns Promise containing map of vNext network IDs to vNext network details
|
|
@@ -3239,14 +3222,6 @@ var MastraClient = class extends BaseResource {
|
|
|
3239
3222
|
getVNextNetworks() {
|
|
3240
3223
|
return this.request("/api/networks/v-next");
|
|
3241
3224
|
}
|
|
3242
|
-
/**
|
|
3243
|
-
* Gets a network instance by ID
|
|
3244
|
-
* @param networkId - ID of the network to retrieve
|
|
3245
|
-
* @returns Network instance
|
|
3246
|
-
*/
|
|
3247
|
-
getNetwork(networkId) {
|
|
3248
|
-
return new Network(this.options, networkId);
|
|
3249
|
-
}
|
|
3250
3225
|
/**
|
|
3251
3226
|
* Gets a vNext network instance by ID
|
|
3252
3227
|
* @param networkId - ID of the vNext network to retrieve
|