@mastra/agent-browser 0.5.5 → 0.6.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.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { BrowserConfig as BrowserConfig$1, BrowserRecordingOptions, BrowserState, BrowserTabState, BrowserToolError, KeyboardEventParams, MastraBrowser, MouseEventParams, ScreencastOptions, ScreencastStream, ThreadManager, ThreadManagerConfig, ThreadSession } from "@mastra/core/browser";
1
+ import { BrowserConfig as BrowserConfig$1, BrowserCookie, BrowserRecordingOptions, BrowserState, BrowserTabState, BrowserToolError, KeyboardEventParams, MastraBrowser, MouseEventParams, ScreencastOptions, ScreencastStream, ThreadManager, ThreadManagerConfig, ThreadSession } from "@mastra/core/browser";
2
2
  import { Tool as Tool$1 } from "@mastra/core/tools";
3
3
  import { BrowserManager } from "agent-browser";
4
4
  import { ChildProcess } from "child_process";
@@ -46893,6 +46893,7 @@ type DragInput = z.output<typeof dragInputSchema>;
46893
46893
  */
46894
46894
  declare const screenshotInputSchema: z.ZodObject<{
46895
46895
  fullPage: z.ZodOptional<z.ZodBoolean>;
46896
+ path: z.ZodOptional<z.ZodString>;
46896
46897
  }, z.core.$strip>;
46897
46898
  type ScreenshotInput = z.output<typeof screenshotInputSchema>;
46898
46899
  /**
@@ -47022,6 +47023,7 @@ export declare const browserSchemas: {
47022
47023
  }, z.core.$strip>;
47023
47024
  readonly screenshot: z.ZodObject<{
47024
47025
  fullPage: z.ZodOptional<z.ZodBoolean>;
47026
+ path: z.ZodOptional<z.ZodString>;
47025
47027
  }, z.core.$strip>;
47026
47028
  readonly evaluate: z.ZodObject<{
47027
47029
  script: z.ZodString;
@@ -47114,6 +47116,8 @@ interface AgentBrowserThreadManagerConfig extends ThreadManagerConfig {
47114
47116
  resolveCdpUrl?: (cdpUrl: string | (() => string | Promise<string>)) => Promise<string>;
47115
47117
  /** Callback when a new browser manager is created for a thread */
47116
47118
  onBrowserCreated?: (manager: BrowserManager, threadId: string) => void;
47119
+ /** Runs once a thread's browser is open, before saved tabs are restored (e.g. to add cookies) */
47120
+ onBrowserOpened?: (threadId: string) => Promise<void>;
47117
47121
  }
47118
47122
  /**
47119
47123
  * Factory for custom thread managers (e.g. Firecrawl-hosted CDP per session).
@@ -47131,6 +47135,7 @@ export declare class AgentBrowserThreadManager extends ThreadManager<BrowserMana
47131
47135
  protected readonly browserConfig: BrowserConfig;
47132
47136
  private readonly resolveCdpUrl?;
47133
47137
  protected readonly onBrowserCreated?: (manager: BrowserManager, threadId: string) => void;
47138
+ protected readonly onBrowserOpened?: (threadId: string) => Promise<void>;
47134
47139
  constructor(config: AgentBrowserThreadManagerConfig);
47135
47140
  /**
47136
47141
  * Get the page for a specific thread, creating session if needed.
@@ -47196,6 +47201,7 @@ export declare class AgentBrowser extends MastraBrowser {
47196
47201
  * Delegates to ThreadManager for scope handling.
47197
47202
  */
47198
47203
  getManagerForThread(threadId?: string): Promise<BrowserManager>;
47204
+ protected addCookiesToOpenBrowser(cookies: BrowserCookie[], threadId: string): Promise<boolean>;
47199
47205
  protected doLaunch(): Promise<void>;
47200
47206
  /**
47201
47207
  * Set up close event listeners for 'shared' scope browser.