@mastra/client-js 1.39.0-alpha.8 → 1.39.0
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 +214 -0
- package/dist/docs/SKILL.md +10 -6
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-long-running-agents-schedules.md +1 -1
- package/dist/docs/references/docs-long-running-agents-signals.md +2 -2
- package/dist/docs/references/docs-server-mastra-client.md +2 -2
- package/dist/docs/references/{docs-server-auth-auth0.md → integrations-auth-auth0.md} +1 -1
- package/dist/docs/references/{docs-server-auth-clerk.md → integrations-auth-clerk.md} +2 -2
- package/dist/docs/references/{docs-server-auth-firebase.md → integrations-auth-firebase.md} +1 -1
- package/dist/docs/references/{docs-server-auth-supabase.md → integrations-auth-supabase.md} +2 -2
- package/dist/docs/references/{docs-server-auth-workos.md → integrations-auth-workos.md} +1 -1
- package/dist/docs/references/reference-client-js-agents.md +2 -1
- package/dist/docs/references/reference-client-js-workflows.md +3 -3
- package/dist/docs/references/reference-migrations-upgrade-to-v1-client.md +339 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts +6 -0
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/route-types.generated.d.ts +46 -26
- package/dist/route-types.generated.d.ts.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,219 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 1.39.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added experiment provenance and grouping support to the JavaScript client. ([#20645](https://github.com/mastra-ai/mastra/pull/20645))
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
await client.triggerDatasetExperiment({
|
|
11
|
+
datasetId,
|
|
12
|
+
targetType: 'agent',
|
|
13
|
+
targetId: 'agent-1',
|
|
14
|
+
grouping: { experimentSetId: 'benchmark-1', trialIndex: 0 },
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Add a reasoning-effort configuration surface across mastracode and Factory (fixes #20766): ([#20884](https://github.com/mastra-ai/mastra/pull/20884))
|
|
19
|
+
|
|
20
|
+
- New `max` thinking level (mapped to `reasoning effort: max` for OpenAI Codex and Anthropic `effort`).
|
|
21
|
+
- Anthropic extended-thinking wiring: the session thinking level now applies to anthropic/claude-opus-4-7 and other Anthropic models via provider thinking/effort options (previously OpenAI-only).
|
|
22
|
+
- New `models.modeThinkingDefaults` setting: per-mode (build/plan/fast) default thinking levels, resolved at request time with precedence session override → mode default → global `preferences.thinkingLevel`. Configuration changes now apply to the next request of every session, including automated Factory runs.
|
|
23
|
+
- Factory: new Settings → Defaults controls for editing global and per-mode thinking defaults in local deployments.
|
|
24
|
+
- TUI: `/think` now sets a session-only override, supports `/think default` to clear it, and `/think status` reports the effective level with provenance (session override / mode default / global default).
|
|
25
|
+
|
|
26
|
+
Example `settings.json` configuration:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"preferences": { "thinkingLevel": "medium" },
|
|
31
|
+
"models": {
|
|
32
|
+
"modeThinkingDefaults": {
|
|
33
|
+
"build": "high",
|
|
34
|
+
"plan": "max",
|
|
35
|
+
"fast": "off"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- Added `getA2AV1()` for opt-in A2A Protocol v1.0 requests, including task listing and v1 streaming responses. Existing `getA2A()` integrations remain on v0.3. ([#20811](https://github.com/mastra-ai/mastra/pull/20811))
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
const a2a = client.getA2AV1('weather-agent');
|
|
45
|
+
const tasks = await a2a.listTasks(ListTasksRequest.fromJSON({ pageSize: 20 }));
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- Renamed the stored workflow client methods to dynamic workflows: `upsertStoredWorkflow()`, `listStoredWorkflows()`, and `getStoredWorkflow()` are now `upsertDynamicWorkflow()`, `listDynamicWorkflows()`, and `getDynamicWorkflow()`. ([#20938](https://github.com/mastra-ai/mastra/pull/20938))
|
|
49
|
+
|
|
50
|
+
- Added `isKnownAgentControllerEvent` to narrow agent controller stream events. `AgentControllerEvent` includes a forward-compatibility arm whose `type` is `string`, so comparing `event.type` to a literal never narrows the union and payload fields stay `unknown` — consumers had to cast. ([#20800](https://github.com/mastra-ai/mastra/pull/20800))
|
|
51
|
+
|
|
52
|
+
**Before**
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
session.subscribe({
|
|
56
|
+
onEvent: event => {
|
|
57
|
+
const known = event as KnownAgentControllerEvent;
|
|
58
|
+
if (known.type === 'message_end') save(known.message);
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**After**
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { isKnownAgentControllerEvent } from '@mastra/client-js';
|
|
67
|
+
|
|
68
|
+
session.subscribe({
|
|
69
|
+
onEvent: event => {
|
|
70
|
+
if (isKnownAgentControllerEvent(event) && event.type === 'message_end') save(event.message);
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The guard is kept in sync with the event union at compile time, so a new event type cannot be added without it.
|
|
76
|
+
|
|
77
|
+
- Added `listWorkflowRunCounts()` — fetches per-workflow counts of running and suspended runs from the new aggregated server endpoint in a single request. ([#18925](https://github.com/mastra-ai/mastra/pull/18925))
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
const runCounts = await mastraClient.listWorkflowRunCounts();
|
|
81
|
+
// { "cityWorkflow": { running: 2, suspended: 1 }, ... }
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Servers that predate the endpoint respond with `404 Not Found`.
|
|
85
|
+
|
|
86
|
+
- Added `listTracesLight()` for fetching trace lists without the `input`, `output` and `attributes` blobs. It takes the same filtering, ordering and delta-polling arguments as `listTraces()`, and each row carries a short `inputPreview` instead of the full input. ([#20677](https://github.com/mastra-ai/mastra/pull/20677))
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
// Full payloads — use when you need attributes/input/output
|
|
90
|
+
const full = await client.listTraces({ pagination: { page: 0, perPage: 25 } });
|
|
91
|
+
|
|
92
|
+
// Lightweight rows for list views; fetch the full record when a row is opened
|
|
93
|
+
const list = await client.listTracesLight({ pagination: { page: 0, perPage: 25 } });
|
|
94
|
+
list.spans[0].inputPreview; // 'summarize this thread'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- Preserve experiment name, description, and metadata from HTTP trigger requests. ([#20578](https://github.com/mastra-ai/mastra/pull/20578))
|
|
100
|
+
|
|
101
|
+
- Added typed display-state fields to the agent-controller `display_state_changed` event: `activeTools`, `toolInputBuffers`, `pendingSuspensions`, `activeSubagents`, and `modifiedFiles` are now declared on the event payload. ([#20805](https://github.com/mastra-ai/mastra/pull/20805))
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
const session = client.getAgentController('code').session('user-1');
|
|
105
|
+
await session.subscribe({
|
|
106
|
+
onEvent: event => {
|
|
107
|
+
if (event.type === 'display_state_changed') {
|
|
108
|
+
for (const [toolCallId, tool] of Object.entries(event.displayState.activeTools ?? {})) {
|
|
109
|
+
console.log(`${tool.name} is ${tool.status} (${toolCallId})`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- Added the `skill_resolution` span type to the generated route types. ([#21232](https://github.com/mastra-ai/mastra/pull/21232))
|
|
117
|
+
|
|
118
|
+
- Added an optional `reason` when declining a tool call, so the model and your UI can see _why_ a tool call was rejected instead of always showing "Tool call was not approved by the user". ([#21085](https://github.com/mastra-ai/mastra/pull/21085))
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
// Before: the model only learned the call was declined
|
|
122
|
+
await agent.declineToolCall({ runId, toolCallId });
|
|
123
|
+
|
|
124
|
+
// After: give the model context it can act on
|
|
125
|
+
await agent.declineToolCall({
|
|
126
|
+
runId,
|
|
127
|
+
toolCallId,
|
|
128
|
+
reason: 'Reading other users personal data is not allowed, ask the user for their own email instead',
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The reason is retained with the tool call, so it is still there when the conversation is recalled later. It is supported by `declineToolCall`, `declineToolCallGenerate` and `declineNetworkToolCall`, on both regular and durable agents. Omitting `reason` keeps the previous default message.
|
|
133
|
+
|
|
134
|
+
Closes #20495
|
|
135
|
+
|
|
136
|
+
- Updated dependencies [[`e7109ee`](https://github.com/mastra-ai/mastra/commit/e7109ee6f731bacc79c885906f3c7dca8d8f013a), [`b8ce7ec`](https://github.com/mastra-ai/mastra/commit/b8ce7ec96e39343c6c2f36d12d68a9ad816c09f7), [`2e4624e`](https://github.com/mastra-ai/mastra/commit/2e4624edb6917e61249cb60ee377735e7af7e4a9), [`45a9147`](https://github.com/mastra-ai/mastra/commit/45a914741f578754d79d8b7de7b4e4f304d8e14a), [`a3a3624`](https://github.com/mastra-ai/mastra/commit/a3a3624f646b98e409424d8defccbd334da9e8b8), [`6246914`](https://github.com/mastra-ai/mastra/commit/62469146636911f3cbbe0880bd011c6a897a59a7), [`6445eba`](https://github.com/mastra-ai/mastra/commit/6445eba6020abac681aba1cc9289f446cb400cbe), [`86b7b77`](https://github.com/mastra-ai/mastra/commit/86b7b777980d30f66e1fd134a37d2af4c22e54cc), [`1c75e32`](https://github.com/mastra-ai/mastra/commit/1c75e32f7fc0b9fb6f548b4407feaec8a1440212), [`296dc9a`](https://github.com/mastra-ai/mastra/commit/296dc9af29f3616e786c7825ec32e0df92d754c5), [`f59032a`](https://github.com/mastra-ai/mastra/commit/f59032a73699443555a08a479e7ac578975784f2), [`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`3f73c07`](https://github.com/mastra-ai/mastra/commit/3f73c076727e8c36b4fff7a1b40290fb68957fa8), [`6bff877`](https://github.com/mastra-ai/mastra/commit/6bff877e214695ff8d9c84b06c13a6e6bcf9f1ed), [`772c0c8`](https://github.com/mastra-ai/mastra/commit/772c0c897cec383258de2e6178147f8014767c7b), [`d7cf7fa`](https://github.com/mastra-ai/mastra/commit/d7cf7fafc1ae1b50bd8462dd0e6c671a8606db93), [`7c1ebb1`](https://github.com/mastra-ai/mastra/commit/7c1ebb15690c4b3f0eabb19077cf8af573311e57), [`0f9a448`](https://github.com/mastra-ai/mastra/commit/0f9a448502157e59f7b76f24360ad497168f5ef8), [`f5a17d9`](https://github.com/mastra-ai/mastra/commit/f5a17d95c19e7d4149996932bd8d1905089f031d), [`578bf2e`](https://github.com/mastra-ai/mastra/commit/578bf2e6a88e9d5b8bf502204e15a95dfbb679ae), [`c47165c`](https://github.com/mastra-ai/mastra/commit/c47165c983c87594c6952f1fd2fa51a90205034c), [`289f4ce`](https://github.com/mastra-ai/mastra/commit/289f4ce16e3293370440172132c52ee787cbc09f), [`df31eb0`](https://github.com/mastra-ai/mastra/commit/df31eb0c7087d782a0d9346e467f9a4af4b0eef6), [`9571e3a`](https://github.com/mastra-ai/mastra/commit/9571e3a06ed2c5220196460bf82a2129255c3a8b), [`4f16ff8`](https://github.com/mastra-ai/mastra/commit/4f16ff824bf2f9b0ddc93f210477c10c8a4fb1ab), [`b4c89b4`](https://github.com/mastra-ai/mastra/commit/b4c89b4371b0c86da57403ad1a3b3ef0681f3128), [`e6534fa`](https://github.com/mastra-ai/mastra/commit/e6534fab031216f6cb48c4c9907cbfdce9d60bc6), [`210cb7a`](https://github.com/mastra-ai/mastra/commit/210cb7a167998c7bbf72cb3b93e6eb0563330239), [`06b2d87`](https://github.com/mastra-ai/mastra/commit/06b2d87e63bcdd0ed59215c6789692b9b12de376), [`1c67d85`](https://github.com/mastra-ai/mastra/commit/1c67d85e9da8285662f4dbbf47e0378c3fee0747), [`ac01d63`](https://github.com/mastra-ai/mastra/commit/ac01d6355974aec73fdb8781449ed12bac582094), [`80a3324`](https://github.com/mastra-ai/mastra/commit/80a33245d3110204de6f56d61211523ffe338692), [`e44e8f3`](https://github.com/mastra-ai/mastra/commit/e44e8f370b66c339ddcaba946d33da6d3c3f06cd), [`d9d2881`](https://github.com/mastra-ai/mastra/commit/d9d2881ede6dd6c023d144215fc812062aed0890), [`a810a05`](https://github.com/mastra-ai/mastra/commit/a810a058f62ad407cfc1701e0be36ae91145d7cf), [`ba24be6`](https://github.com/mastra-ai/mastra/commit/ba24be662439c331ab23a600041f93803c89eca8), [`842b5fe`](https://github.com/mastra-ai/mastra/commit/842b5fe22b6a7fa811bd14e48eb9af523ac989f2), [`990611b`](https://github.com/mastra-ai/mastra/commit/990611ba76eb876d86c9c594371ae5f02f94b432), [`80bdf3a`](https://github.com/mastra-ai/mastra/commit/80bdf3ae16ade6ff63bde0cb16fa2df8ab7dd4dd), [`c967a5e`](https://github.com/mastra-ai/mastra/commit/c967a5eec150c5dc5418c4a4388982d1fb7ad27c), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`9ba1247`](https://github.com/mastra-ai/mastra/commit/9ba12470c77f1c03642d720ce67e517e878f666e), [`fd96298`](https://github.com/mastra-ai/mastra/commit/fd96298a8367622f4ebfcaa97b5b6c1fbbd14564), [`66bbfb5`](https://github.com/mastra-ai/mastra/commit/66bbfb5f05b473d39f88c0e4a481ccac41634f3a), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`f8da216`](https://github.com/mastra-ai/mastra/commit/f8da21633e7eb0e31c9ce0fc30567870d19416d3), [`4a09a9c`](https://github.com/mastra-ai/mastra/commit/4a09a9c0474ef643558fcb5f0edc542b82f1cab0), [`5f798b3`](https://github.com/mastra-ai/mastra/commit/5f798b3362e9bdf4d690f85245606e146eef60b9), [`6a84954`](https://github.com/mastra-ai/mastra/commit/6a84954a2667f85b6d59da652dab1bbff007ccb0), [`1e83a47`](https://github.com/mastra-ai/mastra/commit/1e83a4734ab61ba5926af6793e3569a78b72ed37), [`52d8ef0`](https://github.com/mastra-ai/mastra/commit/52d8ef03801f1deb7ee48532fc4190dd4a33916c), [`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`7fdcaa6`](https://github.com/mastra-ai/mastra/commit/7fdcaa66105d64290f9b14432a12ec99f39c4d3a), [`d6c56f9`](https://github.com/mastra-ai/mastra/commit/d6c56f951db3213330b98b0abafa9778c8770e58), [`e08e789`](https://github.com/mastra-ai/mastra/commit/e08e789c1bf4cd2fe46363f7a4728536ceccc9bd), [`bf936e2`](https://github.com/mastra-ai/mastra/commit/bf936e2c89b2ff0dad5695b873ddc009ba96d41e), [`7fb580a`](https://github.com/mastra-ai/mastra/commit/7fb580ac73fbcacf2ff00872a3395f73ae1b9fa5), [`ed5d606`](https://github.com/mastra-ai/mastra/commit/ed5d606739c5e3fbdfa9f272df7809aa5ab43b1d), [`f53d5bd`](https://github.com/mastra-ai/mastra/commit/f53d5bd4885b29e4ac29a428a6044088ea8d6aa3), [`32980a3`](https://github.com/mastra-ai/mastra/commit/32980a3e2413d0274ac244d32c37d910edc13f00), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`82e3365`](https://github.com/mastra-ai/mastra/commit/82e3365ef7c9bf7bee2e7a7029035ea262d68895), [`6104347`](https://github.com/mastra-ai/mastra/commit/61043473ba6bfd0a25156824e853e13165562e6c), [`35cc901`](https://github.com/mastra-ai/mastra/commit/35cc90102cf834a84827acaf9eee0b6d6d1e2a3b), [`a8b4cf0`](https://github.com/mastra-ai/mastra/commit/a8b4cf02823cffebc4751a53337dfacf097c1ae1), [`9571e3a`](https://github.com/mastra-ai/mastra/commit/9571e3a06ed2c5220196460bf82a2129255c3a8b), [`333785c`](https://github.com/mastra-ai/mastra/commit/333785c93cbb01e42c60167e995457c28897ddbf), [`bda2235`](https://github.com/mastra-ai/mastra/commit/bda22353ee28f2df0eaea555f7cae1549f979c0b), [`efd5c81`](https://github.com/mastra-ai/mastra/commit/efd5c81cc25fde3c2ddd86fc1178deb4ec176e19), [`1b482c2`](https://github.com/mastra-ai/mastra/commit/1b482c2d89244dd758c41e5f927a2b44041388d2), [`5dba2a4`](https://github.com/mastra-ai/mastra/commit/5dba2a41600385751f5aace79878904e1972609d), [`45bfb88`](https://github.com/mastra-ai/mastra/commit/45bfb88fd52f1dd3be20e2a38905777c96499c90), [`ff28284`](https://github.com/mastra-ai/mastra/commit/ff2828416f14daff9d956e6a352fdaa23c950979), [`4bcdfaf`](https://github.com/mastra-ai/mastra/commit/4bcdfaf0eac3199d7cb171b0a19a92c9c341eea4), [`e3b9307`](https://github.com/mastra-ai/mastra/commit/e3b9307098daefbfae2a52ae2ef51bc9fc701190), [`d6834c5`](https://github.com/mastra-ai/mastra/commit/d6834c5a7866b16734d23900163c2414ed70d791), [`f33264f`](https://github.com/mastra-ai/mastra/commit/f33264f517ae603279afd5c4251e2b40f6dd3618), [`689f2c4`](https://github.com/mastra-ai/mastra/commit/689f2c4b6c0835fe455702b01d21daa8abcd9331), [`fcd0667`](https://github.com/mastra-ai/mastra/commit/fcd0667a4e378be35c9a1b1eb19cce78fbfd7282), [`cfd0d9e`](https://github.com/mastra-ai/mastra/commit/cfd0d9ec77ec3c69dd96f79cdb579e03d79f22ce), [`acc3513`](https://github.com/mastra-ai/mastra/commit/acc3513b19f79bf0a7ec2998694580edca54086c), [`1670533`](https://github.com/mastra-ai/mastra/commit/1670533986f6bacf567746245348125e3a106448), [`a7eb4a1`](https://github.com/mastra-ai/mastra/commit/a7eb4a11450f6170274ed5141bffe821d4fdd5a6), [`0976933`](https://github.com/mastra-ai/mastra/commit/0976933142333ec78451feef265b68bcb45aa5e7), [`242b945`](https://github.com/mastra-ai/mastra/commit/242b94558777bfbdeb42cbfea84afff0b6ad0633), [`c52d346`](https://github.com/mastra-ai/mastra/commit/c52d3462ec831a5d95926ecd3d3373f5928ad2e5), [`af4636a`](https://github.com/mastra-ai/mastra/commit/af4636a74463275d71c1d13a38f7d2b738f128bf), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`2eabc09`](https://github.com/mastra-ai/mastra/commit/2eabc097d86d52fbd0123da36a7c874154cc384f), [`0023e79`](https://github.com/mastra-ai/mastra/commit/0023e7919431078280abd11c89d1edeae35fcc69), [`c2ad51e`](https://github.com/mastra-ai/mastra/commit/c2ad51e2467f901eecba8c9f4a45e22a50bd7c18), [`25ca73d`](https://github.com/mastra-ai/mastra/commit/25ca73d25dee7ce9f0ca72939e3a505c4db7257e), [`2f9ef3f`](https://github.com/mastra-ai/mastra/commit/2f9ef3f4ca06fc2dcdd5088c26b7f4da6a016791), [`e7eefcb`](https://github.com/mastra-ai/mastra/commit/e7eefcb162cda7c493e8c3bf43050ead0efbcb2c), [`fea5cae`](https://github.com/mastra-ai/mastra/commit/fea5caedc7e2cfea51784a15e015952692027abf), [`4d7aca2`](https://github.com/mastra-ai/mastra/commit/4d7aca2fe75f225c83d1502d63079568e6ec163f), [`e1cead1`](https://github.com/mastra-ai/mastra/commit/e1cead17b5f3653cf00d2f90cc19b113119c02ba), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`d9d93b2`](https://github.com/mastra-ai/mastra/commit/d9d93b25e4a65ad5fa153fa35be7ed149c8d587f), [`c4ec889`](https://github.com/mastra-ai/mastra/commit/c4ec889561c0264c43f66d04d587bee4ce35e792), [`4b59f78`](https://github.com/mastra-ai/mastra/commit/4b59f786cbc9a7d1ef07a07517dbd4b96865e99d), [`eeae63e`](https://github.com/mastra-ai/mastra/commit/eeae63e7fbe8e1f237adc69bca6e2ac13c5ca907), [`3dc97ea`](https://github.com/mastra-ai/mastra/commit/3dc97ea415fad353b48a13095fad1835933cc12a), [`94e7ae9`](https://github.com/mastra-ai/mastra/commit/94e7ae970b37c888cd1244ef013292639a2fe6d1), [`e6a2860`](https://github.com/mastra-ai/mastra/commit/e6a2860649cc51f87d32d78b766ae2126446ba07), [`7010c5d`](https://github.com/mastra-ai/mastra/commit/7010c5d15728bf9c5dfe4fb6b1bf80ce23bf143a), [`bab06b1`](https://github.com/mastra-ai/mastra/commit/bab06b18923873a584bdfc71a6b4ec7fb4727fb7), [`3d01cd3`](https://github.com/mastra-ai/mastra/commit/3d01cd387321b6f9c5cac31d487c84bf51b19c78), [`7bf3086`](https://github.com/mastra-ai/mastra/commit/7bf308663f0115ca74ad20554ade740f06640859), [`4c186a0`](https://github.com/mastra-ai/mastra/commit/4c186a017275f45e6ed4c09de0f89550e2d09e8c), [`b0fa077`](https://github.com/mastra-ai/mastra/commit/b0fa077bcbc9b08551846fe372a0d3d15b71ed72), [`0282e16`](https://github.com/mastra-ai/mastra/commit/0282e16115538c8e9b248b90f0748eb01cb5dc98), [`a8dd139`](https://github.com/mastra-ai/mastra/commit/a8dd1391a9fe9a6632c25809ef236980afa9a020), [`6a667b4`](https://github.com/mastra-ai/mastra/commit/6a667b4b7cd6a93fe41fcdd357b08c5a8c09b9ab), [`9be8878`](https://github.com/mastra-ai/mastra/commit/9be8878dcf0388e84fc4873e0eec27bd49b881a4), [`e5786be`](https://github.com/mastra-ai/mastra/commit/e5786be02bb903073082bd9d6da880ebaacc343f), [`2440e09`](https://github.com/mastra-ai/mastra/commit/2440e096ea6c2def1ccc1eb2d0f3f5b88c4af940), [`2093fbd`](https://github.com/mastra-ai/mastra/commit/2093fbd53bb744bae19ec89f6d73db9a66fbe8a7), [`a59049b`](https://github.com/mastra-ai/mastra/commit/a59049b1652a13efff66ac826326b5ed9a550342), [`7bd85ea`](https://github.com/mastra-ai/mastra/commit/7bd85ea7588b71c25ce9f4019c88f8539be5dcbc), [`83fa004`](https://github.com/mastra-ai/mastra/commit/83fa0044bfda8b703a83883dbd8bef204844d13f), [`a463cdf`](https://github.com/mastra-ai/mastra/commit/a463cdf1c95c3059e70f0bff27959e8558bb899d), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`7b4393d`](https://github.com/mastra-ai/mastra/commit/7b4393d557411fdcf07b0e30e5acaf7cc85154ae), [`0ea6b80`](https://github.com/mastra-ai/mastra/commit/0ea6b8001408ce02b56e8be0536b0fd8cbaf8ad2)]:
|
|
137
|
+
- @mastra/core@1.58.0
|
|
138
|
+
- @mastra/schema-compat@1.3.6
|
|
139
|
+
|
|
140
|
+
## 1.39.0-alpha.16
|
|
141
|
+
|
|
142
|
+
### Patch Changes
|
|
143
|
+
|
|
144
|
+
- Updated dependencies [[`296dc9a`](https://github.com/mastra-ai/mastra/commit/296dc9af29f3616e786c7825ec32e0df92d754c5), [`4a09a9c`](https://github.com/mastra-ai/mastra/commit/4a09a9c0474ef643558fcb5f0edc542b82f1cab0), [`1e83a47`](https://github.com/mastra-ai/mastra/commit/1e83a4734ab61ba5926af6793e3569a78b72ed37), [`ff28284`](https://github.com/mastra-ai/mastra/commit/ff2828416f14daff9d956e6a352fdaa23c950979), [`1670533`](https://github.com/mastra-ai/mastra/commit/1670533986f6bacf567746245348125e3a106448)]:
|
|
145
|
+
- @mastra/core@1.58.0-alpha.16
|
|
146
|
+
|
|
147
|
+
## 1.39.0-alpha.15
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies [[`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b)]:
|
|
152
|
+
- @mastra/core@1.58.0-alpha.15
|
|
153
|
+
|
|
154
|
+
## 1.39.0-alpha.14
|
|
155
|
+
|
|
156
|
+
### Patch Changes
|
|
157
|
+
|
|
158
|
+
- Added the `skill_resolution` span type to the generated route types. ([#21232](https://github.com/mastra-ai/mastra/pull/21232))
|
|
159
|
+
|
|
160
|
+
- Updated dependencies [[`210cb7a`](https://github.com/mastra-ai/mastra/commit/210cb7a167998c7bbf72cb3b93e6eb0563330239), [`5f798b3`](https://github.com/mastra-ai/mastra/commit/5f798b3362e9bdf4d690f85245606e146eef60b9), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`25ca73d`](https://github.com/mastra-ai/mastra/commit/25ca73d25dee7ce9f0ca72939e3a505c4db7257e), [`e1cead1`](https://github.com/mastra-ai/mastra/commit/e1cead17b5f3653cf00d2f90cc19b113119c02ba), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437)]:
|
|
161
|
+
- @mastra/core@1.58.0-alpha.14
|
|
162
|
+
|
|
163
|
+
## 1.39.0-alpha.13
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- Updated dependencies [[`9571e3a`](https://github.com/mastra-ai/mastra/commit/9571e3a06ed2c5220196460bf82a2129255c3a8b), [`d6c56f9`](https://github.com/mastra-ai/mastra/commit/d6c56f951db3213330b98b0abafa9778c8770e58), [`9571e3a`](https://github.com/mastra-ai/mastra/commit/9571e3a06ed2c5220196460bf82a2129255c3a8b), [`acc3513`](https://github.com/mastra-ai/mastra/commit/acc3513b19f79bf0a7ec2998694580edca54086c), [`94e7ae9`](https://github.com/mastra-ai/mastra/commit/94e7ae970b37c888cd1244ef013292639a2fe6d1), [`6a667b4`](https://github.com/mastra-ai/mastra/commit/6a667b4b7cd6a93fe41fcdd357b08c5a8c09b9ab), [`2440e09`](https://github.com/mastra-ai/mastra/commit/2440e096ea6c2def1ccc1eb2d0f3f5b88c4af940), [`a59049b`](https://github.com/mastra-ai/mastra/commit/a59049b1652a13efff66ac826326b5ed9a550342)]:
|
|
168
|
+
- @mastra/core@1.58.0-alpha.13
|
|
169
|
+
|
|
170
|
+
## 1.39.0-alpha.12
|
|
171
|
+
|
|
172
|
+
### Patch Changes
|
|
173
|
+
|
|
174
|
+
- Updated dependencies [[`2e4624e`](https://github.com/mastra-ai/mastra/commit/2e4624edb6917e61249cb60ee377735e7af7e4a9), [`e6534fa`](https://github.com/mastra-ai/mastra/commit/e6534fab031216f6cb48c4c9907cbfdce9d60bc6), [`7fdcaa6`](https://github.com/mastra-ai/mastra/commit/7fdcaa66105d64290f9b14432a12ec99f39c4d3a), [`5dba2a4`](https://github.com/mastra-ai/mastra/commit/5dba2a41600385751f5aace79878904e1972609d), [`cfd0d9e`](https://github.com/mastra-ai/mastra/commit/cfd0d9ec77ec3c69dd96f79cdb579e03d79f22ce), [`d9d93b2`](https://github.com/mastra-ai/mastra/commit/d9d93b25e4a65ad5fa153fa35be7ed149c8d587f)]:
|
|
175
|
+
- @mastra/core@1.58.0-alpha.12
|
|
176
|
+
- @mastra/schema-compat@1.3.6-alpha.3
|
|
177
|
+
|
|
178
|
+
## 1.39.0-alpha.11
|
|
179
|
+
|
|
180
|
+
### Patch Changes
|
|
181
|
+
|
|
182
|
+
- Updated dependencies [[`b8ce7ec`](https://github.com/mastra-ai/mastra/commit/b8ce7ec96e39343c6c2f36d12d68a9ad816c09f7), [`a3a3624`](https://github.com/mastra-ai/mastra/commit/a3a3624f646b98e409424d8defccbd334da9e8b8), [`6246914`](https://github.com/mastra-ai/mastra/commit/62469146636911f3cbbe0880bd011c6a897a59a7), [`3f73c07`](https://github.com/mastra-ai/mastra/commit/3f73c076727e8c36b4fff7a1b40290fb68957fa8), [`7c1ebb1`](https://github.com/mastra-ai/mastra/commit/7c1ebb15690c4b3f0eabb19077cf8af573311e57), [`32980a3`](https://github.com/mastra-ai/mastra/commit/32980a3e2413d0274ac244d32c37d910edc13f00), [`4bcdfaf`](https://github.com/mastra-ai/mastra/commit/4bcdfaf0eac3199d7cb171b0a19a92c9c341eea4), [`af4636a`](https://github.com/mastra-ai/mastra/commit/af4636a74463275d71c1d13a38f7d2b738f128bf), [`a463cdf`](https://github.com/mastra-ai/mastra/commit/a463cdf1c95c3059e70f0bff27959e8558bb899d), [`0ea6b80`](https://github.com/mastra-ai/mastra/commit/0ea6b8001408ce02b56e8be0536b0fd8cbaf8ad2)]:
|
|
183
|
+
- @mastra/core@1.58.0-alpha.11
|
|
184
|
+
|
|
185
|
+
## 1.39.0-alpha.10
|
|
186
|
+
|
|
187
|
+
### Patch Changes
|
|
188
|
+
|
|
189
|
+
- Updated dependencies [[`66bbfb5`](https://github.com/mastra-ai/mastra/commit/66bbfb5f05b473d39f88c0e4a481ccac41634f3a)]:
|
|
190
|
+
- @mastra/core@1.58.0-alpha.10
|
|
191
|
+
|
|
192
|
+
## 1.39.0-alpha.9
|
|
193
|
+
|
|
194
|
+
### Patch Changes
|
|
195
|
+
|
|
196
|
+
- Added an optional `reason` when declining a tool call, so the model and your UI can see _why_ a tool call was rejected instead of always showing "Tool call was not approved by the user". ([#21085](https://github.com/mastra-ai/mastra/pull/21085))
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
// Before: the model only learned the call was declined
|
|
200
|
+
await agent.declineToolCall({ runId, toolCallId });
|
|
201
|
+
|
|
202
|
+
// After: give the model context it can act on
|
|
203
|
+
await agent.declineToolCall({
|
|
204
|
+
runId,
|
|
205
|
+
toolCallId,
|
|
206
|
+
reason: 'Reading other users personal data is not allowed, ask the user for their own email instead',
|
|
207
|
+
});
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The reason is retained with the tool call, so it is still there when the conversation is recalled later. It is supported by `declineToolCall`, `declineToolCallGenerate` and `declineNetworkToolCall`, on both regular and durable agents. Omitting `reason` keeps the previous default message.
|
|
211
|
+
|
|
212
|
+
Closes #20495
|
|
213
|
+
|
|
214
|
+
- Updated dependencies [[`86b7b77`](https://github.com/mastra-ai/mastra/commit/86b7b777980d30f66e1fd134a37d2af4c22e54cc), [`80a3324`](https://github.com/mastra-ai/mastra/commit/80a33245d3110204de6f56d61211523ffe338692), [`d9d2881`](https://github.com/mastra-ai/mastra/commit/d9d2881ede6dd6c023d144215fc812062aed0890), [`82e3365`](https://github.com/mastra-ai/mastra/commit/82e3365ef7c9bf7bee2e7a7029035ea262d68895), [`1b482c2`](https://github.com/mastra-ai/mastra/commit/1b482c2d89244dd758c41e5f927a2b44041388d2), [`e6a2860`](https://github.com/mastra-ai/mastra/commit/e6a2860649cc51f87d32d78b766ae2126446ba07), [`7bd85ea`](https://github.com/mastra-ai/mastra/commit/7bd85ea7588b71c25ce9f4019c88f8539be5dcbc)]:
|
|
215
|
+
- @mastra/core@1.58.0-alpha.9
|
|
216
|
+
|
|
3
217
|
## 1.39.0-alpha.8
|
|
4
218
|
|
|
5
219
|
### 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.39.0
|
|
6
|
+
version: "1.39.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -20,14 +20,17 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
20
20
|
- [Editor](references/docs-editor-overview.md) - Let collaborators update an agent in Studio, test their changes, and publish without editing code.
|
|
21
21
|
- [Schedules](references/docs-long-running-agents-schedules.md) - Run an agent on a cron schedule to deliver a recurring prompt, with optional thread delivery and lifecycle hooks.
|
|
22
22
|
- [Signals](references/docs-long-running-agents-signals.md) - Learn how to send real-time messages and context into a Mastra agent thread.
|
|
23
|
-
- [Auth0](references/docs-server-auth-auth0.md) - Documentation for the @mastra/auth-auth0 package, which authenticates Mastra applications using Auth0 authentication.
|
|
24
|
-
- [Clerk](references/docs-server-auth-clerk.md) - Documentation for the `@mastra/auth-clerk` package, which authenticates Mastra applications using Clerk authentication.
|
|
25
|
-
- [Firebase](references/docs-server-auth-firebase.md) - Documentation for the `@mastra/auth-firebase` package, which authenticates Mastra applications using Firebase Authentication.
|
|
26
23
|
- [JSON Web Token](references/docs-server-auth-jwt.md) - Documentation for JSON Web Token usage inside Mastra.
|
|
27
|
-
- [Supabase](references/docs-server-auth-supabase.md) - Documentation for the `@mastra/auth-supabase` package, which authenticates Mastra applications using Supabase Auth.
|
|
28
|
-
- [WorkOS](references/docs-server-auth-workos.md) - Documentation for the `@mastra/auth-workos` package, which authenticates Mastra applications using WorkOS authentication.
|
|
29
24
|
- [Mastra client SDK](references/docs-server-mastra-client.md) - Learn how to set up and use the Mastra Client SDK
|
|
30
25
|
|
|
26
|
+
### Integrations
|
|
27
|
+
|
|
28
|
+
- [Auth0](references/integrations-auth-auth0.md) - Documentation for the @mastra/auth-auth0 package, which authenticates Mastra applications using Auth0 authentication.
|
|
29
|
+
- [Clerk](references/integrations-auth-clerk.md) - Documentation for the `@mastra/auth-clerk` package, which authenticates Mastra applications using Clerk authentication.
|
|
30
|
+
- [Firebase](references/integrations-auth-firebase.md) - Documentation for the `@mastra/auth-firebase` package, which authenticates Mastra applications using Firebase Authentication.
|
|
31
|
+
- [Supabase](references/integrations-auth-supabase.md) - Documentation for the `@mastra/auth-supabase` package, which authenticates Mastra applications using Supabase Auth.
|
|
32
|
+
- [WorkOS](references/integrations-auth-workos.md) - Documentation for the `@mastra/auth-workos` package, which authenticates Mastra applications using WorkOS authentication.
|
|
33
|
+
|
|
31
34
|
### Reference
|
|
32
35
|
|
|
33
36
|
- [Reference: toAISdkMessages()](references/reference-ai-sdk-to-ai-sdk-messages.md) - API reference for toAISdkMessages(), a function to convert Mastra messages to AI SDK UI messages for AI SDK v5 or v6.
|
|
@@ -47,6 +50,7 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
47
50
|
- [Reference: Vectors API](references/reference-client-js-vectors.md) - Learn how to work with vector embeddings for semantic search and similarity matching in Mastra using the client-js SDK.
|
|
48
51
|
- [Reference: Workflows API](references/reference-client-js-workflows.md) - Learn how to interact with and execute automated workflows in Mastra using the client-js SDK.
|
|
49
52
|
- [Reference: Versioning](references/reference-editor-versioning.md) - Reference for Editor version lifecycle, selection, sub-agent propagation, source behavior, REST endpoints, and SDK methods.
|
|
53
|
+
- [Client SDK](references/reference-migrations-upgrade-to-v1-client.md) - Learn how to migrate client SDK changes when upgrading to v1.
|
|
50
54
|
|
|
51
55
|
|
|
52
56
|
Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.50.0`
|
|
6
6
|
|
|
7
|
-
> **Beta:**
|
|
7
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
8
|
|
|
9
9
|
A schedule runs an agent on a cron cadence. On each fire, Mastra sends a prompt to the agent, either as a [signal](https://mastra.ai/docs/long-running-agents/signals) into a thread or as a threadless [`agent.generate()`](https://mastra.ai/reference/agents/generate) run. Use schedules for recurring agent work such as daily summaries, periodic checks, or scheduled nudges into a conversation.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.39.0`
|
|
6
6
|
|
|
7
|
-
> **Beta:**
|
|
7
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
8
|
|
|
9
9
|
Signals are a way to interact with an agent through a thread. Instead of starting every interaction with `agent.stream()`, subscribe to a thread and send messages or signals. Mastra either wakes the agent when the thread is idle or drops input into the running agent loop, or alternatively queues input for the next turn.
|
|
10
10
|
|
|
@@ -147,7 +147,7 @@ Use XML-safe `tagName` and attribute names. They can contain letters, numbers, s
|
|
|
147
147
|
|
|
148
148
|
#### Storage support
|
|
149
149
|
|
|
150
|
-
Notification inbox storage is available in the storage adapters that support richer memory and signal workflows: [libSQL](https://mastra.ai/
|
|
150
|
+
Notification inbox storage is available in the storage adapters that support richer memory and signal workflows: [libSQL](https://mastra.ai/integrations/databases/libsql), [PostgreSQL](https://mastra.ai/integrations/databases/postgresql), and [MongoDB](https://mastra.ai/integrations/databases/mongodb). These adapters expose notification records through `getStore('notifications')`.
|
|
151
151
|
|
|
152
152
|
### Send processor context
|
|
153
153
|
|
|
@@ -149,7 +149,7 @@ const testAgent = async () => {
|
|
|
149
149
|
}
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
> **
|
|
152
|
+
> **Note:** You can also call `.generate()` with an array of message objects that include `role` and `content`. Visit the [.generate() reference](https://mastra.ai/reference/client-js/agents) for more information.
|
|
153
153
|
|
|
154
154
|
## Streaming responses
|
|
155
155
|
|
|
@@ -175,7 +175,7 @@ const testAgent = async () => {
|
|
|
175
175
|
}
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
> **
|
|
178
|
+
> **Note:** You can also call `.stream()` with an array of message objects that include `role` and `content`. Visit the [.stream() reference](https://mastra.ai/reference/client-js/agents) for more information.
|
|
179
179
|
|
|
180
180
|
## Configuration options
|
|
181
181
|
|
|
@@ -200,7 +200,7 @@ export const createMastraClient = (accessToken: string) => {
|
|
|
200
200
|
}
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
> **
|
|
203
|
+
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
204
204
|
>
|
|
205
205
|
> Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
206
206
|
|
|
@@ -61,7 +61,7 @@ export const mastra = new Mastra({
|
|
|
61
61
|
})
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
> **
|
|
64
|
+
> **Note:** The default `authorizeUser` method allows all authenticated users. To customize user authorization, provide a custom `authorizeUser` function when constructing the provider.
|
|
65
65
|
>
|
|
66
66
|
> Visit [MastraAuthClerk](https://mastra.ai/reference/auth/clerk) for all available configuration options.
|
|
67
67
|
|
|
@@ -105,7 +105,7 @@ export const mastraClient = new MastraClient({
|
|
|
105
105
|
})
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
> **
|
|
108
|
+
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
109
109
|
>
|
|
110
110
|
> Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
111
111
|
|
|
@@ -200,7 +200,7 @@ export const createMastraClient = (idToken: string) => {
|
|
|
200
200
|
}
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
> **
|
|
203
|
+
> **Note:** The ID token must be prefixed with `Bearer` in the Authorization header.
|
|
204
204
|
>
|
|
205
205
|
> Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
206
206
|
|
|
@@ -59,7 +59,7 @@ export const mastra = new Mastra({
|
|
|
59
59
|
})
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
> **
|
|
62
|
+
> **Note:** The default `authorizeUser` method checks the `isAdmin` column in the `users` table in the `public` schema. To customize user authorization, provide a custom `authorizeUser` function when constructing the provider.
|
|
63
63
|
>
|
|
64
64
|
> Visit [MastraAuthSupabase](https://mastra.ai/reference/auth/supabase) for all available configuration options.
|
|
65
65
|
|
|
@@ -101,7 +101,7 @@ export const mastraClient = new MastraClient({
|
|
|
101
101
|
})
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
> **
|
|
104
|
+
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
105
105
|
>
|
|
106
106
|
> Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
107
107
|
|
|
@@ -221,7 +221,7 @@ export const createMastraClient = (accessToken: string) => {
|
|
|
221
221
|
}
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
> **
|
|
224
|
+
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
225
225
|
>
|
|
226
226
|
> Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
227
227
|
|
|
@@ -421,12 +421,13 @@ Returns `{ accepted: true, runId: string, toolCallId?: string }`.
|
|
|
421
421
|
|
|
422
422
|
### `declineToolCall()`
|
|
423
423
|
|
|
424
|
-
Decline a pending tool call and return a continuation stream. Use this when you are rendering the resumed chunks from the decline response.
|
|
424
|
+
Decline a pending tool call and return a continuation stream. Use this when you are rendering the resumed chunks from the decline response. Pass an optional `reason` to tell the model why the call was rejected. The default is `Tool call was not approved by the user`.
|
|
425
425
|
|
|
426
426
|
```typescript
|
|
427
427
|
const response = await agent.declineToolCall({
|
|
428
428
|
runId: 'run-123',
|
|
429
429
|
toolCallId: 'tool-call-456',
|
|
430
|
+
reason: 'This file is outside the allowed directory', // optional
|
|
430
431
|
})
|
|
431
432
|
|
|
432
433
|
response.processDataStream({
|
|
@@ -14,7 +14,7 @@ const workflows = await mastraClient.listWorkflows()
|
|
|
14
14
|
|
|
15
15
|
## Getting workflow run counts
|
|
16
16
|
|
|
17
|
-
Retrieve per-workflow counts of `running` and [`suspended`](https://mastra.ai/docs/workflows/suspend-and-resume) runs in a single request. The counts are computed on the server and keyed by the workflow's registry key
|
|
17
|
+
Retrieve per-workflow counts of `running` and [`suspended`](https://mastra.ai/docs/workflows/suspend-and-resume) runs in a single request. The counts are computed on the server and keyed by the workflow's registry key, the key used when registering the workflow in the Mastra config, which can differ from the workflow's own `id`:
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
20
|
const runCounts = await mastraClient.listWorkflowRunCounts()
|
|
@@ -23,7 +23,7 @@ const runCounts = await mastraClient.listWorkflowRunCounts()
|
|
|
23
23
|
|
|
24
24
|
Returns: `Record<string, { running: number; suspended: number }>`
|
|
25
25
|
|
|
26
|
-
The server may cache the counts for a few seconds between requests. Servers that predate this endpoint respond with `404 Not Found
|
|
26
|
+
The server may cache the counts for a few seconds between requests. Servers that predate this endpoint respond with `404 Not Found`. Handle the error when the client can talk to older deployments.
|
|
27
27
|
|
|
28
28
|
## Working with a specific workflow
|
|
29
29
|
|
|
@@ -227,7 +227,7 @@ A workflow run result yields the following:
|
|
|
227
227
|
|
|
228
228
|
## Dynamic workflows
|
|
229
229
|
|
|
230
|
-
> **Beta:**
|
|
230
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
231
231
|
|
|
232
232
|
Dynamic workflows are workflow definitions expressed as JSON. The server persists each definition and registers it as a runnable workflow. See [Dynamic workflows](https://mastra.ai/docs/workflows/dynamic-workflows) for the definition format.
|
|
233
233
|
|