Vloop API
    Preparing search index...

    Interface Chat

    A chat object returned by ai. Use ai methods to create or find a chat.

    interface Chat {
        chatTag: string;
        providerSessionId: string | null;
        runner: AgentRunner;
        status: LoopStatus;
        title: string;
        vloopexId: string;
        cacheWarmerPingIntervalMs(): number | "auto";
        cacheWarmerPingIntervalMs(value: number | false | "auto"): Chat;
        childChats(): ChatRef[];
        commandOutput(): string;
        disableCacheWarmer(): Chat;
        done(): Promise<void>;
        enableCacheWarmer(setting?: number | "auto" | undefined): Chat;
        enough(): Chat;
        followup(options: ChatTurnOptions): Chat;
        hold(): Chat;
        incomplete(): boolean;
        on(eventName: string, handler: (data: object) => void): () => boolean;
        processStderr(): string;
        promptCache(): Promise<PromptCacheReport>;
        queue(options: Omit<ChatTurnOptions, "whenBusy">): Chat;
        readMedia(part: ReplyMediaPart): Promise<Buffer<ArrayBufferLike>>;
        ref(): ChatRef;
        releaseHold(): Chat;
        reply(): string;
        replyContent(): ReplyContentPart[];
        saveMedia(part: ReplyMediaPart, file: string): Promise<string>;
        steer(
            options: Pick<
                ChatTurnOptions,
                "timeoutMs"
                | "input"
                | "prompt"
                | "promptFile",
            > & { force?: boolean },
        ): Chat;
        stop(
            options?: {
                force?: boolean;
                reason?: string;
                resolve?: boolean;
                terminal?: boolean;
            },
        ): Chat;
        transcript(): string;
        wait(): Promise<void>;
    }
    Index
    chatTag: string

    Saved chat tag, or an empty string for an unnamed chat.

    providerSessionId: string | null

    Raw provider session ID, when one is known.

    runner: AgentRunner

    Runner used by this chat.

    status: LoopStatus

    Status of the turn that runs or ran last, including a cache warm-up.

    title: string

    Current chat title; follows renames.

    vloopexId: string

    Stable Vloopex chat ID, also shown in the workbench Details.

    • Gets the cache warmer setting: "auto", a number of milliseconds, or 0 when the warmer is off. Warm-ups run on the Vloopex server.

      Returns number | "auto"

    • Sets the cache warmer. "auto" warms before the cache retention ends. A positive interval warms that many milliseconds after each cache use. Zero or false disables warming. A negative number throws. The server applies the change at once. A chat whose provider runs in the loop process keeps the setting but does not warm.

      Parameters

      • value: number | false | "auto"

      Returns Chat

    • Turns the cache warmer of this chat off: no more warm-ups are scheduled. A warm-up that runs ends as a turn does; stop() stops it.

      Returns Chat

    • Waits for the loop's work: the turn that the latest prompt of the loop or of a user started, and the prompts that the loop queued after it. Failed turns reject. A user-paused chat keeps waiting until a later turn finishes. A cache warm-up alone is not loop work: it neither delays nor settles done().

      Returns Promise<void>

    • Turns the cache warmer of this chat on.

      Parameters

      • setting: number | "auto" | undefined = "auto"

        "auto" (the default) warms before the cache retention ends; a positive number of ms warms that long after each use of the cache.

      Returns Chat

    • Starts another turn. While another turn of the chat runs, for example one that a user or a cache warm-up started, whenBusy decides what the prompt does, as the workbench offers Queue and Steer then. The owner of the chat decides with the state that it has when the follow-up arrives: the server for a chat that it owns, this chat object for a provider that runs in the loop process.

      Parameters

      Returns Chat

    • Keeps done() pending after each reply, also a failed or timed-out one, until releaseHold() or enough(). Sends, steers, queued prompts, and stops keep the hold; a terminal stop ends it. docs/lifecycle.md gives the rules.

      Returns Chat

    • Reports whether the chat result may be partial because its turn did not finish successfully, or is not there because the server lost it.

      Returns boolean

    • Runs a handler for matching chat events.

      Parameters

      • eventName: string

        Event name to observe.

      • handler: (data: object) => void

        Function called with event data.

      Returns () => boolean

      Function that removes this handler.

    • Returns string

      Raw process error output collected from the runner.

    • Sends a prompt after the current turn finishes successfully, or starts it immediately when the chat is idle. A queue that the user paused in the workbench sends it after Resume queue.

      Uses resumeChoice and forkSource when the queued turn starts.

      Parameters

      Returns Chat

    • Reads the bytes of a saved or inline binary part from this chat. Provider links are not downloaded. An unreadable saved resource rejects the read; inline data does not replace it.

      Parameters

      Returns Promise<Buffer<ArrayBufferLike>>

      The media bytes.

    • Ends the hold. done() then resolves or rejects from the reply that the hold kept, as without a hold, unless another pause, such as a Stop, keeps it. docs/lifecycle.md gives the rules.

      Returns Chat

    • Returns string

      Model text of the chat result: the reply of the latest turn that a prompt of the loop or of a user in Vloopex started, and before such a turn, the latest reply in the provider history. A cache warm-up alone does not replace it.

    • Saves a media part without changing its bytes. Creates parent folders and rejects if the destination already exists. Does not convert formats.

      Parameters

      • part: ReplyMediaPart

        A media part from replyContent().

      • file: string

        Destination path, relative to the project or absolute.

      Returns Promise<string>

      The absolute path of the saved file.

    • Interrupts a running turn and sends a replacement prompt. When the chat is idle, starts a normal follow-up.

      Parameters

      • options: Pick<ChatTurnOptions, "timeoutMs" | "input" | "prompt" | "promptFile"> & {
            force?: boolean;
        }

        force defaults to false when the driver supports steering during a turn, and true otherwise. A forced steer interrupts the turn before sending.

      Returns Chat

    • Stops the current turn. With no options this pauses the chat, so done() stays pending until a later turn finishes.

      Parameters

      • Optionaloptions: { force?: boolean; reason?: string; resolve?: boolean; terminal?: boolean } = {}
        • Optionalforce?: boolean

          Forcefully stops the process. Defaults to false.

        • Optionalreason?: string

          Text included if stopping becomes an error.

        • Optionalresolve?: boolean

          Accepts the partial reply and lets done() finish. Prefer enough() in normal loop code. Defaults to false.

        • Optionalterminal?: boolean

          Ends the wait as a final abort instead of a pause, also while Hold is on, and ends the hold. Used mainly by runtime cleanup. Defaults to false.

      Returns Chat

    • Returns string

      All prompts and output of the chat, cache warm-ups included.