@mastra/client-js 1.53.0-alpha.3 → 1.53.0-alpha.5

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.
@@ -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.53.0-alpha.3"
6
+ version: "1.53.0-alpha.5"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.53.0-alpha.3",
2
+ "version": "1.53.0-alpha.5",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -201,6 +201,35 @@ await session.model.switch('anthropic/claude-sonnet-4-6')
201
201
  console.log(session.model.get())
202
202
  ```
203
203
 
204
+ ### Select Observational Memory models
205
+
206
+ Observer and reflector model choices are independent. Each role can use an explicit model or an automatic selection that the host resolves from the active main model and session state.
207
+
208
+ Configure automatic selection with a synchronous resolver that returns a concrete model ID:
209
+
210
+ ```typescript
211
+ const controller = new AgentController({
212
+ // ...
213
+ omConfig: {
214
+ observerModel: 'auto',
215
+ reflectorModel: 'auto',
216
+ defaultObserverModelId: 'openai/gpt-5-mini',
217
+ defaultReflectorModelId: 'openai/gpt-5-mini',
218
+ resolveAutoModelId: ({ currentModelId }) => currentModelId,
219
+ },
220
+ })
221
+ ```
222
+
223
+ `session.om.observer.model()` returns `'auto'` or a concrete model ID. `session.om.observer.modelId()` returns the effective concrete model. A host can therefore change the main model without rewriting automatic role settings.
224
+
225
+ Reset one role to automatic selection without changing the other:
226
+
227
+ ```typescript
228
+ await session.om.observer.switchModel({ modelId: 'auto' })
229
+ ```
230
+
231
+ If the resolver returns `undefined` or throws, the role uses its concrete `defaultObserverModelId` or `defaultReflectorModelId` fallback. See the [`Session` Observational Memory API](https://mastra.ai/reference/agent-controller/session) for explicit selection.
232
+
204
233
  ## Manage threads and state
205
234
 
206
235
  List stored conversations with [`session.thread.list()`](https://mastra.ai/reference/agent-controller/session):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/client-js",
3
- "version": "1.53.0-alpha.3",
3
+ "version": "1.53.0-alpha.5",
4
4
  "description": "The official TypeScript library for the Mastra Client API",
5
5
  "author": "",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "canonicalize": "^1.0.8",
39
39
  "jose": "^6.2.11",
40
40
  "json-schema": "^0.4.0",
41
- "@mastra/core": "1.76.0-alpha.3",
41
+ "@mastra/core": "1.76.0-alpha.5",
42
42
  "@mastra/schema-compat": "1.3.13"
43
43
  },
44
44
  "peerDependencies": {
@@ -55,10 +55,10 @@
55
55
  "typescript": "^7.0.2",
56
56
  "vitest": "4.1.11",
57
57
  "zod": "^4.6.4",
58
- "@internal/ai-sdk-v5": "0.0.88",
59
- "@internal/lint": "0.0.141",
58
+ "@internal/ai-sdk-v4": "0.0.88",
60
59
  "@internal/types-builder": "0.0.116",
61
- "@internal/ai-sdk-v4": "0.0.88"
60
+ "@internal/lint": "0.0.141",
61
+ "@internal/ai-sdk-v5": "0.0.88"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22.13.0"