@mastra/agent-browser 0.3.1-alpha.0 → 0.3.3

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/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { BrowserConfig as BrowserConfig$1, ThreadManager, ThreadManagerConfig, ThreadSession, BrowserState, MastraBrowser, BrowserToolError, BrowserTabState, ScreencastOptions, ScreencastStream, MouseEventParams, KeyboardEventParams } from '@mastra/core/browser';
1
+ import { BrowserConfig as BrowserConfig$1, BrowserRecordingOptions, ThreadManager, ThreadManagerConfig, ThreadSession, BrowserState, MastraBrowser, BrowserToolError, BrowserTabState, ScreencastOptions, ScreencastStream, MouseEventParams, KeyboardEventParams } from '@mastra/core/browser';
2
2
  import { Tool } from '@mastra/core/tools';
3
3
  import { BrowserManager } from 'agent-browser';
4
4
  import { Page } from 'playwright-core';
@@ -369,6 +369,13 @@ interface AgentBrowserConfigExtensions {
369
369
  * ```
370
370
  */
371
371
  storageState?: string;
372
+ /**
373
+ * Alpha: opt into browser recording tools.
374
+ *
375
+ * Recording tools are disabled by default. Provide an output directory to add
376
+ * `browser_record` and `browser_record_caption` to this browser's toolset.
377
+ */
378
+ recording?: BrowserRecordingOptions;
372
379
  /**
373
380
  * Tool names to exclude from the browser toolset.
374
381
  * Use this to disable specific tools, e.g. `['browser_screenshot']`
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BrowserConfig as BrowserConfig$1, ThreadManager, ThreadManagerConfig, ThreadSession, BrowserState, MastraBrowser, BrowserToolError, BrowserTabState, ScreencastOptions, ScreencastStream, MouseEventParams, KeyboardEventParams } from '@mastra/core/browser';
1
+ import { BrowserConfig as BrowserConfig$1, BrowserRecordingOptions, ThreadManager, ThreadManagerConfig, ThreadSession, BrowserState, MastraBrowser, BrowserToolError, BrowserTabState, ScreencastOptions, ScreencastStream, MouseEventParams, KeyboardEventParams } from '@mastra/core/browser';
2
2
  import { Tool } from '@mastra/core/tools';
3
3
  import { BrowserManager } from 'agent-browser';
4
4
  import { Page } from 'playwright-core';
@@ -369,6 +369,13 @@ interface AgentBrowserConfigExtensions {
369
369
  * ```
370
370
  */
371
371
  storageState?: string;
372
+ /**
373
+ * Alpha: opt into browser recording tools.
374
+ *
375
+ * Recording tools are disabled by default. Provide an output directory to add
376
+ * `browser_record` and `browser_record_caption` to this browser's toolset.
377
+ */
378
+ recording?: BrowserRecordingOptions;
372
379
  /**
373
380
  * Tool names to exclude from the browser toolset.
374
381
  * Use this to disable specific tools, e.g. `['browser_screenshot']`
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ThreadManager, MastraBrowser, DEFAULT_THREAD_ID, ScreencastStreamImpl } from '@mastra/core/browser';
1
+ import { ThreadManager, MastraBrowser, DEFAULT_THREAD_ID, createBrowserRecordingTools, ScreencastStreamImpl } from '@mastra/core/browser';
2
2
  import { BrowserManager } from 'agent-browser';
3
3
  import { createTool } from '@mastra/core/tools';
4
4
  import { z } from 'zod';
@@ -759,6 +759,9 @@ var AgentBrowser = class extends MastraBrowser {
759
759
  */
760
760
  getTools() {
761
761
  const tools = createAgentBrowserTools(this);
762
+ if (this.browserConfig.recording) {
763
+ Object.assign(tools, createBrowserRecordingTools(this, this.browserConfig.recording));
764
+ }
762
765
  const exclude = this.browserConfig.excludeTools;
763
766
  if (exclude?.length) {
764
767
  for (const name of exclude) {