@mastra/deployer 1.36.0-alpha.6 → 1.36.0-alpha.8

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,23 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.36.0-alpha.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`9aee493`](https://github.com/mastra-ai/mastra/commit/9aee493ed6089b5133472623dcce49934bf2d509)]:
8
+ - @mastra/core@1.36.0-alpha.8
9
+ - @mastra/server@1.36.0-alpha.8
10
+
11
+ ## 1.36.0-alpha.7
12
+
13
+ ### Patch Changes
14
+
15
+ - Browser streaming now works for stored agents. The deployer's `getToolset` first checks the runtime agent registry, then falls back to the editor's stored-agent lookup, so agents created at runtime through the editor can stream browser sessions without being pre-registered in code. ([#16778](https://github.com/mastra-ai/mastra/pull/16778))
16
+
17
+ - Updated dependencies [[`a935b0a`](https://github.com/mastra-ai/mastra/commit/a935b0a0977ae3f196b33ec7621f528069c82db0), [`a935b0a`](https://github.com/mastra-ai/mastra/commit/a935b0a0977ae3f196b33ec7621f528069c82db0)]:
18
+ - @mastra/core@1.36.0-alpha.7
19
+ - @mastra/server@1.36.0-alpha.7
20
+
3
21
  ## 1.36.0-alpha.6
4
22
 
5
23
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-deployer
3
3
  description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/deployer"
6
- version: "1.36.0-alpha.6"
6
+ version: "1.36.0-alpha.8"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.36.0-alpha.6",
2
+ "version": "1.36.0-alpha.8",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {
5
5
  "Deps": {
@@ -3201,7 +3201,7 @@ async function setupBrowserStream(app, config2) {
3201
3201
  onMessage(event, _ws) {
3202
3202
  const data = typeof event.data === "string" ? event.data : null;
3203
3203
  if (data) {
3204
- browserStream.handleInputMessage(data, config2.getToolset, agentId, threadId);
3204
+ void browserStream.handleInputMessage(data, config2.getToolset, agentId, threadId);
3205
3205
  }
3206
3206
  },
3207
3207
  onClose(_event, ws) {
@@ -3214,13 +3214,13 @@ async function setupBrowserStream(app, config2) {
3214
3214
  };
3215
3215
  })
3216
3216
  );
3217
- app.get(`${apiPrefix}/agents/:agentId/browser/session`, (c) => {
3217
+ app.get(`${apiPrefix}/agents/:agentId/browser/session`, async (c) => {
3218
3218
  const agentId = c.req.param("agentId");
3219
3219
  if (!agentId) {
3220
3220
  return c.json({ error: "Agent ID is required" }, 400);
3221
3221
  }
3222
3222
  const threadId = c.req.query("threadId");
3223
- const toolset = config2.getToolset(agentId);
3223
+ const toolset = await config2.getToolset(agentId);
3224
3224
  if (!toolset) {
3225
3225
  return c.json({ hasSession: false, screencastAvailable: true });
3226
3226
  }
@@ -3232,7 +3232,7 @@ async function setupBrowserStream(app, config2) {
3232
3232
  if (!agentId) {
3233
3233
  return c.json({ error: "Agent ID is required" }, 400);
3234
3234
  }
3235
- const toolset = config2.getToolset(agentId);
3235
+ const toolset = await config2.getToolset(agentId);
3236
3236
  if (!toolset) {
3237
3237
  return c.json({ error: "No browser session for this agent" }, 404);
3238
3238
  }
@@ -4568,9 +4568,20 @@ async function createHonoServer(mastra, options = {
4568
4568
  }
4569
4569
  }
4570
4570
  const browserStreamSetup = await setupBrowserStream(app, {
4571
- getToolset: (agentId) => {
4572
- const agent = mastra.getAgentById(agentId);
4573
- return agent?.browser;
4571
+ getToolset: async (agentId) => {
4572
+ try {
4573
+ const runtimeAgent = mastra.getAgentById(agentId);
4574
+ if (runtimeAgent) {
4575
+ return runtimeAgent.browser;
4576
+ }
4577
+ } catch {
4578
+ }
4579
+ try {
4580
+ const storedAgent = await mastra.getEditor?.()?.agent.getById(agentId);
4581
+ return storedAgent?.browser;
4582
+ } catch {
4583
+ return void 0;
4584
+ }
4574
4585
  },
4575
4586
  apiPrefix
4576
4587
  });