@mastra/client-js 0.13.2-alpha.2 → 0.13.2-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/CHANGELOG.md +13 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +45 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +45 -6
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts +17 -1
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/observability.d.ts +10 -0
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -213,7 +213,9 @@ async function executeToolCallAndRespond({
|
|
|
213
213
|
resourceId,
|
|
214
214
|
threadId,
|
|
215
215
|
runtimeContext,
|
|
216
|
-
tracingContext: { currentSpan: void 0 }
|
|
216
|
+
tracingContext: { currentSpan: void 0 },
|
|
217
|
+
suspend: async () => {
|
|
218
|
+
}
|
|
217
219
|
},
|
|
218
220
|
{
|
|
219
221
|
messages: response.messages,
|
|
@@ -321,7 +323,7 @@ var Agent = class extends BaseResource {
|
|
|
321
323
|
}
|
|
322
324
|
async generate(params) {
|
|
323
325
|
console.warn(
|
|
324
|
-
"Deprecation NOTICE:Generate method will switch to use generateVNext implementation September
|
|
326
|
+
"Deprecation NOTICE:Generate method will switch to use generateVNext implementation September 30th, 2025. Please use generateLegacy if you don't want to upgrade just yet."
|
|
325
327
|
);
|
|
326
328
|
return this.generateLegacy(params);
|
|
327
329
|
}
|
|
@@ -356,7 +358,9 @@ var Agent = class extends BaseResource {
|
|
|
356
358
|
resourceId,
|
|
357
359
|
threadId,
|
|
358
360
|
runtimeContext,
|
|
359
|
-
tracingContext: { currentSpan: void 0 }
|
|
361
|
+
tracingContext: { currentSpan: void 0 },
|
|
362
|
+
suspend: async () => {
|
|
363
|
+
}
|
|
360
364
|
},
|
|
361
365
|
{
|
|
362
366
|
messages: response.messages,
|
|
@@ -700,7 +704,7 @@ var Agent = class extends BaseResource {
|
|
|
700
704
|
*/
|
|
701
705
|
async stream(params) {
|
|
702
706
|
console.warn(
|
|
703
|
-
"Deprecation NOTICE:\nStream method will switch to use streamVNext implementation September
|
|
707
|
+
"Deprecation NOTICE:\nStream method will switch to use streamVNext implementation September 30th, 2025. Please use streamLegacy if you don't want to upgrade just yet."
|
|
704
708
|
);
|
|
705
709
|
return this.streamLegacy(params);
|
|
706
710
|
}
|
|
@@ -1049,7 +1053,9 @@ var Agent = class extends BaseResource {
|
|
|
1049
1053
|
threadId: processedParams.threadId,
|
|
1050
1054
|
runtimeContext: processedParams.runtimeContext,
|
|
1051
1055
|
// TODO: Pass proper tracing context when client-js supports tracing
|
|
1052
|
-
tracingContext: { currentSpan: void 0 }
|
|
1056
|
+
tracingContext: { currentSpan: void 0 },
|
|
1057
|
+
suspend: async () => {
|
|
1058
|
+
}
|
|
1053
1059
|
},
|
|
1054
1060
|
{
|
|
1055
1061
|
messages: response.messages,
|
|
@@ -1213,7 +1219,9 @@ var Agent = class extends BaseResource {
|
|
|
1213
1219
|
threadId: processedParams.threadId,
|
|
1214
1220
|
runtimeContext: processedParams.runtimeContext,
|
|
1215
1221
|
// TODO: Pass proper tracing context when client-js supports tracing
|
|
1216
|
-
tracingContext: { currentSpan: void 0 }
|
|
1222
|
+
tracingContext: { currentSpan: void 0 },
|
|
1223
|
+
suspend: async () => {
|
|
1224
|
+
}
|
|
1217
1225
|
},
|
|
1218
1226
|
{
|
|
1219
1227
|
messages: response.messages,
|
|
@@ -1331,6 +1339,28 @@ var Agent = class extends BaseResource {
|
|
|
1331
1339
|
body: params
|
|
1332
1340
|
});
|
|
1333
1341
|
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Updates the model for the agent in the model list
|
|
1344
|
+
* @param params - Parameters for updating the model
|
|
1345
|
+
* @returns Promise containing the updated model
|
|
1346
|
+
*/
|
|
1347
|
+
updateModelInModelList({ modelConfigId, ...params }) {
|
|
1348
|
+
return this.request(`/api/agents/${this.agentId}/models/${modelConfigId}`, {
|
|
1349
|
+
method: "POST",
|
|
1350
|
+
body: params
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Reorders the models for the agent
|
|
1355
|
+
* @param params - Parameters for reordering the model list
|
|
1356
|
+
* @returns Promise containing the updated model list
|
|
1357
|
+
*/
|
|
1358
|
+
reorderModelList(params) {
|
|
1359
|
+
return this.request(`/api/agents/${this.agentId}/models/reorder`, {
|
|
1360
|
+
method: "POST",
|
|
1361
|
+
body: params
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1334
1364
|
};
|
|
1335
1365
|
|
|
1336
1366
|
// src/resources/memory-thread.ts
|
|
@@ -2699,6 +2729,12 @@ var Observability = class extends BaseResource {
|
|
|
2699
2729
|
const queryString = searchParams.toString();
|
|
2700
2730
|
return this.request(`/api/observability/traces${queryString ? `?${queryString}` : ""}`);
|
|
2701
2731
|
}
|
|
2732
|
+
score(params) {
|
|
2733
|
+
return this.request(`/api/observability/traces/score`, {
|
|
2734
|
+
method: "POST",
|
|
2735
|
+
body: { ...params }
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2702
2738
|
};
|
|
2703
2739
|
|
|
2704
2740
|
// src/resources/network-memory-thread.ts
|
|
@@ -3456,6 +3492,9 @@ var MastraClient = class extends BaseResource {
|
|
|
3456
3492
|
getAITraces(params) {
|
|
3457
3493
|
return this.observability.getTraces(params);
|
|
3458
3494
|
}
|
|
3495
|
+
score(params) {
|
|
3496
|
+
return this.observability.score(params);
|
|
3497
|
+
}
|
|
3459
3498
|
};
|
|
3460
3499
|
|
|
3461
3500
|
// src/tools.ts
|