@mastra/stagehand 0.2.2 → 0.2.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
@@ -218,6 +218,16 @@ type ModelConfiguration = string | {
218
218
  /**
219
219
  * Stagehand-specific configuration fields.
220
220
  */
221
+ interface StagehandLogLine {
222
+ category?: string;
223
+ message: string;
224
+ level?: 0 | 1 | 2;
225
+ timestamp?: string;
226
+ auxiliary?: Record<string, {
227
+ value: string;
228
+ type: string;
229
+ }>;
230
+ }
221
231
  interface StagehandConfigExtensions {
222
232
  /**
223
233
  * Environment to run the browser in
@@ -251,13 +261,25 @@ interface StagehandConfigExtensions {
251
261
  */
252
262
  domSettleTimeout?: number;
253
263
  /**
254
- * Logging verbosity level
255
- * - 0: Silent
256
- * - 1: Errors only
257
- * - 2: Verbose
258
- * @default 1
264
+ * Logging verbosity level.
265
+ * - 0: Suppress INFO/DEBUG logs
266
+ * - 1: Include INFO logs
267
+ * - 2: Include DEBUG logs
268
+ *
269
+ * @default 0
259
270
  */
260
271
  verbose?: 0 | 1 | 2;
272
+ /**
273
+ * Optional Stagehand logger hook. When provided, Stagehand log lines are
274
+ * routed here instead of being written directly to the process console.
275
+ */
276
+ logger?: (line: StagehandLogLine) => void;
277
+ /**
278
+ * Disable Stagehand's Pino console logging backend.
279
+ *
280
+ * @default true
281
+ */
282
+ disablePino?: boolean;
261
283
  /**
262
284
  * Custom system prompt for AI operations (act, extract, observe)
263
285
  */
package/dist/index.d.ts CHANGED
@@ -218,6 +218,16 @@ type ModelConfiguration = string | {
218
218
  /**
219
219
  * Stagehand-specific configuration fields.
220
220
  */
221
+ interface StagehandLogLine {
222
+ category?: string;
223
+ message: string;
224
+ level?: 0 | 1 | 2;
225
+ timestamp?: string;
226
+ auxiliary?: Record<string, {
227
+ value: string;
228
+ type: string;
229
+ }>;
230
+ }
221
231
  interface StagehandConfigExtensions {
222
232
  /**
223
233
  * Environment to run the browser in
@@ -251,13 +261,25 @@ interface StagehandConfigExtensions {
251
261
  */
252
262
  domSettleTimeout?: number;
253
263
  /**
254
- * Logging verbosity level
255
- * - 0: Silent
256
- * - 1: Errors only
257
- * - 2: Verbose
258
- * @default 1
264
+ * Logging verbosity level.
265
+ * - 0: Suppress INFO/DEBUG logs
266
+ * - 1: Include INFO logs
267
+ * - 2: Include DEBUG logs
268
+ *
269
+ * @default 0
259
270
  */
260
271
  verbose?: 0 | 1 | 2;
272
+ /**
273
+ * Optional Stagehand logger hook. When provided, Stagehand log lines are
274
+ * routed here instead of being written directly to the process console.
275
+ */
276
+ logger?: (line: StagehandLogLine) => void;
277
+ /**
278
+ * Disable Stagehand's Pino console logging backend.
279
+ *
280
+ * @default true
281
+ */
282
+ disablePino?: boolean;
261
283
  /**
262
284
  * Custom system prompt for AI operations (act, extract, observe)
263
285
  */
package/dist/index.js CHANGED
@@ -400,8 +400,11 @@ var StagehandBrowser = class extends MastraBrowser {
400
400
  model: typeof config.model === "string" ? config.model : config.model?.modelName,
401
401
  selfHeal: config.selfHeal ?? true,
402
402
  domSettleTimeoutMs: config.domSettleTimeout,
403
- verbose: config.verbose ?? 1,
404
- systemPrompt: config.systemPrompt
403
+ verbose: config.verbose ?? 0,
404
+ systemPrompt: config.systemPrompt,
405
+ logger: config.logger ?? (() => {
406
+ }),
407
+ disablePino: config.disablePino ?? true
405
408
  };
406
409
  if (config.env === "BROWSERBASE") {
407
410
  if (config.apiKey) {