@mastra/code-sdk 1.2.0-alpha.10 → 1.2.0-alpha.13

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.
@@ -0,0 +1,166 @@
1
+ //#region src/plugins/signal-lane.ts
2
+ /**
3
+ * Owns the lifecycle of signal providers contributed by plugins.
4
+ *
5
+ * Providers are long-lived; processors are per-request. The Agent constructor
6
+ * conflates the two — it harvests a provider's processors into a closure that
7
+ * can never be undone — so plugin providers are deliberately kept out of the
8
+ * `signals` array and driven from here instead, through the same public methods
9
+ * the constructor uses. That is what makes a provider removable when its plugin
10
+ * is disabled, updated or uninstalled.
11
+ */
12
+ var PluginSignalLane = class {
13
+ #live = /* @__PURE__ */ new Map();
14
+ #reservedProviderIds;
15
+ #onError;
16
+ #agent;
17
+ #mastra;
18
+ #inputProcessors = [];
19
+ #outputProcessors = [];
20
+ constructor(options = {}) {
21
+ this.#reservedProviderIds = new Set(options.reservedProviderIds ?? []);
22
+ this.#onError = options.onError ?? ((message, error) => {
23
+ console.warn(message, error);
24
+ });
25
+ }
26
+ getInputProcessors() {
27
+ return this.#inputProcessors;
28
+ }
29
+ getOutputProcessors() {
30
+ return this.#outputProcessors;
31
+ }
32
+ /**
33
+ * Reconciles the live providers against a freshly loaded plugin list.
34
+ *
35
+ * A plugin whose stamp is unchanged keeps the provider instance it already
36
+ * has, and the freshly resolved one is dropped without ever being registered,
37
+ * connected or polled — reload re-runs every plugin's resolver, so unchanged
38
+ * plugins hand over new instances on every call.
39
+ *
40
+ * Providers of plugins that went inactive, failed to load or were uninstalled
41
+ * are absent from the contributions and get stopped here.
42
+ */
43
+ sync(contributions) {
44
+ const seen = /* @__PURE__ */ new Set();
45
+ for (const { pluginId, versionStamp, value: provider } of contributions) {
46
+ const key = `${pluginId}::${provider.id}`;
47
+ seen.add(key);
48
+ const live = this.#live.get(key);
49
+ if (live && live.versionStamp === versionStamp) continue;
50
+ if (live) this.#retire(key, live);
51
+ if (this.#isProviderIdTaken(provider.id)) {
52
+ this.#onError(`Plugin "${pluginId}" signal provider "${provider.id}" is already running; refusing to start a second instance.`, void 0);
53
+ seen.delete(key);
54
+ continue;
55
+ }
56
+ this.#live.set(key, {
57
+ pluginId,
58
+ provider,
59
+ versionStamp,
60
+ started: false
61
+ });
62
+ }
63
+ for (const [key, live] of this.#live) if (!seen.has(key)) this.#retire(key, live);
64
+ this.#startPending();
65
+ this.#rebuildProcessors();
66
+ }
67
+ /**
68
+ * Called once Mastra exists. Providers resolved before then are registered and
69
+ * started here — without a Mastra instance a provider has no storage, and
70
+ * nothing else will ever hand it one: the Agent propagates Mastra only to the
71
+ * providers in its own `signals` array, which these deliberately are not in.
72
+ */
73
+ setMastra(mastra, agent) {
74
+ this.#mastra = mastra;
75
+ this.#agent = agent;
76
+ this.#startPending();
77
+ this.#rebuildProcessors();
78
+ }
79
+ /**
80
+ * Retires every live provider and empties both processor lanes. The inverse of
81
+ * `sync()`, for a caller that is done with this lane — an embedder sharing one
82
+ * `PluginManager` across controllers would otherwise leave a controller's
83
+ * providers polling after it is gone.
84
+ */
85
+ stopAll() {
86
+ for (const [key, live] of this.#live) this.#retire(key, live);
87
+ this.#rebuildProcessors();
88
+ }
89
+ #startPending() {
90
+ const mastra = this.#mastra;
91
+ const agent = this.#agent;
92
+ if (!mastra || !agent) return;
93
+ for (const [key, live] of this.#live) {
94
+ if (live.started) continue;
95
+ try {
96
+ live.provider.__registerMastra(mastra);
97
+ live.provider.connect(agent);
98
+ live.provider.startPolling();
99
+ live.started = true;
100
+ this.#runStart(key, live);
101
+ } catch (error) {
102
+ this.#failProvider(key, live, error);
103
+ }
104
+ }
105
+ }
106
+ async #runStart(key, live) {
107
+ try {
108
+ await live.provider.start?.();
109
+ if (this.#live.get(key) !== live) this.#stopProvider(live);
110
+ } catch (error) {
111
+ if (this.#live.get(key) !== live) {
112
+ this.#stopProvider(live);
113
+ return;
114
+ }
115
+ this.#failProvider(key, live, error);
116
+ this.#rebuildProcessors();
117
+ }
118
+ }
119
+ /**
120
+ * Isolated: one failing provider does not take down its plugin's tools,
121
+ * commands, skills or sibling providers. A plugin author who wants a provider
122
+ * treated as required throws from the `signalProviders` resolver instead,
123
+ * which fails the whole plugin record.
124
+ */
125
+ #failProvider(key, live, error) {
126
+ this.#onError(`Plugin "${live.pluginId}" signal provider "${live.provider.id}" failed to start:`, error);
127
+ this.#retire(key, live);
128
+ }
129
+ #retire(key, live) {
130
+ this.#stopProvider(live);
131
+ this.#live.delete(key);
132
+ }
133
+ #stopProvider(live) {
134
+ try {
135
+ live.provider.stop();
136
+ } catch (error) {
137
+ this.#onError(`Plugin "${live.pluginId}" signal provider "${live.provider.id}" failed to stop:`, error);
138
+ }
139
+ }
140
+ #isProviderIdTaken(providerId) {
141
+ if (this.#reservedProviderIds.has(providerId)) return true;
142
+ for (const live of this.#live.values()) if (live.provider.id === providerId) return true;
143
+ return false;
144
+ }
145
+ #rebuildProcessors() {
146
+ const input = [];
147
+ const output = [];
148
+ for (const live of this.#live.values()) {
149
+ if (!live.started) continue;
150
+ try {
151
+ const providerInput = live.provider.getInputProcessors?.() ?? [];
152
+ const providerOutput = live.provider.getOutputProcessors?.() ?? [];
153
+ input.push(...providerInput);
154
+ output.push(...providerOutput);
155
+ } catch (error) {
156
+ this.#onError(`Plugin "${live.pluginId}" signal provider "${live.provider.id}" failed to provide processors:`, error);
157
+ }
158
+ }
159
+ this.#inputProcessors = input;
160
+ this.#outputProcessors = output;
161
+ }
162
+ };
163
+ //#endregion
164
+ export { PluginSignalLane };
165
+
166
+ //# sourceMappingURL=signal-lane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal-lane.js","names":["#live","#reservedProviderIds","#onError","#inputProcessors","#outputProcessors","#retire","#isProviderIdTaken","#startPending","#rebuildProcessors","#mastra","#agent","#runStart","#failProvider","#stopProvider"],"sources":["../../src/plugins/signal-lane.ts"],"sourcesContent":["import type { Agent } from '@mastra/core/agent';\nimport type { Mastra } from '@mastra/core/mastra';\nimport type { InputProcessorOrWorkflow, OutputProcessorOrWorkflow } from '@mastra/core/processors';\nimport type { SignalProvider } from '@mastra/core/signals';\n\nimport type { PluginContribution } from './types.js';\n\ntype LiveProvider = {\n pluginId: string;\n provider: SignalProvider<string>;\n versionStamp: string;\n started: boolean;\n};\n\nexport type PluginSignalLaneOptions = {\n /**\n * Ids of providers Mastra Code wires itself (through the Agent constructor).\n * The lane refuses to start a provider that collides with one of them:\n * two live instances of the same provider silently clobber each other's\n * polling, and the built-ins are invisible to the lane's own registry.\n */\n reservedProviderIds?: string[];\n onError?: (message: string, error: unknown) => void;\n};\n\n/**\n * Owns the lifecycle of signal providers contributed by plugins.\n *\n * Providers are long-lived; processors are per-request. The Agent constructor\n * conflates the two — it harvests a provider's processors into a closure that\n * can never be undone — so plugin providers are deliberately kept out of the\n * `signals` array and driven from here instead, through the same public methods\n * the constructor uses. That is what makes a provider removable when its plugin\n * is disabled, updated or uninstalled.\n */\nexport class PluginSignalLane {\n readonly #live = new Map<string, LiveProvider>();\n readonly #reservedProviderIds: Set<string>;\n readonly #onError: (message: string, error: unknown) => void;\n #agent: Agent | undefined;\n #mastra: Mastra | undefined;\n // Replaced wholesale, never mutated: a request that already resolved its\n // processors keeps the array it read, so a reload mid-request cannot change\n // the pipeline underneath it.\n #inputProcessors: InputProcessorOrWorkflow[] = [];\n #outputProcessors: OutputProcessorOrWorkflow[] = [];\n\n constructor(options: PluginSignalLaneOptions = {}) {\n this.#reservedProviderIds = new Set(options.reservedProviderIds ?? []);\n this.#onError =\n options.onError ??\n ((message, error) => {\n console.warn(message, error);\n });\n }\n\n getInputProcessors(): readonly InputProcessorOrWorkflow[] {\n return this.#inputProcessors;\n }\n\n getOutputProcessors(): readonly OutputProcessorOrWorkflow[] {\n return this.#outputProcessors;\n }\n\n /**\n * Reconciles the live providers against a freshly loaded plugin list.\n *\n * A plugin whose stamp is unchanged keeps the provider instance it already\n * has, and the freshly resolved one is dropped without ever being registered,\n * connected or polled — reload re-runs every plugin's resolver, so unchanged\n * plugins hand over new instances on every call.\n *\n * Providers of plugins that went inactive, failed to load or were uninstalled\n * are absent from the contributions and get stopped here.\n */\n sync(contributions: PluginContribution<SignalProvider<string>>[]): void {\n const seen = new Set<string>();\n\n for (const { pluginId, versionStamp, value: provider } of contributions) {\n const key = `${pluginId}::${provider.id}`;\n seen.add(key);\n\n const live = this.#live.get(key);\n if (live && live.versionStamp === versionStamp) continue;\n if (live) this.#retire(key, live);\n\n if (this.#isProviderIdTaken(provider.id)) {\n this.#onError(\n `Plugin \"${pluginId}\" signal provider \"${provider.id}\" is already running; refusing to start a second instance.`,\n undefined,\n );\n seen.delete(key);\n continue;\n }\n\n this.#live.set(key, { pluginId, provider, versionStamp, started: false });\n }\n\n for (const [key, live] of this.#live) {\n if (!seen.has(key)) this.#retire(key, live);\n }\n\n this.#startPending();\n this.#rebuildProcessors();\n }\n\n /**\n * Called once Mastra exists. Providers resolved before then are registered and\n * started here — without a Mastra instance a provider has no storage, and\n * nothing else will ever hand it one: the Agent propagates Mastra only to the\n * providers in its own `signals` array, which these deliberately are not in.\n */\n setMastra(mastra: Mastra, agent: Agent): void {\n this.#mastra = mastra;\n this.#agent = agent;\n this.#startPending();\n this.#rebuildProcessors();\n }\n\n /**\n * Retires every live provider and empties both processor lanes. The inverse of\n * `sync()`, for a caller that is done with this lane — an embedder sharing one\n * `PluginManager` across controllers would otherwise leave a controller's\n * providers polling after it is gone.\n */\n stopAll(): void {\n for (const [key, live] of this.#live) this.#retire(key, live);\n this.#rebuildProcessors();\n }\n\n #startPending(): void {\n const mastra = this.#mastra;\n const agent = this.#agent;\n if (!mastra || !agent) return;\n\n for (const [key, live] of this.#live) {\n if (live.started) continue;\n try {\n live.provider.__registerMastra(mastra);\n live.provider.connect(agent);\n live.provider.startPolling();\n live.started = true;\n // `start()` is the provider's own warm-up and may do network work, so it\n // is not awaited — this runs on the boot path and on every plugin\n // reload, and a slow provider must not hold either up. The Agent\n // constructor treats it the same way (agent.ts: `void provider.start?.()`).\n void this.#runStart(key, live);\n } catch (error) {\n this.#failProvider(key, live, error);\n }\n }\n }\n\n async #runStart(key: string, live: LiveProvider): Promise<void> {\n try {\n await live.provider.start?.();\n // Retired or replaced while warming up: whatever `start()` just armed was\n // armed after this provider was stopped, so it is stopped again. Without\n // this a provider replaced mid-warm-up keeps working against the thread\n // its successor is now watching.\n if (this.#live.get(key) !== live) this.#stopProvider(live);\n } catch (error) {\n if (this.#live.get(key) !== live) {\n this.#stopProvider(live);\n return;\n }\n this.#failProvider(key, live, error);\n this.#rebuildProcessors();\n }\n }\n\n /**\n * Isolated: one failing provider does not take down its plugin's tools,\n * commands, skills or sibling providers. A plugin author who wants a provider\n * treated as required throws from the `signalProviders` resolver instead,\n * which fails the whole plugin record.\n */\n #failProvider(key: string, live: LiveProvider, error: unknown): void {\n this.#onError(`Plugin \"${live.pluginId}\" signal provider \"${live.provider.id}\" failed to start:`, error);\n this.#retire(key, live);\n }\n\n #retire(key: string, live: LiveProvider): void {\n this.#stopProvider(live);\n this.#live.delete(key);\n }\n\n #stopProvider(live: LiveProvider): void {\n try {\n live.provider.stop();\n } catch (error) {\n this.#onError(`Plugin \"${live.pluginId}\" signal provider \"${live.provider.id}\" failed to stop:`, error);\n }\n }\n\n #isProviderIdTaken(providerId: string): boolean {\n if (this.#reservedProviderIds.has(providerId)) return true;\n for (const live of this.#live.values()) {\n if (live.provider.id === providerId) return true;\n }\n return false;\n }\n\n #rebuildProcessors(): void {\n const input: InputProcessorOrWorkflow[] = [];\n const output: OutputProcessorOrWorkflow[] = [];\n for (const live of this.#live.values()) {\n // Only started providers contribute: one that has not been handed Mastra\n // yet has no storage, so running its processors would fail on the first\n // request rather than wait for the lifecycle to complete.\n if (!live.started) continue;\n // Guarded like every other provider call: a throwing getter drops that\n // provider's processors from this rebuild instead of unwinding the whole\n // lane mid-sync. Both getters are read before either lane is touched so a\n // provider never contributes input processors without its output ones.\n try {\n const providerInput = live.provider.getInputProcessors?.() ?? [];\n const providerOutput = live.provider.getOutputProcessors?.() ?? [];\n input.push(...providerInput);\n output.push(...providerOutput);\n } catch (error) {\n this.#onError(\n `Plugin \"${live.pluginId}\" signal provider \"${live.provider.id}\" failed to provide processors:`,\n error,\n );\n }\n }\n this.#inputProcessors = input;\n this.#outputProcessors = output;\n }\n}\n"],"mappings":";;;;;;;;;;;AAmCA,IAAa,mBAAb,MAA8B;CAC5B,wBAAiB,IAAI,IAA0B;CAC/C;CACA;CACA;CACA;CAIA,mBAA+C,CAAC;CAChD,oBAAiD,CAAC;CAElD,YAAY,UAAmC,CAAC,GAAG;EACjD,KAAKC,uBAAuB,IAAI,IAAI,QAAQ,uBAAuB,CAAC,CAAC;EACrE,KAAKC,WACH,QAAQ,aACN,SAAS,UAAU;GACnB,QAAQ,KAAK,SAAS,KAAK;EAC7B;CACJ;CAEA,qBAA0D;EACxD,OAAO,KAAKC;CACd;CAEA,sBAA4D;EAC1D,OAAO,KAAKC;CACd;;;;;;;;;;;;CAaA,KAAK,eAAmE;EACtE,MAAM,uBAAO,IAAI,IAAY;EAE7B,KAAK,MAAM,EAAE,UAAU,cAAc,OAAO,cAAc,eAAe;GACvE,MAAM,MAAM,GAAG,SAAS,IAAI,SAAS;GACrC,KAAK,IAAI,GAAG;GAEZ,MAAM,OAAO,KAAKJ,MAAM,IAAI,GAAG;GAC/B,IAAI,QAAQ,KAAK,iBAAiB,cAAc;GAChD,IAAI,MAAM,KAAKK,QAAQ,KAAK,IAAI;GAEhC,IAAI,KAAKC,mBAAmB,SAAS,EAAE,GAAG;IACxC,KAAKJ,SACH,WAAW,SAAS,qBAAqB,SAAS,GAAG,6DACrD,KAAA,CACF;IACA,KAAK,OAAO,GAAG;IACf;GACF;GAEA,KAAKF,MAAM,IAAI,KAAK;IAAE;IAAU;IAAU;IAAc,SAAS;GAAM,CAAC;EAC1E;EAEA,KAAK,MAAM,CAAC,KAAK,SAAS,KAAKA,OAC7B,IAAI,CAAC,KAAK,IAAI,GAAG,GAAG,K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Q,cAAc,IAAI;EACvB,KAAKb,MAAM,OAAO,GAAG;CACvB;CAEA,cAAc,MAA0B;EACtC,IAAI;GACF,KAAK,SAAS,KAAK;EACrB,SAAS,OAAO;GACd,KAAKE,SAAS,WAAW,KAAK,SAAS,qBAAqB,KAAK,SAAS,GAAG,oBAAoB,KAAK;EACxG;CACF;CAEA,mBAAmB,YAA6B;EAC9C,IAAI,KAAKD,qBAAqB,IAAI,UAAU,GAAG,OAAO;EACtD,KAAK,MAAM,QAAQ,KAAKD,MAAM,OAAO,GACnC,IAAI,KAAK,SAAS,OAAO,YAAY,OAAO;EAE9C,OAAO;CACT;CAEA,qBAA2B;EACzB,MAAM,QAAoC,CAAC;EAC3C,MAAM,SAAsC,CAAC;EAC7C,KAAK,MAAM,QAAQ,KAAKA,MAAM,OAAO,GAAG;GAItC,IAAI,CAAC,KAAK,SAAS;GAKnB,IAAI;IACF,MAAM,gBAAgB,KAAK,SAAS,qBAAqB,KAAK,CAAC;IAC/D,MAAM,iBAAiB,KAAK,SAAS,sBAAsB,KAAK,CAAC;IACjE,MAAM,KAAK,GAAG,aAAa;IAC3B,OAAO,KAAK,GAAG,cAAc;GAC/B,SAAS,OAAO;IACd,KAAKE,SACH,WAAW,KAAK,SAAS,qBAAqB,KAAK,SAAS,GAAG,kCAC/D,KACF;GACF;EACF;EACA,KAAKC,mBAAmB;EACxB,KAAKC,oBAAoB;CAC3B;AACF"}
@@ -1,4 +1,27 @@
1
+ import type { InputProcessor, OutputProcessor } from '@mastra/core/processors';
2
+ import type { SignalProvider } from '@mastra/core/signals';
1
3
  import type { MastraCodePluginConfigSchema, MastraCodePluginConfigValue, MastraCodePluginTools, MastraCodeToolRenderConfig } from '../plugin.js';
4
+ /** Processors a plugin contributed, normalized into the lane they belong to. */
5
+ export type LoadedPluginProcessors = {
6
+ input: InputProcessor[];
7
+ output: OutputProcessor[];
8
+ };
9
+ /**
10
+ * A single contribution, carrying the id of the plugin that owns it. Ownership
11
+ * has to survive collection: the signal lane keys live providers by
12
+ * `(pluginId, providerId)`, and a processor's state id is derived from the
13
+ * plugin id so it stays stable when the plugin is reloaded.
14
+ */
15
+ export type PluginContribution<TValue> = {
16
+ pluginId: string;
17
+ /** The owning plugin's {@link LoadedPlugin.versionStamp} at collection time. */
18
+ versionStamp: string;
19
+ value: TValue;
20
+ };
21
+ export type PluginProcessorEntries = {
22
+ input: PluginContribution<InputProcessor>[];
23
+ output: PluginContribution<OutputProcessor>[];
24
+ };
2
25
  export type PluginScope = 'global' | 'project';
3
26
  export type PluginSource = 'local' | 'github';
4
27
  export type PluginStatus = 'active' | 'inactive' | 'blocked' | 'load failed' | 'conflicted';
@@ -30,11 +53,24 @@ export type LoadedPlugin = ScopedInstalledPluginRecord & {
30
53
  tools: MastraCodePluginTools;
31
54
  renderConfigs?: Record<string, MastraCodeToolRenderConfig>;
32
55
  toolNames: string[];
56
+ processors?: LoadedPluginProcessors;
57
+ signalProviders?: SignalProvider<string>[];
33
58
  skillPaths?: string[];
34
59
  commandPaths?: string[];
35
60
  configSchema?: MastraCodePluginConfigSchema;
36
61
  configValues?: Record<string, MastraCodePluginConfigValue>;
37
62
  conflicts?: string[];
63
+ /**
64
+ * Changes when this plugin's contributions should be rebuilt: source content
65
+ * (git HEAD for GitHub checkouts, entry file version for local plugins) plus
66
+ * the registry record's config values and enabled flag. Reload fires on
67
+ * non-content events too — a config edit hands the plugin different values
68
+ * while every file is untouched — so both halves matter.
69
+ *
70
+ * Consumers that own long-lived instances (the signal-provider lane) compare
71
+ * this to decide between keeping what they have and cycling it.
72
+ */
73
+ versionStamp?: string;
38
74
  };
39
75
  export type PluginScopePaths = {
40
76
  scope: PluginScope;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AAEtB,MAA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,MAAM,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/code-sdk",
3
- "version": "1.2.0-alpha.10",
3
+ "version": "1.2.0-alpha.13",
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": {
@@ -56,19 +56,19 @@
56
56
  "vscode-languageserver-protocol": "^3.17.5",
57
57
  "yaml": "^2.7.1",
58
58
  "zod": "^4.3.6",
59
- "@mastra/core": "1.58.0-alpha.9",
60
- "@mastra/agent-browser": "0.5.1-alpha.0",
61
59
  "@mastra/duckdb": "1.6.1-alpha.0",
62
- "@mastra/fastembed": "1.2.0",
63
- "@mastra/github-signals": "0.2.5-alpha.0",
60
+ "@mastra/agent-browser": "0.5.1-alpha.0",
61
+ "@mastra/github-signals": "0.2.5-alpha.1",
62
+ "@mastra/core": "1.58.0-alpha.12",
64
63
  "@mastra/libsql": "1.20.0-alpha.2",
65
- "@mastra/mcp": "1.16.0-alpha.1",
66
- "@mastra/observability": "1.16.6-alpha.2",
67
- "@mastra/memory": "1.26.1-alpha.4",
64
+ "@mastra/fastembed": "1.2.0",
65
+ "@mastra/memory": "1.26.1-alpha.6",
66
+ "@mastra/mcp": "1.16.0-alpha.2",
67
+ "@mastra/observability": "1.16.6-alpha.3",
68
68
  "@mastra/pg": "1.20.0-alpha.3",
69
- "@mastra/tavily": "1.1.1",
70
- "@mastra/schema-compat": "1.3.6-alpha.2",
71
- "@mastra/stagehand": "0.3.2-alpha.1"
69
+ "@mastra/schema-compat": "1.3.6-alpha.3",
70
+ "@mastra/stagehand": "0.3.2-alpha.1",
71
+ "@mastra/tavily": "1.1.1"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@libsql/client": "^0.17.4",
@@ -79,9 +79,9 @@
79
79
  "typescript": "^6.0.3",
80
80
  "typescript-eslint": "^8.57.0",
81
81
  "vitest": "4.1.10",
82
+ "@internal/types-builder": "0.0.96",
82
83
  "@internal/lint": "0.0.121",
83
- "@internal/workspace-test-utils": "0.0.65",
84
- "@internal/types-builder": "0.0.96"
84
+ "@internal/workspace-test-utils": "0.0.65"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=22.19.0"