@mastra/client-js 0.0.0-update-scorers-api-20250801170445 → 0.0.0-usechat-duplicate-20251016110554
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 +1050 -3
- package/README.md +6 -8
- package/dist/client.d.ts +57 -44
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +1735 -850
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1734 -851
- package/dist/index.js.map +1 -1
- package/dist/resources/a2a.d.ts +15 -18
- package/dist/resources/a2a.d.ts.map +1 -1
- package/dist/resources/agent-builder.d.ts +160 -0
- package/dist/resources/agent-builder.d.ts.map +1 -0
- package/dist/resources/agent.d.ts +89 -17
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/base.d.ts +1 -1
- package/dist/resources/base.d.ts.map +1 -1
- package/dist/resources/index.d.ts +10 -10
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/mcp-tool.d.ts +4 -3
- package/dist/resources/mcp-tool.d.ts.map +1 -1
- package/dist/resources/memory-thread.d.ts +3 -3
- package/dist/resources/memory-thread.d.ts.map +1 -1
- package/dist/resources/network-memory-thread.d.ts +3 -3
- package/dist/resources/network-memory-thread.d.ts.map +1 -1
- package/dist/resources/observability.d.ts +35 -0
- package/dist/resources/observability.d.ts.map +1 -0
- package/dist/resources/tool.d.ts +4 -3
- package/dist/resources/tool.d.ts.map +1 -1
- package/dist/resources/vector.d.ts +7 -4
- package/dist/resources/vector.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +129 -14
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/tools.d.ts +22 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/types.d.ts +100 -43
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/process-client-tools.d.ts.map +1 -1
- package/dist/utils/process-mastra-stream.d.ts +11 -0
- package/dist/utils/process-mastra-stream.d.ts.map +1 -0
- package/dist/utils/zod-to-json-schema.d.ts +2 -104
- package/dist/utils/zod-to-json-schema.d.ts.map +1 -1
- package/package.json +24 -16
- package/dist/adapters/agui.d.ts +0 -23
- package/dist/adapters/agui.d.ts.map +0 -1
- package/dist/resources/legacy-workflow.d.ts +0 -87
- package/dist/resources/legacy-workflow.d.ts.map +0 -1
- package/dist/resources/network.d.ts +0 -30
- package/dist/resources/network.d.ts.map +0 -1
- package/dist/resources/vNextNetwork.d.ts +0 -42
- package/dist/resources/vNextNetwork.d.ts.map +0 -1
- package/eslint.config.js +0 -6
- package/integration-tests/agui-adapter.test.ts +0 -122
- package/integration-tests/package.json +0 -18
- package/integration-tests/src/mastra/index.ts +0 -35
- package/integration-tests/vitest.config.ts +0 -9
- package/src/adapters/agui.test.ts +0 -322
- package/src/adapters/agui.ts +0 -239
- package/src/client.ts +0 -623
- package/src/example.ts +0 -95
- package/src/index.test.ts +0 -1226
- package/src/index.ts +0 -3
- package/src/resources/a2a.ts +0 -88
- package/src/resources/agent.ts +0 -785
- package/src/resources/base.ts +0 -76
- package/src/resources/index.ts +0 -10
- package/src/resources/legacy-workflow.ts +0 -242
- package/src/resources/mcp-tool.ts +0 -48
- package/src/resources/memory-thread.test.ts +0 -285
- package/src/resources/memory-thread.ts +0 -99
- package/src/resources/network-memory-thread.test.ts +0 -269
- package/src/resources/network-memory-thread.ts +0 -81
- package/src/resources/network.ts +0 -86
- package/src/resources/tool.ts +0 -45
- package/src/resources/vNextNetwork.ts +0 -194
- package/src/resources/vector.ts +0 -83
- package/src/resources/workflow.ts +0 -410
- package/src/types.ts +0 -502
- package/src/utils/index.ts +0 -11
- package/src/utils/process-client-tools.ts +0 -32
- package/src/utils/zod-to-json-schema.ts +0 -10
- package/src/v2-messages.test.ts +0 -180
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -5
- package/tsup.config.ts +0 -22
- package/vitest.config.js +0 -8
package/src/index.ts
DELETED
package/src/resources/a2a.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { TaskSendParams, TaskQueryParams, TaskIdParams, Task, AgentCard, JSONRPCResponse } from '@mastra/core/a2a';
|
|
2
|
-
import type { ClientOptions } from '../types';
|
|
3
|
-
import { BaseResource } from './base';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Class for interacting with an agent via the A2A protocol
|
|
7
|
-
*/
|
|
8
|
-
export class A2A extends BaseResource {
|
|
9
|
-
constructor(
|
|
10
|
-
options: ClientOptions,
|
|
11
|
-
private agentId: string,
|
|
12
|
-
) {
|
|
13
|
-
super(options);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Get the agent card with metadata about the agent
|
|
18
|
-
* @returns Promise containing the agent card information
|
|
19
|
-
*/
|
|
20
|
-
async getCard(): Promise<AgentCard> {
|
|
21
|
-
return this.request(`/.well-known/${this.agentId}/agent.json`);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Send a message to the agent and get a response
|
|
26
|
-
* @param params - Parameters for the task
|
|
27
|
-
* @returns Promise containing the task response
|
|
28
|
-
*/
|
|
29
|
-
async sendMessage(params: TaskSendParams): Promise<{ task: Task }> {
|
|
30
|
-
const response = await this.request<JSONRPCResponse<Task>>(`/a2a/${this.agentId}`, {
|
|
31
|
-
method: 'POST',
|
|
32
|
-
body: {
|
|
33
|
-
method: 'tasks/send',
|
|
34
|
-
params,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
return { task: response.result! };
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Get the status and result of a task
|
|
43
|
-
* @param params - Parameters for querying the task
|
|
44
|
-
* @returns Promise containing the task response
|
|
45
|
-
*/
|
|
46
|
-
async getTask(params: TaskQueryParams): Promise<Task> {
|
|
47
|
-
const response = await this.request<JSONRPCResponse<Task>>(`/a2a/${this.agentId}`, {
|
|
48
|
-
method: 'POST',
|
|
49
|
-
body: {
|
|
50
|
-
method: 'tasks/get',
|
|
51
|
-
params,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
return response.result!;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Cancel a running task
|
|
60
|
-
* @param params - Parameters identifying the task to cancel
|
|
61
|
-
* @returns Promise containing the task response
|
|
62
|
-
*/
|
|
63
|
-
async cancelTask(params: TaskIdParams): Promise<{ task: Task }> {
|
|
64
|
-
return this.request(`/a2a/${this.agentId}`, {
|
|
65
|
-
method: 'POST',
|
|
66
|
-
body: {
|
|
67
|
-
method: 'tasks/cancel',
|
|
68
|
-
params,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Send a message and subscribe to streaming updates (not fully implemented)
|
|
75
|
-
* @param params - Parameters for the task
|
|
76
|
-
* @returns Promise containing the task response
|
|
77
|
-
*/
|
|
78
|
-
async sendAndSubscribe(params: TaskSendParams): Promise<Response> {
|
|
79
|
-
return this.request(`/a2a/${this.agentId}`, {
|
|
80
|
-
method: 'POST',
|
|
81
|
-
body: {
|
|
82
|
-
method: 'tasks/sendSubscribe',
|
|
83
|
-
params,
|
|
84
|
-
},
|
|
85
|
-
stream: true,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|