@mastra/code-sdk 1.4.0-alpha.4 → 1.4.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # @mastra/code-sdk
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Fixed credential failures that told every interface to run `/login`, a command only the terminal UI has. A provider fetch without a usable credential now throws `ProviderAuthRequiredError`, which states the fact and leaves the remedy to the host running the agent. ([#21860](https://github.com/mastra-ai/mastra/pull/21860))
8
+
9
+ ```ts
10
+ import { ProviderAuthRequiredError } from '@mastra/code-sdk/auth/provider-auth-error';
11
+
12
+ try {
13
+ await run();
14
+ } catch (error) {
15
+ // Before: the message hardcoded "Run /login first."
16
+ // Now: match the error and point the user at whatever sign-in path your host offers.
17
+ if (error instanceof ProviderAuthRequiredError) showSignIn();
18
+ }
19
+ ```
20
+
21
+ The error name is stable across serialization, so a client that only receives `{ name, message }` over the wire can match it too.
22
+
23
+ - Added opt-in process memory diagnostics for SDK process adapters. The service records process and V8 heap-space samples, naturally occurring garbage collection events, and periodic allocation profiles without forcing garbage collection or writing heap snapshots. ([#21821](https://github.com/mastra-ai/mastra/pull/21821))
24
+
25
+ Start diagnostics before creating Mastra Code, then await the final capture after work-producing services stop:
26
+
27
+ ```ts
28
+ import {
29
+ createProcessMemoryDiagnosticsFromEnvironment,
30
+ startConfiguredProcessMemoryDiagnostics,
31
+ } from '@mastra/code-sdk/process-memory-diagnostics';
32
+
33
+ const setup = createProcessMemoryDiagnosticsFromEnvironment(process.env);
34
+ const diagnostics = await startConfiguredProcessMemoryDiagnostics(setup, console.warn);
35
+
36
+ try {
37
+ // Create and run the process adapter.
38
+ } finally {
39
+ await diagnostics.stop();
40
+ }
41
+ ```
42
+
43
+ Allocation profiles remain local and may contain prompts, credentials, file contents, and tool arguments. Keep them private and delete them after analysis.
44
+
45
+ ### Patch Changes
46
+
47
+ - Factory runs now resolve provider credentials with org > user precedence, so an org-wide "Everyone in org" key takes priority over a run's acting user's personal key. This means factory automation always bills against the org's shared credentials when they exist, regardless of who triggered the run. Interactive (non-factory) sessions keep the existing user > org precedence, so personal plan subscriptions and keys still take priority there. ([#21899](https://github.com/mastra-ai/mastra/pull/21899))
48
+
49
+ - Interactive messages and model switches on factory sessions now resolve provider credentials org-first (org > user), matching board-run kickoff. The credential resolver keys off the session's `factoryProjectId` in controller state, so any run on a factory-owned session rides the org's shared keys with the caller's personal credentials as fallback — switching to a personal-only model still works through that fallback. Repo-backed Slack channel sessions now stamp the owning factory project onto session state so they get the same behavior. ([#21899](https://github.com/mastra-ai/mastra/pull/21899))
50
+
51
+ - Fixed shared threads running with a stale model in multi-server deployments. The model selected for a mode is now re-read from the thread's persisted settings at the start of every run, so a model switch made in one browser session or server replica is picked up by all others instead of silently diverging until the next mode switch. ([#21899](https://github.com/mastra-ai/mastra/pull/21899))
52
+
53
+ - Updated dependencies [[`88d14ca`](https://github.com/mastra-ai/mastra/commit/88d14cac008582a618fecc3d5c7fd3bdf4f6ddc3), [`480e491`](https://github.com/mastra-ai/mastra/commit/480e491588bd6a7a1c9ee4407590ad625dd33952), [`9267e9b`](https://github.com/mastra-ai/mastra/commit/9267e9b3d9c2fcf16936050495a787054c2431ab), [`acc3471`](https://github.com/mastra-ai/mastra/commit/acc3471de5f3fde8027ee4e355af292b2bc1bc30), [`b6a771e`](https://github.com/mastra-ai/mastra/commit/b6a771ef23d203ddb348efca8065eff65def8191), [`84a5b69`](https://github.com/mastra-ai/mastra/commit/84a5b699f84d6bae0a34efe5a970d891090b9f41), [`9267e9b`](https://github.com/mastra-ai/mastra/commit/9267e9b3d9c2fcf16936050495a787054c2431ab), [`3bb88dd`](https://github.com/mastra-ai/mastra/commit/3bb88ddf07fb98f3cd16d3bff94e51cd3b45d011), [`d23e75d`](https://github.com/mastra-ai/mastra/commit/d23e75d57cc7cf5b9bfdbee896bf5a6a2484fed7), [`c8faa4e`](https://github.com/mastra-ai/mastra/commit/c8faa4e1cfebaec56b65e754e90b9fe46d153359), [`acc3471`](https://github.com/mastra-ai/mastra/commit/acc3471de5f3fde8027ee4e355af292b2bc1bc30), [`d378d75`](https://github.com/mastra-ai/mastra/commit/d378d7511f71309ed61a8f6b93cd0361dc6cb70f), [`84a5b69`](https://github.com/mastra-ai/mastra/commit/84a5b699f84d6bae0a34efe5a970d891090b9f41), [`64cd7ac`](https://github.com/mastra-ai/mastra/commit/64cd7ac22c2c7a6e6b533a4b3a9ede432700f1fb), [`26d4016`](https://github.com/mastra-ai/mastra/commit/26d40160ff7f7d8bf95fee2039a52cbc83863533), [`7c60df5`](https://github.com/mastra-ai/mastra/commit/7c60df5c7872343fbac5c3e5b1175c8076a5abfd), [`9267e9b`](https://github.com/mastra-ai/mastra/commit/9267e9b3d9c2fcf16936050495a787054c2431ab), [`84a5b69`](https://github.com/mastra-ai/mastra/commit/84a5b699f84d6bae0a34efe5a970d891090b9f41), [`f2031a4`](https://github.com/mastra-ai/mastra/commit/f2031a47445e8f67a89ba1309036816f97ab7a65), [`9267e9b`](https://github.com/mastra-ai/mastra/commit/9267e9b3d9c2fcf16936050495a787054c2431ab), [`cad4208`](https://github.com/mastra-ai/mastra/commit/cad42082e6aa1776168a94914f523334be45d929), [`8e529d4`](https://github.com/mastra-ai/mastra/commit/8e529d4ac754efef04b225841349e0da9edf89a6), [`57c5103`](https://github.com/mastra-ai/mastra/commit/57c51035a2a36e3df3c4f32f46bb789a66ed5946), [`acc3471`](https://github.com/mastra-ai/mastra/commit/acc3471de5f3fde8027ee4e355af292b2bc1bc30), [`038b7b4`](https://github.com/mastra-ai/mastra/commit/038b7b405cb4ac25ab3f3031334111b1f87ac112), [`4132d61`](https://github.com/mastra-ai/mastra/commit/4132d61f8367077120ee9e6420d3224dffd93c93), [`1d41dd0`](https://github.com/mastra-ai/mastra/commit/1d41dd06a001c6fee3aab1cdf1ec759f2070df3e), [`d378d75`](https://github.com/mastra-ai/mastra/commit/d378d7511f71309ed61a8f6b93cd0361dc6cb70f)]:
54
+ - @mastra/core@1.61.0
55
+ - @mastra/libsql@1.21.1
56
+ - @mastra/pg@1.21.1
57
+ - @mastra/mcp@1.17.1
58
+
59
+ ## 1.4.0-alpha.5
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [[`7c60df5`](https://github.com/mastra-ai/mastra/commit/7c60df5c7872343fbac5c3e5b1175c8076a5abfd)]:
64
+ - @mastra/core@1.61.0-alpha.5
65
+
3
66
  ## 1.4.0-alpha.4
4
67
 
5
68
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/code-sdk",
3
- "version": "1.4.0-alpha.4",
3
+ "version": "1.4.0",
4
4
  "description": "Mastra Code SDK: the agent core behind Mastra Code (everything except the TUI) — build your own UIs and surfaces on top of it",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -57,18 +57,18 @@
57
57
  "vscode-languageserver-protocol": "^3.17.5",
58
58
  "yaml": "^2.7.1",
59
59
  "zod": "^4.3.6",
60
- "@mastra/duckdb": "1.6.2",
61
60
  "@mastra/agent-browser": "0.5.1",
62
- "@mastra/core": "1.61.0-alpha.4",
63
- "@mastra/github-signals": "0.2.5",
64
- "@mastra/libsql": "1.21.1-alpha.1",
65
61
  "@mastra/fastembed": "1.2.0",
66
- "@mastra/memory": "1.27.0",
62
+ "@mastra/core": "1.61.0",
63
+ "@mastra/duckdb": "1.6.2",
64
+ "@mastra/github-signals": "0.2.5",
65
+ "@mastra/libsql": "1.21.1",
66
+ "@mastra/mcp": "1.17.1",
67
67
  "@mastra/observability": "1.17.1",
68
- "@mastra/mcp": "1.17.1-alpha.1",
68
+ "@mastra/memory": "1.27.0",
69
+ "@mastra/pg": "1.21.1",
69
70
  "@mastra/schema-compat": "1.3.7",
70
71
  "@mastra/stagehand": "0.3.3",
71
- "@mastra/pg": "1.21.1-alpha.1",
72
72
  "@mastra/tavily": "1.1.1"
73
73
  },
74
74
  "devDependencies": {
@@ -80,9 +80,9 @@
80
80
  "typescript": "^6.0.3",
81
81
  "typescript-eslint": "^8.57.0",
82
82
  "vitest": "4.1.10",
83
- "@internal/lint": "0.0.124",
84
- "@internal/types-builder": "0.0.99",
85
- "@internal/workspace-test-utils": "0.0.68"
83
+ "@internal/lint": "0.0.125",
84
+ "@internal/workspace-test-utils": "0.0.69",
85
+ "@internal/types-builder": "0.0.100"
86
86
  },
87
87
  "engines": {
88
88
  "node": ">=22.19.0"