// Copyright 2023 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// @generated by protoc-gen-es v1.10.1 with parameter "target=dts+js"
// @generated from file agent/livekit_agent_text.proto (package livekit.agent, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import type { AgentHandoff, ChatMessage, FunctionCall, FunctionCallOutput } from "./livekit_agent_session_pb.js";

/**
 * @generated from enum livekit.agent.TextMessageErrorCode
 */
export declare enum TextMessageErrorCode {
  /**
   * Unexpected internal error
   *
   * @generated from enum value: INTERNAL_ERROR = 0;
   */
  INTERNAL_ERROR = 0,

  /**
   * Session state not found in cache or version mismatch
   *
   * @generated from enum value: SESSION_STATE_NOT_FOUND = 1;
   */
  SESSION_STATE_NOT_FOUND = 1,

  /**
   * An exception was raised inside the user's text handler
   *
   * @generated from enum value: TEXT_HANDLER_ERROR = 2;
   */
  TEXT_HANDLER_ERROR = 2,

  /**
   * The worker process exited before the text session completed
   *
   * @generated from enum value: PROCESS_CLOSED = 3;
   */
  PROCESS_CLOSED = 3,
}

/**
 * Request to send a text message to an agent.
 *
 * @generated from message livekit.agent.TextMessageRequest
 */
export declare class TextMessageRequest extends Message<TextMessageRequest> {
  /**
   * @generated from field: string text = 1;
   */
  text: string;

  /**
   * @generated from field: string message_id = 2;
   */
  messageId: string;

  /**
   * @generated from field: string session_id = 3;
   */
  sessionId: string;

  /**
   * @generated from field: string agent_name = 4;
   */
  agentName: string;

  /**
   * @generated from field: string metadata = 5;
   */
  metadata: string;

  /**
   * @generated from field: optional livekit.agent.AgentSessionState session_state = 6;
   */
  sessionState?: AgentSessionState;

  constructor(data?: PartialMessage<TextMessageRequest>);

  static readonly runtime: typeof proto3;
  static readonly typeName = "livekit.agent.TextMessageRequest";
  static readonly fields: FieldList;

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TextMessageRequest;

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TextMessageRequest;

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TextMessageRequest;

  static equals(a: TextMessageRequest | PlainMessage<TextMessageRequest> | undefined, b: TextMessageRequest | PlainMessage<TextMessageRequest> | undefined): boolean;
}

/**
 * Response to a text message request, multiple responses may be sent for a single request until it is complete.
 *
 * @generated from message livekit.agent.TextMessageResponse
 */
export declare class TextMessageResponse extends Message<TextMessageResponse> {
  /**
   * @generated from field: string message_id = 1;
   */
  messageId: string;

  /**
   * @generated from field: string session_id = 2;
   */
  sessionId: string;

  /**
   * @generated from oneof livekit.agent.TextMessageResponse.event
   */
  event: {
    /**
     * @generated from field: livekit.agent.ChatMessage message = 3;
     */
    value: ChatMessage;
    case: "message";
  } | {
    /**
     * @generated from field: livekit.agent.FunctionCall function_call = 4;
     */
    value: FunctionCall;
    case: "functionCall";
  } | {
    /**
     * @generated from field: livekit.agent.FunctionCallOutput function_call_output = 5;
     */
    value: FunctionCallOutput;
    case: "functionCallOutput";
  } | {
    /**
     * @generated from field: livekit.agent.AgentHandoff agent_handoff = 6;
     */
    value: AgentHandoff;
    case: "agentHandoff";
  } | {
    /**
     * @generated from field: livekit.agent.TextMessageComplete complete = 7;
     */
    value: TextMessageComplete;
    case: "complete";
  } | { case: undefined; value?: undefined };

  constructor(data?: PartialMessage<TextMessageResponse>);

  static readonly runtime: typeof proto3;
  static readonly typeName = "livekit.agent.TextMessageResponse";
  static readonly fields: FieldList;

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TextMessageResponse;

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TextMessageResponse;

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TextMessageResponse;

  static equals(a: TextMessageResponse | PlainMessage<TextMessageResponse> | undefined, b: TextMessageResponse | PlainMessage<TextMessageResponse> | undefined): boolean;
}

/**
 * Indicates the text message session is complete.
 *
 * @generated from message livekit.agent.TextMessageComplete
 */
export declare class TextMessageComplete extends Message<TextMessageComplete> {
  /**
   * @generated from oneof livekit.agent.TextMessageComplete.result
   */
  result: {
    /**
     * @generated from field: livekit.agent.AgentSessionState session_state = 1;
     */
    value: AgentSessionState;
    case: "sessionState";
  } | {
    /**
     * @generated from field: livekit.agent.TextMessageError error = 2;
     */
    value: TextMessageError;
    case: "error";
  } | { case: undefined; value?: undefined };

  constructor(data?: PartialMessage<TextMessageComplete>);

  static readonly runtime: typeof proto3;
  static readonly typeName = "livekit.agent.TextMessageComplete";
  static readonly fields: FieldList;

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TextMessageComplete;

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TextMessageComplete;

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TextMessageComplete;

  static equals(a: TextMessageComplete | PlainMessage<TextMessageComplete> | undefined, b: TextMessageComplete | PlainMessage<TextMessageComplete> | undefined): boolean;
}

/**
 * @generated from message livekit.agent.AgentSessionState
 */
export declare class AgentSessionState extends Message<AgentSessionState> {
  /**
   * @generated from field: uint64 version = 1;
   */
  version: bigint;

  /**
   * @generated from oneof livekit.agent.AgentSessionState.data
   */
  data: {
    /**
     * @generated from field: bytes snapshot = 2;
     */
    value: Uint8Array;
    case: "snapshot";
  } | {
    /**
     * @generated from field: bytes delta = 3;
     */
    value: Uint8Array;
    case: "delta";
  } | { case: undefined; value?: undefined };

  constructor(data?: PartialMessage<AgentSessionState>);

  static readonly runtime: typeof proto3;
  static readonly typeName = "livekit.agent.AgentSessionState";
  static readonly fields: FieldList;

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AgentSessionState;

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AgentSessionState;

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AgentSessionState;

  static equals(a: AgentSessionState | PlainMessage<AgentSessionState> | undefined, b: AgentSessionState | PlainMessage<AgentSessionState> | undefined): boolean;
}

/**
 * @generated from message livekit.agent.TextMessageError
 */
export declare class TextMessageError extends Message<TextMessageError> {
  /**
   * @generated from field: string message = 1;
   */
  message: string;

  /**
   * @generated from field: livekit.agent.TextMessageErrorCode code = 2;
   */
  code: TextMessageErrorCode;

  constructor(data?: PartialMessage<TextMessageError>);

  static readonly runtime: typeof proto3;
  static readonly typeName = "livekit.agent.TextMessageError";
  static readonly fields: FieldList;

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TextMessageError;

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TextMessageError;

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TextMessageError;

  static equals(a: TextMessageError | PlainMessage<TextMessageError> | undefined, b: TextMessageError | PlainMessage<TextMessageError> | undefined): boolean;
}

