@mastra/client-js 1.20.0-alpha.6 → 1.20.0-alpha.8
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
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 1.20.0-alpha.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`9aee493`](https://github.com/mastra-ai/mastra/commit/9aee493ed6089b5133472623dcce49934bf2d509)]:
|
|
8
|
+
- @mastra/core@1.36.0-alpha.8
|
|
9
|
+
|
|
10
|
+
## 1.20.0-alpha.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`a935b0a`](https://github.com/mastra-ai/mastra/commit/a935b0a0977ae3f196b33ec7621f528069c82db0)]:
|
|
15
|
+
- @mastra/core@1.36.0-alpha.7
|
|
16
|
+
|
|
3
17
|
## 1.20.0-alpha.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
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.20.0-alpha.
|
|
6
|
+
version: "1.20.0-alpha.8"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -86,6 +86,32 @@ agent.sendSignal(
|
|
|
86
86
|
)
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
## Identify users with attributes
|
|
90
|
+
|
|
91
|
+
Use `attributes` to tag each signal with user identity. The signal type and attributes are rendered as XML so the model can distinguish who said what in a multi-user thread:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
agent.sendSignal(
|
|
95
|
+
{
|
|
96
|
+
type: 'user',
|
|
97
|
+
contents: 'Can we simplify the API surface?',
|
|
98
|
+
attributes: { name: 'Devin', from: 'slack' },
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
resourceId: 'user_123',
|
|
102
|
+
threadId: 'thread_456',
|
|
103
|
+
},
|
|
104
|
+
)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The model receives:
|
|
108
|
+
|
|
109
|
+
```xml
|
|
110
|
+
<user name="Devin" from="slack">Can we simplify the API surface?</user>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The UI sees just the message contents but can also read `attributes` and `metadata` off the signal message for custom rendering (e.g. showing user names, avatars, or platform badges).
|
|
114
|
+
|
|
89
115
|
## Send external event context
|
|
90
116
|
|
|
91
117
|
Use custom signal types for system-generated context. Non-user signal types are rendered as XML-style user-role context so they can appear inside conversation history without looking like assistant output.
|
|
@@ -96,7 +122,7 @@ agent.sendSignal(
|
|
|
96
122
|
type: 'system-reminder',
|
|
97
123
|
contents: 'User X has left a new PR comment asking for a smaller API surface.',
|
|
98
124
|
attributes: {
|
|
99
|
-
|
|
125
|
+
source: 'github',
|
|
100
126
|
pr: '123',
|
|
101
127
|
},
|
|
102
128
|
},
|
|
@@ -110,7 +136,7 @@ agent.sendSignal(
|
|
|
110
136
|
The model receives the custom signal as context like this:
|
|
111
137
|
|
|
112
138
|
```xml
|
|
113
|
-
<system-reminder
|
|
139
|
+
<system-reminder source="github" pr="123">User X has left a new PR comment asking for a smaller API surface.</system-reminder>
|
|
114
140
|
```
|
|
115
141
|
|
|
116
142
|
Use XML-safe signal type names and attribute names. Signal type names and attribute names can contain letters, numbers, underscores, periods, and hyphens. They must start with a letter or underscore.
|
|
@@ -201,7 +201,7 @@ await agent.sendSignal({
|
|
|
201
201
|
|
|
202
202
|
Returns `{ accepted: true, runId: string }`.
|
|
203
203
|
|
|
204
|
-
**signal** (`{ type: 'user-message' | string; contents: string | Array<TextPart | FilePart>; attributes?: Record<string, JSONValue>; metadata?: Record<string, unknown>; providerOptions?: ProviderMetadata }`): \`user-message\` signals are treated as user input.
|
|
204
|
+
**signal** (`{ type: 'user-message' | 'system-reminder' | string; contents: string | Array<TextPart | FilePart>; attributes?: Record<string, JSONValue>; metadata?: Record<string, unknown>; providerOptions?: ProviderMetadata }`): \`user-message\` signals without attributes are treated as plain user input. All other signals — including \`user-message\` with \`attributes\`, \`system-reminder\`, and custom types — are wrapped in an XML element named after the signal type with \`attributes\` rendered as XML attributes (e.g. \`\<user name="Devin" from="slack">message\</user>\`). The model sees the XML; the UI sees the raw contents and can read \`attributes\` for custom rendering. \`providerOptions\` is attached to the resulting prompt turn and persisted on the stored signal message.
|
|
205
205
|
|
|
206
206
|
**runId** (`string`): Run ID to target directly.
|
|
207
207
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "1.20.0-alpha.
|
|
3
|
+
"version": "1.20.0-alpha.8",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"canonicalize": "^1.0.8",
|
|
40
40
|
"jose": "^6.2.1",
|
|
41
41
|
"json-schema": "^0.4.0",
|
|
42
|
-
"@mastra/core": "1.36.0-alpha.
|
|
42
|
+
"@mastra/core": "1.36.0-alpha.8",
|
|
43
43
|
"@mastra/schema-compat": "1.2.10"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"zod": "^4.3.6",
|
|
58
58
|
"@internal/ai-sdk-v4": "0.0.43",
|
|
59
59
|
"@internal/ai-sdk-v5": "0.0.43",
|
|
60
|
-
"@internal/
|
|
61
|
-
"@internal/
|
|
60
|
+
"@internal/types-builder": "0.0.71",
|
|
61
|
+
"@internal/lint": "0.0.96"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22.13.0"
|