@mastra/client-js 0.0.0-fix-cloud-peer-deps-20250923194656 → 0.0.0-gl-test-20250917080133
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 +3 -111
- package/dist/client.d.ts +13 -29
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +71 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +71 -135
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts +6 -22
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/network.d.ts +32 -0
- package/dist/resources/network.d.ts.map +1 -0
- package/dist/resources/observability.d.ts +0 -10
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +0 -28
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/types.d.ts +21 -42
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,94 +1,15 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- fix: result object type inference when using structuredOutput and unify output/structuredOutput types with single OUTPUT generic ([#7969](https://github.com/mastra-ai/mastra/pull/7969))
|
|
8
|
-
|
|
9
|
-
- Add model fallback handlers and apis ([#7378](https://github.com/mastra-ai/mastra/pull/7378))
|
|
10
|
-
|
|
11
|
-
- Get rid off swr one for all ([#7931](https://github.com/mastra-ai/mastra/pull/7931))
|
|
12
|
-
|
|
13
|
-
- Delayed streamVNext breaking change notice by 1 week ([#8121](https://github.com/mastra-ai/mastra/pull/8121))
|
|
14
|
-
|
|
15
|
-
- Add server api to score traces ([#8064](https://github.com/mastra-ai/mastra/pull/8064))
|
|
16
|
-
|
|
17
|
-
- Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a)]:
|
|
18
|
-
- @mastra/core@0.0.0-fix-cloud-peer-deps-20250923194656
|
|
19
|
-
|
|
20
|
-
## 0.13.2-alpha.3
|
|
21
|
-
|
|
22
|
-
### Patch Changes
|
|
23
|
-
|
|
24
|
-
- Add model fallback handlers and apis ([#7378](https://github.com/mastra-ai/mastra/pull/7378))
|
|
25
|
-
|
|
26
|
-
- Delayed streamVNext breaking change notice by 1 week ([#8121](https://github.com/mastra-ai/mastra/pull/8121))
|
|
27
|
-
|
|
28
|
-
- Add server api to score traces ([#8064](https://github.com/mastra-ai/mastra/pull/8064))
|
|
29
|
-
|
|
30
|
-
- Updated dependencies [[`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a)]:
|
|
31
|
-
- @mastra/core@0.18.0-alpha.3
|
|
32
|
-
|
|
33
|
-
## 0.13.2-alpha.2
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55)]:
|
|
38
|
-
- @mastra/core@0.18.0-alpha.2
|
|
39
|
-
|
|
40
|
-
## 0.13.2-alpha.1
|
|
41
|
-
|
|
42
|
-
### Patch Changes
|
|
43
|
-
|
|
44
|
-
- Updated dependencies [[`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb)]:
|
|
45
|
-
- @mastra/core@0.17.2-alpha.1
|
|
46
|
-
|
|
47
|
-
## 0.13.2-alpha.0
|
|
48
|
-
|
|
49
|
-
### Patch Changes
|
|
50
|
-
|
|
51
|
-
- fix: result object type inference when using structuredOutput and unify output/structuredOutput types with single OUTPUT generic ([#7969](https://github.com/mastra-ai/mastra/pull/7969))
|
|
52
|
-
|
|
53
|
-
- Get rid off swr one for all ([#7931](https://github.com/mastra-ai/mastra/pull/7931))
|
|
54
|
-
|
|
55
|
-
- Updated dependencies [[`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad)]:
|
|
56
|
-
- @mastra/core@0.17.2-alpha.0
|
|
57
|
-
|
|
58
|
-
## 0.13.1
|
|
59
|
-
|
|
60
|
-
### Patch Changes
|
|
61
|
-
|
|
62
|
-
- fix workflow resuming issue in the playground ([#7988](https://github.com/mastra-ai/mastra/pull/7988))
|
|
63
|
-
|
|
64
|
-
- Updated dependencies [[`fd00e63`](https://github.com/mastra-ai/mastra/commit/fd00e63759cbcca3473c40cac9843280b0557cff), [`ab610f6`](https://github.com/mastra-ai/mastra/commit/ab610f6f41dbfe6c9502368671485ca7a0aac09b), [`e6bda5f`](https://github.com/mastra-ai/mastra/commit/e6bda5f954ee8493ea18adc1a883f0a5b785ad9b)]:
|
|
65
|
-
- @mastra/core@0.17.1
|
|
66
|
-
|
|
67
|
-
## 0.13.1-alpha.0
|
|
68
|
-
|
|
69
|
-
### Patch Changes
|
|
70
|
-
|
|
71
|
-
- fix workflow resuming issue in the playground ([#7988](https://github.com/mastra-ai/mastra/pull/7988))
|
|
72
|
-
|
|
73
|
-
- Updated dependencies [[`fd00e63`](https://github.com/mastra-ai/mastra/commit/fd00e63759cbcca3473c40cac9843280b0557cff), [`ab610f6`](https://github.com/mastra-ai/mastra/commit/ab610f6f41dbfe6c9502368671485ca7a0aac09b), [`e6bda5f`](https://github.com/mastra-ai/mastra/commit/e6bda5f954ee8493ea18adc1a883f0a5b785ad9b)]:
|
|
74
|
-
- @mastra/core@0.17.1-alpha.0
|
|
75
|
-
|
|
76
|
-
## 0.13.0
|
|
3
|
+
## 0.0.0-gl-test-20250917080133
|
|
77
4
|
|
|
78
5
|
### Minor Changes
|
|
79
6
|
|
|
80
|
-
- Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
|
|
81
|
-
|
|
82
7
|
- Fully deprecated createRun (now throws an error) in favour of createRunAsync ([#7897](https://github.com/mastra-ai/mastra/pull/7897))
|
|
83
8
|
|
|
84
9
|
### Patch Changes
|
|
85
10
|
|
|
86
|
-
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
87
|
-
|
|
88
11
|
- Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
|
|
89
12
|
|
|
90
|
-
- Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
|
|
91
|
-
|
|
92
13
|
- Playground ui -pass runtimeContext to client SDK get methods ([#7767](https://github.com/mastra-ai/mastra/pull/7767))
|
|
93
14
|
|
|
94
15
|
- Improve client-js SDK agent and workflow APIs ([#7592](https://github.com/mastra-ai/mastra/pull/7592))
|
|
@@ -97,37 +18,8 @@
|
|
|
97
18
|
|
|
98
19
|
- Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
|
|
99
20
|
|
|
100
|
-
- Updated dependencies [[`
|
|
101
|
-
- @mastra/core@0.
|
|
102
|
-
|
|
103
|
-
## 0.13.0-alpha.8
|
|
104
|
-
|
|
105
|
-
### Patch Changes
|
|
106
|
-
|
|
107
|
-
- Updated dependencies [[`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a)]:
|
|
108
|
-
- @mastra/core@0.17.0-alpha.8
|
|
109
|
-
|
|
110
|
-
## 0.13.0-alpha.7
|
|
111
|
-
|
|
112
|
-
### Patch Changes
|
|
113
|
-
|
|
114
|
-
- Updated dependencies [[`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689)]:
|
|
115
|
-
- @mastra/core@0.17.0-alpha.7
|
|
116
|
-
|
|
117
|
-
## 0.13.0-alpha.6
|
|
118
|
-
|
|
119
|
-
### Minor Changes
|
|
120
|
-
|
|
121
|
-
- Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
|
|
122
|
-
|
|
123
|
-
### Patch Changes
|
|
124
|
-
|
|
125
|
-
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
126
|
-
|
|
127
|
-
- Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
|
|
128
|
-
|
|
129
|
-
- 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)]:
|
|
130
|
-
- @mastra/core@0.17.0-alpha.6
|
|
21
|
+
- Updated dependencies [[`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
|
|
22
|
+
- @mastra/core@0.0.0-gl-test-20250917080133
|
|
131
23
|
|
|
132
24
|
## 0.13.0-alpha.5
|
|
133
25
|
|
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, A2A, MCPTool, LegacyWorkflow, AgentBuilder } from './resources/index.js';
|
|
4
|
+
import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, Network, 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, GetTelemetryParams, GetTelemetryResponse, GetToolResponse, GetWorkflowResponse, SaveMessageToMemoryParams, SaveMessageToMemoryResponse, McpServerListResponse, McpServerToolListResponse, GetLegacyWorkflowResponse, GetVNextNetworkResponse, GetNetworkMemoryThreadParams, CreateNetworkMemoryThreadParams, SaveNetworkMessageToMemoryParams, GetScorerResponse, GetScoresByScorerIdParams, GetScoresResponse, GetScoresByRunIdParams, GetScoresByEntityIdParams, SaveScoreParams, SaveScoreResponse, GetAITracesResponse
|
|
7
|
+
import type { ClientOptions, CreateMemoryThreadParams, CreateMemoryThreadResponse, GetAgentResponse, GetLogParams, GetLogsParams, GetLogsResponse, GetMemoryThreadParams, GetMemoryThreadResponse, GetNetworkResponse, 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);
|
|
@@ -26,12 +26,6 @@ export declare class MastraClient extends BaseResource {
|
|
|
26
26
|
* @returns Promise containing array of memory threads
|
|
27
27
|
*/
|
|
28
28
|
getMemoryThreads(params: GetMemoryThreadParams): Promise<GetMemoryThreadResponse>;
|
|
29
|
-
/**
|
|
30
|
-
* Retrieves memory config for a resource
|
|
31
|
-
* @param params - Parameters containing the resource ID
|
|
32
|
-
* @returns Promise containing array of memory threads
|
|
33
|
-
*/
|
|
34
|
-
getMemoryConfig(params: GetMemoryConfigParams): Promise<GetMemoryConfigResponse>;
|
|
35
29
|
/**
|
|
36
30
|
* Creates a new memory thread
|
|
37
31
|
* @param params - Parameters for creating the memory thread
|
|
@@ -44,17 +38,6 @@ export declare class MastraClient extends BaseResource {
|
|
|
44
38
|
* @returns MemoryThread instance
|
|
45
39
|
*/
|
|
46
40
|
getMemoryThread(threadId: string, agentId: string): MemoryThread;
|
|
47
|
-
getThreadMessages(threadId: string, opts?: {
|
|
48
|
-
agentId?: string;
|
|
49
|
-
networkId?: string;
|
|
50
|
-
}): Promise<GetMemoryThreadMessagesResponse>;
|
|
51
|
-
deleteThread(threadId: string, opts?: {
|
|
52
|
-
agentId?: string;
|
|
53
|
-
networkId?: string;
|
|
54
|
-
}): Promise<{
|
|
55
|
-
success: boolean;
|
|
56
|
-
message: string;
|
|
57
|
-
}>;
|
|
58
41
|
/**
|
|
59
42
|
* Saves messages to memory
|
|
60
43
|
* @param params - Parameters containing messages to save
|
|
@@ -175,11 +158,22 @@ export declare class MastraClient extends BaseResource {
|
|
|
175
158
|
* @returns Promise containing telemetry data
|
|
176
159
|
*/
|
|
177
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>>;
|
|
178
166
|
/**
|
|
179
167
|
* Retrieves all available vNext networks
|
|
180
168
|
* @returns Promise containing map of vNext network IDs to vNext network details
|
|
181
169
|
*/
|
|
182
170
|
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;
|
|
183
177
|
/**
|
|
184
178
|
* Gets a vNext network instance by ID
|
|
185
179
|
* @param networkId - ID of the vNext network to retrieve
|
|
@@ -286,15 +280,5 @@ export declare class MastraClient extends BaseResource {
|
|
|
286
280
|
getModelProviders(): Promise<string[]>;
|
|
287
281
|
getAITrace(traceId: string): Promise<AITraceRecord>;
|
|
288
282
|
getAITraces(params: AITracesPaginatedArg): Promise<GetAITracesResponse>;
|
|
289
|
-
score(params: {
|
|
290
|
-
scorerName: string;
|
|
291
|
-
targets: Array<{
|
|
292
|
-
traceId: string;
|
|
293
|
-
spanId?: string;
|
|
294
|
-
}>;
|
|
295
|
-
}): Promise<{
|
|
296
|
-
status: string;
|
|
297
|
-
message: string;
|
|
298
|
-
}>;
|
|
299
283
|
}
|
|
300
284
|
//# sourceMappingURL=client.d.ts.map
|
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,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,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,E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AAiB,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.log("\u{1F3C1} Stream finished");
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
try {
|
|
@@ -219,9 +219,7 @@ async function executeToolCallAndRespond({
|
|
|
219
219
|
resourceId,
|
|
220
220
|
threadId,
|
|
221
221
|
runtimeContext,
|
|
222
|
-
tracingContext: { currentSpan: void 0 }
|
|
223
|
-
suspend: async () => {
|
|
224
|
-
}
|
|
222
|
+
tracingContext: { currentSpan: void 0 }
|
|
225
223
|
},
|
|
226
224
|
{
|
|
227
225
|
messages: response.messages,
|
|
@@ -329,7 +327,7 @@ var Agent = class extends BaseResource {
|
|
|
329
327
|
}
|
|
330
328
|
async generate(params) {
|
|
331
329
|
console.warn(
|
|
332
|
-
"Deprecation NOTICE:Generate method will switch to use generateVNext implementation September
|
|
330
|
+
"Deprecation NOTICE:Generate method will switch to use generateVNext implementation September 23rd, 2025. Please use generateLegacy if you don't want to upgrade just yet."
|
|
333
331
|
);
|
|
334
332
|
return this.generateLegacy(params);
|
|
335
333
|
}
|
|
@@ -364,9 +362,7 @@ var Agent = class extends BaseResource {
|
|
|
364
362
|
resourceId,
|
|
365
363
|
threadId,
|
|
366
364
|
runtimeContext,
|
|
367
|
-
tracingContext: { currentSpan: void 0 }
|
|
368
|
-
suspend: async () => {
|
|
369
|
-
}
|
|
365
|
+
tracingContext: { currentSpan: void 0 }
|
|
370
366
|
},
|
|
371
367
|
{
|
|
372
368
|
messages: response.messages,
|
|
@@ -710,7 +706,7 @@ var Agent = class extends BaseResource {
|
|
|
710
706
|
*/
|
|
711
707
|
async stream(params) {
|
|
712
708
|
console.warn(
|
|
713
|
-
"Deprecation NOTICE:\nStream method will switch to use streamVNext implementation September
|
|
709
|
+
"Deprecation NOTICE:\nStream method will switch to use streamVNext implementation September 23rd, 2025. Please use streamLegacy if you don't want to upgrade just yet."
|
|
714
710
|
);
|
|
715
711
|
return this.streamLegacy(params);
|
|
716
712
|
}
|
|
@@ -1059,9 +1055,7 @@ var Agent = class extends BaseResource {
|
|
|
1059
1055
|
threadId: processedParams.threadId,
|
|
1060
1056
|
runtimeContext: processedParams.runtimeContext,
|
|
1061
1057
|
// TODO: Pass proper tracing context when client-js supports tracing
|
|
1062
|
-
tracingContext: { currentSpan: void 0 }
|
|
1063
|
-
suspend: async () => {
|
|
1064
|
-
}
|
|
1058
|
+
tracingContext: { currentSpan: void 0 }
|
|
1065
1059
|
},
|
|
1066
1060
|
{
|
|
1067
1061
|
messages: response.messages,
|
|
@@ -1225,9 +1219,7 @@ var Agent = class extends BaseResource {
|
|
|
1225
1219
|
threadId: processedParams.threadId,
|
|
1226
1220
|
runtimeContext: processedParams.runtimeContext,
|
|
1227
1221
|
// TODO: Pass proper tracing context when client-js supports tracing
|
|
1228
|
-
tracingContext: { currentSpan: void 0 }
|
|
1229
|
-
suspend: async () => {
|
|
1230
|
-
}
|
|
1222
|
+
tracingContext: { currentSpan: void 0 }
|
|
1231
1223
|
},
|
|
1232
1224
|
{
|
|
1233
1225
|
messages: response.messages,
|
|
@@ -1345,27 +1337,62 @@ var Agent = class extends BaseResource {
|
|
|
1345
1337
|
body: params
|
|
1346
1338
|
});
|
|
1347
1339
|
}
|
|
1340
|
+
};
|
|
1341
|
+
var Network = class extends BaseResource {
|
|
1342
|
+
constructor(options, networkId) {
|
|
1343
|
+
super(options);
|
|
1344
|
+
this.networkId = networkId;
|
|
1345
|
+
}
|
|
1348
1346
|
/**
|
|
1349
|
-
*
|
|
1350
|
-
* @param
|
|
1351
|
-
* @returns Promise containing
|
|
1347
|
+
* Retrieves details about the network
|
|
1348
|
+
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
1349
|
+
* @returns Promise containing network details
|
|
1352
1350
|
*/
|
|
1353
|
-
|
|
1354
|
-
return this.request(`/api/
|
|
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`, {
|
|
1355
1366
|
method: "POST",
|
|
1356
|
-
body:
|
|
1367
|
+
body: processedParams
|
|
1357
1368
|
});
|
|
1358
1369
|
}
|
|
1359
1370
|
/**
|
|
1360
|
-
*
|
|
1361
|
-
* @param params -
|
|
1362
|
-
* @returns Promise containing the
|
|
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
|
|
1363
1374
|
*/
|
|
1364
|
-
|
|
1365
|
-
|
|
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`, {
|
|
1366
1382
|
method: "POST",
|
|
1367
|
-
body:
|
|
1383
|
+
body: processedParams,
|
|
1384
|
+
stream: true
|
|
1368
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;
|
|
1369
1396
|
}
|
|
1370
1397
|
};
|
|
1371
1398
|
|
|
@@ -1918,14 +1945,6 @@ var Workflow = class extends BaseResource {
|
|
|
1918
1945
|
},
|
|
1919
1946
|
resumeAsync: async (p) => {
|
|
1920
1947
|
return this.resumeAsync({ runId, step: p.step, resumeData: p.resumeData, runtimeContext: p.runtimeContext });
|
|
1921
|
-
},
|
|
1922
|
-
resumeStreamVNext: async (p) => {
|
|
1923
|
-
return this.resumeStreamVNext({
|
|
1924
|
-
runId,
|
|
1925
|
-
step: p.step,
|
|
1926
|
-
resumeData: p.resumeData,
|
|
1927
|
-
runtimeContext: p.runtimeContext
|
|
1928
|
-
});
|
|
1929
1948
|
}
|
|
1930
1949
|
};
|
|
1931
1950
|
}
|
|
@@ -1998,54 +2017,7 @@ var Workflow = class extends BaseResource {
|
|
|
1998
2017
|
}
|
|
1999
2018
|
);
|
|
2000
2019
|
if (!response.ok) {
|
|
2001
|
-
throw new Error(`Failed to stream workflow: ${response.statusText}`);
|
|
2002
|
-
}
|
|
2003
|
-
if (!response.body) {
|
|
2004
|
-
throw new Error("Response body is null");
|
|
2005
|
-
}
|
|
2006
|
-
let failedChunk = void 0;
|
|
2007
|
-
const transformStream = new TransformStream({
|
|
2008
|
-
start() {
|
|
2009
|
-
},
|
|
2010
|
-
async transform(chunk, controller) {
|
|
2011
|
-
try {
|
|
2012
|
-
const decoded = new TextDecoder().decode(chunk);
|
|
2013
|
-
const chunks = decoded.split(RECORD_SEPARATOR2);
|
|
2014
|
-
for (const chunk2 of chunks) {
|
|
2015
|
-
if (chunk2) {
|
|
2016
|
-
const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
|
|
2017
|
-
try {
|
|
2018
|
-
const parsedChunk = JSON.parse(newChunk);
|
|
2019
|
-
controller.enqueue(parsedChunk);
|
|
2020
|
-
failedChunk = void 0;
|
|
2021
|
-
} catch {
|
|
2022
|
-
failedChunk = newChunk;
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
} catch {
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
});
|
|
2030
|
-
return response.body.pipeThrough(transformStream);
|
|
2031
|
-
}
|
|
2032
|
-
/**
|
|
2033
|
-
* Observes workflow stream for a workflow run
|
|
2034
|
-
* @param params - Object containing the runId
|
|
2035
|
-
* @returns Promise containing the workflow execution results
|
|
2036
|
-
*/
|
|
2037
|
-
async observeStream(params) {
|
|
2038
|
-
const searchParams = new URLSearchParams();
|
|
2039
|
-
searchParams.set("runId", params.runId);
|
|
2040
|
-
const response = await this.request(
|
|
2041
|
-
`/api/workflows/${this.workflowId}/observe-stream?${searchParams.toString()}`,
|
|
2042
|
-
{
|
|
2043
|
-
method: "POST",
|
|
2044
|
-
stream: true
|
|
2045
|
-
}
|
|
2046
|
-
);
|
|
2047
|
-
if (!response.ok) {
|
|
2048
|
-
throw new Error(`Failed to observe workflow stream: ${response.statusText}`);
|
|
2020
|
+
throw new Error(`Failed to stream vNext workflow: ${response.statusText}`);
|
|
2049
2021
|
}
|
|
2050
2022
|
if (!response.body) {
|
|
2051
2023
|
throw new Error("Response body is null");
|
|
@@ -2091,7 +2063,7 @@ var Workflow = class extends BaseResource {
|
|
|
2091
2063
|
`/api/workflows/${this.workflowId}/streamVNext?${searchParams.toString()}`,
|
|
2092
2064
|
{
|
|
2093
2065
|
method: "POST",
|
|
2094
|
-
body: { inputData: params.inputData, runtimeContext
|
|
2066
|
+
body: { inputData: params.inputData, runtimeContext },
|
|
2095
2067
|
stream: true
|
|
2096
2068
|
}
|
|
2097
2069
|
);
|
|
@@ -2143,22 +2115,6 @@ var Workflow = class extends BaseResource {
|
|
|
2143
2115
|
}
|
|
2144
2116
|
});
|
|
2145
2117
|
}
|
|
2146
|
-
/**
|
|
2147
|
-
* Resumes a suspended workflow step that uses streamVNext asynchronously and returns a promise that resolves when the workflow is complete
|
|
2148
|
-
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
2149
|
-
* @returns Promise containing the workflow resume results
|
|
2150
|
-
*/
|
|
2151
|
-
resumeStreamVNext(params) {
|
|
2152
|
-
const runtimeContext = parseClientRuntimeContext(params.runtimeContext);
|
|
2153
|
-
return this.request(`/api/workflows/${this.workflowId}/resume-stream?runId=${params.runId}`, {
|
|
2154
|
-
method: "POST",
|
|
2155
|
-
body: {
|
|
2156
|
-
step: params.step,
|
|
2157
|
-
resumeData: params.resumeData,
|
|
2158
|
-
runtimeContext
|
|
2159
|
-
}
|
|
2160
|
-
});
|
|
2161
|
-
}
|
|
2162
2118
|
/**
|
|
2163
2119
|
* Watches workflow transitions in real-time
|
|
2164
2120
|
* @param runId - Optional run ID to filter the watch stream
|
|
@@ -2735,12 +2691,6 @@ var Observability = class extends BaseResource {
|
|
|
2735
2691
|
const queryString = searchParams.toString();
|
|
2736
2692
|
return this.request(`/api/observability/traces${queryString ? `?${queryString}` : ""}`);
|
|
2737
2693
|
}
|
|
2738
|
-
score(params) {
|
|
2739
|
-
return this.request(`/api/observability/traces/score`, {
|
|
2740
|
-
method: "POST",
|
|
2741
|
-
body: { ...params }
|
|
2742
|
-
});
|
|
2743
|
-
}
|
|
2744
2694
|
};
|
|
2745
2695
|
|
|
2746
2696
|
// src/resources/network-memory-thread.ts
|
|
@@ -2982,14 +2932,6 @@ var MastraClient = class extends BaseResource {
|
|
|
2982
2932
|
getMemoryThreads(params) {
|
|
2983
2933
|
return this.request(`/api/memory/threads?resourceid=${params.resourceId}&agentId=${params.agentId}`);
|
|
2984
2934
|
}
|
|
2985
|
-
/**
|
|
2986
|
-
* Retrieves memory config for a resource
|
|
2987
|
-
* @param params - Parameters containing the resource ID
|
|
2988
|
-
* @returns Promise containing array of memory threads
|
|
2989
|
-
*/
|
|
2990
|
-
getMemoryConfig(params) {
|
|
2991
|
-
return this.request(`/api/memory/config?agentId=${params.agentId}`);
|
|
2992
|
-
}
|
|
2993
2935
|
/**
|
|
2994
2936
|
* Creates a new memory thread
|
|
2995
2937
|
* @param params - Parameters for creating the memory thread
|
|
@@ -3006,24 +2948,6 @@ var MastraClient = class extends BaseResource {
|
|
|
3006
2948
|
getMemoryThread(threadId, agentId) {
|
|
3007
2949
|
return new MemoryThread(this.options, threadId, agentId);
|
|
3008
2950
|
}
|
|
3009
|
-
getThreadMessages(threadId, opts = {}) {
|
|
3010
|
-
let url = "";
|
|
3011
|
-
if (opts.agentId) {
|
|
3012
|
-
url = `/api/memory/threads/${threadId}/messages?agentId=${opts.agentId}`;
|
|
3013
|
-
} else if (opts.networkId) {
|
|
3014
|
-
url = `/api/memory/network/threads/${threadId}/messages?networkId=${opts.networkId}`;
|
|
3015
|
-
}
|
|
3016
|
-
return this.request(url);
|
|
3017
|
-
}
|
|
3018
|
-
deleteThread(threadId, opts = {}) {
|
|
3019
|
-
let url = "";
|
|
3020
|
-
if (opts.agentId) {
|
|
3021
|
-
url = `/api/memory/threads/${threadId}?agentId=${opts.agentId}`;
|
|
3022
|
-
} else if (opts.networkId) {
|
|
3023
|
-
url = `/api/memory/network/threads/${threadId}?networkId=${opts.networkId}`;
|
|
3024
|
-
}
|
|
3025
|
-
return this.request(url, { method: "DELETE" });
|
|
3026
|
-
}
|
|
3027
2951
|
/**
|
|
3028
2952
|
* Saves messages to memory
|
|
3029
2953
|
* @param params - Parameters containing messages to save
|
|
@@ -3301,6 +3225,13 @@ var MastraClient = class extends BaseResource {
|
|
|
3301
3225
|
return this.request(`/api/telemetry`);
|
|
3302
3226
|
}
|
|
3303
3227
|
}
|
|
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
|
+
}
|
|
3304
3235
|
/**
|
|
3305
3236
|
* Retrieves all available vNext networks
|
|
3306
3237
|
* @returns Promise containing map of vNext network IDs to vNext network details
|
|
@@ -3308,6 +3239,14 @@ var MastraClient = class extends BaseResource {
|
|
|
3308
3239
|
getVNextNetworks() {
|
|
3309
3240
|
return this.request("/api/networks/v-next");
|
|
3310
3241
|
}
|
|
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
|
+
}
|
|
3311
3250
|
/**
|
|
3312
3251
|
* Gets a vNext network instance by ID
|
|
3313
3252
|
* @param networkId - ID of the vNext network to retrieve
|
|
@@ -3498,9 +3437,6 @@ var MastraClient = class extends BaseResource {
|
|
|
3498
3437
|
getAITraces(params) {
|
|
3499
3438
|
return this.observability.getTraces(params);
|
|
3500
3439
|
}
|
|
3501
|
-
score(params) {
|
|
3502
|
-
return this.observability.score(params);
|
|
3503
|
-
}
|
|
3504
3440
|
};
|
|
3505
3441
|
|
|
3506
3442
|
// src/tools.ts
|