> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 브라우저 녹화(베타) **추가된 항목:** `@mastra/core@1.43.0` 브라우저 녹화에는 Agent가 브라우저 세션을 Motion-JPEG AVI 비디오로 저장할 수 있는 두 가지 선택 Tool이 추가됩니다. Agent는 작동하는 동안 짧은 캡션을 추가할 수도 있습니다. :::실험적 이 기능은 베타 버전입니다. API가 안정될 때까지 주요 버전 변경 없이 주요 변경 사항이 발생할 수 있습니다. ::: ## 브라우저 기록을 사용하는 경우 다음과 같은 경우 브라우저 기록을 사용하세요. - Agent가 브라우저에서 수행한 작업을 검토하세요. - 짧은 브라우저 자동화 실행을 팀원과 공유하세요 - 누락된 작업, 느린 페이지 로드 또는 예상치 못한 탐색 디버그 - 각 주요 단계를 설명하는 짧은 캡션을 추가하세요. 녹음 Tool은 기본적으로 비활성화되어 있습니다. 비디오 파일을 작성해야 하는 Agent에 대해서만 활성화하세요. ## 녹음 활성화 `recording` 객체를 `AgentBrowser` 또는 `StagehandBrowser`에 전달하세요. 필수 필드는 `outputDir`뿐입니다. 이 브라우저에서 시작하는 모든 녹화의 기본값으로 `maxDurationMs`, `maxWidth`, `maxHeight`도 설정할 수 있습니다. 다음 예에서는 녹음을 활성화합니다.`AgentBrowser`: ```typescript import { join } from 'node:path' import { AgentBrowser } from '@mastra/agent-browser' export const browser = new AgentBrowser({ headless: false, recording: { outputDir: join(process.cwd(), 'browser-recordings'), maxDurationMs: 60_000, maxWidth: 1280, maxHeight: 720, }, }) ``` 동일한 옵션이 다음과 함께 작동합니다.`StagehandBrowser`: ```typescript import { join } from 'node:path' import { StagehandBrowser } from '@mastra/stagehand' export const browser = new StagehandBrowser({ headless: false, recording: { outputDir: join(process.cwd(), 'browser-recordings'), maxDurationMs: 60_000, maxWidth: 1280, maxHeight: 720, }, }) ``` Agent는 시작할 때 `maxDurationMs`, `maxWidth` 또는 `maxHeight`를 `browser_record` Tool에 전달하여 녹화별로 이러한 기본값을 재정의할 수 있습니다. ## 녹음 Tool 녹음을 활성화하면 다음 Tool이 추가됩니다. | Tool | 설명 | | ------------------------------------ | ------------------------- | | `browser_record` | 녹화를 시작하거나 중지하고 상태를 확인합니다. | | `browser_record_caption` | 녹화의 현재 시점에 짧은 캡션을 추가합니다. | | `browser_record`받아들인다`action` field: | | - `start`: 현재 브라우저 세션 기록을 시작합니다. - `status`: 녹화가 활성화되어 있는지 확인하세요. - `stop`: 녹음을 중지하고 다음 내용을 씁니다.`.avi` file. `browser_record`의 `outputPath` 옵션은 구성된 `recording.outputDir` 내부의 절대 경로여야 합니다. 생략하면 Mastra가 `outputDir`에 파일을 생성합니다. ## Agent 지침 예시 녹음할 시기와 캡션을 추가할 시기를 상담사에게 알려주세요. ```typescript import { Agent } from '@mastra/core/agent' import { browser } from '../browsers' export const browserAgent = new Agent({ id: 'browser-agent', name: 'Browser Agent', model: 'openai/gpt-5.6-sol', browser, instructions: `Use browser tools to complete the requested task. When the user asks for a recording: 1. Call browser_record with action="start" before browser work begins. 2. After each major action, call browser_record_caption with a caption of about six words. 3. Call browser_record with action="stop" as soon as the task is complete. 4. Return the saved video path to the user.`, }) ``` ## 출력 형식 및 제한 녹화는 Motion-JPEG AVI 파일로 저장됩니다. 이 형식은 JavaScript로 인코딩되며 `ffmpeg` 또는 네이티브 의존성이 필요하지 않습니다. 기본 한도: - 최대 지속 시간: 30초 - 하드 지속 시간 한도: 120초 - 최대 프레임 크기: 1024 × 720 - 캡션: 각 80자 - 프로세스당 하나의 활성 기록 가능하면 더 짧은 녹음을 사용하십시오. 긴 브라우저 세션에서는 더 큰 파일이 생성되고 검토하기가 더 어렵습니다. ## 다음 단계 - [Agent브라우저](https://mastra.zisheng.pro/ko/docs/browser/agent-browser) - [무대 담당자](https://mastra.zisheng.pro/ko/docs/browser/stagehand) - [브라우저 개요](https://mastra.zisheng.pro/ko/docs/browser/overview)