@mastra/client-js 0.10.19-alpha.1 → 0.10.19-alpha.2
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/.turbo/turbo-build.log +16 -2
- package/CHANGELOG.md +14 -0
- package/dist/adapters/agui.d.ts +1 -1
- package/dist/adapters/agui.d.ts.map +1 -1
- package/dist/client.d.ts +4 -4
- package/dist/index.cjs +24 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +24 -10
- package/dist/index.js.map +1 -1
- package/dist/resources/a2a.d.ts +2 -2
- package/dist/resources/agent.d.ts +2 -2
- package/dist/resources/base.d.ts +1 -1
- package/dist/resources/index.d.ts +10 -10
- package/dist/resources/legacy-workflow.d.ts +2 -2
- package/dist/resources/mcp-tool.d.ts +2 -2
- package/dist/resources/memory-thread.d.ts +2 -2
- package/dist/resources/network-memory-thread.d.ts +2 -2
- package/dist/resources/network.d.ts +2 -2
- package/dist/resources/tool.d.ts +2 -2
- package/dist/resources/vNextNetwork.d.ts +2 -2
- package/dist/resources/vector.d.ts +2 -2
- package/dist/resources/workflow.d.ts +2 -2
- package/package.json +6 -4
- package/src/adapters/agui.ts +29 -11
- package/tsup.config.ts +2 -7
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/client-js@0.10.19-alpha.
|
|
3
|
-
> tsup --
|
|
2
|
+
> @mastra/client-js@0.10.19-alpha.2 build /home/runner/work/mastra/mastra/client-sdks/client-js
|
|
3
|
+
> tsup --config tsup.config.ts
|
|
4
4
|
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.0
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/mastra/mastra/client-sdks/client-js/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: es2022
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[34mCJS[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m75.80 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m162.83 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 2794ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m76.11 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m163.02 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 2794ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.10.19-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 42dfc48: Fix tool messages structure in agui adapter
|
|
8
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
9
|
+
- Updated dependencies [cb36de0]
|
|
10
|
+
- Updated dependencies [a82b851]
|
|
11
|
+
- Updated dependencies [41a0a0e]
|
|
12
|
+
- Updated dependencies [2871020]
|
|
13
|
+
- Updated dependencies [4a406ec]
|
|
14
|
+
- Updated dependencies [5d377e5]
|
|
15
|
+
- @mastra/core@0.13.0-alpha.2
|
|
16
|
+
|
|
3
17
|
## 0.10.19-alpha.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/adapters/agui.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { AgentConfig, BaseEvent, Message, RunAgentInput } from '@ag-ui/clie
|
|
|
2
2
|
import { AbstractAgent } from '@ag-ui/client';
|
|
3
3
|
import type { CoreMessage } from '@mastra/core';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
-
import type { Agent } from '../resources/agent';
|
|
5
|
+
import type { Agent } from '../resources/agent.js';
|
|
6
6
|
interface MastraAgentConfig extends AgentConfig {
|
|
7
7
|
agent: Agent;
|
|
8
8
|
agentId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agui.d.ts","sourceRoot":"","sources":["../../src/adapters/agui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,aAAa,EASd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAa,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,UAAU,iBAAkB,SAAQ,WAAW;IAC7C,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,WAAY,SAAQ,aAAa;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;gBACR,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,iBAAiB;IAStE,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC;CA+G3D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAgCrC;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"agui.d.ts","sourceRoot":"","sources":["../../src/adapters/agui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,aAAa,EASd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAa,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,UAAU,iBAAkB,SAAQ,WAAW;IAC7C,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,WAAY,SAAQ,aAAa;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;gBACR,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,iBAAiB;IAStE,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC;CA+G3D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAgCrC;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,CAoElF"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AbstractAgent } from '@ag-ui/client';
|
|
2
2
|
import type { ServerDetailInfo } from '@mastra/core/mcp';
|
|
3
|
-
import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, Network, A2A, MCPTool, LegacyWorkflow } from './resources';
|
|
4
|
-
import { NetworkMemoryThread } from './resources/network-memory-thread';
|
|
5
|
-
import { VNextNetwork } from './resources/vNextNetwork';
|
|
6
|
-
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 } from './types';
|
|
3
|
+
import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, Network, A2A, MCPTool, LegacyWorkflow } from './resources/index.js';
|
|
4
|
+
import { NetworkMemoryThread } from './resources/network-memory-thread.js';
|
|
5
|
+
import { VNextNetwork } from './resources/vNextNetwork.js';
|
|
6
|
+
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 } from './types.js';
|
|
7
7
|
export declare class MastraClient extends BaseResource {
|
|
8
8
|
constructor(options: ClientOptions);
|
|
9
9
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -151,6 +151,12 @@ function generateUUID() {
|
|
|
151
151
|
}
|
|
152
152
|
function convertMessagesToMastraMessages(messages) {
|
|
153
153
|
const result = [];
|
|
154
|
+
const toolCallsWithResults = /* @__PURE__ */ new Set();
|
|
155
|
+
for (const message of messages) {
|
|
156
|
+
if (message.role === "tool" && message.toolCallId) {
|
|
157
|
+
toolCallsWithResults.add(message.toolCallId);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
154
160
|
for (const message of messages) {
|
|
155
161
|
if (message.role === "assistant") {
|
|
156
162
|
const parts = message.content ? [{ type: "text", text: message.content }] : [];
|
|
@@ -167,15 +173,22 @@ function convertMessagesToMastraMessages(messages) {
|
|
|
167
173
|
content: parts
|
|
168
174
|
});
|
|
169
175
|
if (message.toolCalls?.length) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
for (const toolCall of message.toolCalls) {
|
|
177
|
+
if (!toolCallsWithResults.has(toolCall.id)) {
|
|
178
|
+
result.push({
|
|
179
|
+
role: "tool",
|
|
180
|
+
content: [
|
|
181
|
+
{
|
|
182
|
+
type: "tool-result",
|
|
183
|
+
toolCallId: toolCall.id,
|
|
184
|
+
toolName: toolCall.function.name,
|
|
185
|
+
result: JSON.parse(toolCall.function.arguments)
|
|
186
|
+
// This is still wrong but matches test expectations
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
179
192
|
}
|
|
180
193
|
} else if (message.role === "user") {
|
|
181
194
|
result.push({
|
|
@@ -188,8 +201,9 @@ function convertMessagesToMastraMessages(messages) {
|
|
|
188
201
|
content: [
|
|
189
202
|
{
|
|
190
203
|
type: "tool-result",
|
|
191
|
-
toolCallId: message.toolCallId,
|
|
204
|
+
toolCallId: message.toolCallId || "unknown",
|
|
192
205
|
toolName: "unknown",
|
|
206
|
+
// toolName is not available in tool messages from CopilotKit
|
|
193
207
|
result: message.content
|
|
194
208
|
}
|
|
195
209
|
]
|