@mastra/client-js 1.18.0-alpha.13 → 1.18.0-alpha.15
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 +23 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +8 -11
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +0 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 1.18.0-alpha.15
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added client, React, and Studio support for Agent signals in threaded chat. Threaded user messages now send through Agent signals, stream output is consumed from the thread subscription, echoed user messages are deduped by signal ID, file and image message contents are preserved, Studio can send follow-ups while a response is streaming, Studio subscribes to open threads so additional tabs can observe active streams, and the Studio stop button aborts the active thread subscription. React chat also falls back to legacy threaded streaming when it connects to a server or core version that does not support signal routes yet. ([#16338](https://github.com/mastra-ai/mastra/pull/16338))
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const { sendMessage } = useChat({ agentId, resourceId, threadId });
|
|
11
|
+
await sendMessage({ message: 'Follow up while streaming', threadId });
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies:
|
|
17
|
+
- @mastra/core@1.33.0-alpha.14
|
|
18
|
+
|
|
19
|
+
## 1.18.0-alpha.14
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`f984b4d`](https://github.com/mastra-ai/mastra/commit/f984b4d6c60bf2ae2a9b156f0e8c35a66fe96c91), [`ce01024`](https://github.com/mastra-ai/mastra/commit/ce010242eee9bdfc09e4c26725b9d37998679a8d), [`f984b4d`](https://github.com/mastra-ai/mastra/commit/f984b4d6c60bf2ae2a9b156f0e8c35a66fe96c91), [`8373ff4`](https://github.com/mastra-ai/mastra/commit/8373ff46745d77af79f183c4470f80fa2727a6b2), [`11c1528`](https://github.com/mastra-ai/mastra/commit/11c152848c5d0ef227184853b5040f5b41ee7b1e)]:
|
|
24
|
+
- @mastra/core@1.33.0-alpha.13
|
|
25
|
+
|
|
3
26
|
## 1.18.0-alpha.13
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
|
@@ -1547,16 +1547,16 @@ declare interface EventSourceMessage {
|
|
|
1547
1547
|
* implementation in that browsers will default this to `message`, whereas this parser will
|
|
1548
1548
|
* leave this as `undefined` if not explicitly declared.
|
|
1549
1549
|
*/
|
|
1550
|
-
event?: string | undefined
|
|
1550
|
+
event?: string | undefined
|
|
1551
1551
|
/**
|
|
1552
1552
|
* ID of the message, if any was provided by the server. Can be used by clients to keep the
|
|
1553
1553
|
* last received message ID in sync when reconnecting.
|
|
1554
1554
|
*/
|
|
1555
|
-
id?: string | undefined
|
|
1555
|
+
id?: string | undefined
|
|
1556
1556
|
/**
|
|
1557
1557
|
* The data received for this message
|
|
1558
1558
|
*/
|
|
1559
|
-
data: string
|
|
1559
|
+
data: string
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
1562
|
/**
|
|
@@ -1580,11 +1580,8 @@ declare interface EventSourceMessage {
|
|
|
1580
1580
|
*
|
|
1581
1581
|
* @public
|
|
1582
1582
|
*/
|
|
1583
|
-
declare class EventSourceParserStream extends TransformStream<
|
|
1584
|
-
|
|
1585
|
-
EventSourceMessage
|
|
1586
|
-
> {
|
|
1587
|
-
constructor({ onError, onRetry, onComment }?: StreamOptions);
|
|
1583
|
+
declare class EventSourceParserStream extends TransformStream<string, EventSourceMessage> {
|
|
1584
|
+
constructor({onError, onRetry, onComment}?: StreamOptions)
|
|
1588
1585
|
}
|
|
1589
1586
|
|
|
1590
1587
|
/**
|
|
@@ -6988,19 +6985,19 @@ declare interface StreamOptions {
|
|
|
6988
6985
|
*
|
|
6989
6986
|
* @defaultValue `undefined`
|
|
6990
6987
|
*/
|
|
6991
|
-
onError?: (
|
|
6988
|
+
onError?: ('terminate' | ((error: Error) => void)) | undefined
|
|
6992
6989
|
/**
|
|
6993
6990
|
* Callback for when a reconnection interval is sent from the server.
|
|
6994
6991
|
*
|
|
6995
6992
|
* @param retry - The number of milliseconds to wait before reconnecting.
|
|
6996
6993
|
*/
|
|
6997
|
-
onRetry?: ((retry: number) => void) | undefined
|
|
6994
|
+
onRetry?: ((retry: number) => void) | undefined
|
|
6998
6995
|
/**
|
|
6999
6996
|
* Callback for when a comment is encountered in the stream.
|
|
7000
6997
|
*
|
|
7001
6998
|
* @param comment - The comment encountered in the stream.
|
|
7002
6999
|
*/
|
|
7003
|
-
onComment?: ((comment: string) => void) | undefined
|
|
7000
|
+
onComment?: ((comment: string) => void) | undefined
|
|
7004
7001
|
}
|
|
7005
7002
|
|
|
7006
7003
|
/**
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-client-js
|
|
|
3
3
|
description: Documentation for @mastra/client-js. Use when working with @mastra/client-js APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/client-js"
|
|
6
|
-
version: "1.18.0-alpha.
|
|
6
|
+
version: "1.18.0-alpha.15"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/dist/index.cjs
CHANGED
|
@@ -357,8 +357,6 @@ var AgentVoice = class extends BaseResource {
|
|
|
357
357
|
this.version = version;
|
|
358
358
|
this.agentId = agentId;
|
|
359
359
|
}
|
|
360
|
-
agentId;
|
|
361
|
-
version;
|
|
362
360
|
getQueryString(requestContext, delimiter = "?") {
|
|
363
361
|
const searchParams = new URLSearchParams(requestContextQueryString(requestContext).slice(1));
|
|
364
362
|
if (this.version) {
|
|
@@ -428,8 +426,6 @@ var Agent = class extends BaseResource {
|
|
|
428
426
|
this.version = version;
|
|
429
427
|
this.voice = new AgentVoice(options, this.agentId, this.version);
|
|
430
428
|
}
|
|
431
|
-
agentId;
|
|
432
|
-
version;
|
|
433
429
|
voice;
|
|
434
430
|
getQueryString(requestContext, delimiter = "?") {
|
|
435
431
|
const searchParams = new URLSearchParams(requestContextQueryString(requestContext).slice(1));
|
|
@@ -1946,8 +1942,6 @@ var MemoryThread = class extends BaseResource {
|
|
|
1946
1942
|
this.threadId = threadId;
|
|
1947
1943
|
this.agentId = agentId;
|
|
1948
1944
|
}
|
|
1949
|
-
threadId;
|
|
1950
|
-
agentId;
|
|
1951
1945
|
/**
|
|
1952
1946
|
* Builds the query string for agentId (if provided)
|
|
1953
1947
|
*/
|
|
@@ -2080,7 +2074,6 @@ var Vector = class extends BaseResource {
|
|
|
2080
2074
|
super(options);
|
|
2081
2075
|
this.vectorName = vectorName;
|
|
2082
2076
|
}
|
|
2083
|
-
vectorName;
|
|
2084
2077
|
/**
|
|
2085
2078
|
* Retrieves details about a specific vector index
|
|
2086
2079
|
* @param indexName - Name of the index to get details for
|
|
@@ -2153,7 +2146,6 @@ var Tool = class extends BaseResource {
|
|
|
2153
2146
|
super(options);
|
|
2154
2147
|
this.toolId = toolId;
|
|
2155
2148
|
}
|
|
2156
|
-
toolId;
|
|
2157
2149
|
/**
|
|
2158
2150
|
* Retrieves details about the tool
|
|
2159
2151
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -2189,7 +2181,6 @@ var Processor = class extends BaseResource {
|
|
|
2189
2181
|
super(options);
|
|
2190
2182
|
this.processorId = processorId;
|
|
2191
2183
|
}
|
|
2192
|
-
processorId;
|
|
2193
2184
|
/**
|
|
2194
2185
|
* Retrieves details about the processor
|
|
2195
2186
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -2271,8 +2262,6 @@ var Run = class extends BaseResource {
|
|
|
2271
2262
|
this.workflowId = workflowId;
|
|
2272
2263
|
this.runId = runId;
|
|
2273
2264
|
}
|
|
2274
|
-
workflowId;
|
|
2275
|
-
runId;
|
|
2276
2265
|
/**
|
|
2277
2266
|
* Creates a transform stream that parses RECORD_SEPARATOR-delimited JSON chunks
|
|
2278
2267
|
*/
|
|
@@ -2665,7 +2654,6 @@ var Workflow = class extends BaseResource {
|
|
|
2665
2654
|
super(options);
|
|
2666
2655
|
this.workflowId = workflowId;
|
|
2667
2656
|
}
|
|
2668
|
-
workflowId;
|
|
2669
2657
|
/**
|
|
2670
2658
|
* Retrieves details about the workflow
|
|
2671
2659
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -3028,7 +3016,6 @@ var A2A = class extends BaseResource {
|
|
|
3028
3016
|
super(options);
|
|
3029
3017
|
this.agentId = agentId;
|
|
3030
3018
|
}
|
|
3031
|
-
agentId;
|
|
3032
3019
|
/**
|
|
3033
3020
|
* Get the agent card with metadata about the agent.
|
|
3034
3021
|
* @param options - Optional Agent Card verification settings
|
|
@@ -3277,7 +3264,6 @@ var AgentBuilder = class extends BaseResource {
|
|
|
3277
3264
|
super(options);
|
|
3278
3265
|
this.actionId = actionId;
|
|
3279
3266
|
}
|
|
3280
|
-
actionId;
|
|
3281
3267
|
// Helper function to transform workflow result to action result
|
|
3282
3268
|
transformWorkflowResult(result) {
|
|
3283
3269
|
if (result.status === "success") {
|
|
@@ -4005,7 +3991,6 @@ var StoredAgent = class extends BaseResource {
|
|
|
4005
3991
|
super(options);
|
|
4006
3992
|
this.storedAgentId = storedAgentId;
|
|
4007
3993
|
}
|
|
4008
|
-
storedAgentId;
|
|
4009
3994
|
/**
|
|
4010
3995
|
* Retrieves details about the stored agent
|
|
4011
3996
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -4165,7 +4150,6 @@ var StoredPromptBlock = class extends BaseResource {
|
|
|
4165
4150
|
super(options);
|
|
4166
4151
|
this.storedPromptBlockId = storedPromptBlockId;
|
|
4167
4152
|
}
|
|
4168
|
-
storedPromptBlockId;
|
|
4169
4153
|
/**
|
|
4170
4154
|
* Retrieves details about the stored prompt block
|
|
4171
4155
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -4325,7 +4309,6 @@ var StoredMCPClient = class extends BaseResource {
|
|
|
4325
4309
|
super(options);
|
|
4326
4310
|
this.storedMCPClientId = storedMCPClientId;
|
|
4327
4311
|
}
|
|
4328
|
-
storedMCPClientId;
|
|
4329
4312
|
/**
|
|
4330
4313
|
* Retrieves details about the stored MCP client
|
|
4331
4314
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -4372,7 +4355,6 @@ var StoredScorer = class extends BaseResource {
|
|
|
4372
4355
|
super(options);
|
|
4373
4356
|
this.storedScorerId = storedScorerId;
|
|
4374
4357
|
}
|
|
4375
|
-
storedScorerId;
|
|
4376
4358
|
/**
|
|
4377
4359
|
* Retrieves details about the stored scorer definition
|
|
4378
4360
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -4533,7 +4515,6 @@ var ToolProvider = class extends BaseResource {
|
|
|
4533
4515
|
super(options);
|
|
4534
4516
|
this.providerId = providerId;
|
|
4535
4517
|
}
|
|
4536
|
-
providerId;
|
|
4537
4518
|
/**
|
|
4538
4519
|
* Lists available toolkits from this provider
|
|
4539
4520
|
* @returns Promise containing list of toolkits
|
|
@@ -4583,7 +4564,6 @@ var ProcessorProvider = class extends BaseResource {
|
|
|
4583
4564
|
super(options);
|
|
4584
4565
|
this.providerId = providerId;
|
|
4585
4566
|
}
|
|
4586
|
-
providerId;
|
|
4587
4567
|
/**
|
|
4588
4568
|
* Gets details about this processor provider and its available processors
|
|
4589
4569
|
* @returns Promise containing provider info and processor list
|
|
@@ -4603,9 +4583,6 @@ var WorkspaceSkillResource = class extends BaseResource {
|
|
|
4603
4583
|
this.basePath = `/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}`;
|
|
4604
4584
|
this.pathQuery = this.skillPath ? `?path=${encodeURIComponent(this.skillPath)}` : "";
|
|
4605
4585
|
}
|
|
4606
|
-
workspaceId;
|
|
4607
|
-
skillName;
|
|
4608
|
-
skillPath;
|
|
4609
4586
|
basePath;
|
|
4610
4587
|
pathQuery;
|
|
4611
4588
|
/**
|
|
@@ -4825,7 +4802,6 @@ var StoredSkill = class extends BaseResource {
|
|
|
4825
4802
|
super(options);
|
|
4826
4803
|
this.storedSkillId = storedSkillId;
|
|
4827
4804
|
}
|
|
4828
|
-
storedSkillId;
|
|
4829
4805
|
/**
|
|
4830
4806
|
* Retrieves details about the stored skill
|
|
4831
4807
|
* @param requestContext - Optional request context to pass as query parameter
|
|
@@ -4922,7 +4898,6 @@ var ResponsesStream = class {
|
|
|
4922
4898
|
constructor(response) {
|
|
4923
4899
|
this.response = response;
|
|
4924
4900
|
}
|
|
4925
|
-
response;
|
|
4926
4901
|
asResponse() {
|
|
4927
4902
|
return this.response;
|
|
4928
4903
|
}
|