# Agent

## AI Task

**post** `/automate`

Execute AI-powered browser automation tasks using natural language with optional geotargeting. This endpoint **always streams** responses using Server-Sent Events (SSE).

**Streaming Response:**

- All responses are streamed using Server-Sent Events (`text/event-stream`)
- Real-time progress updates and results as they're generated

**Geotargeting:**

- Optionally specify a country code for geotargeted browsing

**Use Cases:**

- Web scraping and data extraction
- Form filling and interaction
- Navigation and information gathering
- Multi-step web workflows
- Content analysis from web pages

### Body Parameters

- `task: string`

  The task description in natural language

- `data: optional unknown`

  JSON data to provide context for form filling or complex tasks

- `geo_target: optional GeotargetGeoTarget`

  Optional geotargeting parameters for proxy requests

  - `country: optional string`

    Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB", "JP").
    See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

- `guardrails: optional string`

  Safety constraints for execution

- `interactive: optional boolean`

  Enable interactive mode to allow human-in-the-loop input during task execution

- `maxIterations: optional number`

  Maximum task iterations

- `maxValidationAttempts: optional number`

  Maximum validation attempts

- `trusted_hostnames: optional array of string`

  TrustedHostnames lists hostnames where the action firewall is bypassed for fills and submissions.
  WARNING: on listed hosts, prompt injection from page content can drive the agent to fill and submit any field, including personal and credential data. Use only for sites you fully trust to receive your data.

- `unsafe_mode: optional boolean`

  UnsafeMode disables the action firewall entirely.
  WARNING: prompt injection from page content can then cause the agent to submit your data, including credentials, personal information, and conversation context, to attacker-controlled forms. Only enable for trusted, controlled environments.

- `url: optional string`

  Starting URL for the task

### Returns

- `AutomateEvent = object { data, event }  or object { data, event }  or object { data, event }  or 30 more`

  A Server-Sent Event from /v1/automate. Typed discriminated union keyed on event.

  - `AgentAction object { data, event }`

    Envelope for the "agent:action" event from /v1/automate.

    - `data: object { action, iterationId, timestamp, 2 more }`

      Event data for action execution

      - `action: string`

      - `iterationId: string`

      - `timestamp: number`

      - `ref: optional string`

      - `value: optional string`

    - `event: "agent:action"`

      - `"agent:action"`

  - `AgentExtracted object { data, event }`

    Envelope for the "agent:extracted" event from /v1/automate.

    - `data: object { extractedData, iterationId, timestamp }`

      Event data for extracted data

      - `extractedData: string`

      - `iterationId: string`

      - `timestamp: number`

    - `event: "agent:extracted"`

      - `"agent:extracted"`

  - `AgentProcessing object { data, event }`

    Envelope for the "agent:processing" event from /v1/automate.

    - `data: object { hasScreenshot, iterationId, operation, timestamp }`

      Event data for when the agent is waiting for model generation

      - `hasScreenshot: boolean`

      - `iterationId: string`

      - `operation: string`

      - `timestamp: number`

    - `event: "agent:processing"`

      - `"agent:processing"`

  - `AgentReasoned object { data, event }`

    Envelope for the "agent:reasoned" event from /v1/automate.

    - `data: object { iterationId, reasoning, timestamp }`

      Event data for agent reasoning

      - `iterationId: string`

      - `reasoning: string`

      - `timestamp: number`

    - `event: "agent:reasoned"`

      - `"agent:reasoned"`

  - `AgentStatus object { data, event }`

    Envelope for the "agent:status" event from /v1/automate.

    - `data: object { iterationId, message, timestamp }`

      Event data for status messages

      - `iterationId: string`

      - `message: string`

      - `timestamp: number`

    - `event: "agent:status"`

      - `"agent:status"`

  - `AgentStep object { data, event }`

    Envelope for the "agent:step" event from /v1/automate.

    - `data: object { currentIteration, iterationId, timestamp }`

      Event data for agent step tracking (each loop iteration)

      - `currentIteration: number`

      - `iterationId: string`

      - `timestamp: number`

    - `event: "agent:step"`

      - `"agent:step"`

  - `AgentWaiting object { data, event }`

    Envelope for the "agent:waiting" event from /v1/automate.

    - `data: object { iterationId, seconds, timestamp }`

      Event data for waiting notifications

      - `iterationId: string`

      - `seconds: number`

      - `timestamp: number`

    - `event: "agent:waiting"`

      - `"agent:waiting"`

  - `AIGeneration object { data, event }`

    Envelope for the "ai:generation" event from /v1/automate.

    - `data: object { finishReason, iterationId, prompt, 8 more }`

      Event data when AI generation occurs

      - `finishReason: "stop" or "length" or "content-filter" or 3 more`

        - `"stop"`

        - `"length"`

        - `"content-filter"`

        - `"tool-calls"`

        - `"error"`

        - `"other"`

      - `iterationId: string`

      - `prompt: string`

      - `schema: unknown`

      - `timestamp: number`

      - `usage: object { inputTokens, outputTokens, totalTokens }`

        - `inputTokens: optional number`

        - `outputTokens: optional number`

        - `totalTokens: optional number`

      - `messages: optional array of object { content, role, providerOptions }  or object { content, role, providerOptions }  or object { content, role, providerOptions }  or object { content, role, providerOptions }`

        - `System object { content, role, providerOptions }`

          A system message. It can contain system information.

          Note: using the "system" part of the prompt is strongly preferred to increase the resilience against prompt injection attacks, and because not all providers support several system messages.

          - `content: string`

          - `role: "system"`

            - `"system"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

        - `User object { content, role, providerOptions }`

          A user message. It can contain text or a combination of text and images.

          - `content: string or array of object { text, type, providerOptions }  or object { image, type, mediaType, providerOptions }  or object { data, mediaType, type, 2 more }`

            Content of a user message. It can be a string or an array of text and image parts.

            - `string`

            - `array of object { text, type, providerOptions }  or object { image, type, mediaType, providerOptions }  or object { data, mediaType, type, 2 more }`

              - `Text object { text, type, providerOptions }`

                Text content part of a prompt. It contains a string of text.

                - `text: string`

                  The text content.

                - `type: "text"`

                  - `"text"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `Image object { image, type, mediaType, providerOptions }`

                Image content part of a prompt. It contains an image.

                - `image: string or object { buffer, byteLength, byteOffset, 2 more }  or object { byteLength }  or V1GlobalBuffer`

                  Image data. Can either be:

                  - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
                  - URL: a URL that points to the image

                  - `string`

                  - `object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                  - `ByteLength object { byteLength }`

                    - `byteLength: number`

                  - `V1GlobalBuffer object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                - `type: "image"`

                  - `"image"`

                - `mediaType: optional string`

                  Optional IANA media type of the image.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `File object { data, mediaType, type, 2 more }`

                File content part of a prompt. It contains a file.

                - `data: string or object { buffer, byteLength, byteOffset, 2 more }  or object { byteLength }  or V1GlobalBuffer`

                  File data. Can either be:

                  - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
                  - URL: a URL that points to the image

                  - `string`

                  - `object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                  - `ByteLength object { byteLength }`

                    - `byteLength: number`

                  - `V1GlobalBuffer object { buffer, byteLength, byteOffset, 2 more }`

                - `mediaType: string`

                  IANA media type of the file.

                - `type: "file"`

                  - `"file"`

                - `filename: optional string`

                  Optional filename of the file.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

          - `role: "user"`

            - `"user"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

        - `Assistant object { content, role, providerOptions }`

          An assistant message. It can contain text, tool calls, or a combination of text and tool calls.

          - `content: string or array of object { text, type, providerOptions }  or object { data, mediaType, type, 2 more }  or object { text, type, providerOptions }  or 3 more`

            Content of an assistant message. It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.

            - `string`

            - `array of object { text, type, providerOptions }  or object { data, mediaType, type, 2 more }  or object { text, type, providerOptions }  or 3 more`

              - `Text object { text, type, providerOptions }`

                Text content part of a prompt. It contains a string of text.

                - `text: string`

                  The text content.

                - `type: "text"`

                  - `"text"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `File object { data, mediaType, type, 2 more }`

                File content part of a prompt. It contains a file.

                - `data: string or object { buffer, byteLength, byteOffset, 2 more }  or object { byteLength }  or V1GlobalBuffer`

                  File data. Can either be:

                  - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
                  - URL: a URL that points to the image

                  - `string`

                  - `object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                  - `ByteLength object { byteLength }`

                    - `byteLength: number`

                  - `V1GlobalBuffer object { buffer, byteLength, byteOffset, 2 more }`

                - `mediaType: string`

                  IANA media type of the file.

                - `type: "file"`

                  - `"file"`

                - `filename: optional string`

                  Optional filename of the file.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `Reasoning object { text, type, providerOptions }`

                Reasoning content part of a prompt. It contains a reasoning.

                - `text: string`

                  The reasoning text.

                - `type: "reasoning"`

                  - `"reasoning"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `ToolCall object { input, toolCallId, toolName, 3 more }`

                Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).

                - `input: unknown`

                  Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.

                - `toolCallId: string`

                  ID of the tool call. This ID is used to match the tool call with the tool result.

                - `toolName: string`

                  Name of the tool that is being called.

                - `type: "tool-call"`

                  - `"tool-call"`

                - `providerExecuted: optional boolean`

                  Whether the tool call was executed by the provider.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `ToolResult object { output, toolCallId, toolName, 2 more }`

                Tool result content part of a prompt. It contains the result of the tool call with the matching ID.

                - `output: object { type, value, providerOptions }  or object { type, value, providerOptions }  or object { type, providerOptions, reason }  or 3 more`

                  Result of the tool call. This is a JSON-serializable object.

                  - `Text object { type, value, providerOptions }`

                    - `type: "text"`

                      Text tool output that should be directly sent to the API.

                      - `"text"`

                    - `value: string`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `Json object { type, value, providerOptions }`

                    - `type: "json"`

                      - `"json"`

                    - `value: string or number or boolean or 2 more`

                      A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                      - `string`

                      - `number`

                      - `boolean`

                      - `map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `ExecutionDenied object { type, providerOptions, reason }`

                    - `type: "execution-denied"`

                      Type when the user has denied the execution of the tool call.

                      - `"execution-denied"`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `reason: optional string`

                      Optional reason for the execution denial.

                  - `ErrorText object { type, value, providerOptions }`

                    - `type: "error-text"`

                      - `"error-text"`

                    - `value: string`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `ErrorJson object { type, value, providerOptions }`

                    - `type: "error-json"`

                      - `"error-json"`

                    - `value: string or number or boolean or 2 more`

                      A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                      - `string`

                      - `number`

                      - `boolean`

                      - `map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `Content object { type, value }`

                    - `type: "content"`

                      - `"content"`

                    - `value: array of object { text, type, providerOptions }  or object { data, mediaType, type }  or object { data, mediaType, type, 2 more }  or 6 more`

                      - `Text object { text, type, providerOptions }`

                        - `text: string`

                          Text content.

                        - `type: "text"`

                          - `"text"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `Media object { data, mediaType, type }`

                        - `data: string`

                        - `mediaType: string`

                        - `type: "media"`

                          Deprecated. Use image-data or file-data instead.

                          - `"media"`

                      - `FileData object { data, mediaType, type, 2 more }`

                        - `data: string`

                          Base-64 encoded media data.

                        - `mediaType: string`

                          IANA media type.

                        - `type: "file-data"`

                          - `"file-data"`

                        - `filename: optional string`

                          Optional filename of the file.

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `FileURL object { type, url, providerOptions }`

                        - `type: "file-url"`

                          - `"file-url"`

                        - `url: string`

                          URL of the file.

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `FileID object { fileId, type, providerOptions }`

                        - `fileId: string or map[string]`

                          ID of the file.

                          If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                          - `string`

                          - `map[string]`

                        - `type: "file-id"`

                          - `"file-id"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `ImageData object { data, mediaType, type, providerOptions }`

                        - `data: string`

                          Base-64 encoded image data.

                        - `mediaType: string`

                          IANA media type.

                        - `type: "image-data"`

                          Images that are referenced using base64 encoded data.

                          - `"image-data"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `ImageURL object { type, url, providerOptions }`

                        - `type: "image-url"`

                          Images that are referenced using a URL.

                          - `"image-url"`

                        - `url: string`

                          URL of the image.

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `ImageFileID object { fileId, type, providerOptions }`

                        - `fileId: string or map[string]`

                          Image that is referenced using a provider file id.

                          If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                          - `string`

                          - `map[string]`

                        - `type: "image-file-id"`

                          Images that are referenced using a provider file id.

                          - `"image-file-id"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `Custom object { type, providerOptions }`

                        - `type: "custom"`

                          Custom content part. This can be used to implement provider-specific content parts.

                          - `"custom"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                - `toolCallId: string`

                  ID of the tool call that this result is associated with.

                - `toolName: string`

                  Name of the tool that generated this result.

                - `type: "tool-result"`

                  - `"tool-result"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `ToolApprovalRequest object { approvalId, toolCallId, type }`

                Tool approval request prompt part.

                - `approvalId: string`

                  ID of the tool approval.

                - `toolCallId: string`

                  ID of the tool call that the approval request is for.

                - `type: "tool-approval-request"`

                  - `"tool-approval-request"`

          - `role: "assistant"`

            - `"assistant"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

        - `Tool object { content, role, providerOptions }`

          A tool message. It contains the result of one or more tool calls.

          - `content: array of object { output, toolCallId, toolName, 2 more }  or object { approvalId, approved, type, 2 more }`

            Content of a tool message. It is an array of tool result parts.

            - `ToolResult object { output, toolCallId, toolName, 2 more }`

              Tool result content part of a prompt. It contains the result of the tool call with the matching ID.

              - `output: object { type, value, providerOptions }  or object { type, value, providerOptions }  or object { type, providerOptions, reason }  or 3 more`

                Result of the tool call. This is a JSON-serializable object.

                - `Text object { type, value, providerOptions }`

                  - `type: "text"`

                    Text tool output that should be directly sent to the API.

                    - `"text"`

                  - `value: string`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `Json object { type, value, providerOptions }`

                  - `type: "json"`

                    - `"json"`

                  - `value: string or number or boolean or 2 more`

                    A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                    - `string`

                    - `number`

                    - `boolean`

                    - `map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `ExecutionDenied object { type, providerOptions, reason }`

                  - `type: "execution-denied"`

                    Type when the user has denied the execution of the tool call.

                    - `"execution-denied"`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                  - `reason: optional string`

                    Optional reason for the execution denial.

                - `ErrorText object { type, value, providerOptions }`

                  - `type: "error-text"`

                    - `"error-text"`

                  - `value: string`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `ErrorJson object { type, value, providerOptions }`

                  - `type: "error-json"`

                    - `"error-json"`

                  - `value: string or number or boolean or 2 more`

                    A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                    - `string`

                    - `number`

                    - `boolean`

                    - `map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `Content object { type, value }`

                  - `type: "content"`

                    - `"content"`

                  - `value: array of object { text, type, providerOptions }  or object { data, mediaType, type }  or object { data, mediaType, type, 2 more }  or 6 more`

                    - `Text object { text, type, providerOptions }`

                      - `text: string`

                        Text content.

                      - `type: "text"`

                        - `"text"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `Media object { data, mediaType, type }`

                      - `data: string`

                      - `mediaType: string`

                      - `type: "media"`

                        Deprecated. Use image-data or file-data instead.

                        - `"media"`

                    - `FileData object { data, mediaType, type, 2 more }`

                      - `data: string`

                        Base-64 encoded media data.

                      - `mediaType: string`

                        IANA media type.

                      - `type: "file-data"`

                        - `"file-data"`

                      - `filename: optional string`

                        Optional filename of the file.

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `FileURL object { type, url, providerOptions }`

                      - `type: "file-url"`

                        - `"file-url"`

                      - `url: string`

                        URL of the file.

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `FileID object { fileId, type, providerOptions }`

                      - `fileId: string or map[string]`

                        ID of the file.

                        If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                        - `string`

                        - `map[string]`

                      - `type: "file-id"`

                        - `"file-id"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `ImageData object { data, mediaType, type, providerOptions }`

                      - `data: string`

                        Base-64 encoded image data.

                      - `mediaType: string`

                        IANA media type.

                      - `type: "image-data"`

                        Images that are referenced using base64 encoded data.

                        - `"image-data"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `ImageURL object { type, url, providerOptions }`

                      - `type: "image-url"`

                        Images that are referenced using a URL.

                        - `"image-url"`

                      - `url: string`

                        URL of the image.

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `ImageFileID object { fileId, type, providerOptions }`

                      - `fileId: string or map[string]`

                        Image that is referenced using a provider file id.

                        If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                        - `string`

                        - `map[string]`

                      - `type: "image-file-id"`

                        Images that are referenced using a provider file id.

                        - `"image-file-id"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `Custom object { type, providerOptions }`

                      - `type: "custom"`

                        Custom content part. This can be used to implement provider-specific content parts.

                        - `"custom"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

              - `toolCallId: string`

                ID of the tool call that this result is associated with.

              - `toolName: string`

                Name of the tool that generated this result.

              - `type: "tool-result"`

                - `"tool-result"`

              - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                - `string`

                - `number`

                - `boolean`

                - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                  - `string`

                  - `number`

                  - `boolean`

                  - `unknown`

                  - `array of unknown`

                - `array of string or number or boolean or 2 more`

                  - `string`

                  - `number`

                  - `boolean`

                  - `unknown`

                  - `array of unknown`

            - `ToolApprovalResponse object { approvalId, approved, type, 2 more }`

              Tool approval response prompt part.

              - `approvalId: string`

                ID of the tool approval.

              - `approved: boolean`

                Flag indicating whether the approval was granted or denied.

              - `type: "tool-approval-response"`

                - `"tool-approval-response"`

              - `providerExecuted: optional boolean`

                Flag indicating whether the tool call is provider-executed. Only provider-executed tool approval responses should be sent to the model.

              - `reason: optional string`

                Optional reason for the approval or denial.

          - `role: "tool"`

            - `"tool"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

      - `object: optional unknown`

      - `providerMetadata: optional map[unknown]`

      - `temperature: optional number`

      - `warnings: optional array of unknown`

    - `event: "ai:generation"`

      - `"ai:generation"`

  - `AIGenerationError object { data, event }`

    Envelope for the "ai:generation:error" event from /v1/automate.

    - `data: object { error, iterationId, prompt, 3 more }`

      Event data when AI generation error occurs

      - `error: string`

      - `iterationId: string`

      - `prompt: string`

      - `schema: unknown`

      - `timestamp: number`

      - `messages: optional array of unknown`

    - `event: "ai:generation:error"`

      - `"ai:generation:error"`

  - `BrowserActionCompleted object { data, event }`

    Envelope for the "browser:action_completed" event from /v1/automate.

    - `data: object { iterationId, success, timestamp, error }`

      Event data for action results

      - `iterationId: string`

      - `success: boolean`

      - `timestamp: number`

      - `error: optional string`

    - `event: "browser:action_completed"`

      - `"browser:action_completed"`

  - `BrowserActionStarted object { data, event }`

    Envelope for the "browser:action_started" event from /v1/automate.

    - `data: object { action, iterationId, timestamp, 2 more }`

      Event data for action execution

      - `action: string`

      - `iterationId: string`

      - `timestamp: number`

      - `ref: optional string`

      - `value: optional string`

    - `event: "browser:action_started"`

      - `"browser:action_started"`

  - `BrowserNavigated object { data, event }`

    Envelope for the "browser:navigated" event from /v1/automate.

    - `data: object { iterationId, timestamp, title, url }`

      Event data when navigating to a page

      - `iterationId: string`

      - `timestamp: number`

      - `title: string`

      - `url: string`

    - `event: "browser:navigated"`

      - `"browser:navigated"`

  - `BrowserReconnected object { data, event }`

    Envelope for the "browser:reconnected" event from /v1/automate.

    - `data: object { endpointIndex, iterationId, startingUrl, 2 more }`

      Event data when the browser reconnects after a mid-task disconnect

      - `endpointIndex: number`

        1-based index of the CDP endpoint now in use

      - `iterationId: string`

      - `startingUrl: string`

        The original starting URL the agent is restarting execution from

      - `timestamp: number`

      - `total: number`

        Total number of configured CDP endpoints

    - `event: "browser:reconnected"`

      - `"browser:reconnected"`

  - `BrowserScreenshotCaptured object { data, event }`

    Envelope for the "browser:screenshot_captured" event from /v1/automate.

    - `data: object { format, iterationId, size, timestamp }`

      Event data for screenshot capture

      - `format: "jpeg" or "png"`

        - `"jpeg"`

        - `"png"`

      - `iterationId: string`

      - `size: number`

      - `timestamp: number`

    - `event: "browser:screenshot_captured"`

      - `"browser:screenshot_captured"`

  - `BrowserScreenshotCapturedImage object { data, event }`

    Envelope for the "browser:screenshot_captured_image" event from /v1/automate.

    - `data: object { image, iterationId, mediaType, timestamp }`

      Event data for screenshot image capture with full image data This event contains the complete screenshot and can be very large

      - `image: string`

      - `iterationId: string`

      - `mediaType: "image/jpeg" or "image/png"`

        - `"image/jpeg"`

        - `"image/png"`

      - `timestamp: number`

    - `event: "browser:screenshot_captured_image"`

      - `"browser:screenshot_captured_image"`

  - `CdpEndpointConnected object { data, event }`

    Envelope for the "cdp:endpoint_connected" event from /v1/automate.

    - `data: object { endpointIndex, iterationId, timestamp, total }`

      Event data when a CDP endpoint is successfully connected to

      - `endpointIndex: number`

        1-based index of the endpoint that connected

      - `iterationId: string`

      - `timestamp: number`

      - `total: number`

        Total number of configured CDP endpoints

    - `event: "cdp:endpoint_connected"`

      - `"cdp:endpoint_connected"`

  - `CdpEndpointCycle object { data, event }`

    Envelope for the "cdp:endpoint_cycle" event from /v1/automate.

    - `data: object { attempt, error, iterationId, 2 more }`

      Event data when a CDP endpoint fails and the next one is being tried

      - `attempt: number`

        1-based index of the endpoint attempt that failed

      - `error: string`

        Sanitized error identifier from the failed connection attempt (error.name, not error.message — full messages may contain endpoint URLs)

      - `iterationId: string`

      - `timestamp: number`

      - `total: number`

        Total number of configured CDP endpoints

    - `event: "cdp:endpoint_cycle"`

      - `"cdp:endpoint_cycle"`

  - `Complete object { data, event }`

    Envelope for the "complete" event from /v1/automate.

    - `data: object { finalAnswer, stats, success, error }`

      Payload for the `complete` stream event. Structurally identical to TaskExecutionResult from webAgent.ts — the `complete` event's data is the agent's final TaskExecutionResult, stringified onto the SSE stream.

      - `finalAnswer: string`

        Final answer or result from the agent

      - `stats: object { actions, durationMs, endTime, 2 more }`

        Execution statistics

        - `actions: number`

        - `durationMs: number`

        - `endTime: number`

        - `iterations: number`

        - `startTime: number`

      - `success: boolean`

        Whether the task completed successfully

      - `error: optional object { code, message }`

        Structured error information for failed tasks

        - `code: "TASK_ABORTED" or "MAX_ITERATIONS" or "MAX_ERRORS" or "TASK_FAILED"`

          Error codes for task failures

          - `"TASK_ABORTED"`

          - `"MAX_ITERATIONS"`

          - `"MAX_ERRORS"`

          - `"TASK_FAILED"`

        - `message: string`

          Human-readable error message

    - `event: "complete"`

      - `"complete"`

  - `Done object { data, event }`

    Envelope for the "done" event from /v1/automate.

    - `data: map[unknown]`

      Payload for the `done` stream terminator event. Empty today; reserved for future metadata.

    - `event: "done"`

      - `"done"`

  - `Error object { data, event }`

    Envelope for the "error" event from /v1/automate.

    - `data: object { error, success }`

      Payload for the top-level `error` stream event. Emitted when an uncaught error escapes the task runner. Mirrors `ErrorResponse` from the server package's `taskRunner.ts` — kept structurally aligned so schema and runtime stay consistent. Distinct from agent-level error events like `ai:generation:error` and `task:validation_error`, which are emitted through the normal event emitter during the agent loop.

      - `error: object { code, message, timestamp }`

        - `code: string`

        - `message: string`

        - `timestamp: string`

          ISO-8601 timestamp

      - `success: false`

        - `false`

    - `event: "error"`

      - `"error"`

  - `InteractiveFormDataError object { data, event }`

    Envelope for the "interactive:form_data:error" event from /v1/automate.

    - `data: object { fieldErrors, fields, formDescription, 5 more }`

      Event data when form validation fails and the agent re-requests data. Carries both the error context and the fields that need new values. Callers respond to this the same way as a request event.

      - `fieldErrors: map[string]`

        Per-field error messages from validation (field ref -> error text)

      - `fields: array of object { fieldType, label, ref, 4 more }`

        - `fieldType: "text" or "email" or "phone" or 8 more`

          Semantic field type

          - `"text"`

          - `"email"`

          - `"phone"`

          - `"date"`

          - `"number"`

          - `"select"`

          - `"checkbox"`

          - `"radio"`

          - `"textarea"`

          - `"password"`

          - `"other"`

        - `label: string`

          The field's visible label

        - `ref: string`

          Element ref from the accessibility tree (e.g., "E42")

        - `required: boolean`

          Whether this field must be filled

        - `currentValue: optional string`

          Current value if already partially filled

        - `description: optional string`

          Additional context (e.g., validation error message on re-request)

        - `options: optional array of string`

          Available options for select/radio fields

      - `formDescription: string`

      - `iterationId: string`

      - `pageTitle: string`

      - `pageUrl: string`

      - `requestId: string`

      - `timestamp: number`

    - `event: "interactive:form_data:error"`

      - `"interactive:form_data:error"`

  - `InteractiveFormDataRequest object { data, event }`

    Envelope for the "interactive:form_data:request" event from /v1/automate.

    - `data: object { fields, formDescription, iterationId, 4 more }`

      Event data when the agent requests user data for form fields

      - `fields: array of object { fieldType, label, ref, 4 more }`

        - `fieldType: "text" or "email" or "phone" or 8 more`

          Semantic field type

          - `"text"`

          - `"email"`

          - `"phone"`

          - `"date"`

          - `"number"`

          - `"select"`

          - `"checkbox"`

          - `"radio"`

          - `"textarea"`

          - `"password"`

          - `"other"`

        - `label: string`

          The field's visible label

        - `ref: string`

          Element ref from the accessibility tree (e.g., "E42")

        - `required: boolean`

          Whether this field must be filled

        - `currentValue: optional string`

          Current value if already partially filled

        - `description: optional string`

          Additional context (e.g., validation error message on re-request)

        - `options: optional array of string`

          Available options for select/radio fields

      - `formDescription: string`

      - `iterationId: string`

      - `pageTitle: string`

      - `pageUrl: string`

      - `requestId: string`

      - `timestamp: number`

    - `event: "interactive:form_data:request"`

      - `"interactive:form_data:request"`

  - `SystemDebugCompression object { data, event }`

    Envelope for the "system:debug_compression" event from /v1/automate.

    - `data: object { compressedSize, compressionPercent, iterationId, 2 more }`

      Event data for compression debug info

      - `compressedSize: number`

      - `compressionPercent: number`

      - `iterationId: string`

      - `originalSize: number`

      - `timestamp: number`

    - `event: "system:debug_compression"`

      - `"system:debug_compression"`

  - `SystemDebugMessage object { data, event }`

    Envelope for the "system:debug_message" event from /v1/automate.

    - `data: object { iterationId, messages, timestamp }`

      Event data for message debug info

      - `iterationId: string`

      - `messages: array of unknown`

      - `timestamp: number`

    - `event: "system:debug_message"`

      - `"system:debug_message"`

  - `TaskAborted object { data, event }`

    Envelope for the "task:aborted" event from /v1/automate.

    - `data: object { finalAnswer, iterationId, reason, timestamp }`

      Event data when a task is aborted

      - `finalAnswer: string`

      - `iterationId: string`

      - `reason: string`

      - `timestamp: number`

    - `event: "task:aborted"`

      - `"task:aborted"`

  - `TaskCompleted object { data, event }`

    Envelope for the "task:completed" event from /v1/automate.

    - `data: object { finalAnswer, iterationId, timestamp, success }`

      Event data when a task is completed

      - `finalAnswer: string`

      - `iterationId: string`

      - `timestamp: number`

      - `success: optional boolean`

    - `event: "task:completed"`

      - `"task:completed"`

  - `TaskMetrics object { data, event }`

    Envelope for the "task:metrics" event from /v1/automate.

    - `data: object { aiGenerationCount, aiGenerationErrorCount, eventCounts, 5 more }`

      - `aiGenerationCount: number`

      - `aiGenerationErrorCount: number`

      - `eventCounts: map[number]`

      - `iterationId: string`

      - `stepCount: number`

      - `timestamp: number`

      - `totalInputTokens: number`

      - `totalOutputTokens: number`

    - `event: "task:metrics"`

      - `"task:metrics"`

  - `TaskMetricsIncremental object { data, event }`

    Envelope for the "task:metrics_incremental" event from /v1/automate.

    - `data: object { aiGenerationCount, aiGenerationErrorCount, eventCounts, 5 more }`

      - `aiGenerationCount: number`

      - `aiGenerationErrorCount: number`

      - `eventCounts: map[number]`

      - `iterationId: string`

      - `stepCount: number`

      - `timestamp: number`

      - `totalInputTokens: number`

      - `totalOutputTokens: number`

    - `event: "task:metrics_incremental"`

      - `"task:metrics_incremental"`

  - `TaskSetup object { data, event }`

    Envelope for the "task:setup" event from /v1/automate.

    - `data: object { browserName, iterationId, task, 14 more }`

      Event data when a task is setup

      - `browserName: string`

      - `iterationId: string`

      - `task: string`

      - `timestamp: number`

      - `data: optional unknown`

      - `guardrails: optional string`

      - `hasApiKey: optional boolean`

      - `keySource: optional "global" or "env" or "not_set"`

        - `"global"`

        - `"env"`

        - `"not_set"`

      - `model: optional string`

      - `provider: optional string`

      - `proxy: optional string`

      - `pwCdpEndpoint: optional string`

      - `pwCdpEndpointCount: optional number`

        Total number of CDP endpoints configured (index, not URLs)

      - `pwCdpEndpoints: optional array of string`

      - `pwEndpoint: optional string`

      - `url: optional string`

      - `vision: optional boolean`

    - `event: "task:setup"`

      - `"task:setup"`

  - `TaskStarted object { data, event }`

    Envelope for the "task:started" event from /v1/automate.

    - `data: object { iterationId, plan, successCriteria, 4 more }`

      Event data when a task is started

      - `iterationId: string`

      - `plan: string`

      - `successCriteria: string`

      - `task: string`

      - `timestamp: number`

      - `url: string`

      - `actionItems: optional array of string`

    - `event: "task:started"`

      - `"task:started"`

  - `TaskTraceContext object { data, event }`

    Envelope for the "task:trace_context" event from /v1/automate.

    - `data: object { traceId }`

      Payload for the task:trace_context event. Carries the OpenTelemetry trace ID for this /v1/automate request so consumers can deep-link to distributed-tracing UIs (e.g. Cloud Trace, Cloud Logging) for the run.

      - `traceId: string`

        W3C trace ID — 32-character lowercase hexadecimal string.

    - `event: "task:trace_context"`

      - `"task:trace_context"`

  - `TaskValidated object { data, event }`

    Envelope for the "task:validated" event from /v1/automate.

    - `data: object { completionQuality, finalAnswer, iterationId, 3 more }`

      Event data for task validation

      - `completionQuality: "failed" or "partial" or "complete" or "excellent"`

        - `"failed"`

        - `"partial"`

        - `"complete"`

        - `"excellent"`

      - `finalAnswer: string`

      - `iterationId: string`

      - `observation: string`

      - `timestamp: number`

      - `feedback: optional string`

    - `event: "task:validated"`

      - `"task:validated"`

  - `TaskValidationError object { data, event }`

    Envelope for the "task:validation_error" event from /v1/automate.

    - `data: object { errors, iterationId, rawResponse, 2 more }`

      Event data for validation errors during action response processing

      - `errors: array of string`

      - `iterationId: string`

      - `rawResponse: unknown`

      - `retryCount: number`

      - `timestamp: number`

    - `event: "task:validation_error"`

      - `"task:validation_error"`

### Example

```http
curl https://api.tabstack.ai/v1/automate \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TABSTACK_API_KEY" \
    --max-time 600 \
    -d "{
          \"task\": \"Find the top 3 trending repositories and extract their names, descriptions, and star counts\",
          \"guardrails\": \"browse and extract only, don't interact with repositories\",
          \"maxIterations\": 50,
          \"maxValidationAttempts\": 3,
          \"url\": \"https://github.com/trending\"
        }"
```

#### Response

```json
event: start
data: {"task": "Find the top 3 trending repositories", "url": "https://github.com/trending"}

event: agent:processing
data: {"operation": "Creating task plan", "hasScreenshot": false}

event: browser:navigated
data: {"title": "Trending - GitHub", "url": "https://github.com/trending"}

event: agent:extracted
data: {"extractedData": "[{\"name\": \"awesome-ai\", \"stars\": \"45.2k\"}]"}

event: task:completed
data: {"success": true, "finalAnswer": "Top 3 trending repos extracted"}

event: complete
data: {"success": true}

event: done
data: {}
```

## Submit Input Response

**post** `/automate/{requestID}/input`

Submit a response to an interactive form data request from an in-progress automation task. When the AI agent encounters a form requiring user data, it emits an `interactive:form_data:request` or `interactive:form_data:error` SSE event containing a `requestId`. Use this endpoint to provide the requested data or cancel the request.

**Lifecycle:**

- Input requests expire after 2 minutes by default
- Expired or already-answered requests return `410 Gone`
- Successful submissions return `202 Accepted` (fire-and-forget from caller's perspective)

### Path Parameters

- `requestID: string`

### Body Parameters

- `cancelled: optional boolean`

  Set to true to cancel/decline the request

- `fields: optional array of object { ref, value }`

  Field values as array of {ref, value} pairs (required when not cancelled)

  - `ref: optional string`

  - `value: optional string`

### Returns

- `status: optional string`

### Example

```http
curl https://api.tabstack.ai/v1/automate/$REQUEST_ID/input \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TABSTACK_API_KEY" \
    -d '{}'
```

#### Response

```json
{
  "status": "accepted"
}
```

## Research

**post** `/research`

Execute AI-powered research queries that search the web, analyze sources, and synthesize comprehensive answers. This endpoint **always streams** responses using Server-Sent Events (SSE).

**Streaming Response:**

- All responses are streamed using Server-Sent Events (`text/event-stream`)
- Real-time progress updates as research progresses through phases

**Research Modes:**

- `fast` - Quick answers with minimal web searches (default)
- `balanced` - Standard research with multiple iterations

**Use Cases:**

- Answering complex questions with cited sources
- Synthesizing information from multiple web sources
- Research reports on specific topics
- Fact-checking and verification tasks

### Body Parameters

- `query: string`

  The research query or question to answer. Maximum 10,000 characters.

- `fetch_timeout: optional number`

  Timeout in seconds for fetching web pages

- `mode: optional "fast" or "balanced"`

  Research mode: fast (quick answers, default), balanced (standard research)

  - `"fast"`

  - `"balanced"`

- `nocache: optional boolean`

  Skip cache and force fresh research

### Returns

- `ResearchEvent = object { data, event }  or object { data, event }  or object { data, event }  or 20 more`

  A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.

  - `AnalyzingEnd object { data, event }`

    Envelope for the "analyzing:end" event from /v1/research.

    - `data: object { analyzed, failed, iteration, 3 more }`

      - `analyzed: number`

      - `failed: number`

      - `iteration: number`

      - `message: string`

      - `samples: array of object { domain, title, url, 4 more }`

        - `domain: string`

        - `title: string`

        - `url: string`

        - `urlSource: "user-input" or "search-result" or "extracted-link"`

          URL source tracking - where a URL came from

          - `"user-input"`

          - `"search-result"`

          - `"extracted-link"`

        - `relevance: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `reliability: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `summary: optional string`

      - `timestamp: number`

    - `event: "analyzing:end"`

      - `"analyzing:end"`

  - `AnalyzingStart object { data, event }`

    Envelope for the "analyzing:start" event from /v1/research.

    - `data: object { iteration, message, pageCount, timestamp }`

      - `iteration: number`

      - `message: string`

      - `pageCount: number`

      - `timestamp: number`

    - `event: "analyzing:start"`

      - `"analyzing:start"`

  - `Complete object { data, event }`

    Envelope for the "complete" event from /v1/research.

    - `data: object { message, metadata, report, timestamp }`

      complete - Research finished successfully

      - `message: string`

      - `metadata: object { executedQueries, mode, prompt, 11 more }`

        Research metadata

        Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.

        - `executedQueries: array of array of string`

        - `mode: "fast" or "balanced" or "deep" or 2 more`

          Research mode determines depth, thinking budget, and quality controls

          Modes (in order of cost/thoroughness):

          - **fast**: Quick answers with minimal validation (~$2, 1 iteration, no judge)
          - **balanced**: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
          - **deep**: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
          - **max**: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
          - **ultra**: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)

          - `"fast"`

          - `"balanced"`

          - `"deep"`

          - `"max"`

          - `"ultra"`

        - `prompt: string`

        - `queryComplexity: "simple" or "moderate" or "complex"`

          - `"simple"`

          - `"moderate"`

          - `"complex"`

        - `researchObjective: string`

        - `researchPlan: string`

        - `researchQuestions: array of string`

        - `totalPagesAnalyzed: number`

          Total pages analyzed across all iterations

        - `citedPages: optional array of object { id, claims, sourceQueries, 9 more }`

          Pages cited in the report, ordered by first citation appearance

          - `id: string`

          - `claims: array of string`

          - `sourceQueries: array of string`

          - `url: string`

          - `depth: optional number`

          - `fullText: optional string`

            Full page text (fetched markdown or search excerpts). Only populated when `includeFullText: true` in ResearchOptions.

            - Fast mode: Parallel API excerpts (~5000 chars)
            - Other modes: Fetched page markdown

          - `parentUrl: optional string`

          - `relevance: optional "low" or "medium" or "high"`

            - `"low"`

            - `"medium"`

            - `"high"`

          - `reliability: optional "low" or "medium" or "high"`

            - `"low"`

            - `"medium"`

            - `"high"`

          - `summary: optional string`

            LLM-generated summary. Undefined in fast mode (no content analysis).

          - `title: optional string`

          - `urlSource: optional "user-input" or "search-result" or "extracted-link"`

            URL source tracking - where a URL came from

            - `"user-input"`

            - `"search-result"`

            - `"extracted-link"`

        - `gapEvaluations: optional array of object { gapDescription, questionAssessments, researchCoverage, 3 more }`

          - `gapDescription: string`

            Based on unanswered/partial questions, what specific information is still needed?

          - `questionAssessments: array of V1ResearchQuestionAssessment`

            Assessment of each research question's status and findings

            - `findings: string`

              What we learned (if answered/partial) or what's missing (if unanswered)

            - `question: string`

              The research question being assessed

            - `status: "answered" or "partial" or "unanswered"`

              Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)

              - `"answered"`

              - `"partial"`

              - `"unanswered"`

          - `researchCoverage: "Light" or "Moderate" or "Solid" or "Comprehensive"`

            Research coverage level - assesses quality across all questions.

            Hierarchy: Light < Moderate < Solid < Comprehensive

            - **Light**: Basic info on some questions, most need more depth → Continue
            - **Moderate**: Multiple questions answered, some remain partial → Continue
            - **Solid**: Most questions well-answered with validated sources → Sufficient to stop
            - **Comprehensive**: All questions thoroughly answered, exceptional depth → Definitely stop

            - `"Light"`

            - `"Moderate"`

            - `"Solid"`

            - `"Comprehensive"`

          - `shouldContinueResearch: boolean`

            Explicit decision: should research continue with another iteration?

            - Considers: how many questions unanswered/partial, coverage for mode, remaining iterations
            - Drives query generation: true → generate queries, false → stop researching

          - `newResearchQuestions: optional array of string`

            New research questions to add (optional, use sparingly)

            - Only if original decomposition missed something critical
            - Maximum 2-3 new questions total across all iterations
            - Most iterations should return empty array or omit this field

          - `searchQueries: optional array of string`

            Search queries to address identified gaps (only when shouldContinueResearch is true)

            - Target unanswered questions first, then partial questions
            - 3-10 targeted queries if shouldContinueResearch is true
            - Omit or provide empty array if shouldContinueResearch is false

        - `judgments: optional array of object { approved, observation, score, feedback }`

          - `approved: boolean`

          - `observation: string`

          - `score: number`

          - `feedback: optional string`

        - `metrics: optional object { cachedFetches, cachedSearches, fetches, 7 more }`

          Complete research metrics

          - `cachedFetches: number`

            Cached fetch count (subset of fetches)

          - `cachedSearches: map[number]`

            Cached search count by provider name (subset of searches)

          - `fetches: number`

            Fetch count (number of pages fetched)

          - `iterations: number`

            Number of research iterations performed

          - `phases: map[object { duration } ]`

            Phase timings with duration in milliseconds

            - `duration: number`

          - `robotsBlocked: number`

            Number of URLs blocked by robots.txt

          - `searches: map[number]`

            Search count by provider name (e.g., "bright-data", "parallel")

          - `successRates: object { analyzes, fetches, searches }`

            Success rate metrics

            - `analyzes: number`

            - `fetches: number`

            - `searches: number`

          - `tokens: map[object { input, output } ]`

            Token usage by model ID (e.g., "gemini-2.5-flash")

            - `input: number`

            - `output: number`

          - `totalDuration: number`

            Total duration in milliseconds

        - `outline: optional object { directAnswer, keyTakeaways, outline, relevantSourceIds }`

          Report outline from research writer

          - `directAnswer: string`

          - `keyTakeaways: array of string`

          - `outline: string`

          - `relevantSourceIds: array of string`

        - `urlSources: optional object { extractedLinks, searchResults, userProvided }`

          - `extractedLinks: number`

          - `searchResults: number`

          - `userProvided: number`

      - `report: string`

      - `timestamp: number`

    - `event: "complete"`

      - `"complete"`

  - `Error object { data, event }`

    Envelope for the "error" event from /v1/research.

    - `data: object { error, message, timestamp, 2 more }`

      error - Research failed

      - `error: object { message, name, stack }`

        - `message: string`

        - `name: string`

        - `stack: optional string`

      - `message: string`

      - `timestamp: number`

      - `activity: optional "prefetching" or "planning" or "iteration" or 7 more`

        Activity types for research workflow

        - `"prefetching"`

        - `"planning"`

        - `"iteration"`

        - `"searching"`

        - `"analyzing"`

        - `"following"`

        - `"evaluating"`

        - `"outlining"`

        - `"writing"`

        - `"judging"`

      - `iteration: optional number`

    - `event: "error"`

      - `"error"`

  - `EvaluatingEnd object { data, event }`

    Envelope for the "evaluating:end" event from /v1/research.

    - `data: object { coverage, gaps, iteration, 5 more }`

      - `coverage: "Light" or "Moderate" or "Solid" or "Comprehensive"`

        - `"Light"`

        - `"Moderate"`

        - `"Solid"`

        - `"Comprehensive"`

      - `gaps: string`

      - `iteration: number`

      - `message: string`

      - `nextQueries: array of string`

      - `questionAssessments: array of V1ResearchQuestionAssessment`

        - `findings: string`

          What we learned (if answered/partial) or what's missing (if unanswered)

        - `question: string`

          The research question being assessed

        - `status: "answered" or "partial" or "unanswered"`

          Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)

      - `shouldContinue: boolean`

      - `timestamp: number`

    - `event: "evaluating:end"`

      - `"evaluating:end"`

  - `EvaluatingStart object { data, event }`

    Envelope for the "evaluating:start" event from /v1/research.

    - `data: object { iteration, message, pagesAnalyzed, 2 more }`

      - `iteration: number`

      - `message: string`

      - `pagesAnalyzed: number`

        Total pages analyzed so far (including this iteration)

      - `questionCount: number`

        Number of research questions being assessed

      - `timestamp: number`

    - `event: "evaluating:start"`

      - `"evaluating:start"`

  - `FollowingEnd object { data, event }`

    Envelope for the "following:end" event from /v1/research.

    - `data: object { failed, followed, iteration, 3 more }`

      - `failed: number`

      - `followed: number`

      - `iteration: number`

      - `message: string`

      - `samples: array of object { domain, title, url, 4 more }`

        - `domain: string`

        - `title: string`

        - `url: string`

        - `urlSource: "user-input" or "search-result" or "extracted-link"`

          URL source tracking - where a URL came from

          - `"user-input"`

          - `"search-result"`

          - `"extracted-link"`

        - `relevance: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `reliability: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `summary: optional string`

      - `timestamp: number`

    - `event: "following:end"`

      - `"following:end"`

  - `FollowingStart object { data, event }`

    Envelope for the "following:start" event from /v1/research.

    - `data: object { iteration, linkCount, message, timestamp }`

      - `iteration: number`

      - `linkCount: number`

      - `message: string`

      - `timestamp: number`

    - `event: "following:start"`

      - `"following:start"`

  - `IterationEnd object { data, event }`

    Envelope for the "iteration:end" event from /v1/research.

    - `data: object { isLast, iteration, message, 2 more }`

      - `isLast: boolean`

        Whether this is the final iteration

      - `iteration: number`

      - `message: string`

      - `timestamp: number`

      - `stopReason: optional "max_iterations" or "coverage_sufficient"`

        Why research iterations stopped (only present when isLast is true)

        - `"max_iterations"`

        - `"coverage_sufficient"`

    - `event: "iteration:end"`

      - `"iteration:end"`

  - `IterationStart object { data, event }`

    Envelope for the "iteration:start" event from /v1/research.

    - `data: object { iteration, maxIterations, message, 2 more }`

      - `iteration: number`

      - `maxIterations: number`

        Maximum iterations for this research mode

      - `message: string`

      - `queries: array of string`

        Search queries to execute in this iteration

      - `timestamp: number`

    - `event: "iteration:start"`

      - `"iteration:start"`

  - `JudgingEnd object { data, event }`

    Envelope for the "judging:end" event from /v1/research.

    - `data: object { approved, attempt, message, 3 more }`

      - `approved: boolean`

      - `attempt: number`

      - `message: string`

      - `score: number`

      - `timestamp: number`

      - `feedback: optional string`

    - `event: "judging:end"`

      - `"judging:end"`

  - `JudgingStart object { data, event }`

    Envelope for the "judging:start" event from /v1/research.

    - `data: object { attempt, maxAttempts, message, timestamp }`

      - `attempt: number`

      - `maxAttempts: number`

        Maximum attempts allowed (1 + maxRevisions)

      - `message: string`

      - `timestamp: number`

    - `event: "judging:start"`

      - `"judging:start"`

  - `OutliningEnd object { data, event }`

    Envelope for the "outlining:end" event from /v1/research.

    - `data: object { message, sourcesSelected, timestamp }`

      - `message: string`

      - `sourcesSelected: number`

      - `timestamp: number`

    - `event: "outlining:end"`

      - `"outlining:end"`

  - `OutliningStart object { data, event }`

    Envelope for the "outlining:start" event from /v1/research.

    - `data: object { message, pagesAnalyzed, qualityPageCount, timestamp }`

      - `message: string`

      - `pagesAnalyzed: number`

        Total pages analyzed across all iterations

      - `qualityPageCount: number`

        Pages that meet quality threshold (medium+ relevance and reliability)

      - `timestamp: number`

    - `event: "outlining:start"`

      - `"outlining:start"`

  - `PlanningEnd object { data, event }`

    Envelope for the "planning:end" event from /v1/research.

    - `data: object { complexity, message, objective, 4 more }`

      - `complexity: "simple" or "moderate" or "complex"`

        - `"simple"`

        - `"moderate"`

        - `"complex"`

      - `message: string`

      - `objective: string`

      - `plan: string`

      - `queries: array of string`

      - `questions: array of string`

      - `timestamp: number`

    - `event: "planning:end"`

      - `"planning:end"`

  - `PlanningStart object { data, event }`

    Envelope for the "planning:start" event from /v1/research.

    - `data: object { hasPrefetchedContext, message, timestamp }`

      - `hasPrefetchedContext: boolean`

        Whether prefetched user-provided URLs exist for context

      - `message: string`

      - `timestamp: number`

    - `event: "planning:start"`

      - `"planning:start"`

  - `PrefetchingEnd object { data, event }`

    Envelope for the "prefetching:end" event from /v1/research.

    - `data: object { failed, fetched, message, timestamp }`

      - `failed: number`

      - `fetched: number`

      - `message: string`

      - `timestamp: number`

    - `event: "prefetching:end"`

      - `"prefetching:end"`

  - `PrefetchingStart object { data, event }`

    Envelope for the "prefetching:start" event from /v1/research.

    - `data: object { message, timestamp, urlCount, urls }`

      - `message: string`

      - `timestamp: number`

      - `urlCount: number`

      - `urls: array of string`

    - `event: "prefetching:start"`

      - `"prefetching:start"`

  - `SearchingEnd object { data, event }`

    Envelope for the "searching:end" event from /v1/research.

    - `data: object { iteration, message, timestamp, 2 more }`

      - `iteration: number`

      - `message: string`

      - `timestamp: number`

      - `urlsFound: number`

      - `urlsNew: number`

    - `event: "searching:end"`

      - `"searching:end"`

  - `SearchingStart object { data, event }`

    Envelope for the "searching:start" event from /v1/research.

    - `data: object { iteration, message, queries, timestamp }`

      - `iteration: number`

      - `message: string`

      - `queries: array of string`

      - `timestamp: number`

    - `event: "searching:start"`

      - `"searching:start"`

  - `Start object { data, event }`

    Envelope for the "start" event from /v1/research.

    - `data: object { message, timestamp }`

      start - Research begins

      - `message: string`

      - `timestamp: number`

    - `event: "start"`

      - `"start"`

  - `WritingEnd object { data, event }`

    Envelope for the "writing:end" event from /v1/research.

    - `data: object { attempt, message, timestamp }`

      - `attempt: number`

      - `message: string`

      - `timestamp: number`

    - `event: "writing:end"`

      - `"writing:end"`

  - `WritingStart object { data, event }`

    Envelope for the "writing:start" event from /v1/research.

    - `data: object { attempt, isRevision, maxAttempts, 3 more }`

      - `attempt: number`

      - `isRevision: boolean`

        Whether this is a revision attempt (attempt > 1)

      - `maxAttempts: number`

        Maximum attempts allowed (1 + maxRevisions)

      - `message: string`

      - `timestamp: number`

      - `previousScore: optional number`

        Previous judgment score if this is a revision

    - `event: "writing:start"`

      - `"writing:start"`

### Example

```http
curl https://api.tabstack.ai/v1/research \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TABSTACK_API_KEY" \
    --max-time 600 \
    -d '{
          "query": "What are the latest developments in quantum computing?",
          "fetch_timeout": 30,
          "mode": "fast"
        }'
```

## Domain Types

### Automate Event

- `AutomateEvent = object { data, event }  or object { data, event }  or object { data, event }  or 30 more`

  A Server-Sent Event from /v1/automate. Typed discriminated union keyed on event.

  - `AgentAction object { data, event }`

    Envelope for the "agent:action" event from /v1/automate.

    - `data: object { action, iterationId, timestamp, 2 more }`

      Event data for action execution

      - `action: string`

      - `iterationId: string`

      - `timestamp: number`

      - `ref: optional string`

      - `value: optional string`

    - `event: "agent:action"`

      - `"agent:action"`

  - `AgentExtracted object { data, event }`

    Envelope for the "agent:extracted" event from /v1/automate.

    - `data: object { extractedData, iterationId, timestamp }`

      Event data for extracted data

      - `extractedData: string`

      - `iterationId: string`

      - `timestamp: number`

    - `event: "agent:extracted"`

      - `"agent:extracted"`

  - `AgentProcessing object { data, event }`

    Envelope for the "agent:processing" event from /v1/automate.

    - `data: object { hasScreenshot, iterationId, operation, timestamp }`

      Event data for when the agent is waiting for model generation

      - `hasScreenshot: boolean`

      - `iterationId: string`

      - `operation: string`

      - `timestamp: number`

    - `event: "agent:processing"`

      - `"agent:processing"`

  - `AgentReasoned object { data, event }`

    Envelope for the "agent:reasoned" event from /v1/automate.

    - `data: object { iterationId, reasoning, timestamp }`

      Event data for agent reasoning

      - `iterationId: string`

      - `reasoning: string`

      - `timestamp: number`

    - `event: "agent:reasoned"`

      - `"agent:reasoned"`

  - `AgentStatus object { data, event }`

    Envelope for the "agent:status" event from /v1/automate.

    - `data: object { iterationId, message, timestamp }`

      Event data for status messages

      - `iterationId: string`

      - `message: string`

      - `timestamp: number`

    - `event: "agent:status"`

      - `"agent:status"`

  - `AgentStep object { data, event }`

    Envelope for the "agent:step" event from /v1/automate.

    - `data: object { currentIteration, iterationId, timestamp }`

      Event data for agent step tracking (each loop iteration)

      - `currentIteration: number`

      - `iterationId: string`

      - `timestamp: number`

    - `event: "agent:step"`

      - `"agent:step"`

  - `AgentWaiting object { data, event }`

    Envelope for the "agent:waiting" event from /v1/automate.

    - `data: object { iterationId, seconds, timestamp }`

      Event data for waiting notifications

      - `iterationId: string`

      - `seconds: number`

      - `timestamp: number`

    - `event: "agent:waiting"`

      - `"agent:waiting"`

  - `AIGeneration object { data, event }`

    Envelope for the "ai:generation" event from /v1/automate.

    - `data: object { finishReason, iterationId, prompt, 8 more }`

      Event data when AI generation occurs

      - `finishReason: "stop" or "length" or "content-filter" or 3 more`

        - `"stop"`

        - `"length"`

        - `"content-filter"`

        - `"tool-calls"`

        - `"error"`

        - `"other"`

      - `iterationId: string`

      - `prompt: string`

      - `schema: unknown`

      - `timestamp: number`

      - `usage: object { inputTokens, outputTokens, totalTokens }`

        - `inputTokens: optional number`

        - `outputTokens: optional number`

        - `totalTokens: optional number`

      - `messages: optional array of object { content, role, providerOptions }  or object { content, role, providerOptions }  or object { content, role, providerOptions }  or object { content, role, providerOptions }`

        - `System object { content, role, providerOptions }`

          A system message. It can contain system information.

          Note: using the "system" part of the prompt is strongly preferred to increase the resilience against prompt injection attacks, and because not all providers support several system messages.

          - `content: string`

          - `role: "system"`

            - `"system"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

        - `User object { content, role, providerOptions }`

          A user message. It can contain text or a combination of text and images.

          - `content: string or array of object { text, type, providerOptions }  or object { image, type, mediaType, providerOptions }  or object { data, mediaType, type, 2 more }`

            Content of a user message. It can be a string or an array of text and image parts.

            - `string`

            - `array of object { text, type, providerOptions }  or object { image, type, mediaType, providerOptions }  or object { data, mediaType, type, 2 more }`

              - `Text object { text, type, providerOptions }`

                Text content part of a prompt. It contains a string of text.

                - `text: string`

                  The text content.

                - `type: "text"`

                  - `"text"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `Image object { image, type, mediaType, providerOptions }`

                Image content part of a prompt. It contains an image.

                - `image: string or object { buffer, byteLength, byteOffset, 2 more }  or object { byteLength }  or V1GlobalBuffer`

                  Image data. Can either be:

                  - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
                  - URL: a URL that points to the image

                  - `string`

                  - `object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                  - `ByteLength object { byteLength }`

                    - `byteLength: number`

                  - `V1GlobalBuffer object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                - `type: "image"`

                  - `"image"`

                - `mediaType: optional string`

                  Optional IANA media type of the image.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `File object { data, mediaType, type, 2 more }`

                File content part of a prompt. It contains a file.

                - `data: string or object { buffer, byteLength, byteOffset, 2 more }  or object { byteLength }  or V1GlobalBuffer`

                  File data. Can either be:

                  - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
                  - URL: a URL that points to the image

                  - `string`

                  - `object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                  - `ByteLength object { byteLength }`

                    - `byteLength: number`

                  - `V1GlobalBuffer object { buffer, byteLength, byteOffset, 2 more }`

                - `mediaType: string`

                  IANA media type of the file.

                - `type: "file"`

                  - `"file"`

                - `filename: optional string`

                  Optional filename of the file.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

          - `role: "user"`

            - `"user"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

        - `Assistant object { content, role, providerOptions }`

          An assistant message. It can contain text, tool calls, or a combination of text and tool calls.

          - `content: string or array of object { text, type, providerOptions }  or object { data, mediaType, type, 2 more }  or object { text, type, providerOptions }  or 3 more`

            Content of an assistant message. It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.

            - `string`

            - `array of object { text, type, providerOptions }  or object { data, mediaType, type, 2 more }  or object { text, type, providerOptions }  or 3 more`

              - `Text object { text, type, providerOptions }`

                Text content part of a prompt. It contains a string of text.

                - `text: string`

                  The text content.

                - `type: "text"`

                  - `"text"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `File object { data, mediaType, type, 2 more }`

                File content part of a prompt. It contains a file.

                - `data: string or object { buffer, byteLength, byteOffset, 2 more }  or object { byteLength }  or V1GlobalBuffer`

                  File data. Can either be:

                  - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
                  - URL: a URL that points to the image

                  - `string`

                  - `object { buffer, byteLength, byteOffset, 2 more }`

                    - `buffer: object { byteLength }`

                      - `byteLength: number`

                    - `byteLength: number`

                    - `byteOffset: number`

                    - `BYTES_PER_ELEMENT: number`

                    - `length: number`

                  - `ByteLength object { byteLength }`

                    - `byteLength: number`

                  - `V1GlobalBuffer object { buffer, byteLength, byteOffset, 2 more }`

                - `mediaType: string`

                  IANA media type of the file.

                - `type: "file"`

                  - `"file"`

                - `filename: optional string`

                  Optional filename of the file.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `Reasoning object { text, type, providerOptions }`

                Reasoning content part of a prompt. It contains a reasoning.

                - `text: string`

                  The reasoning text.

                - `type: "reasoning"`

                  - `"reasoning"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `ToolCall object { input, toolCallId, toolName, 3 more }`

                Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).

                - `input: unknown`

                  Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.

                - `toolCallId: string`

                  ID of the tool call. This ID is used to match the tool call with the tool result.

                - `toolName: string`

                  Name of the tool that is being called.

                - `type: "tool-call"`

                  - `"tool-call"`

                - `providerExecuted: optional boolean`

                  Whether the tool call was executed by the provider.

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `ToolResult object { output, toolCallId, toolName, 2 more }`

                Tool result content part of a prompt. It contains the result of the tool call with the matching ID.

                - `output: object { type, value, providerOptions }  or object { type, value, providerOptions }  or object { type, providerOptions, reason }  or 3 more`

                  Result of the tool call. This is a JSON-serializable object.

                  - `Text object { type, value, providerOptions }`

                    - `type: "text"`

                      Text tool output that should be directly sent to the API.

                      - `"text"`

                    - `value: string`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `Json object { type, value, providerOptions }`

                    - `type: "json"`

                      - `"json"`

                    - `value: string or number or boolean or 2 more`

                      A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                      - `string`

                      - `number`

                      - `boolean`

                      - `map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `ExecutionDenied object { type, providerOptions, reason }`

                    - `type: "execution-denied"`

                      Type when the user has denied the execution of the tool call.

                      - `"execution-denied"`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `reason: optional string`

                      Optional reason for the execution denial.

                  - `ErrorText object { type, value, providerOptions }`

                    - `type: "error-text"`

                      - `"error-text"`

                    - `value: string`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `ErrorJson object { type, value, providerOptions }`

                    - `type: "error-json"`

                      - `"error-json"`

                    - `value: string or number or boolean or 2 more`

                      A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                      - `string`

                      - `number`

                      - `boolean`

                      - `map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                      Provider-specific options.

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                  - `Content object { type, value }`

                    - `type: "content"`

                      - `"content"`

                    - `value: array of object { text, type, providerOptions }  or object { data, mediaType, type }  or object { data, mediaType, type, 2 more }  or 6 more`

                      - `Text object { text, type, providerOptions }`

                        - `text: string`

                          Text content.

                        - `type: "text"`

                          - `"text"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `Media object { data, mediaType, type }`

                        - `data: string`

                        - `mediaType: string`

                        - `type: "media"`

                          Deprecated. Use image-data or file-data instead.

                          - `"media"`

                      - `FileData object { data, mediaType, type, 2 more }`

                        - `data: string`

                          Base-64 encoded media data.

                        - `mediaType: string`

                          IANA media type.

                        - `type: "file-data"`

                          - `"file-data"`

                        - `filename: optional string`

                          Optional filename of the file.

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `FileURL object { type, url, providerOptions }`

                        - `type: "file-url"`

                          - `"file-url"`

                        - `url: string`

                          URL of the file.

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `FileID object { fileId, type, providerOptions }`

                        - `fileId: string or map[string]`

                          ID of the file.

                          If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                          - `string`

                          - `map[string]`

                        - `type: "file-id"`

                          - `"file-id"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `ImageData object { data, mediaType, type, providerOptions }`

                        - `data: string`

                          Base-64 encoded image data.

                        - `mediaType: string`

                          IANA media type.

                        - `type: "image-data"`

                          Images that are referenced using base64 encoded data.

                          - `"image-data"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `ImageURL object { type, url, providerOptions }`

                        - `type: "image-url"`

                          Images that are referenced using a URL.

                          - `"image-url"`

                        - `url: string`

                          URL of the image.

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `ImageFileID object { fileId, type, providerOptions }`

                        - `fileId: string or map[string]`

                          Image that is referenced using a provider file id.

                          If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                          - `string`

                          - `map[string]`

                        - `type: "image-file-id"`

                          Images that are referenced using a provider file id.

                          - `"image-file-id"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                      - `Custom object { type, providerOptions }`

                        - `type: "custom"`

                          Custom content part. This can be used to implement provider-specific content parts.

                          - `"custom"`

                        - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                          Provider-specific options.

                          - `string`

                          - `number`

                          - `boolean`

                          - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                          - `array of string or number or boolean or 2 more`

                            - `string`

                            - `number`

                            - `boolean`

                            - `unknown`

                            - `array of unknown`

                - `toolCallId: string`

                  ID of the tool call that this result is associated with.

                - `toolName: string`

                  Name of the tool that generated this result.

                - `type: "tool-result"`

                  - `"tool-result"`

                - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                  Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                  - `string`

                  - `number`

                  - `boolean`

                  - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

                  - `array of string or number or boolean or 2 more`

                    - `string`

                    - `number`

                    - `boolean`

                    - `unknown`

                    - `array of unknown`

              - `ToolApprovalRequest object { approvalId, toolCallId, type }`

                Tool approval request prompt part.

                - `approvalId: string`

                  ID of the tool approval.

                - `toolCallId: string`

                  ID of the tool call that the approval request is for.

                - `type: "tool-approval-request"`

                  - `"tool-approval-request"`

          - `role: "assistant"`

            - `"assistant"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

        - `Tool object { content, role, providerOptions }`

          A tool message. It contains the result of one or more tool calls.

          - `content: array of object { output, toolCallId, toolName, 2 more }  or object { approvalId, approved, type, 2 more }`

            Content of a tool message. It is an array of tool result parts.

            - `ToolResult object { output, toolCallId, toolName, 2 more }`

              Tool result content part of a prompt. It contains the result of the tool call with the matching ID.

              - `output: object { type, value, providerOptions }  or object { type, value, providerOptions }  or object { type, providerOptions, reason }  or 3 more`

                Result of the tool call. This is a JSON-serializable object.

                - `Text object { type, value, providerOptions }`

                  - `type: "text"`

                    Text tool output that should be directly sent to the API.

                    - `"text"`

                  - `value: string`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `Json object { type, value, providerOptions }`

                  - `type: "json"`

                    - `"json"`

                  - `value: string or number or boolean or 2 more`

                    A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                    - `string`

                    - `number`

                    - `boolean`

                    - `map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `ExecutionDenied object { type, providerOptions, reason }`

                  - `type: "execution-denied"`

                    Type when the user has denied the execution of the tool call.

                    - `"execution-denied"`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                  - `reason: optional string`

                    Optional reason for the execution denial.

                - `ErrorText object { type, value, providerOptions }`

                  - `type: "error-text"`

                    - `"error-text"`

                  - `value: string`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `ErrorJson object { type, value, providerOptions }`

                  - `type: "error-json"`

                    - `"error-json"`

                  - `value: string or number or boolean or 2 more`

                    A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.

                    - `string`

                    - `number`

                    - `boolean`

                    - `map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                      - `array of string or number or boolean or 2 more`

                        - `string`

                        - `number`

                        - `boolean`

                        - `unknown`

                        - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                  - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                    Provider-specific options.

                    - `string`

                    - `number`

                    - `boolean`

                    - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                    - `array of string or number or boolean or 2 more`

                      - `string`

                      - `number`

                      - `boolean`

                      - `unknown`

                      - `array of unknown`

                - `Content object { type, value }`

                  - `type: "content"`

                    - `"content"`

                  - `value: array of object { text, type, providerOptions }  or object { data, mediaType, type }  or object { data, mediaType, type, 2 more }  or 6 more`

                    - `Text object { text, type, providerOptions }`

                      - `text: string`

                        Text content.

                      - `type: "text"`

                        - `"text"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `Media object { data, mediaType, type }`

                      - `data: string`

                      - `mediaType: string`

                      - `type: "media"`

                        Deprecated. Use image-data or file-data instead.

                        - `"media"`

                    - `FileData object { data, mediaType, type, 2 more }`

                      - `data: string`

                        Base-64 encoded media data.

                      - `mediaType: string`

                        IANA media type.

                      - `type: "file-data"`

                        - `"file-data"`

                      - `filename: optional string`

                        Optional filename of the file.

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `FileURL object { type, url, providerOptions }`

                      - `type: "file-url"`

                        - `"file-url"`

                      - `url: string`

                        URL of the file.

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `FileID object { fileId, type, providerOptions }`

                      - `fileId: string or map[string]`

                        ID of the file.

                        If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                        - `string`

                        - `map[string]`

                      - `type: "file-id"`

                        - `"file-id"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `ImageData object { data, mediaType, type, providerOptions }`

                      - `data: string`

                        Base-64 encoded image data.

                      - `mediaType: string`

                        IANA media type.

                      - `type: "image-data"`

                        Images that are referenced using base64 encoded data.

                        - `"image-data"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `ImageURL object { type, url, providerOptions }`

                      - `type: "image-url"`

                        Images that are referenced using a URL.

                        - `"image-url"`

                      - `url: string`

                        URL of the image.

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `ImageFileID object { fileId, type, providerOptions }`

                      - `fileId: string or map[string]`

                        Image that is referenced using a provider file id.

                        If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. 'openai' or 'anthropic'.

                        - `string`

                        - `map[string]`

                      - `type: "image-file-id"`

                        Images that are referenced using a provider file id.

                        - `"image-file-id"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                    - `Custom object { type, providerOptions }`

                      - `type: "custom"`

                        Custom content part. This can be used to implement provider-specific content parts.

                        - `"custom"`

                      - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                        Provider-specific options.

                        - `string`

                        - `number`

                        - `boolean`

                        - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

                        - `array of string or number or boolean or 2 more`

                          - `string`

                          - `number`

                          - `boolean`

                          - `unknown`

                          - `array of unknown`

              - `toolCallId: string`

                ID of the tool call that this result is associated with.

              - `toolName: string`

                Name of the tool that generated this result.

              - `type: "tool-result"`

                - `"tool-result"`

              - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

                Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

                - `string`

                - `number`

                - `boolean`

                - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

                  - `string`

                  - `number`

                  - `boolean`

                  - `unknown`

                  - `array of unknown`

                - `array of string or number or boolean or 2 more`

                  - `string`

                  - `number`

                  - `boolean`

                  - `unknown`

                  - `array of unknown`

            - `ToolApprovalResponse object { approvalId, approved, type, 2 more }`

              Tool approval response prompt part.

              - `approvalId: string`

                ID of the tool approval.

              - `approved: boolean`

                Flag indicating whether the approval was granted or denied.

              - `type: "tool-approval-response"`

                - `"tool-approval-response"`

              - `providerExecuted: optional boolean`

                Flag indicating whether the tool call is provider-executed. Only provider-executed tool approval responses should be sent to the model.

              - `reason: optional string`

                Optional reason for the approval or denial.

          - `role: "tool"`

            - `"tool"`

          - `providerOptions: optional map[map[string or number or boolean or 2 more]]`

            Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

            - `string`

            - `number`

            - `boolean`

            - `V1Alias922155206_411_476_922155206_0_129727 = map[string or number or boolean or 2 more]`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

            - `array of string or number or boolean or 2 more`

              - `string`

              - `number`

              - `boolean`

              - `unknown`

              - `array of unknown`

      - `object: optional unknown`

      - `providerMetadata: optional map[unknown]`

      - `temperature: optional number`

      - `warnings: optional array of unknown`

    - `event: "ai:generation"`

      - `"ai:generation"`

  - `AIGenerationError object { data, event }`

    Envelope for the "ai:generation:error" event from /v1/automate.

    - `data: object { error, iterationId, prompt, 3 more }`

      Event data when AI generation error occurs

      - `error: string`

      - `iterationId: string`

      - `prompt: string`

      - `schema: unknown`

      - `timestamp: number`

      - `messages: optional array of unknown`

    - `event: "ai:generation:error"`

      - `"ai:generation:error"`

  - `BrowserActionCompleted object { data, event }`

    Envelope for the "browser:action_completed" event from /v1/automate.

    - `data: object { iterationId, success, timestamp, error }`

      Event data for action results

      - `iterationId: string`

      - `success: boolean`

      - `timestamp: number`

      - `error: optional string`

    - `event: "browser:action_completed"`

      - `"browser:action_completed"`

  - `BrowserActionStarted object { data, event }`

    Envelope for the "browser:action_started" event from /v1/automate.

    - `data: object { action, iterationId, timestamp, 2 more }`

      Event data for action execution

      - `action: string`

      - `iterationId: string`

      - `timestamp: number`

      - `ref: optional string`

      - `value: optional string`

    - `event: "browser:action_started"`

      - `"browser:action_started"`

  - `BrowserNavigated object { data, event }`

    Envelope for the "browser:navigated" event from /v1/automate.

    - `data: object { iterationId, timestamp, title, url }`

      Event data when navigating to a page

      - `iterationId: string`

      - `timestamp: number`

      - `title: string`

      - `url: string`

    - `event: "browser:navigated"`

      - `"browser:navigated"`

  - `BrowserReconnected object { data, event }`

    Envelope for the "browser:reconnected" event from /v1/automate.

    - `data: object { endpointIndex, iterationId, startingUrl, 2 more }`

      Event data when the browser reconnects after a mid-task disconnect

      - `endpointIndex: number`

        1-based index of the CDP endpoint now in use

      - `iterationId: string`

      - `startingUrl: string`

        The original starting URL the agent is restarting execution from

      - `timestamp: number`

      - `total: number`

        Total number of configured CDP endpoints

    - `event: "browser:reconnected"`

      - `"browser:reconnected"`

  - `BrowserScreenshotCaptured object { data, event }`

    Envelope for the "browser:screenshot_captured" event from /v1/automate.

    - `data: object { format, iterationId, size, timestamp }`

      Event data for screenshot capture

      - `format: "jpeg" or "png"`

        - `"jpeg"`

        - `"png"`

      - `iterationId: string`

      - `size: number`

      - `timestamp: number`

    - `event: "browser:screenshot_captured"`

      - `"browser:screenshot_captured"`

  - `BrowserScreenshotCapturedImage object { data, event }`

    Envelope for the "browser:screenshot_captured_image" event from /v1/automate.

    - `data: object { image, iterationId, mediaType, timestamp }`

      Event data for screenshot image capture with full image data This event contains the complete screenshot and can be very large

      - `image: string`

      - `iterationId: string`

      - `mediaType: "image/jpeg" or "image/png"`

        - `"image/jpeg"`

        - `"image/png"`

      - `timestamp: number`

    - `event: "browser:screenshot_captured_image"`

      - `"browser:screenshot_captured_image"`

  - `CdpEndpointConnected object { data, event }`

    Envelope for the "cdp:endpoint_connected" event from /v1/automate.

    - `data: object { endpointIndex, iterationId, timestamp, total }`

      Event data when a CDP endpoint is successfully connected to

      - `endpointIndex: number`

        1-based index of the endpoint that connected

      - `iterationId: string`

      - `timestamp: number`

      - `total: number`

        Total number of configured CDP endpoints

    - `event: "cdp:endpoint_connected"`

      - `"cdp:endpoint_connected"`

  - `CdpEndpointCycle object { data, event }`

    Envelope for the "cdp:endpoint_cycle" event from /v1/automate.

    - `data: object { attempt, error, iterationId, 2 more }`

      Event data when a CDP endpoint fails and the next one is being tried

      - `attempt: number`

        1-based index of the endpoint attempt that failed

      - `error: string`

        Sanitized error identifier from the failed connection attempt (error.name, not error.message — full messages may contain endpoint URLs)

      - `iterationId: string`

      - `timestamp: number`

      - `total: number`

        Total number of configured CDP endpoints

    - `event: "cdp:endpoint_cycle"`

      - `"cdp:endpoint_cycle"`

  - `Complete object { data, event }`

    Envelope for the "complete" event from /v1/automate.

    - `data: object { finalAnswer, stats, success, error }`

      Payload for the `complete` stream event. Structurally identical to TaskExecutionResult from webAgent.ts — the `complete` event's data is the agent's final TaskExecutionResult, stringified onto the SSE stream.

      - `finalAnswer: string`

        Final answer or result from the agent

      - `stats: object { actions, durationMs, endTime, 2 more }`

        Execution statistics

        - `actions: number`

        - `durationMs: number`

        - `endTime: number`

        - `iterations: number`

        - `startTime: number`

      - `success: boolean`

        Whether the task completed successfully

      - `error: optional object { code, message }`

        Structured error information for failed tasks

        - `code: "TASK_ABORTED" or "MAX_ITERATIONS" or "MAX_ERRORS" or "TASK_FAILED"`

          Error codes for task failures

          - `"TASK_ABORTED"`

          - `"MAX_ITERATIONS"`

          - `"MAX_ERRORS"`

          - `"TASK_FAILED"`

        - `message: string`

          Human-readable error message

    - `event: "complete"`

      - `"complete"`

  - `Done object { data, event }`

    Envelope for the "done" event from /v1/automate.

    - `data: map[unknown]`

      Payload for the `done` stream terminator event. Empty today; reserved for future metadata.

    - `event: "done"`

      - `"done"`

  - `Error object { data, event }`

    Envelope for the "error" event from /v1/automate.

    - `data: object { error, success }`

      Payload for the top-level `error` stream event. Emitted when an uncaught error escapes the task runner. Mirrors `ErrorResponse` from the server package's `taskRunner.ts` — kept structurally aligned so schema and runtime stay consistent. Distinct from agent-level error events like `ai:generation:error` and `task:validation_error`, which are emitted through the normal event emitter during the agent loop.

      - `error: object { code, message, timestamp }`

        - `code: string`

        - `message: string`

        - `timestamp: string`

          ISO-8601 timestamp

      - `success: false`

        - `false`

    - `event: "error"`

      - `"error"`

  - `InteractiveFormDataError object { data, event }`

    Envelope for the "interactive:form_data:error" event from /v1/automate.

    - `data: object { fieldErrors, fields, formDescription, 5 more }`

      Event data when form validation fails and the agent re-requests data. Carries both the error context and the fields that need new values. Callers respond to this the same way as a request event.

      - `fieldErrors: map[string]`

        Per-field error messages from validation (field ref -> error text)

      - `fields: array of object { fieldType, label, ref, 4 more }`

        - `fieldType: "text" or "email" or "phone" or 8 more`

          Semantic field type

          - `"text"`

          - `"email"`

          - `"phone"`

          - `"date"`

          - `"number"`

          - `"select"`

          - `"checkbox"`

          - `"radio"`

          - `"textarea"`

          - `"password"`

          - `"other"`

        - `label: string`

          The field's visible label

        - `ref: string`

          Element ref from the accessibility tree (e.g., "E42")

        - `required: boolean`

          Whether this field must be filled

        - `currentValue: optional string`

          Current value if already partially filled

        - `description: optional string`

          Additional context (e.g., validation error message on re-request)

        - `options: optional array of string`

          Available options for select/radio fields

      - `formDescription: string`

      - `iterationId: string`

      - `pageTitle: string`

      - `pageUrl: string`

      - `requestId: string`

      - `timestamp: number`

    - `event: "interactive:form_data:error"`

      - `"interactive:form_data:error"`

  - `InteractiveFormDataRequest object { data, event }`

    Envelope for the "interactive:form_data:request" event from /v1/automate.

    - `data: object { fields, formDescription, iterationId, 4 more }`

      Event data when the agent requests user data for form fields

      - `fields: array of object { fieldType, label, ref, 4 more }`

        - `fieldType: "text" or "email" or "phone" or 8 more`

          Semantic field type

          - `"text"`

          - `"email"`

          - `"phone"`

          - `"date"`

          - `"number"`

          - `"select"`

          - `"checkbox"`

          - `"radio"`

          - `"textarea"`

          - `"password"`

          - `"other"`

        - `label: string`

          The field's visible label

        - `ref: string`

          Element ref from the accessibility tree (e.g., "E42")

        - `required: boolean`

          Whether this field must be filled

        - `currentValue: optional string`

          Current value if already partially filled

        - `description: optional string`

          Additional context (e.g., validation error message on re-request)

        - `options: optional array of string`

          Available options for select/radio fields

      - `formDescription: string`

      - `iterationId: string`

      - `pageTitle: string`

      - `pageUrl: string`

      - `requestId: string`

      - `timestamp: number`

    - `event: "interactive:form_data:request"`

      - `"interactive:form_data:request"`

  - `SystemDebugCompression object { data, event }`

    Envelope for the "system:debug_compression" event from /v1/automate.

    - `data: object { compressedSize, compressionPercent, iterationId, 2 more }`

      Event data for compression debug info

      - `compressedSize: number`

      - `compressionPercent: number`

      - `iterationId: string`

      - `originalSize: number`

      - `timestamp: number`

    - `event: "system:debug_compression"`

      - `"system:debug_compression"`

  - `SystemDebugMessage object { data, event }`

    Envelope for the "system:debug_message" event from /v1/automate.

    - `data: object { iterationId, messages, timestamp }`

      Event data for message debug info

      - `iterationId: string`

      - `messages: array of unknown`

      - `timestamp: number`

    - `event: "system:debug_message"`

      - `"system:debug_message"`

  - `TaskAborted object { data, event }`

    Envelope for the "task:aborted" event from /v1/automate.

    - `data: object { finalAnswer, iterationId, reason, timestamp }`

      Event data when a task is aborted

      - `finalAnswer: string`

      - `iterationId: string`

      - `reason: string`

      - `timestamp: number`

    - `event: "task:aborted"`

      - `"task:aborted"`

  - `TaskCompleted object { data, event }`

    Envelope for the "task:completed" event from /v1/automate.

    - `data: object { finalAnswer, iterationId, timestamp, success }`

      Event data when a task is completed

      - `finalAnswer: string`

      - `iterationId: string`

      - `timestamp: number`

      - `success: optional boolean`

    - `event: "task:completed"`

      - `"task:completed"`

  - `TaskMetrics object { data, event }`

    Envelope for the "task:metrics" event from /v1/automate.

    - `data: object { aiGenerationCount, aiGenerationErrorCount, eventCounts, 5 more }`

      - `aiGenerationCount: number`

      - `aiGenerationErrorCount: number`

      - `eventCounts: map[number]`

      - `iterationId: string`

      - `stepCount: number`

      - `timestamp: number`

      - `totalInputTokens: number`

      - `totalOutputTokens: number`

    - `event: "task:metrics"`

      - `"task:metrics"`

  - `TaskMetricsIncremental object { data, event }`

    Envelope for the "task:metrics_incremental" event from /v1/automate.

    - `data: object { aiGenerationCount, aiGenerationErrorCount, eventCounts, 5 more }`

      - `aiGenerationCount: number`

      - `aiGenerationErrorCount: number`

      - `eventCounts: map[number]`

      - `iterationId: string`

      - `stepCount: number`

      - `timestamp: number`

      - `totalInputTokens: number`

      - `totalOutputTokens: number`

    - `event: "task:metrics_incremental"`

      - `"task:metrics_incremental"`

  - `TaskSetup object { data, event }`

    Envelope for the "task:setup" event from /v1/automate.

    - `data: object { browserName, iterationId, task, 14 more }`

      Event data when a task is setup

      - `browserName: string`

      - `iterationId: string`

      - `task: string`

      - `timestamp: number`

      - `data: optional unknown`

      - `guardrails: optional string`

      - `hasApiKey: optional boolean`

      - `keySource: optional "global" or "env" or "not_set"`

        - `"global"`

        - `"env"`

        - `"not_set"`

      - `model: optional string`

      - `provider: optional string`

      - `proxy: optional string`

      - `pwCdpEndpoint: optional string`

      - `pwCdpEndpointCount: optional number`

        Total number of CDP endpoints configured (index, not URLs)

      - `pwCdpEndpoints: optional array of string`

      - `pwEndpoint: optional string`

      - `url: optional string`

      - `vision: optional boolean`

    - `event: "task:setup"`

      - `"task:setup"`

  - `TaskStarted object { data, event }`

    Envelope for the "task:started" event from /v1/automate.

    - `data: object { iterationId, plan, successCriteria, 4 more }`

      Event data when a task is started

      - `iterationId: string`

      - `plan: string`

      - `successCriteria: string`

      - `task: string`

      - `timestamp: number`

      - `url: string`

      - `actionItems: optional array of string`

    - `event: "task:started"`

      - `"task:started"`

  - `TaskTraceContext object { data, event }`

    Envelope for the "task:trace_context" event from /v1/automate.

    - `data: object { traceId }`

      Payload for the task:trace_context event. Carries the OpenTelemetry trace ID for this /v1/automate request so consumers can deep-link to distributed-tracing UIs (e.g. Cloud Trace, Cloud Logging) for the run.

      - `traceId: string`

        W3C trace ID — 32-character lowercase hexadecimal string.

    - `event: "task:trace_context"`

      - `"task:trace_context"`

  - `TaskValidated object { data, event }`

    Envelope for the "task:validated" event from /v1/automate.

    - `data: object { completionQuality, finalAnswer, iterationId, 3 more }`

      Event data for task validation

      - `completionQuality: "failed" or "partial" or "complete" or "excellent"`

        - `"failed"`

        - `"partial"`

        - `"complete"`

        - `"excellent"`

      - `finalAnswer: string`

      - `iterationId: string`

      - `observation: string`

      - `timestamp: number`

      - `feedback: optional string`

    - `event: "task:validated"`

      - `"task:validated"`

  - `TaskValidationError object { data, event }`

    Envelope for the "task:validation_error" event from /v1/automate.

    - `data: object { errors, iterationId, rawResponse, 2 more }`

      Event data for validation errors during action response processing

      - `errors: array of string`

      - `iterationId: string`

      - `rawResponse: unknown`

      - `retryCount: number`

      - `timestamp: number`

    - `event: "task:validation_error"`

      - `"task:validation_error"`

### Research Event

- `ResearchEvent = object { data, event }  or object { data, event }  or object { data, event }  or 20 more`

  A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.

  - `AnalyzingEnd object { data, event }`

    Envelope for the "analyzing:end" event from /v1/research.

    - `data: object { analyzed, failed, iteration, 3 more }`

      - `analyzed: number`

      - `failed: number`

      - `iteration: number`

      - `message: string`

      - `samples: array of object { domain, title, url, 4 more }`

        - `domain: string`

        - `title: string`

        - `url: string`

        - `urlSource: "user-input" or "search-result" or "extracted-link"`

          URL source tracking - where a URL came from

          - `"user-input"`

          - `"search-result"`

          - `"extracted-link"`

        - `relevance: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `reliability: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `summary: optional string`

      - `timestamp: number`

    - `event: "analyzing:end"`

      - `"analyzing:end"`

  - `AnalyzingStart object { data, event }`

    Envelope for the "analyzing:start" event from /v1/research.

    - `data: object { iteration, message, pageCount, timestamp }`

      - `iteration: number`

      - `message: string`

      - `pageCount: number`

      - `timestamp: number`

    - `event: "analyzing:start"`

      - `"analyzing:start"`

  - `Complete object { data, event }`

    Envelope for the "complete" event from /v1/research.

    - `data: object { message, metadata, report, timestamp }`

      complete - Research finished successfully

      - `message: string`

      - `metadata: object { executedQueries, mode, prompt, 11 more }`

        Research metadata

        Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.

        - `executedQueries: array of array of string`

        - `mode: "fast" or "balanced" or "deep" or 2 more`

          Research mode determines depth, thinking budget, and quality controls

          Modes (in order of cost/thoroughness):

          - **fast**: Quick answers with minimal validation (~$2, 1 iteration, no judge)
          - **balanced**: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
          - **deep**: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
          - **max**: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
          - **ultra**: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)

          - `"fast"`

          - `"balanced"`

          - `"deep"`

          - `"max"`

          - `"ultra"`

        - `prompt: string`

        - `queryComplexity: "simple" or "moderate" or "complex"`

          - `"simple"`

          - `"moderate"`

          - `"complex"`

        - `researchObjective: string`

        - `researchPlan: string`

        - `researchQuestions: array of string`

        - `totalPagesAnalyzed: number`

          Total pages analyzed across all iterations

        - `citedPages: optional array of object { id, claims, sourceQueries, 9 more }`

          Pages cited in the report, ordered by first citation appearance

          - `id: string`

          - `claims: array of string`

          - `sourceQueries: array of string`

          - `url: string`

          - `depth: optional number`

          - `fullText: optional string`

            Full page text (fetched markdown or search excerpts). Only populated when `includeFullText: true` in ResearchOptions.

            - Fast mode: Parallel API excerpts (~5000 chars)
            - Other modes: Fetched page markdown

          - `parentUrl: optional string`

          - `relevance: optional "low" or "medium" or "high"`

            - `"low"`

            - `"medium"`

            - `"high"`

          - `reliability: optional "low" or "medium" or "high"`

            - `"low"`

            - `"medium"`

            - `"high"`

          - `summary: optional string`

            LLM-generated summary. Undefined in fast mode (no content analysis).

          - `title: optional string`

          - `urlSource: optional "user-input" or "search-result" or "extracted-link"`

            URL source tracking - where a URL came from

            - `"user-input"`

            - `"search-result"`

            - `"extracted-link"`

        - `gapEvaluations: optional array of object { gapDescription, questionAssessments, researchCoverage, 3 more }`

          - `gapDescription: string`

            Based on unanswered/partial questions, what specific information is still needed?

          - `questionAssessments: array of V1ResearchQuestionAssessment`

            Assessment of each research question's status and findings

            - `findings: string`

              What we learned (if answered/partial) or what's missing (if unanswered)

            - `question: string`

              The research question being assessed

            - `status: "answered" or "partial" or "unanswered"`

              Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)

              - `"answered"`

              - `"partial"`

              - `"unanswered"`

          - `researchCoverage: "Light" or "Moderate" or "Solid" or "Comprehensive"`

            Research coverage level - assesses quality across all questions.

            Hierarchy: Light < Moderate < Solid < Comprehensive

            - **Light**: Basic info on some questions, most need more depth → Continue
            - **Moderate**: Multiple questions answered, some remain partial → Continue
            - **Solid**: Most questions well-answered with validated sources → Sufficient to stop
            - **Comprehensive**: All questions thoroughly answered, exceptional depth → Definitely stop

            - `"Light"`

            - `"Moderate"`

            - `"Solid"`

            - `"Comprehensive"`

          - `shouldContinueResearch: boolean`

            Explicit decision: should research continue with another iteration?

            - Considers: how many questions unanswered/partial, coverage for mode, remaining iterations
            - Drives query generation: true → generate queries, false → stop researching

          - `newResearchQuestions: optional array of string`

            New research questions to add (optional, use sparingly)

            - Only if original decomposition missed something critical
            - Maximum 2-3 new questions total across all iterations
            - Most iterations should return empty array or omit this field

          - `searchQueries: optional array of string`

            Search queries to address identified gaps (only when shouldContinueResearch is true)

            - Target unanswered questions first, then partial questions
            - 3-10 targeted queries if shouldContinueResearch is true
            - Omit or provide empty array if shouldContinueResearch is false

        - `judgments: optional array of object { approved, observation, score, feedback }`

          - `approved: boolean`

          - `observation: string`

          - `score: number`

          - `feedback: optional string`

        - `metrics: optional object { cachedFetches, cachedSearches, fetches, 7 more }`

          Complete research metrics

          - `cachedFetches: number`

            Cached fetch count (subset of fetches)

          - `cachedSearches: map[number]`

            Cached search count by provider name (subset of searches)

          - `fetches: number`

            Fetch count (number of pages fetched)

          - `iterations: number`

            Number of research iterations performed

          - `phases: map[object { duration } ]`

            Phase timings with duration in milliseconds

            - `duration: number`

          - `robotsBlocked: number`

            Number of URLs blocked by robots.txt

          - `searches: map[number]`

            Search count by provider name (e.g., "bright-data", "parallel")

          - `successRates: object { analyzes, fetches, searches }`

            Success rate metrics

            - `analyzes: number`

            - `fetches: number`

            - `searches: number`

          - `tokens: map[object { input, output } ]`

            Token usage by model ID (e.g., "gemini-2.5-flash")

            - `input: number`

            - `output: number`

          - `totalDuration: number`

            Total duration in milliseconds

        - `outline: optional object { directAnswer, keyTakeaways, outline, relevantSourceIds }`

          Report outline from research writer

          - `directAnswer: string`

          - `keyTakeaways: array of string`

          - `outline: string`

          - `relevantSourceIds: array of string`

        - `urlSources: optional object { extractedLinks, searchResults, userProvided }`

          - `extractedLinks: number`

          - `searchResults: number`

          - `userProvided: number`

      - `report: string`

      - `timestamp: number`

    - `event: "complete"`

      - `"complete"`

  - `Error object { data, event }`

    Envelope for the "error" event from /v1/research.

    - `data: object { error, message, timestamp, 2 more }`

      error - Research failed

      - `error: object { message, name, stack }`

        - `message: string`

        - `name: string`

        - `stack: optional string`

      - `message: string`

      - `timestamp: number`

      - `activity: optional "prefetching" or "planning" or "iteration" or 7 more`

        Activity types for research workflow

        - `"prefetching"`

        - `"planning"`

        - `"iteration"`

        - `"searching"`

        - `"analyzing"`

        - `"following"`

        - `"evaluating"`

        - `"outlining"`

        - `"writing"`

        - `"judging"`

      - `iteration: optional number`

    - `event: "error"`

      - `"error"`

  - `EvaluatingEnd object { data, event }`

    Envelope for the "evaluating:end" event from /v1/research.

    - `data: object { coverage, gaps, iteration, 5 more }`

      - `coverage: "Light" or "Moderate" or "Solid" or "Comprehensive"`

        - `"Light"`

        - `"Moderate"`

        - `"Solid"`

        - `"Comprehensive"`

      - `gaps: string`

      - `iteration: number`

      - `message: string`

      - `nextQueries: array of string`

      - `questionAssessments: array of V1ResearchQuestionAssessment`

        - `findings: string`

          What we learned (if answered/partial) or what's missing (if unanswered)

        - `question: string`

          The research question being assessed

        - `status: "answered" or "partial" or "unanswered"`

          Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)

      - `shouldContinue: boolean`

      - `timestamp: number`

    - `event: "evaluating:end"`

      - `"evaluating:end"`

  - `EvaluatingStart object { data, event }`

    Envelope for the "evaluating:start" event from /v1/research.

    - `data: object { iteration, message, pagesAnalyzed, 2 more }`

      - `iteration: number`

      - `message: string`

      - `pagesAnalyzed: number`

        Total pages analyzed so far (including this iteration)

      - `questionCount: number`

        Number of research questions being assessed

      - `timestamp: number`

    - `event: "evaluating:start"`

      - `"evaluating:start"`

  - `FollowingEnd object { data, event }`

    Envelope for the "following:end" event from /v1/research.

    - `data: object { failed, followed, iteration, 3 more }`

      - `failed: number`

      - `followed: number`

      - `iteration: number`

      - `message: string`

      - `samples: array of object { domain, title, url, 4 more }`

        - `domain: string`

        - `title: string`

        - `url: string`

        - `urlSource: "user-input" or "search-result" or "extracted-link"`

          URL source tracking - where a URL came from

          - `"user-input"`

          - `"search-result"`

          - `"extracted-link"`

        - `relevance: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `reliability: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `summary: optional string`

      - `timestamp: number`

    - `event: "following:end"`

      - `"following:end"`

  - `FollowingStart object { data, event }`

    Envelope for the "following:start" event from /v1/research.

    - `data: object { iteration, linkCount, message, timestamp }`

      - `iteration: number`

      - `linkCount: number`

      - `message: string`

      - `timestamp: number`

    - `event: "following:start"`

      - `"following:start"`

  - `IterationEnd object { data, event }`

    Envelope for the "iteration:end" event from /v1/research.

    - `data: object { isLast, iteration, message, 2 more }`

      - `isLast: boolean`

        Whether this is the final iteration

      - `iteration: number`

      - `message: string`

      - `timestamp: number`

      - `stopReason: optional "max_iterations" or "coverage_sufficient"`

        Why research iterations stopped (only present when isLast is true)

        - `"max_iterations"`

        - `"coverage_sufficient"`

    - `event: "iteration:end"`

      - `"iteration:end"`

  - `IterationStart object { data, event }`

    Envelope for the "iteration:start" event from /v1/research.

    - `data: object { iteration, maxIterations, message, 2 more }`

      - `iteration: number`

      - `maxIterations: number`

        Maximum iterations for this research mode

      - `message: string`

      - `queries: array of string`

        Search queries to execute in this iteration

      - `timestamp: number`

    - `event: "iteration:start"`

      - `"iteration:start"`

  - `JudgingEnd object { data, event }`

    Envelope for the "judging:end" event from /v1/research.

    - `data: object { approved, attempt, message, 3 more }`

      - `approved: boolean`

      - `attempt: number`

      - `message: string`

      - `score: number`

      - `timestamp: number`

      - `feedback: optional string`

    - `event: "judging:end"`

      - `"judging:end"`

  - `JudgingStart object { data, event }`

    Envelope for the "judging:start" event from /v1/research.

    - `data: object { attempt, maxAttempts, message, timestamp }`

      - `attempt: number`

      - `maxAttempts: number`

        Maximum attempts allowed (1 + maxRevisions)

      - `message: string`

      - `timestamp: number`

    - `event: "judging:start"`

      - `"judging:start"`

  - `OutliningEnd object { data, event }`

    Envelope for the "outlining:end" event from /v1/research.

    - `data: object { message, sourcesSelected, timestamp }`

      - `message: string`

      - `sourcesSelected: number`

      - `timestamp: number`

    - `event: "outlining:end"`

      - `"outlining:end"`

  - `OutliningStart object { data, event }`

    Envelope for the "outlining:start" event from /v1/research.

    - `data: object { message, pagesAnalyzed, qualityPageCount, timestamp }`

      - `message: string`

      - `pagesAnalyzed: number`

        Total pages analyzed across all iterations

      - `qualityPageCount: number`

        Pages that meet quality threshold (medium+ relevance and reliability)

      - `timestamp: number`

    - `event: "outlining:start"`

      - `"outlining:start"`

  - `PlanningEnd object { data, event }`

    Envelope for the "planning:end" event from /v1/research.

    - `data: object { complexity, message, objective, 4 more }`

      - `complexity: "simple" or "moderate" or "complex"`

        - `"simple"`

        - `"moderate"`

        - `"complex"`

      - `message: string`

      - `objective: string`

      - `plan: string`

      - `queries: array of string`

      - `questions: array of string`

      - `timestamp: number`

    - `event: "planning:end"`

      - `"planning:end"`

  - `PlanningStart object { data, event }`

    Envelope for the "planning:start" event from /v1/research.

    - `data: object { hasPrefetchedContext, message, timestamp }`

      - `hasPrefetchedContext: boolean`

        Whether prefetched user-provided URLs exist for context

      - `message: string`

      - `timestamp: number`

    - `event: "planning:start"`

      - `"planning:start"`

  - `PrefetchingEnd object { data, event }`

    Envelope for the "prefetching:end" event from /v1/research.

    - `data: object { failed, fetched, message, timestamp }`

      - `failed: number`

      - `fetched: number`

      - `message: string`

      - `timestamp: number`

    - `event: "prefetching:end"`

      - `"prefetching:end"`

  - `PrefetchingStart object { data, event }`

    Envelope for the "prefetching:start" event from /v1/research.

    - `data: object { message, timestamp, urlCount, urls }`

      - `message: string`

      - `timestamp: number`

      - `urlCount: number`

      - `urls: array of string`

    - `event: "prefetching:start"`

      - `"prefetching:start"`

  - `SearchingEnd object { data, event }`

    Envelope for the "searching:end" event from /v1/research.

    - `data: object { iteration, message, timestamp, 2 more }`

      - `iteration: number`

      - `message: string`

      - `timestamp: number`

      - `urlsFound: number`

      - `urlsNew: number`

    - `event: "searching:end"`

      - `"searching:end"`

  - `SearchingStart object { data, event }`

    Envelope for the "searching:start" event from /v1/research.

    - `data: object { iteration, message, queries, timestamp }`

      - `iteration: number`

      - `message: string`

      - `queries: array of string`

      - `timestamp: number`

    - `event: "searching:start"`

      - `"searching:start"`

  - `Start object { data, event }`

    Envelope for the "start" event from /v1/research.

    - `data: object { message, timestamp }`

      start - Research begins

      - `message: string`

      - `timestamp: number`

    - `event: "start"`

      - `"start"`

  - `WritingEnd object { data, event }`

    Envelope for the "writing:end" event from /v1/research.

    - `data: object { attempt, message, timestamp }`

      - `attempt: number`

      - `message: string`

      - `timestamp: number`

    - `event: "writing:end"`

      - `"writing:end"`

  - `WritingStart object { data, event }`

    Envelope for the "writing:start" event from /v1/research.

    - `data: object { attempt, isRevision, maxAttempts, 3 more }`

      - `attempt: number`

      - `isRevision: boolean`

        Whether this is a revision attempt (attempt > 1)

      - `maxAttempts: number`

        Maximum attempts allowed (1 + maxRevisions)

      - `message: string`

      - `timestamp: number`

      - `previousScore: optional number`

        Previous judgment score if this is a revision

    - `event: "writing:start"`

      - `"writing:start"`

### V1 Global Buffer

- `V1GlobalBuffer object { buffer, byteLength, byteOffset, 2 more }`

  - `buffer: object { byteLength }`

    - `byteLength: number`

  - `byteLength: number`

  - `byteOffset: number`

  - `BYTES_PER_ELEMENT: number`

  - `length: number`

### V1 Research Question Assessment

- `V1ResearchQuestionAssessment object { findings, question, status }`

  Assessment of a single research question

  - `findings: string`

    What we learned (if answered/partial) or what's missing (if unanswered)

  - `question: string`

    The research question being assessed

  - `status: "answered" or "partial" or "unanswered"`

    Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)

    - `"answered"`

    - `"partial"`

    - `"unanswered"`

### Agent Automate Input Response

- `AgentAutomateInputResponse object { status }`

  - `status: optional string`
