@mastra/client-js 1.33.0-alpha.9 → 1.33.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 CHANGED
@@ -1,5 +1,142 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 1.33.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added Agent Learning response types for entity discovery, snapshots, flows, theme details, examples, history, and noise. ([#19871](https://github.com/mastra-ai/mastra/pull/19871))
8
+
9
+ ```ts
10
+ import type { ThemeDetailResponse, ThemeFlowResponse } from '@mastra/client-js';
11
+ ```
12
+
13
+ - Added a `requestContext` option to agent controller session methods in @mastra/client-js. You can now pass custom request context to `sendMessage`, `steer`, `followUp`, `approveTool`, and `respondToToolSuspension`, matching what `agent.generate()` already supports. The context is merged into the run's request context on the server, so it reaches dynamic instructions and tools. ([#19531](https://github.com/mastra-ai/mastra/pull/19531))
14
+
15
+ ```ts
16
+ const session = client.getAgentController('code').session('user-1');
17
+ await session.sendMessage('hello', { requestContext: { userId: 'user-1', tier: 'pro' } });
18
+ ```
19
+
20
+ - Added exact thread binding when creating AgentController sessions through the JavaScript client. ([#19902](https://github.com/mastra-ai/mastra/pull/19902))
21
+
22
+ - Added request-scoped model overrides to agent execution and approvals, and fixed Studio model selection so each tab can use a different model without changing the agent's configured default. ([#19749](https://github.com/mastra-ai/mastra/pull/19749))
23
+
24
+ ```ts
25
+ await agent.stream(messages, { model: 'google/gemini-2.5-flash' });
26
+ ```
27
+
28
+ - Added reconnect support to `AgentControllerSession.subscribe()` so SSE subscriptions recover after proxy timeouts or transport errors. Fixes #19202. ([#19560](https://github.com/mastra-ai/mastra/pull/19560))
29
+
30
+ ```ts
31
+ await session.subscribe({
32
+ onEvent: event => {
33
+ /* handle event */
34
+ },
35
+ reconnect: true,
36
+ });
37
+ ```
38
+
39
+ ### Patch Changes
40
+
41
+ - Fixed AgentController live events and thread history returning serialized message timestamps instead of Date values. ([#18783](https://github.com/mastra-ai/mastra/pull/18783))
42
+
43
+ - Fixed AgentControllerSession.subscribe() so it resolves only after the stream is established and rejects when it cannot connect (leaving no background retry loop). Reconnect now applies only after an established stream drops, backs off exponentially, and fires a new onReconnect callback on each re-established stream so consumers can re-sync missed events: ([#19580](https://github.com/mastra-ai/mastra/pull/19580))
44
+
45
+ ```ts
46
+ const subscription = await session.subscribe({
47
+ onEvent: event => applyEvent(event),
48
+ onError: error => showDisconnected(error),
49
+ reconnect: { maxRetries: 5, delayMs: 1000, maxDelayMs: 30_000 },
50
+ onReconnect: async () => {
51
+ // Events emitted while disconnected are not replayed — re-sync state.
52
+ applyState(await session.state());
53
+ },
54
+ });
55
+ ```
56
+
57
+ - Updated generated route types so `memory.resource` is optional in agent generate and stream request bodies. The server can derive the resource ID from the authenticated user via `mapUserToResourceId`, so clients no longer need to provide it. Fixes [#19518](https://github.com/mastra-ai/mastra/issues/19518). ([#19524](https://github.com/mastra-ai/mastra/pull/19524))
58
+
59
+ - Replace `any` with `unknown` in generated route types so clients get real type errors instead of silently unchecked values. Route-types generation now deduplicates shared schemas into reusable type aliases, shrinking the generated `route-types.generated.ts` from ~94K to ~22K lines (77% smaller). The memory config response now types `workingMemory` (enabled, scope, template, schema, version) instead of `unknown`. ([#19573](https://github.com/mastra-ai/mastra/pull/19573))
60
+
61
+ If your code read fields from responses that were previously typed `any`, TypeScript now requires you to narrow them before use:
62
+
63
+ ```ts
64
+ // Before: `metadata` was `any`, so this compiled even when unsafe
65
+ const value = response.metadata.someField;
66
+
67
+ // After: `metadata` is `unknown` — narrow it first
68
+ const metadata = response.metadata;
69
+ if (metadata && typeof metadata === 'object' && 'someField' in metadata) {
70
+ const value = metadata.someField;
71
+ }
72
+ // ...or cast if you know the shape: (metadata as MyMetadata).someField
73
+ ```
74
+
75
+ Code that reads `workingMemory` from the memory config response no longer needs casts — `config.workingMemory?.enabled`, `scope`, `template`, `schema`, and `version` are now typed directly.
76
+
77
+ - Added stable metrics and logs capability reporting for observability storage. The system packages response now includes `observabilityStorageCapabilities` with `metrics` and `logs` flags, enabling capability-based detection that is resilient to bundler-generated constructor name changes. ([#19305](https://github.com/mastra-ai/mastra/pull/19305))
78
+
79
+ ```typescript
80
+ const packages = await client.getSystemPackages();
81
+ console.log(packages.observabilityStorageCapabilities?.metrics); // true
82
+ console.log(packages.observabilityStorageCapabilities?.logs); // true
83
+ ```
84
+
85
+ Studio now uses the capability response instead of relying on constructor names, with a fallback for older servers.
86
+
87
+ - Updated dependencies [[`ec857fc`](https://github.com/mastra-ai/mastra/commit/ec857fc79c264b53b38e16478c789b7177f2ad59), [`d7385ad`](https://github.com/mastra-ai/mastra/commit/d7385ad9e88f9e4f33d15c0ec0bfebedde0cbc2e), [`41a5392`](https://github.com/mastra-ai/mastra/commit/41a5392d9f6c5e18d6b227f0fc0ddf49c50774e9), [`3d6e539`](https://github.com/mastra-ai/mastra/commit/3d6e539272eb2ea0407034605ee1906b3be06b39), [`1426af2`](https://github.com/mastra-ai/mastra/commit/1426af24975879c000d13ac75673f630fcc970c1), [`a40adeb`](https://github.com/mastra-ai/mastra/commit/a40adeb222b961a56a58af56a106106525721b74), [`8a0d145`](https://github.com/mastra-ai/mastra/commit/8a0d145aadbdf7278665aceaaec364b35dd9bd94), [`bd2f1d2`](https://github.com/mastra-ai/mastra/commit/bd2f1d274d05e60e2366f005ea0d94d5cea0d5ff), [`e1f2fae`](https://github.com/mastra-ai/mastra/commit/e1f2faebaf048c3d4c2e2c01d293767c195d5794), [`63aa799`](https://github.com/mastra-ai/mastra/commit/63aa799c6b44eacc7806cda6846b7c5bbee06b37), [`b7e79c3`](https://github.com/mastra-ai/mastra/commit/b7e79c3c02ac5cd415db34ba0975ceafc1464333), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`da009e1`](https://github.com/mastra-ai/mastra/commit/da009e1aacd89ed94b8d1b2af09c9d4fe7c4db49), [`3b77e77`](https://github.com/mastra-ai/mastra/commit/3b77e7704936522e4769d29de1b5ea6901f302bd), [`c7d30cd`](https://github.com/mastra-ai/mastra/commit/c7d30cd86009c407df91105591f03cd6e3d2854d), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2), [`8b20926`](https://github.com/mastra-ai/mastra/commit/8b20926cd59e2ba3d66458e062fa0e6e2ada3e68), [`975295d`](https://github.com/mastra-ai/mastra/commit/975295d418552f0d46a59edfef4c3ee555f9930a), [`73db8db`](https://github.com/mastra-ai/mastra/commit/73db8db90d69ab6153c7942749f624db0d96952d), [`6b1bf3b`](https://github.com/mastra-ai/mastra/commit/6b1bf3b9494bd51aa8f654c68c9355d6046fa2a1), [`35c2181`](https://github.com/mastra-ai/mastra/commit/35c2181e6a50e47c90ba36260db7c9723d54696f), [`0a2c22c`](https://github.com/mastra-ai/mastra/commit/0a2c22c902604439ec490319e14c17f331e0c84c), [`4cfdd64`](https://github.com/mastra-ai/mastra/commit/4cfdd645794feaea0c4ea711e70ecdfbef0c5b8e), [`b75d749`](https://github.com/mastra-ai/mastra/commit/b75d749621ff5d17e86bcb4ee809d301fb4f7cf3), [`821648b`](https://github.com/mastra-ai/mastra/commit/821648bf2871ef840100c7bacbecf676010bd12a), [`de86fd7`](https://github.com/mastra-ai/mastra/commit/de86fd7119f0438381d1a642e3d258143c0b9c29), [`2745031`](https://github.com/mastra-ai/mastra/commit/2745031d1d4a4978f037092da371428c32e2842a), [`b4b7ea8`](https://github.com/mastra-ai/mastra/commit/b4b7ea8733f033fc441ea47ed03f6afb17ec2248), [`3a8024c`](https://github.com/mastra-ai/mastra/commit/3a8024ce615f8aa89479c0d71fe61d10bb0040be), [`35865a5`](https://github.com/mastra-ai/mastra/commit/35865a53e194aa9634d6a70a97010e7a6b9d58b1), [`74faf8b`](https://github.com/mastra-ai/mastra/commit/74faf8bd9c1018f2492653c06b1e25fc8300e9e6), [`ef03fbc`](https://github.com/mastra-ai/mastra/commit/ef03fbcc556bcbc04c9b3d06fab88771ecaa043c), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`70687f7`](https://github.com/mastra-ai/mastra/commit/70687f7e495a322a02070b4a67cb0c77a5ca91ec), [`1fadac4`](https://github.com/mastra-ai/mastra/commit/1fadac44537caeefe81f9f775ae2f2f3d94e9069), [`73db8db`](https://github.com/mastra-ai/mastra/commit/73db8db90d69ab6153c7942749f624db0d96952d), [`76b7181`](https://github.com/mastra-ai/mastra/commit/76b71810366e6d90b9d3973149d1c7ba3659ffb9), [`792ec9a`](https://github.com/mastra-ai/mastra/commit/792ec9a0869bab8274cf5e0ed2840738737a1607), [`712b864`](https://github.com/mastra-ai/mastra/commit/712b864aa1ed12b14c54390ec17b69de163c37f7), [`85e4fb5`](https://github.com/mastra-ai/mastra/commit/85e4fb50087a81c74df3a762f53b56373db0b912), [`0c0e8d7`](https://github.com/mastra-ai/mastra/commit/0c0e8d7becd4d1445c656b78d5d845f606c1ff9d), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`72e437c`](https://github.com/mastra-ai/mastra/commit/72e437c515942c80b9def5b026e0bdee61b469d9), [`8f7a5de`](https://github.com/mastra-ai/mastra/commit/8f7a5dedc246cdc938bb65516703cf9b27b03756), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`11f6cd9`](https://github.com/mastra-ai/mastra/commit/11f6cd96fe42582403416608beb212cc1a2cc79e), [`ef03c0c`](https://github.com/mastra-ai/mastra/commit/ef03c0cfc62367a458e4cc56462e2148b35681c5), [`4fb4d88`](https://github.com/mastra-ai/mastra/commit/4fb4d881bc107acee13890ad4d78661016c510ed), [`4e68363`](https://github.com/mastra-ai/mastra/commit/4e683634f94ebd062d26a3bb6093a8dfc7263d37), [`c328769`](https://github.com/mastra-ai/mastra/commit/c3287698ff8ef98dba86d415faa566fa3e5f4d56), [`9f7c67a`](https://github.com/mastra-ai/mastra/commit/9f7c67abeeb52c41c51a9b5edee60b62afe7cd8d), [`3b65e68`](https://github.com/mastra-ai/mastra/commit/3b65e68d7f1c771c7a70eea42d83fefdd28cad88), [`4eba27a`](https://github.com/mastra-ai/mastra/commit/4eba27adcf60f991df0e62f94b3e75b4e67f3b4b), [`c701be3`](https://github.com/mastra-ai/mastra/commit/c701be32d7d9aa94a66da8c6cc38dcac6856f464), [`db650ce`](https://github.com/mastra-ai/mastra/commit/db650ce490348914e85b93651d83acdf8f2a4c31), [`232fcbc`](https://github.com/mastra-ai/mastra/commit/232fcbc14fce625dd672ba043329c0b732c62be2), [`6354eeb`](https://github.com/mastra-ai/mastra/commit/6354eeb32efa9f5f68f51dda394e90e2ee76f1fb), [`a8799bb`](https://github.com/mastra-ai/mastra/commit/a8799bb8e44f4a60d01e4e2acd3448ff80bf14f8), [`3d6e539`](https://github.com/mastra-ai/mastra/commit/3d6e539272eb2ea0407034605ee1906b3be06b39), [`e3868e2`](https://github.com/mastra-ai/mastra/commit/e3868e22babfffd0133771669ca724501c2dd58e), [`9251370`](https://github.com/mastra-ai/mastra/commit/9251370ad413af464aa22d7566338bec5613e8de), [`3491666`](https://github.com/mastra-ai/mastra/commit/34916663c4fdd43b48c21f4ab2d5fb6dcccc94f9), [`c0bec73`](https://github.com/mastra-ai/mastra/commit/c0bec732c93d1a22ae5e51ed66cf8cacca8bd6a6)]:
88
+ - @mastra/core@1.52.0
89
+
90
+ ## 1.33.0-alpha.14
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies:
95
+ - @mastra/core@1.52.0-alpha.13
96
+
97
+ ## 1.33.0-alpha.13
98
+
99
+ ### Minor Changes
100
+
101
+ - Added Agent Learning response types for entity discovery, snapshots, flows, theme details, examples, history, and noise. ([#19871](https://github.com/mastra-ai/mastra/pull/19871))
102
+
103
+ ```ts
104
+ import type { ThemeDetailResponse, ThemeFlowResponse } from '@mastra/client-js';
105
+ ```
106
+
107
+ ## 1.33.0-alpha.12
108
+
109
+ ### Patch Changes
110
+
111
+ - Updated dependencies [[`d7385ad`](https://github.com/mastra-ai/mastra/commit/d7385ad9e88f9e4f33d15c0ec0bfebedde0cbc2e), [`3d6e539`](https://github.com/mastra-ai/mastra/commit/3d6e539272eb2ea0407034605ee1906b3be06b39), [`35865a5`](https://github.com/mastra-ai/mastra/commit/35865a53e194aa9634d6a70a97010e7a6b9d58b1), [`70687f7`](https://github.com/mastra-ai/mastra/commit/70687f7e495a322a02070b4a67cb0c77a5ca91ec), [`3d6e539`](https://github.com/mastra-ai/mastra/commit/3d6e539272eb2ea0407034605ee1906b3be06b39)]:
112
+ - @mastra/core@1.52.0-alpha.12
113
+
114
+ ## 1.33.0-alpha.11
115
+
116
+ ### Minor Changes
117
+
118
+ - Added exact thread binding when creating AgentController sessions through the JavaScript client. ([#19902](https://github.com/mastra-ai/mastra/pull/19902))
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [[`c7d30cd`](https://github.com/mastra-ai/mastra/commit/c7d30cd86009c407df91105591f03cd6e3d2854d), [`ef03fbc`](https://github.com/mastra-ai/mastra/commit/ef03fbcc556bcbc04c9b3d06fab88771ecaa043c), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`4e68363`](https://github.com/mastra-ai/mastra/commit/4e683634f94ebd062d26a3bb6093a8dfc7263d37), [`9251370`](https://github.com/mastra-ai/mastra/commit/9251370ad413af464aa22d7566338bec5613e8de)]:
123
+ - @mastra/core@1.52.0-alpha.11
124
+
125
+ ## 1.33.0-alpha.10
126
+
127
+ ### Minor Changes
128
+
129
+ - Added request-scoped model overrides to agent execution and approvals, and fixed Studio model selection so each tab can use a different model without changing the agent's configured default. ([#19749](https://github.com/mastra-ai/mastra/pull/19749))
130
+
131
+ ```ts
132
+ await agent.stream(messages, { model: 'google/gemini-2.5-flash' });
133
+ ```
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [[`41a5392`](https://github.com/mastra-ai/mastra/commit/41a5392d9f6c5e18d6b227f0fc0ddf49c50774e9), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`da009e1`](https://github.com/mastra-ai/mastra/commit/da009e1aacd89ed94b8d1b2af09c9d4fe7c4db49), [`35c2181`](https://github.com/mastra-ai/mastra/commit/35c2181e6a50e47c90ba36260db7c9723d54696f), [`b4b7ea8`](https://github.com/mastra-ai/mastra/commit/b4b7ea8733f033fc441ea47ed03f6afb17ec2248), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`c328769`](https://github.com/mastra-ai/mastra/commit/c3287698ff8ef98dba86d415faa566fa3e5f4d56), [`232fcbc`](https://github.com/mastra-ai/mastra/commit/232fcbc14fce625dd672ba043329c0b732c62be2), [`3491666`](https://github.com/mastra-ai/mastra/commit/34916663c4fdd43b48c21f4ab2d5fb6dcccc94f9)]:
138
+ - @mastra/core@1.52.0-alpha.10
139
+
3
140
  ## 1.33.0-alpha.9
4
141
 
5
142
  ### Patch Changes
@@ -0,0 +1,151 @@
1
+ export type TraceSignalName = 'goal' | 'sentiment' | 'behavior' | 'outcome';
2
+ export interface ThemeLearningEntity {
3
+ entityId: string;
4
+ entityType: string;
5
+ availableSignals: TraceSignalName[];
6
+ latestWindow?: {
7
+ startedAt: string;
8
+ endedAt: string;
9
+ };
10
+ }
11
+ export interface ThemeSnapshot {
12
+ snapshotId: string;
13
+ ordinal: number;
14
+ total: number;
15
+ startedAt: string;
16
+ endedAt: string;
17
+ traceCount: number;
18
+ }
19
+ export type ThemeNode = {
20
+ nodeId: string;
21
+ kind: 'theme';
22
+ themeId: string;
23
+ label: string;
24
+ description?: string;
25
+ traceCount: number;
26
+ stageShare: number;
27
+ } | {
28
+ nodeId: string;
29
+ kind: 'noise' | 'other';
30
+ label: string;
31
+ description?: string;
32
+ traceCount: number;
33
+ stageShare: number;
34
+ };
35
+ export interface ThemeFlowResponse {
36
+ snapshot: ThemeSnapshot;
37
+ stages: Array<{
38
+ signalName: TraceSignalName;
39
+ traceCount: number;
40
+ nodes: ThemeNode[];
41
+ }>;
42
+ links: Array<{
43
+ sourceNodeId: string;
44
+ targetNodeId: string;
45
+ traceCount: number;
46
+ sourceShare: number;
47
+ targetShare: number;
48
+ }>;
49
+ }
50
+ export interface ThemeSnapshotsResponse {
51
+ snapshots: Array<ThemeSnapshot & {
52
+ availableSignals: TraceSignalName[];
53
+ }>;
54
+ nextCursor?: string;
55
+ }
56
+ export interface ThemeEntitiesResponse {
57
+ entities: ThemeLearningEntity[];
58
+ }
59
+ export interface ThemePathTheme {
60
+ signalName: TraceSignalName;
61
+ themeId: string;
62
+ label: string;
63
+ description?: string;
64
+ }
65
+ export interface ThemePathsResponse {
66
+ snapshot: ThemeSnapshot;
67
+ signals: TraceSignalName[];
68
+ themes: Record<string, ThemePathTheme>;
69
+ paths: Array<{
70
+ traceId: string;
71
+ assignments: Record<string, string>;
72
+ }>;
73
+ nextOffset?: number;
74
+ }
75
+ export type ActiveThemeState = 'birth' | 'continue' | 'split' | 'merge' | 'resurrection';
76
+ export type ThemeHistoryState = ActiveThemeState | 'death';
77
+ export interface ThemeTrend {
78
+ popularity: number;
79
+ signalScore: number;
80
+ strength: 'none' | 'weak' | 'strong';
81
+ }
82
+ export interface SnapshotTheme {
83
+ themeId: string;
84
+ label: string;
85
+ description?: string;
86
+ state: ActiveThemeState;
87
+ traceCount: number;
88
+ coverage: number;
89
+ trend?: ThemeTrend;
90
+ }
91
+ export interface ThemesResponse {
92
+ snapshot: ThemeSnapshot;
93
+ signalName: TraceSignalName;
94
+ themes: SnapshotTheme[];
95
+ noise: {
96
+ traceCount: number;
97
+ coverage: number;
98
+ };
99
+ }
100
+ export interface ThemeDetailResponse {
101
+ snapshot: ThemeSnapshot;
102
+ theme?: SnapshotTheme & {
103
+ signalName: TraceSignalName;
104
+ };
105
+ }
106
+ export interface ThemeExample {
107
+ traceId: string;
108
+ extractedTraceId: string;
109
+ signalText: string;
110
+ traceStartedAt?: string;
111
+ }
112
+ export interface ThemeExamplesResponse {
113
+ examples: ThemeExample[];
114
+ nextOffset?: number;
115
+ }
116
+ export type NoiseExamplesResponse = ThemeExamplesResponse;
117
+ export interface ThemeHistoryResponse {
118
+ theme: {
119
+ themeId: string;
120
+ signalName: TraceSignalName;
121
+ label: string;
122
+ description?: string;
123
+ };
124
+ points: Array<{
125
+ snapshotId: string;
126
+ startedAt: string;
127
+ endedAt: string;
128
+ state: ThemeHistoryState;
129
+ traceCount: number;
130
+ coverage: number;
131
+ trend?: ThemeTrend;
132
+ }>;
133
+ relationships: Array<{
134
+ snapshotId: string;
135
+ kind: 'split-from' | 'split-into' | 'merged-from' | 'merged-into';
136
+ relatedTheme: {
137
+ themeId: string;
138
+ label: string;
139
+ };
140
+ }>;
141
+ nextCursor?: string;
142
+ }
143
+ export interface NoiseResponse {
144
+ snapshot: ThemeSnapshot;
145
+ noise: {
146
+ signalName: TraceSignalName;
147
+ traceCount: number;
148
+ coverage: number;
149
+ };
150
+ }
151
+ //# sourceMappingURL=agent-learning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-learning.d.ts","sourceRoot":"","sources":["../src/agent-learning.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,YAAY,CAAC,EAAE;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE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AC5B,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE;QACL,UAAU,EAAE,eAAe,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH"}
@@ -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.33.0-alpha.9"
6
+ version: "1.33.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.33.0-alpha.9",
2
+ "version": "1.33.0",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {
5
5
  "RequestContext": {
package/dist/index.cjs CHANGED
@@ -6179,14 +6179,18 @@ var AgentControllerSession = class extends BaseResource {
6179
6179
  /**
6180
6180
  * Create or resume this session. Pass `tags` to scope initial thread
6181
6181
  * selection — a thread is a resume candidate only when its metadata matches
6182
- * every tag. Required when sessions share a resourceId (e.g. git worktrees
6183
- * using a `{ projectPath }` tag) so each resumes its own thread instead of the
6184
- * most recent thread across the whole resource.
6182
+ * every tag. Pass `threadId` to bind the session to one exact thread,
6183
+ * creating it with that id when it does not exist.
6185
6184
  */
6186
6185
  create(options) {
6187
6186
  return this.request(`/agent-controller/${encodeURIComponent(this.controllerId)}/sessions`, {
6188
6187
  method: "POST",
6189
- body: { resourceId: this.resourceId, tags: options?.tags, sessionScope: this.scope }
6188
+ body: {
6189
+ resourceId: this.resourceId,
6190
+ tags: options?.tags,
6191
+ threadId: options?.threadId,
6192
+ sessionScope: this.scope
6193
+ }
6190
6194
  });
6191
6195
  }
6192
6196
  /**