// @generated by protoc-gen-es v2.13.0 with parameter "target=ts,import_extension=js"
// @generated from file soulfire/logs.proto (package soulfire.v1, syntax proto3)
/* eslint-disable */

import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
import { file_soulfire_api_docs } from "./api_docs_pb.js";
import { file_google_api_annotations } from "../google/api/annotations_pb.js";
import { file_google_api_field_behavior } from "../google/api/field_behavior_pb.js";
import type { Timestamp } from "@bufbuild/protobuf/wkt";
import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file soulfire/logs.proto.
 */
export const file_soulfire_logs: GenFile = /*@__PURE__*/
  fileDesc("ChNzb3VsZmlyZS9sb2dzLnByb3RvEgtzb3VsZmlyZS52MSK3AwoJTG9nU3RyaW5nEgoKAmlkGAEgASgJEg8KB21lc3NhZ2UYAiABKAkSJAoLaW5zdGFuY2VfaWQYAyABKAlCCtLzGAYKBHV1aWRIAIgBARInCg5ib3RfYWNjb3VudF9pZBgEIAEoCUIK0vMYBgoEdXVpZEgBiAEBEiIKCXNjcmlwdF9pZBgFIAEoCUIK0vMYBgoEdXVpZEgCiAEBEhAKCHBlcnNvbmFsGAYgASgIEhoKDWluc3RhbmNlX25hbWUYByABKAlIA4gBARIdChBib3RfYWNjb3VudF9uYW1lGAggASgJSASIAQESLQoJdGltZXN0YW1wGAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIYCgtsb2dnZXJfbmFtZRgKIAEoCUgFiAEBEhIKBWxldmVsGAsgASgJSAaIAQFCDgoMX2luc3RhbmNlX2lkQhEKD19ib3RfYWNjb3VudF9pZEIMCgpfc2NyaXB0X2lkQhAKDl9pbnN0YW5jZV9uYW1lQhMKEV9ib3RfYWNjb3VudF9uYW1lQg4KDF9sb2dnZXJfbmFtZUIICgZfbGV2ZWwiEAoOR2xvYmFsTG9nU2Nvc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dCA+BBAjLaAgoLTG9nc1NlcnZpY2USjQEKC0dldFByZXZpb3VzEh8uc291bGZpcmUudjEuUHJldmlvdXNMb2dSZXF1ZXN0GiAuc291bGZpcmUudjEuUHJldmlvdXNMb2dSZXNwb25zZSI7yvMYHAoPR2V0IGxvZyBoaXN0b3J5Iglsb2cuc2NvcGWC0+STAhU6ASoiEC92MS9sb2dzOmhpc3RvcnkSugEKCVN1YnNjcmliZRIXLnNvdWxmaXJlLnYxLkxvZ1JlcXVlc3QaGC5zb3VsZmlyZS52MS5Mb2dSZXNwb25zZSJ4yvMYdAoRU3Vic2NyaWJlIHRvIGxvZ3MiCWxvZy5zY29wZTIQU2VydmVyIHN0cmVhbWluZzpCT3BlbnMgYSBsaXZlIGxvZyBzdHJlYW0gdW50aWwgdGhlIGNsaWVudCBjYW5jZWxzIHRoZSBzdWJzY3JpcHRpb24uMAFCIQodY29tLnNvdWxmaXJlbWMuZ3JwYy5nZW5lcmF0ZWRQAWIGcHJvdG8z", [file_soulfire_api_docs, file_google_api_annotations, file_google_api_field_behavior, file_google_protobuf_timestamp]);

/**
 * Represents a single log entry from the SoulFire logging system.
 * Log entries can be associated with specific instances, bots, or scripts,
 * or they can be personal messages directed to a specific user.
 *
 * @generated from message soulfire.v1.LogString
 */
export type LogString = Message<"soulfire.v1.LogString"> & {
  /**
   * Unique identifier for this log entry. Format is "{timestamp_millis}-{counter}"
   * where counter is an incrementing integer to ensure uniqueness within the same millisecond.
   *
   * @generated from field: string id = 1;
   */
  id: string;

  /**
   * The formatted log message content. This is the fully formatted output including
   * any Minecraft formatting codes and exception stack traces if present.
   *
   * @generated from field: string message = 2;
   */
  message: string;

  /**
   * The UUID of the instance this log is associated with, if any.
   * Present when the log was generated in the context of a specific attack instance.
   *
   * @generated from field: optional string instance_id = 3;
   */
  instanceId?: string | undefined;

  /**
   * The UUID of the bot account this log is associated with, if any.
   * Present when the log was generated by or about a specific bot.
   *
   * @generated from field: optional string bot_account_id = 4;
   */
  botAccountId?: string | undefined;

  /**
   * The UUID of the script this log is associated with, if any.
   * Present when the log was generated during script execution.
   *
   * @generated from field: optional string script_id = 5;
   */
  scriptId?: string | undefined;

  /**
   * Indicates whether this is a personal message directed to a specific user.
   * Personal messages are only visible to the target user and are not stored in the log history.
   *
   * @generated from field: bool personal = 6;
   */
  personal: boolean;

  /**
   * Human-readable name of the instance, if available.
   * Provided as a convenience to avoid requiring additional lookups.
   *
   * @generated from field: optional string instance_name = 7;
   */
  instanceName?: string | undefined;

  /**
   * Human-readable name of the bot account, if available.
   * Provided as a convenience to avoid requiring additional lookups.
   *
   * @generated from field: optional string bot_account_name = 8;
   */
  botAccountName?: string | undefined;

  /**
   * The timestamp when this log entry was created.
   *
   * @generated from field: google.protobuf.Timestamp timestamp = 9;
   */
  timestamp?: Timestamp | undefined;

  /**
   * The name of the logger that produced this log entry (e.g., "com.soulfiremc.server.SomeClass").
   * Useful for filtering and debugging purposes.
   *
   * @generated from field: optional string logger_name = 10;
   */
  loggerName?: string | undefined;

  /**
   * The log level (e.g., "INFO", "WARN", "ERROR", "DEBUG", "TRACE", "FATAL").
   * Corresponds to Log4j2 log levels.
   *
   * @generated from field: optional string level = 11;
   */
  level?: string | undefined;
};

/**
 * Describes the message soulfire.v1.LogString.
 * Use `create(LogStringSchema)` to create a new message.
 */
export const LogStringSchema: GenMessage<LogString> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 0);

/**
 * Scope for receiving all non-personal logs from the entire server.
 * Requires the GLOBAL_SUBSCRIBE_LOGS permission.
 *
 * @generated from message soulfire.v1.GlobalLogScope
 */
export type GlobalLogScope = Message<"soulfire.v1.GlobalLogScope"> & {
};

/**
 * Describes the message soulfire.v1.GlobalLogScope.
 * Use `create(GlobalLogScopeSchema)` to create a new message.
 */
export const GlobalLogScopeSchema: GenMessage<GlobalLogScope> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 1);

/**
 * Scope for receiving logs from a specific attack instance.
 * Only includes logs where the instance_id matches. Personal logs are excluded.
 * Requires the INSTANCE_SUBSCRIBE_LOGS permission for the specified instance.
 *
 * @generated from message soulfire.v1.InstanceLogScope
 */
export type InstanceLogScope = Message<"soulfire.v1.InstanceLogScope"> & {
  /**
   * The UUID of the instance to filter logs for. Must be a valid UUID string.
   *
   * @generated from field: string instance_id = 1;
   */
  instanceId: string;
};

/**
 * Describes the message soulfire.v1.InstanceLogScope.
 * Use `create(InstanceLogScopeSchema)` to create a new message.
 */
export const InstanceLogScopeSchema: GenMessage<InstanceLogScope> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 2);

/**
 * Scope for receiving logs from a specific bot within an instance.
 * Only includes logs where both instance_id and bot_account_id match. Personal logs are excluded.
 * Requires the INSTANCE_SUBSCRIBE_LOGS permission for the specified instance.
 *
 * @generated from message soulfire.v1.BotLogScope
 */
export type BotLogScope = Message<"soulfire.v1.BotLogScope"> & {
  /**
   * The UUID of the instance the bot belongs to. Must be a valid UUID string.
   *
   * @generated from field: string instance_id = 1;
   */
  instanceId: string;

  /**
   * The UUID of the bot account to filter logs for. Must be a valid UUID string.
   *
   * @generated from field: string bot_id = 2;
   */
  botId: string;
};

/**
 * Describes the message soulfire.v1.BotLogScope.
 * Use `create(BotLogScopeSchema)` to create a new message.
 */
export const BotLogScopeSchema: GenMessage<BotLogScope> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 3);

/**
 * Scope for receiving logs from a specific script running within an instance.
 * Only includes logs where both instance_id and script_id match. Personal logs are excluded.
 * Requires the INSTANCE_SUBSCRIBE_LOGS permission for the specified instance.
 *
 * @generated from message soulfire.v1.InstanceScriptLogScope
 */
export type InstanceScriptLogScope = Message<"soulfire.v1.InstanceScriptLogScope"> & {
  /**
   * The UUID of the instance the script is running in. Must be a valid UUID string.
   *
   * @generated from field: string instance_id = 1;
   */
  instanceId: string;

  /**
   * The UUID of the script to filter logs for. Must be a valid UUID string.
   *
   * @generated from field: string script_id = 2;
   */
  scriptId: string;
};

/**
 * Describes the message soulfire.v1.InstanceScriptLogScope.
 * Use `create(InstanceScriptLogScopeSchema)` to create a new message.
 */
export const InstanceScriptLogScopeSchema: GenMessage<InstanceScriptLogScope> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 4);

/**
 * Scope for receiving personal messages directed to the authenticated user.
 * Personal messages are private notifications that are not stored in log history.
 * No special permissions required beyond being authenticated.
 *
 * @generated from message soulfire.v1.PersonalLogScope
 */
export type PersonalLogScope = Message<"soulfire.v1.PersonalLogScope"> & {
};

/**
 * Describes the message soulfire.v1.PersonalLogScope.
 * Use `create(PersonalLogScopeSchema)` to create a new message.
 */
export const PersonalLogScopeSchema: GenMessage<PersonalLogScope> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 5);

/**
 * Defines the scope of logs to retrieve or subscribe to.
 * The scope determines which logs are included based on their source and the user's permissions.
 *
 * @generated from message soulfire.v1.LogScope
 */
export type LogScope = Message<"soulfire.v1.LogScope"> & {
  /**
   * Reserved for removed GlobalScriptLogScope (field 4)
   *
   * @generated from oneof soulfire.v1.LogScope.scope
   */
  scope: {
    /**
     * Receive all non-personal logs from the server. Requires GLOBAL_SUBSCRIBE_LOGS permission.
     *
     * @generated from field: soulfire.v1.GlobalLogScope global = 1;
     */
    value: GlobalLogScope;
    case: "global";
  } | {
    /**
     * Receive logs from a specific instance. Requires INSTANCE_SUBSCRIBE_LOGS permission.
     *
     * @generated from field: soulfire.v1.InstanceLogScope instance = 2;
     */
    value: InstanceLogScope;
    case: "instance";
  } | {
    /**
     * Receive logs from a specific bot within an instance. Requires INSTANCE_SUBSCRIBE_LOGS permission.
     *
     * @generated from field: soulfire.v1.BotLogScope bot = 3;
     */
    value: BotLogScope;
    case: "bot";
  } | {
    /**
     * Receive logs from a specific script within an instance. Requires INSTANCE_SUBSCRIBE_LOGS permission.
     *
     * @generated from field: soulfire.v1.InstanceScriptLogScope instance_script = 5;
     */
    value: InstanceScriptLogScope;
    case: "instanceScript";
  } | {
    /**
     * Receive personal messages for the authenticated user. No special permissions required.
     *
     * @generated from field: soulfire.v1.PersonalLogScope personal = 6;
     */
    value: PersonalLogScope;
    case: "personal";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message soulfire.v1.LogScope.
 * Use `create(LogScopeSchema)` to create a new message.
 */
export const LogScopeSchema: GenMessage<LogScope> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 6);

/**
 * Request to retrieve historical log entries from the server's log buffer.
 *
 * @generated from message soulfire.v1.PreviousLogRequest
 */
export type PreviousLogRequest = Message<"soulfire.v1.PreviousLogRequest"> & {
  /**
   * The scope defining which logs to retrieve. Personal logs are not included
   * in historical retrieval as they are not stored.
   *
   * @generated from field: soulfire.v1.LogScope scope = 4;
   */
  scope?: LogScope | undefined;

  /**
   * The maximum number of recent log entries to retrieve.
   * Must not exceed 300 (the server's maximum log buffer size).
   * Returns the newest entries that match the scope, up to this count.
   *
   * @generated from field: int32 count = 3;
   */
  count: number;
};

/**
 * Describes the message soulfire.v1.PreviousLogRequest.
 * Use `create(PreviousLogRequestSchema)` to create a new message.
 */
export const PreviousLogRequestSchema: GenMessage<PreviousLogRequest> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 7);

/**
 * Response containing historical log entries.
 *
 * @generated from message soulfire.v1.PreviousLogResponse
 */
export type PreviousLogResponse = Message<"soulfire.v1.PreviousLogResponse"> & {
  /**
   * The list of log entries matching the requested scope, ordered from oldest to newest.
   * May contain fewer entries than requested if not enough matching logs exist in the buffer.
   *
   * @generated from field: repeated soulfire.v1.LogString messages = 1;
   */
  messages: LogString[];
};

/**
 * Describes the message soulfire.v1.PreviousLogResponse.
 * Use `create(PreviousLogResponseSchema)` to create a new message.
 */
export const PreviousLogResponseSchema: GenMessage<PreviousLogResponse> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 8);

/**
 * Request to subscribe to a real-time stream of log entries.
 *
 * @generated from message soulfire.v1.LogRequest
 */
export type LogRequest = Message<"soulfire.v1.LogRequest"> & {
  /**
   * The scope defining which logs to receive. The subscription will only
   * deliver logs that match this scope and that the user has permission to access.
   *
   * @generated from field: soulfire.v1.LogScope scope = 3;
   */
  scope?: LogScope | undefined;
};

/**
 * Describes the message soulfire.v1.LogRequest.
 * Use `create(LogRequestSchema)` to create a new message.
 */
export const LogRequestSchema: GenMessage<LogRequest> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 9);

/**
 * Response containing a single log entry from a subscription stream.
 *
 * @generated from message soulfire.v1.LogResponse
 */
export type LogResponse = Message<"soulfire.v1.LogResponse"> & {
  /**
   * A single log entry that matches the subscription scope.
   *
   * @generated from field: soulfire.v1.LogString message = 1;
   */
  message?: LogString | undefined;
};

/**
 * Describes the message soulfire.v1.LogResponse.
 * Use `create(LogResponseSchema)` to create a new message.
 */
export const LogResponseSchema: GenMessage<LogResponse> = /*@__PURE__*/
  messageDesc(file_soulfire_logs, 10);

/**
 * Service for accessing SoulFire server logs.
 * Provides both historical log retrieval and real-time log streaming capabilities.
 * All methods require appropriate authentication and permissions based on the requested scope.
 *
 * @generated from service soulfire.v1.LogsService
 */
export const LogsService: GenService<{
  /**
   * Retrieves historical log entries from the server's in-memory log buffer.
   * The server maintains a rolling buffer of the last 300 log entries.
   * Only returns non-personal logs that match the specified scope.
   *
   * Permissions required:
   * - GlobalLogScope: GLOBAL_SUBSCRIBE_LOGS
   * - InstanceLogScope/BotLogScope/InstanceScriptLogScope: INSTANCE_SUBSCRIBE_LOGS for the instance
   * - PersonalLogScope: No special permissions (but returns empty since personal logs are not stored)
   *
   * Errors:
   * - PERMISSION_DENIED: User lacks required permission for the requested scope
   * - INVALID_ARGUMENT: Scope not set or invalid UUID format
   * - INTERNAL: Server error while retrieving logs
   *
   * @generated from rpc soulfire.v1.LogsService.GetPrevious
   */
  getPrevious: {
    methodKind: "unary";
    input: typeof PreviousLogRequestSchema;
    output: typeof PreviousLogResponseSchema;
  },
  /**
   * Subscribes to a real-time stream of log entries matching the specified scope.
   * The stream remains open until cancelled by the client or the connection is lost.
   * Permissions are re-validated periodically (every 1 second) to handle permission changes.
   *
   * For PersonalLogScope: Receives personal messages directed to the authenticated user.
   * Personal messages are transient and only delivered to active subscribers.
   *
   * Permissions required:
   * - GlobalLogScope: GLOBAL_SUBSCRIBE_LOGS
   * - InstanceLogScope/BotLogScope/InstanceScriptLogScope: INSTANCE_SUBSCRIBE_LOGS for the instance
   * - PersonalLogScope: No special permissions required
   *
   * Errors:
   * - PERMISSION_DENIED: User lacks required permission for the requested scope
   * - INVALID_ARGUMENT: Scope not set or invalid UUID format
   * - INTERNAL: Server error while setting up subscription
   *
   * @generated from rpc soulfire.v1.LogsService.Subscribe
   */
  subscribe: {
    methodKind: "server_streaming";
    input: typeof LogRequestSchema;
    output: typeof LogResponseSchema;
  },
}> = /*@__PURE__*/
  serviceDesc(file_soulfire_logs, 0);
