import { BaseMessageInput } from './graphql/types/base/index.js';

declare enum MessageRole {
    assistant = "assistant",
    developer = "developer",
    system = "system",
    tool = "tool",
    user = "user"
}
declare enum ActionInputAvailability {
    disabled = "disabled",
    enabled = "enabled",
    remote = "remote"
}

declare class MessageInput extends BaseMessageInput {
    textMessage?: TextMessageInput;
    actionExecutionMessage?: ActionExecutionMessageInput;
    resultMessage?: ResultMessageInput;
    agentStateMessage?: AgentStateMessageInput;
    imageMessage?: ImageMessageInput;
}
declare class TextMessageInput {
    content: string;
    parentMessageId?: string;
    role: MessageRole;
}
declare class ActionExecutionMessageInput {
    name: string;
    arguments: string;
    parentMessageId?: string;
    scope?: String;
}
declare class ResultMessageInput {
    actionExecutionId: string;
    actionName: string;
    parentMessageId?: string;
    result: string;
}
declare class AgentStateMessageInput {
    threadId: string;
    agentName: string;
    role: MessageRole;
    state: string;
    running: boolean;
    nodeName: string;
    runId: string;
    active: boolean;
}
declare class ImageMessageInput {
    format: string;
    bytes: string;
    parentMessageId?: string;
    role: MessageRole;
}

declare enum MessageStatusCode {
    Pending = "pending",
    Success = "success",
    Failed = "failed"
}
declare class BaseMessageStatus {
    code: MessageStatusCode;
}
declare class PendingMessageStatus extends BaseMessageStatus {
    code: MessageStatusCode;
}
declare class SuccessMessageStatus extends BaseMessageStatus {
    code: MessageStatusCode;
}
declare class FailedMessageStatus extends BaseMessageStatus {
    code: MessageStatusCode;
    reason: string;
}
declare const MessageStatusUnion: PendingMessageStatus | SuccessMessageStatus | FailedMessageStatus;
type MessageStatus = typeof MessageStatusUnion;

declare abstract class BaseMessageOutput {
    id: string;
    createdAt: Date;
    status: typeof MessageStatusUnion;
}

type MessageType = "TextMessage" | "ActionExecutionMessage" | "ResultMessage" | "AgentStateMessage" | "ImageMessage";
declare class Message {
    type: MessageType;
    id: BaseMessageOutput["id"];
    createdAt: BaseMessageOutput["createdAt"];
    status: MessageStatus;
    constructor(props: any);
    isTextMessage(): this is TextMessage;
    isActionExecutionMessage(): this is ActionExecutionMessage;
    isResultMessage(): this is ResultMessage;
    isAgentStateMessage(): this is AgentStateMessage;
    isImageMessage(): this is ImageMessage;
}
declare const Role: typeof MessageRole;
type MessageConstructorOptions = Partial<Message>;
type TextMessageConstructorOptions = MessageConstructorOptions & TextMessageInput;
declare class TextMessage extends Message implements TextMessageConstructorOptions {
    content: TextMessageInput["content"];
    parentMessageId: TextMessageInput["parentMessageId"];
    role: TextMessageInput["role"];
    type: "TextMessage";
    constructor(props: TextMessageConstructorOptions);
}
declare class ActionExecutionMessage extends Message implements Omit<ActionExecutionMessageInput, "arguments" | "scope"> {
    type: MessageType;
    name: string;
    arguments: Record<string, any>;
    parentMessageId?: string;
}
declare class ResultMessage extends Message implements ResultMessageInput {
    type: MessageType;
    actionExecutionId: string;
    actionName: string;
    result: string;
    static encodeResult(result: any, error?: {
        code: string;
        message: string;
    } | string | Error): string;
    static decodeResult(result: string): {
        error?: {
            code: string;
            message: string;
        };
        result: string;
    };
    hasError(): boolean;
    getError(): {
        code: string;
        message: string;
    } | undefined;
}
declare class AgentStateMessage extends Message implements Omit<AgentStateMessageInput, "state"> {
    type: MessageType;
    threadId: string;
    agentName: string;
    nodeName: string;
    runId: string;
    active: boolean;
    role: MessageRole;
    state: any;
    running: boolean;
}
declare class ImageMessage extends Message implements ImageMessageInput {
    type: MessageType;
    format: string;
    bytes: string;
    role: MessageRole;
    parentMessageId?: string;
}

export { ActionExecutionMessage as A, ImageMessage as I, Message as M, ResultMessage as R, TextMessage as T, MessageInput as a, ActionInputAvailability as b, MessageType as c, Role as d, AgentStateMessage as e };
