@mastra/client-js 1.47.0-alpha.2 → 1.47.0-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/dist/client.d.ts +45 -201
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-client-js-mastra-client.md +1 -1
- package/dist/index.cjs +36 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -29
- package/dist/index.js.map +1 -1
- package/dist/resources/agent-builder.d.ts +25 -40
- package/dist/resources/agent-builder.d.ts.map +1 -1
- package/dist/resources/agent-controller.d.ts +5 -4
- package/dist/resources/agent-controller.d.ts.map +1 -1
- package/dist/resources/agent.d.ts +32 -70
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/channels.d.ts +13 -31
- package/dist/resources/channels.d.ts.map +1 -1
- package/dist/resources/conversations.d.ts +6 -3
- package/dist/resources/conversations.d.ts.map +1 -1
- package/dist/resources/mcp-tool.d.ts +3 -5
- package/dist/resources/mcp-tool.d.ts.map +1 -1
- package/dist/resources/memory-thread.d.ts +6 -11
- package/dist/resources/memory-thread.d.ts.map +1 -1
- package/dist/resources/observability-route-types.d.ts +88 -0
- package/dist/resources/observability-route-types.d.ts.map +1 -0
- package/dist/resources/observability.d.ts +6 -9
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/resources/responses.d.ts +5 -2
- package/dist/resources/responses.d.ts.map +1 -1
- package/dist/resources/run.d.ts +21 -57
- package/dist/resources/run.d.ts.map +1 -1
- package/dist/resources/tool.d.ts +6 -4
- package/dist/resources/tool.d.ts.map +1 -1
- package/dist/resources/vector.d.ts +5 -10
- package/dist/resources/vector.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +8 -10
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/route-types.generated.d.ts +2702 -2163
- package/dist/route-types.generated.d.ts.map +1 -1
- package/dist/types.d.ts +230 -1598
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -919,6 +919,11 @@ var Agent = class extends BaseResource {
|
|
|
919
919
|
* depending on the toolset's scope).
|
|
920
920
|
*
|
|
921
921
|
* @param threadId - Optional thread ID for thread-scoped browser sessions
|
|
922
|
+
*
|
|
923
|
+
* @remarks This is a browser-stream adapter compatibility endpoint, not a
|
|
924
|
+
* `SERVER_ROUTES` route. Its historical deployer implementation returns
|
|
925
|
+
* `{ success: true }`; no generated contract exists while the adapter owns it.
|
|
926
|
+
* The public `boolean` result remains broad for backwards compatibility.
|
|
922
927
|
*/
|
|
923
928
|
closeBrowser(threadId) {
|
|
924
929
|
return this.request(`/agents/${this.agentId}/browser/close`, {
|
|
@@ -3235,7 +3240,7 @@ var Run = class extends BaseResource {
|
|
|
3235
3240
|
resourceId: params.resourceId,
|
|
3236
3241
|
perStep: params.perStep
|
|
3237
3242
|
}
|
|
3238
|
-
}).then(deserializeWorkflowError);
|
|
3243
|
+
}).then((result) => deserializeWorkflowError(result));
|
|
3239
3244
|
}
|
|
3240
3245
|
/**
|
|
3241
3246
|
* Starts a workflow run and returns a stream
|
|
@@ -3317,7 +3322,7 @@ var Run = class extends BaseResource {
|
|
|
3317
3322
|
perStep: params.perStep,
|
|
3318
3323
|
forEachIndex: params.forEachIndex
|
|
3319
3324
|
}
|
|
3320
|
-
}).then(deserializeWorkflowError);
|
|
3325
|
+
}).then((result) => deserializeWorkflowError(result));
|
|
3321
3326
|
}
|
|
3322
3327
|
/**
|
|
3323
3328
|
* Resumes a suspended workflow step without waiting for the workflow to complete (fire-and-forget)
|
|
@@ -3401,7 +3406,7 @@ var Run = class extends BaseResource {
|
|
|
3401
3406
|
requestContext,
|
|
3402
3407
|
tracingOptions: params?.tracingOptions
|
|
3403
3408
|
}
|
|
3404
|
-
}).then(deserializeWorkflowError);
|
|
3409
|
+
}).then((result) => deserializeWorkflowError(result));
|
|
3405
3410
|
}
|
|
3406
3411
|
/**
|
|
3407
3412
|
* Time travels a workflow run synchronously without waiting for the workflow to complete
|
|
@@ -3431,7 +3436,7 @@ var Run = class extends BaseResource {
|
|
|
3431
3436
|
...params,
|
|
3432
3437
|
requestContext
|
|
3433
3438
|
}
|
|
3434
|
-
}).then(deserializeWorkflowError);
|
|
3439
|
+
}).then((result) => deserializeWorkflowError(result));
|
|
3435
3440
|
}
|
|
3436
3441
|
/**
|
|
3437
3442
|
* Time travels a workflow run and returns a stream
|
|
@@ -4023,12 +4028,8 @@ var MCPTool = class extends BaseResource {
|
|
|
4023
4028
|
* @returns Promise containing `{ result }`, or the suspended shape described above.
|
|
4024
4029
|
*/
|
|
4025
4030
|
execute(params) {
|
|
4026
|
-
const body =
|
|
4027
|
-
|
|
4028
|
-
if (params.requestContext !== void 0) body.requestContext = params.requestContext;
|
|
4029
|
-
if (params.resumeData !== void 0) body.resumeData = params.resumeData;
|
|
4030
|
-
if (params.suspendPayload !== void 0) body.suspendPayload = params.suspendPayload;
|
|
4031
|
-
return this.request(`/mcp/${encodeURIComponent(this.serverId)}/tools/${encodeURIComponent(this.toolId)}/execute`, {
|
|
4031
|
+
const { requestContext, ...body } = params;
|
|
4032
|
+
return this.request(`/mcp/${encodeURIComponent(this.serverId)}/tools/${encodeURIComponent(this.toolId)}/execute${requestContextQueryString(requestContext)}`, {
|
|
4032
4033
|
method: "POST",
|
|
4033
4034
|
body
|
|
4034
4035
|
});
|
|
@@ -4046,23 +4047,29 @@ var AgentBuilder = class extends BaseResource {
|
|
|
4046
4047
|
this.actionId = actionId;
|
|
4047
4048
|
}
|
|
4048
4049
|
transformWorkflowResult(result) {
|
|
4049
|
-
if (result.status === "success")
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4050
|
+
if (result.status === "success") {
|
|
4051
|
+
const actionResult = result.result;
|
|
4052
|
+
return {
|
|
4053
|
+
success: actionResult?.success ?? false,
|
|
4054
|
+
applied: actionResult?.applied ?? false,
|
|
4055
|
+
branchName: actionResult?.branchName,
|
|
4056
|
+
message: actionResult?.message ?? "Agent builder action completed",
|
|
4057
|
+
validationResults: actionResult?.validationResults,
|
|
4058
|
+
error: actionResult?.error,
|
|
4059
|
+
errors: actionResult?.errors,
|
|
4060
|
+
stepResults: actionResult?.stepResults
|
|
4061
|
+
};
|
|
4062
|
+
}
|
|
4063
|
+
if (result.status === "failed") {
|
|
4064
|
+
const message = result.error?.message ?? "Agent builder action failed";
|
|
4065
|
+
return {
|
|
4066
|
+
success: false,
|
|
4067
|
+
applied: false,
|
|
4068
|
+
message: `Agent builder action failed: ${message}`,
|
|
4069
|
+
error: message
|
|
4070
|
+
};
|
|
4071
|
+
}
|
|
4072
|
+
return {
|
|
4066
4073
|
success: false,
|
|
4067
4074
|
applied: false,
|
|
4068
4075
|
message: "Agent builder action was suspended",
|
|
@@ -4258,7 +4265,7 @@ var AgentBuilder = class extends BaseResource {
|
|
|
4258
4265
|
* This calls `/agent-builder/:actionId`.
|
|
4259
4266
|
*/
|
|
4260
4267
|
async details() {
|
|
4261
|
-
return
|
|
4268
|
+
return this.request(`/agent-builder/${this.actionId}`);
|
|
4262
4269
|
}
|
|
4263
4270
|
/**
|
|
4264
4271
|
* Gets all runs for this agent builder action.
|
|
@@ -4487,7 +4494,7 @@ var Observability = class extends BaseResource {
|
|
|
4487
4494
|
deleteTraces(params) {
|
|
4488
4495
|
return this.request(`/observability/traces/delete`, {
|
|
4489
4496
|
method: "POST",
|
|
4490
|
-
body:
|
|
4497
|
+
body: params
|
|
4491
4498
|
});
|
|
4492
4499
|
}
|
|
4493
4500
|
/**
|