Task that can be run in the Task Agent

Hierarchy (view full)

Constructors

  • Parameters

    • config: Config

      The configuration for the task

    • prompt: string

      The prompt to run, e.g. "What time is it in New York?"

    • stepByStep: boolean = false

      Should the task be run step by step. Every step must be confirmed by the user by sending a resume event.

    Returns Task

Properties

WebSocket: {
    CLOSED: 3;
    CLOSING: 2;
    CONNECTING: 0;
    OPEN: 1;
    prototype: WebSocket;
    new (url, protocols?): WebSocket;
}

Type declaration

    • new (url, protocols?): WebSocket
    • Parameters

      • url: string | URL
      • Optional protocols: string | string[]

      Returns WebSocket

  • Readonly CLOSED: 3
  • Readonly CLOSING: 2
  • Readonly CONNECTING: 0
  • Readonly OPEN: 1
  • prototype: WebSocket
authorization: string
config: Config
fetch: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
}

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optional init: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: string | Request | URL
      • Optional init: RequestInit

      Returns Promise<Response>

prompt: string
socket: WebSocket
stepByStep: boolean

Methods

  • Emit an event with data. This will call all listeners for the event and all taps of this emitter.

    Type Parameters

    • E extends (keyof ServerEvents) | "socketClose" | "socketError" | "capture"

    Parameters

    Returns void

  • Exit the task, this will force the task to stop

    Returns Promise<void>

  • Parameters

    • name: string
    • url: string

    Returns Promise<TaskPage>

  • Get a page in the browser

    Parameters

    • name: string

      The name of the page

    Returns TaskPage

  • Start the task

    Parameters

    • Optional events: (keyof ServerEvents)[]

      The events to listen for, defaults to listening to all events

    Returns Promise<void>

  • Wait for the task to be done

    Returns Promise<string>

    The result of the task, e.g. The answer to the prompt.