@mastra/client-js 1.47.0-alpha.3 → 1.47.0-alpha.4
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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +21 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/dist/resources/a2a.d.ts +5 -1
- package/dist/resources/a2a.d.ts.map +1 -1
- package/dist/route-types.generated.d.ts +104 -20
- package/dist/route-types.generated.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { standardSchemaToJSONSchema, toStandardSchema } from "@mastra/schema-com
|
|
|
5
5
|
import { RequestContext, RequestContext as RequestContext$1 } from "@mastra/core/request-context";
|
|
6
6
|
import { zodToJsonSchema } from "@mastra/schema-compat/zod-to-json";
|
|
7
7
|
import { MastraA2AError } from "@mastra/core/a2a/client";
|
|
8
|
-
import { AgentCard, CancelTaskRequest, GetTaskRequest, ListTasksRequest, ListTasksResponse, SendMessageRequest, SendMessageResponse, StreamResponse, SubscribeToTaskRequest, Task } from "@mastra/core/a2a/v1";
|
|
8
|
+
import { AgentCard, CancelTaskRequest, DeleteTaskPushNotificationConfigRequest, GetTaskPushNotificationConfigRequest, GetTaskRequest, ListTaskPushNotificationConfigsRequest, ListTaskPushNotificationConfigsResponse, ListTasksRequest, ListTasksResponse, SendMessageRequest, SendMessageResponse, StreamResponse, SubscribeToTaskRequest, Task, TaskPushNotificationConfig } from "@mastra/core/a2a/v1";
|
|
9
9
|
import canonicalize from "canonicalize";
|
|
10
10
|
import { base64url, compactVerify, decodeProtectedHeader, importJWK, importSPKI, importX509 } from "jose";
|
|
11
11
|
//#region src/observability/collector.ts
|
|
@@ -3924,12 +3924,27 @@ var A2AV1 = class extends BaseResource {
|
|
|
3924
3924
|
}
|
|
3925
3925
|
}));
|
|
3926
3926
|
}
|
|
3927
|
+
async createTaskPushNotificationConfig(params) {
|
|
3928
|
+
const result = await this.rpc("CreateTaskPushNotificationConfig", TaskPushNotificationConfig.toJSON(params));
|
|
3929
|
+
return TaskPushNotificationConfig.fromJSON(result);
|
|
3930
|
+
}
|
|
3931
|
+
async getTaskPushNotificationConfig(params) {
|
|
3932
|
+
const result = await this.rpc("GetTaskPushNotificationConfig", GetTaskPushNotificationConfigRequest.toJSON(params));
|
|
3933
|
+
return TaskPushNotificationConfig.fromJSON(result);
|
|
3934
|
+
}
|
|
3935
|
+
async listTaskPushNotificationConfigs(params) {
|
|
3936
|
+
const result = await this.rpc("ListTaskPushNotificationConfigs", ListTaskPushNotificationConfigsRequest.toJSON(params));
|
|
3937
|
+
return ListTaskPushNotificationConfigsResponse.fromJSON(result);
|
|
3938
|
+
}
|
|
3939
|
+
async deleteTaskPushNotificationConfig(params) {
|
|
3940
|
+
await this.rpc("DeleteTaskPushNotificationConfig", DeleteTaskPushNotificationConfigRequest.toJSON(params));
|
|
3941
|
+
}
|
|
3927
3942
|
async getAgentCard() {
|
|
3928
3943
|
const card = await this.request(`/.well-known/${this.agentId}/agent-card.json`, { headers: { "A2A-Version": "1.0" } });
|
|
3929
3944
|
return AgentCard.fromJSON(card);
|
|
3930
3945
|
}
|
|
3931
3946
|
async sendMessage(params) {
|
|
3932
|
-
const result = await this.rpc("
|
|
3947
|
+
const result = await this.rpc("SendMessage", SendMessageRequest.toJSON(params));
|
|
3933
3948
|
return SendMessageResponse.fromJSON(result);
|
|
3934
3949
|
}
|
|
3935
3950
|
async *sendMessageStream(params) {
|
|
@@ -3939,7 +3954,7 @@ var A2AV1 = class extends BaseResource {
|
|
|
3939
3954
|
body: {
|
|
3940
3955
|
jsonrpc: "2.0",
|
|
3941
3956
|
id: crypto.randomUUID(),
|
|
3942
|
-
method: "
|
|
3957
|
+
method: "SendStreamingMessage",
|
|
3943
3958
|
params: SendMessageRequest.toJSON(params)
|
|
3944
3959
|
},
|
|
3945
3960
|
stream: true
|
|
@@ -3947,15 +3962,15 @@ var A2AV1 = class extends BaseResource {
|
|
|
3947
3962
|
for await (const event of processA2AStream(await requireResponseBody(response, "message/stream"))) yield StreamResponse.fromJSON(event);
|
|
3948
3963
|
}
|
|
3949
3964
|
async getTask(params) {
|
|
3950
|
-
const result = await this.rpc("
|
|
3965
|
+
const result = await this.rpc("GetTask", GetTaskRequest.toJSON(params));
|
|
3951
3966
|
return Task.fromJSON(result);
|
|
3952
3967
|
}
|
|
3953
3968
|
async listTasks(params) {
|
|
3954
|
-
const result = await this.rpc("
|
|
3969
|
+
const result = await this.rpc("ListTasks", ListTasksRequest.toJSON(params));
|
|
3955
3970
|
return ListTasksResponse.fromJSON(result);
|
|
3956
3971
|
}
|
|
3957
3972
|
async cancelTask(params) {
|
|
3958
|
-
const result = await this.rpc("
|
|
3973
|
+
const result = await this.rpc("CancelTask", CancelTaskRequest.toJSON(params));
|
|
3959
3974
|
return Task.fromJSON(result);
|
|
3960
3975
|
}
|
|
3961
3976
|
async *resubscribeTask(params) {
|
|
@@ -3965,7 +3980,7 @@ var A2AV1 = class extends BaseResource {
|
|
|
3965
3980
|
body: {
|
|
3966
3981
|
jsonrpc: "2.0",
|
|
3967
3982
|
id: crypto.randomUUID(),
|
|
3968
|
-
method: "
|
|
3983
|
+
method: "SubscribeToTask",
|
|
3969
3984
|
params: SubscribeToTaskRequest.toJSON(params)
|
|
3970
3985
|
},
|
|
3971
3986
|
stream: true
|