import { z } from 'zod';

type StringNumber = `${number}`;
type StringBoolean = `${boolean}`;
type NumberRange<start extends number, end extends number, arr extends unknown[] = [], acc extends number = never> = arr["length"] extends end ? acc | start | end : NumberRange<start, end, [
    ...arr,
    1
], arr[start] extends undefined ? acc : acc | arr["length"]>;
type StringNumberRange<F extends number, T extends number> = `${NumberRange<F, T>}`;
/**
 * Valid AMS control actions
 */
declare enum AMSControlAction {
    RESUME = "resume",
    RESET = "reset",
    PAUSE = "pause",
    DONE = "done"
}
type State = "pause" | "resume" | "stop";
type PrintMessageCommands = "push_status" | "ams_control" | State | "gcode_line" | "gcode_file" | "project_file";
type PrintMessageCommand = {
    command: PrintMessageCommands;
    param?: string;
    sequence_id: string;
};
interface PrintMessage {
    print: PrintMessageCommand;
}
declare function isPrintMessage(data: any): data is PrintMessage;
type PrinterStatus = "FINISH" | "FAILED" | "RUNNING" | "IDLE" | "PAUSE" | "PREPARE" | "SLICING";
/**
 * Every stage of a print.
 * Extracted from https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp
 */
declare enum PrintStage {
    "PRINTING" = "Printing",
    "BED_LEVELING" = "Auto bed leveling",
    "HEATBED_PREHEATING" = "Heatbed preheating",
    "XY_MECH_MODE_SWEEP" = "Sweeping XY mech mode",
    "CHANGE_MATERIAL" = "Changing filament",
    "M400_PAUSE" = "M400 pause",
    "FILAMENT_RUNOUT_PAUSE" = "Paused due to filament runout",
    "HOTEND_HEATING" = "Heating hotend",
    "EXTRUDE_COMPENSATION_SCAN" = "Calibrating extrusion",
    "BED_SCAN" = "Scanning bed surface",
    "FIRST_LAYER_SCAN" = "Inspecting first layer",
    "BE_SURFACE_TYPT_IDENTIFICATION" = "Identifying build plate type",
    "SCANNER_EXTRINSIC_PARA_CALI" = "Calibrating Micro Lidar",
    "TOOLHEAD_HOMING" = "Homing toolhead",
    "NOZZLE_TIP_CLEANING" = "Cleaning nozzle tip",
    "EXTRUDER_TEMP_PROTECT_CALI" = "Checking extruder temperature",
    "USER_PAUSE" = "Printing was paused by the user",
    "TOOLHEAD_SHELL_OFF_PAUSE" = "Pause of front cover falling",
    "SCANNER_LASER_PARA_CALI" = "Calibrating the micro lida",
    "EXTRUDER_ABSOLUTE_FLOW_CALI" = "Calibrating extrusion flow",
    "HOTEND_TEMPERATURE_ERROR_PAUSE" = "Paused due to nozzle temperature malfunction",
    "HEATED_BED_TEMPERATURE_ERROR_PAUSE" = "Paused due to heat bed temperature malfunction",
    "FILAMENT_UNLOADING" = "Filament unloading",
    "SKIP_STEP_PAUSE" = "Skip step pause",
    "FILAMENT_LOADING" = "Filament loading",
    "MOTOR_NOISE_CALIBRATION" = "Motor noise calibration",
    "AMS_LOST_PAUSE" = "Paused due to AMS lost",
    "HEAT_BREAK_FAN_PAUSE" = "Paused due to low speed of the heat break fan",
    "CHAMBER_TEMPERATURE_CONTROL_ERROR_PAUSE" = "Paused due to chamber temperature control error",
    "CHAMBER_COOLING" = "Cooling chamber",
    "USER_INSERT_GCODE_PAUSE" = "Paused by the Gcode inserted by user",
    "MOTOR_NOISE_SHOWOFF" = "Motor noise showoff",
    "NOZZLE_FILAMENT_COVERED_DETECTED_PAUSE" = "Nozzle filament covered detected pause",
    "CUTTER_ERROR_PAUSE" = "Cutter error pause",
    "FIRST_LAYER_ERROR_PAUSE" = "First layer error pause",
    "NOZZLE_CLOG_PAUSE" = "Nozzle clog pause"
}
/**
 * Maps numeric stage_curr values to PrintStage enum values
 */
declare const stageCurrToStage: Record<number, PrintStage>;
/**
 * Detailed information about a print stage
 */
interface PrintStageInfo {
    /** The current stage of printing */
    stage: PrintStage;
    /** Progress percentage within the current stage (0-100) */
    progress: number;
    /** Human-readable name of the stage */
    name: string;
    /** Detailed description of what's happening in this stage */
    description: string;
    /** Whether this stage can be controlled (paused/resumed/skipped) */
    controllable: boolean;
    /** Whether this stage is critical for print success */
    critical: boolean;
    /** Estimated time remaining in this stage (seconds) */
    timeRemaining?: number;
}
declare const PrintStageDetails: Record<PrintStage, Partial<PrintStageInfo>>;
/**
 * Speed levels of the printer.
 *
 * Extracted from https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.hpp#L73-L80
 */
declare enum SpeedLevel {
    SILENT = "1",
    NORMAL = "2",
    SPORT = "3",
    LUDICROUS = "4"
}
declare enum FilamentType {
    PLA = "PLA",
    ABS = "ABS",
    TPU = "TPU",
    PC = "PC",
    ASA = "ASA",
    PA_CF = "PA-CF",
    PA6_CF = "PA6-CF",
    PET_CF = "PET-CF",
    PETG = "PETG",
    PETG_CF = "PETG-CF",
    PLA_AERO = "PLA-AERO",
    PLA_CF = "PLA-CF",
    PPA_CF = "PPA-CF",
    PPA_GF = "PPA-GF",
    PA = "PA",
    HIPS = "HIPS",
    PPS = "PPS",
    PPS_CF = "PPS-CF",
    PVA = "PVA",
    PLA_S = "PLA-S",
    PA_S = "PLA-S"
}
/**
 * An AMS tray (filament slot) instance.
 */
interface AMSTray$1 {
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    bed_temp: string;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    bed_temp_type: string;
    /**
     * Unknown. Bambu Studio doesn't even check for it.
     *
     * Probably the temperature required for filament drying.
     */
    drying_temp: string;
    /**
     * Probably the time required for filament drying.
     */
    drying_time: string;
    /**
     * The ID of the tray.
     */
    id: string;
    /**
     * The loaded filament's maximum nozzle temperature.
     */
    nozzle_temp_max: StringNumber;
    /**
     * The loaded filament's minimum nozzle temperature.
     */
    nozzle_temp_min: StringNumber;
    /**
     * The amount filament remaining in %, if enabled and an official Bambu filament is loaded.
     *
     * With non-official Bambu filament:
     * - 0: Tracking is disabled.
     * - -1: Tracking is enabled.
     */
    remain: number;
    /**
     * The UID of the filament's NFC that was scanned.
     *
     * Uses:
     * - Check if filament's manufacturer is Bambu Lab: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1090-L1101
     *
     * TODO: Extract when received from printer / provide helper function to do so.
     */
    tag_uid: string;
    /**
     * The color of the filament loaded in HEX color code.
     */
    tray_color: string;
    /**
     * The diameter of the spool loaded.
     */
    tray_diameter: 1.75;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    tray_id_name: string;
    /**
     * The ID of the base config file for the filament.
     *
     * Uses:
     * - Associate the filament loaded with it's complete brand name. Use the `getFilamentConfig` function for getting the config.
     *
     * Config files can be found here: https://github.com/bambulab/BambuStudio/tree/master/resources/profiles/BBL/filament
     */
    tray_info_idx: string;
    /**
     * No use cases are known.
     */
    tray_sub_brands: "";
    /**
     * The type of filament loaded into the tray (filament slot).
     */
    tray_type: FilamentType;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    tray_uuid: string;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    tray_weight: string;
    /**
     * Information about the AI camera features (?)
     */
    xcam_info: string;
}
/**
 * An AMS instance.
 */
interface AMS {
    humidity: string;
    id: string;
    temp: string;
    tray: [
        AMSTray$1 | undefined,
        AMSTray$1 | undefined,
        AMSTray$1 | undefined,
        AMSTray$1 | undefined
    ];
}
/**
 * External spool (tray). This has unused values due to being a copy of the AMS trays.
 */
interface ExternalTray extends AMSTray$1 {
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    cols: StringNumber[];
    /**
     * The ID of the tray.
     */
    id: "254";
    /**
     * The loaded filament's "k" value (manually set in Bambu Studio).
     */
    k: number;
    /**
     * The loaded filament's "n" value (manually set in Bambu Studio).
     */
    n: number;
}
/**
 * Status of the AMS' RFID reader.
 */
declare enum AmsRFIDStatus {
    IDLE = 0,
    READING = 1,
    GCODE_TRANS = 2,
    GCODE_RUNNING = 3,
    ASSISTANT = 4,
    SWITCH_FILAMENT = 5,
    HAS_FILAMENT = 6
}
/**
 * Bambu Lab's proprietary Health Management System (HMS).
 *
 * More info: https://wiki.bambulab.com/en/x1/troubleshooting/intro-hms
 *
 * All error codes: https://wiki.bambulab.com/en/hms/home
 */
interface HMS {
    attr: number;
    code: number;
}
/**
 * Interior lighting related status instance.
 */
interface LightReport {
    node: "chamber_light" | "work_light";
    mode: "on" | "off" | "flashing";
}
/**
 * The possible progress states of a firmware upgrade.
 *
 * Extracted from https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L3481-L3494
 */
declare enum UpgradeStatusProgressState {
    DOWNLOADING = "DOWNLOADING",
    UPGRADE_REQUEST = "UPGRADE_REQUEST",
    PRE_FLASH_START = "PRE_FLASH_START",
    PRE_FLASH_SUCCESS = "PRE_FLASH_SUCCESS"
}
/**
 * The possible finish states of a firmware upgrade.
 *
 * Extracted from https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L3481-L3494
 */
declare enum UpgradeStatusFinishState {
    UPGRADE_SUCCESS = "UPGRADE_SUCCESS",
    DOWNLOAD_FAIL = "DOWNLOAD_FAIL",
    FLASH_FAIL = "FLASH_FAIL",
    PRE_FLASH_FAIL = "PRE_FLASH_FAIL",
    UPGRADE_FAIL = "UPGRADE_FAIL"
}
/**
 * Error codes thrown by the upgrade.
 */
declare enum UpgradeErrorCode {
    UpgradeNoError = 0,
    UpgradeDownloadFailed = 1,
    UpgradeVerifyFailed = 2,
    UpgradeFlashFailed = 3,
    UpgradePrinting = 4
}
/**
 * The possible states the printer's screen will display.
 */
declare enum UpgradeDisplayState {
    UNAVAILABLE = 0,
    IDLE = 1,
    UPGRADING = 2,
    UPGRADE_FINISHED = 3
}
/**
 * Contains basic data about a filament, which is then extended by the final product.
 */
interface BaseFilamentConfig {
    type: "filament";
    name: string;
    inherits: string;
    from: string;
    instantiation: StringBoolean;
    fan_cooling_layer_time: [StringNumber];
    filament_max_volumetric_speed: [StringNumber];
    filament_density: [StringNumber];
    filament_cost: [StringNumber];
    cool_plate_temp: [StringNumber];
    eng_plate_temp: [StringNumber];
    hot_plate_temp: [StringNumber];
    textured_plate_temp: [StringNumber];
    cool_plate_temp_initial_layer: [StringNumber];
    eng_plate_temp_initial_layer: [StringNumber];
    hot_plate_temp_initial_layer: [StringNumber];
    textured_plate_temp_initial_layer: [StringNumber];
    nozzle_temperature_initial_layer: [StringNumber];
    reduce_fan_stop_start_freq: [StringNumber];
    fan_min_speed: [StringNumber];
    overhang_fan_threshold: [StringNumber];
    close_fan_the_first_x_layers: [StringNumber];
    nozzle_temperature: [StringNumber];
    temperature_vitrification: [StringNumber];
    nozzle_temperature_range_low: [StringNumber];
    nozzle_temperature_range_high: [StringNumber];
    slow_down_min_speed: [StringNumber];
    slow_down_layer_time: [StringNumber];
    additional_cooling_fan_speed: [StringNumber];
    filament_start_gcode: [string];
}
/**
 * The config files ending with @base
 */
interface ExtendedFilamentConfig extends Partial<BaseFilamentConfig> {
    type: "filament";
    name: string;
    inherits: string;
    from: string;
    filament_id: string;
    setting_id: string;
}
/**
 * The final filament config data. Contains the inherited and @base file data.
 */
interface FilamentConfig {
    type: "filament";
    name: string;
    inherits: string;
    from: string;
    filament_id: string;
    instantiation: StringBoolean;
    filament_cost: [StringNumber];
    filament_vendor: [string];
    nozzle_temp_min: string;
    nozzle_temp_max: string;
    bed_temp: string;
    bed_temp_type: string;
}
interface FilamentConfigs {
    [key: string]: FilamentConfig;
}
declare const filamentConfigs: FilamentConfigs;
/**
 * Reports all sensors and statuses of the printer.
 */
interface PushAllResponse extends PrintMessageCommand {
    /**
     * Status of all connected AMSes.
     */
    ams: {
        ams: [] | [AMS] | [AMS, AMS] | [AMS, AMS, AMS] | [AMS, AMS, AMS, AMS];
        /**
         * Unknown.
         *
         * Probably used for checking for new AMSes.
         */
        ams_exist_bits: StringNumber;
        /**
         * Unknown.
         *
         * Could possibly be related to storing whether the filament's data has been read from the AMSes.
         */
        insert_flag: boolean;
        /**
         * Exact definition is unknown, but it appears to be used for checking if all filaments have been read since startup or not.
         */
        power_on_flag: boolean;
        /**
         * Unknown.
         *
         * Probably used for checking for new AMSes.
         */
        tray_exist_bits: StringNumber;
        /**
         * Unknown.
         *
         * Probably used for checking for new AMSes.
         */
        tray_is_bbl_bits: StringNumber;
        /**
         * Current tray selected by all AMSes.
         * - 254: external spool (vt_tray)
         * - otherwise: ((ams_id * 4) + tray_id) for current tray
         *
         * @example Ams 2 tray 2 would be: (1*4)+1 = 5.
         */
        tray_now: StringNumber;
        /**
         * Unknown.
         *
         * Probably used for checking which filament slots (trays) have already been read.
         */
        tray_read_done_bits: StringNumber;
        /**
         * Unknown.
         *
         * Probably used for signalling which filament slots (trays) are currently being read.
         */
        tray_reading_bits: StringNumber;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         */
        tray_tar: StringNumber;
        /**
         * Unknown.
         *
         * Could possibly be related to the AMS UI on the X1 series and in Bambu Studio.
         */
        version: number;
    };
    /**
     * The RFID reader status of the connected AMSes.
     */
    ams_rfid_status: AmsRFIDStatus;
    /**
     * The AMS status.
     *
     * How to extract it: https://github.com/bambulab/BambuStudio/blob/f96b6cd433cf925e9759260925cd2142abf298ef/src/slic3r/GUI/DeviceManager.cpp#L736-L759
     *
     * TODO: Extract when received from printer / provide helper function to do so.
     */
    ams_status: number;
    /**
     * The target temperature of the printing bed in Celsius.
     */
    bed_target_temper: number;
    /**
     * The temperature of the printing bed in Celsius.
     */
    bed_temper: number;
    /**
     * Speed of the auxiliary fan in %.
     */
    big_fan1_speed: StringNumberRange<0, 100>;
    /**
     * Speed of the chamber fan in %.
     */
    big_fan2_speed: StringNumberRange<0, 100>;
    /**
     * Interior chamber temperature.
     */
    chamber_temper: number;
    /**
     * The interior chamber's target temperature.
     *
     * Exists on the X1 series but only used on the X1E.
     */
    ctt: number;
    /**
     * `chamber_temper` doesn't make sense on P1 series (due to it not being enclosed
     * by default) hence the `frame_temper` property.
     *
     * Even though `chamber_temper` exists, there is no physical sensor for it, but it is still included for some reason.
     *
     * The value of `chamber_temper` on the P1 series is a placeholder.
     */
    frame_temper: number;
    /**
     * The command the response corresponds to.
     */
    command: "push_status";
    /**
     * Speed of the part cooling fan in %.
     */
    cooling_fan_speed: StringNumberRange<0, 100>;
    /**
     * Unknown. Bambu Studio doesn't even check for it.
     */
    fail_reason: StringNumber;
    /**
     * Array of filament backup groups. Each number is a bitmap where each bit represents
     * an AMS slot that can be used as backup for that filament group. Compatible slots
     * (same filament type and color) are grouped together.
     *
     * For example, if slots 0 and 4 contain the same filament type and color,
     * they would be in the same group with bitmap value 17 (binary: 0001 0001).
     */
    filam_bak: number[];
    /**
     * Contains the current speed of all the fans
     *
     * How to extract it: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L3273-L3279
     *
     * TODO: Extract when received from printer / provide helper function to do so.
     */
    fan_gear: number;
    /**
     * Something related to the firmware upgrades.
     */
    force_upgrade: boolean;
    /**
     * Name of the GCode file that is currently printing.
     *
     * In most cases it's in the format "/plate_#.gcode", unless printing a
     * gcode file directly (bbl.gcode, or calibration gcodes) instead of a 3mf.
     */
    gcode_file: string;
    /**
     * % of GCode prepared (sliced?)
     */
    gcode_file_prepare_percent: StringNumberRange<0, 100>;
    /**
     * Epoch time when the print started.
     */
    gcode_start_time: StringNumber;
    /**
     * The current status of the printer.
     */
    gcode_state: PrinterStatus;
    /**
     * Fan speed in %
     *
     * Heat break fan: The smaller fan on the hotend itself
     */
    heatbreak_fan_speed: StringNumberRange<0, 100>;
    /**
     * Bambu Lab's proprietary Health Management System (HMS)
     *
     * More info: https://wiki.bambulab.com/en/x1/troubleshooting/intro-hms
     *
     * All error codes: https://wiki.bambulab.com/en/hms/home
     */
    hms: HMS[];
    /**
     * This single property houses a lot of data regarding the printer.
     * There's currently no documentation for it except Bambu Studio's source code:
     *
     * - Check if axes are homed: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1255-L1269
     * - Check if printer is using 220V: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1346-L1351
     * - Check if camera is currently recording: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1353
     * - Check if AI camera detected filament entanglement: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1368
     * - Check if motor noise cancellation has been calibrated: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1376-L1378
     * - Check if the current machine is a P1P and has the enclosure enabled: https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1380-L1387
     * - Check current SD card state (has a lot more info than the sdcard property): https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1389
     * - Check if printer is using wired network (ethernet; X1E exclusive): https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1391
     */
    home_flag: number;
    hw_switch_state: number;
    /**
     * The printer's onboard camera.
     */
    ipcam: {
        /**
         * The IP and path to the LAN liveview, otherwise disabled.
         * @version X1 series exclusive
         */
        liveview: string | "disable";
        /**
         * Unknown. Bambu Studio doesn't even check for it.
         */
        tukt_server: string;
        /**
         * 0: Doesn't have camera
         * 1: Has camera
         */
        ipcam_dev: StringNumberRange<0, 1>;
        /**
         * Whether recording while printing is enabled.
         */
        ipcam_record: "enable" | "disable";
        /**
         * Unknown. Bambu Studio doesn't even check for it.
         */
        mode_bits: 3;
        /**
         * The camera's resolution
         *
         * The value is known to be very weird on the A1 series.
         */
        resolution: "720p" | "1080p" | string;
        /**
         * Whether creating a timelapse while printing is enabled.
         */
        timelapse: "enable" | "disable";
    };
    /**
     * Current layer number while printing.
     */
    layer_num: number;
    /**
     * Probably to differentiate between in-house prototypes and production machines.
     */
    lifecycle: "product" | "engineer";
    /**
     * Internal light states
     */
    lights_report: LightReport[];
    /**
     * Unknown. Bambu Studio doesn't even check for it.
     */
    maintain: number;
    /**
     * % of print done
     */
    mc_percent: NumberRange<0, 100>;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     *
     * Perhaps the current GCode line while printing?
     */
    mc_print_line_number: StringNumber;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    mc_print_error_code: "0" | StringNumber;
    /**
     * Something to do with signalling if calibration is done according to source code
     *
     * https://github.com/bambulab/BambuStudio/blob/master/src/slic3r/GUI/DeviceManager.cpp#L1331-L1342
     */
    mc_print_stage: StringNumberRange<1, 3>;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    mc_print_sub_stage: number;
    /**
     * Remaining time from print.
     */
    mc_remaining_time: number;
    /**
     * Probably to differentiate between in-house prototypes and production machines
     */
    mess_production_state: "active" | "inactive";
    /**
     * - 0: Full (pushAll) message
     * - 1: Partial (pushStatus) "difference" message (only changed properties are sent)
     *
     * @deprecated Unavailable on the X1 series in LAN mode.
     *
     *  You can instead use isPushAllCommand or isPushStatusCommand from /responses or create a new PushAllCommand and PushStatus command from /commands and use their ownsResponse method for consistency.
     */
    msg: NumberRange<0, 1>;
    /**
     * The target temperature of the nozzle in Celsius.
     */
    nozzle_target_temper: number;
    /**
     * The temperature of the nozzle in Celsius.
     */
    nozzle_temper: number;
    /**
     * Signals the status of some components of the printer and/or accessories.
     */
    online: {
        /**
         * Unknown.
         */
        ahb: boolean;
        /**
         * The RFID reader.
         */
        rfid: boolean;
        /**
         * Unknown.
         */
        version: number;
    };
    /**
     * Unknown. Some error code standard which isn't defined in Bambu Studio.
     *
     * These codes can be cleared using `system.clean_print_error` command.
     */
    print_error: number;
    /**
     * Unknown. Bambu Studio doesn't even check for it.
     */
    print_gcode_action: number;
    /**
     * Unknown. Bambu Studio doesn't even check for it.
     */
    print_real_action: number;
    /**
     * Where the print originates from.
     */
    print_type: "cloud" | "system" | "local" | "idle";
    /**
     * Unknown. Something related to what's being printed.
     */
    profile_id: StringNumber;
    /**
     * Unknown. Something related to what's being printed.
     */
    project_id: StringNumber;
    /**
     * Unknown. Something related to a print queue. (?)
     */
    queue_est: number;
    /**
     * Unknown. Something related to a print queue. (?)
     */
    queue_number: number;
    /**
     * Unknown. Something related to a print queue. (?)
     */
    queue_sts: number;
    /**
     * Unknown. Something related to a print queue. (?)
     */
    queue_total: number;
    /**
     * Objects that have been skipped by the printer while printing,
     */
    s_obj: unknown[];
    /**
     * Whether the SD card is inserted.
     */
    sdcard: boolean;
    /**
     * Related to general MQTT commands on all Bambu Lab printers. Incremented by one each response/request.
     */
    sequence_id: StringNumber;
    /**
     * The current speed level.
     */
    spd_lvl: SpeedLevel;
    /**
     * The current speed level in %.
     */
    spd_mag: NumberRange<50, 166>;
    /**
     * An x (unknown) amount of previous stages.
     */
    stg: PrintStage[];
    /**
     * The current print stage.
     */
    stg_cur: PrintStage;
    /**
     * Main purpose is unknown.
     * - 0: printing from SD card
     */
    subtask_id: StringNumber;
    /**
     * The name of the calibration gcode (without file extension), or the project file name (.3mf - with file extension)
     */
    subtask_name: string;
    /**
     * Unknown. Bambu Studio appears to do nothing with it.
     */
    task_id: StringNumber;
    /**
     * Total layer number of the current job.
     */
    total_layer_num: number;
    /**
     * Firmware upgrade status data of the printer.
     */
    upgrade_state: {
        /**
         * Unknown.
         *
         * Some component's new version number.
         */
        ahb_new_version_number: string;
        /**
         * The new version number of the AMS(es).
         */
        ams_new_version_number: string;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         */
        consistency_request: boolean;
        /**
         * What the display should say in the process.
         */
        dis_state: UpgradeDisplayState;
        /**
         * Error codes thrown by the upgrade.
         */
        err_code: UpgradeErrorCode;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         *
         * Probably has something to do with an update the user can't deny. (for ex.: security vulnerabilities)
         */
        force_upgrade: boolean;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         */
        message: string;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         */
        module: string;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         */
        new_ver_list: string;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         */
        new_version_state: number;
        /**
         * Unknown. Bambu Studio appears to do nothing with it.
         */
        ota_new_version_number: string;
        /**
         * The progress of the update in %.
         */
        progress: StringNumberRange<0, 100>;
        /**
         * Incremented by one every time a new status is returned.
         */
        sequence_id: number;
        /**
         * The progress / finish states of the upgrade.
         */
        status: UpgradeStatusProgressState & UpgradeStatusFinishState;
    };
    /**
     * Print file download status data.
     */
    upload: {
        /**
         * Downloaded file size (?)
         */
        file_size: number;
        /**
         * Total file size (?)
         */
        finish_size: number;
        /**
         * Unknown. Bambu Studio doesn't even check for it.
         */
        message: string;
        /**
         * Unknown. Bambu Studio doesn't even check for it.
         */
        oss_url: string;
        /**
         * The progress of the file download in %.
         */
        progress: StringNumberRange<0, 100>;
        /**
         * Incremented by one every time a new status is returned.
         */
        sequence_id: StringNumber;
        /**
         * Download speed in unknown units.
         */
        speed: number;
        /**
         * Unknown. Bambu Studio doesn't even check for it.
         */
        status: "idle" | string;
        /**
         * Unknown. Bambu Studio doesn't even check for it.
         */
        task_id: string;
        /**
         * Time remaining until download completes in unknown units.
         */
        time_remaining: number;
        /**
         * Unknown. Bambu Studio doesn't even check for it.
         *
         * Probably some kind of error code.
         */
        trouble_id: string;
    };
    /**
     * External spool (tray). This has unused values due to being a copy of the AMS trays.
     */
    vt_tray: ExternalTray;
    /**
     * The signal strength of the Wi-Fi signal which the printer is connected to in dBm.
     */
    wifi_signal: `-${number}dBm`;
    /**
     * AI-related features of the printer's camera.
     */
    xcam: {
        /**
         * Whether skipping parts setting is enabled.
         */
        allow_skip_parts: boolean;
        /**
         * Whether the printer should detect the correct orientation and type of the buildplate.
         */
        buildplate_marker_detector: boolean;
        /**
         * Whether the first layer inspection is enabled for the printer.
         */
        first_layer_inspector: boolean;
        /**
         * Whether the printer is allowed to stop the print in the event it detects an abnormality.
         */
        print_halt: boolean;
        /**
         * The sensitivity for the spaghetti detector, first layer inspection, etc.
         */
        halt_print_sensitivity: "low" | "medium" | "high";
        /**
         * Whether print monitoring is enabled.
         */
        printing_monitor: boolean;
        /**
         * Whether the spaghetti detector is enabled.
         */
        spaghetti_detector: boolean;
    };
    /**
     * AI-related features' status.
     */
    xcam_status: StringNumber;
}
/**
 * Retrieves the FilamentConfig object associated with the specified ID.
 * @param id - The ID of the FilamentConfig to retrieve.
 * @returns The FilamentConfig object if found, otherwise undefined.
 */
declare function getFilamentConfig(id: string): FilamentConfig | null;
/**
 * Converts a numeric stage_curr value to its corresponding PrintStage enum value
 * @param stageCurr - The numeric stage value (0-35)
 * @returns The corresponding PrintStage enum value, or undefined if not found
 */
declare function getStageFromCurr(stageCurr: number): PrintStage | undefined;
/**
 * Converts an array of numeric stage values to an array of PrintStage enum values
 * @param stages - Array of numeric stage values (0-35)
 * @returns Array of corresponding PrintStage enum values, filtering out any undefined stages
 */
declare function getStagesFromArray(stages: number[]): PrintStage[];
/**
 * Represents a stage with its details and completion status
 */
interface EnrichedStageInfo extends Partial<PrintStageInfo> {
    stage: PrintStage;
    description: string;
    completed: boolean;
    current: boolean;
}
/**
 * Creates an enriched array of stage information with completion status
 * @param currentStage - The current stage number (stage_curr)
 * @param stageHistory - Array of previous stage numbers (stg)
 * @returns Array of stages with their details and completion status
 *
 * @example
 * const stages = getEnrichedStages(4, [2, 13, 24, 4]);
 * // Returns array of EnrichedStageInfo with:
 * // - HEATBED_PREHEATING (completed)
 * // - TOOLHEAD_HOMING (completed)
 * // - FILAMENT_LOADING (completed)
 * // - CHANGE_MATERIAL (current, not completed)
 */
declare function getEnrichedStages(currentStage: number, stageHistory: number[]): EnrichedStageInfo[];
declare function isPushAllCommand(data: PrintMessageCommand): data is PushAllResponse;

type BambuClientPrinterStatus = "FINISH" | "FAILED" | "RUNNING" | "IDLE" | "PAUSE" | "PREPARE" | "SLICING" | "OFFLINE";
declare enum PrinterModelNamesShort {
    X1C = "X1C",
    X1 = "X1",
    X1E = "X1E",
    P1P = "P1P",
    P1S = "P1S",
    A1 = "A1",
    A1M = "A1M",
    H2D = "H2D"
}
declare enum PrinterModelIDs {
    X1C = "BL-P001",
    X1 = "BL-P002",
    P1P = "C11",
    P1S = "C12",
    X1E = "C13",
    A1 = "N2S",
    A1M = "N1",
    H2D = "O1D"
}
/**
 * Mapping of printer model IDs to their friendly model names
 * This includes:
 * - Official model IDs from machine profiles (BL-P001, C11, etc.)
 * - Full names (from project_settings.config)
 */
declare const PRINTER_MODEL_MAP: Record<PrinterModelIDs, string>;
/**
 * Mapping of printer model IDs to their full names
 * This includes:
 * - Official model IDs from machine profiles (BL-P001, C11, etc.)
 * - Full names (from project_settings.config)
 */
declare const PRINTER_MODEL_LONG_NAME_MAP: Record<PrinterModelIDs, PrinterLongNames>;
declare const CONNECT_RETURN_CODE_DESC: {
    0: string;
    1: string;
    2: string;
    3: string;
    4: string;
    5: string;
};
type PrinterLongNames = "Bambu Lab X1C" | "Bambu Lab X1" | "Bambu Lab P1S" | "Bambu Lab P1P" | "Bambu Lab A1" | "Bambu Lab A1 Mini" | "Bambu Lab H2D";
type AMS_PREFIX = "A" | "B" | "C" | "D";
declare const AMS_LETTER_MAP: Record<string, AMS_PREFIX>;

declare const commandSchemas: {
    updateLight: z.ZodObject<{
        light: z.ZodEnum<["chamber_light", "work_light"]>;
        mode: z.ZodEnum<["on", "off", "flashing"]>;
        loopOptions: z.ZodOptional<z.ZodObject<{
            onTime: z.ZodOptional<z.ZodNumber>;
            offTime: z.ZodOptional<z.ZodNumber>;
            loops: z.ZodOptional<z.ZodNumber>;
            interval: z.ZodOptional<z.ZodNumber>;
        }, "strip", z.ZodTypeAny, {
            onTime?: number | undefined;
            offTime?: number | undefined;
            loops?: number | undefined;
            interval?: number | undefined;
        }, {
            onTime?: number | undefined;
            offTime?: number | undefined;
            loops?: number | undefined;
            interval?: number | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        light: "chamber_light" | "work_light";
        mode: "on" | "off" | "flashing";
        loopOptions?: {
            onTime?: number | undefined;
            offTime?: number | undefined;
            loops?: number | undefined;
            interval?: number | undefined;
        } | undefined;
    }, {
        light: "chamber_light" | "work_light";
        mode: "on" | "off" | "flashing";
        loopOptions?: {
            onTime?: number | undefined;
            offTime?: number | undefined;
            loops?: number | undefined;
            interval?: number | undefined;
        } | undefined;
    }>;
    updateFan: z.ZodObject<{
        fan: z.ZodEffects<z.ZodEnum<["1", "2", "3"]>, number, "1" | "2" | "3">;
        speed: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        speed: number;
        fan: number;
    }, {
        speed: number;
        fan: "1" | "2" | "3";
    }>;
    updateSpeed: z.ZodObject<{
        speed: z.ZodEnum<["1", "2", "3", "4"]>;
    }, "strip", z.ZodTypeAny, {
        speed: "1" | "2" | "3" | "4";
    }, {
        speed: "1" | "2" | "3" | "4";
    }>;
    updateTemp: z.ZodObject<{
        part: z.ZodEnum<["bed", "nozzle", "chamber"]>;
        temperature: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        part: "bed" | "nozzle" | "chamber";
        temperature: number;
    }, {
        part: "bed" | "nozzle" | "chamber";
        temperature: number;
    }>;
    updateState: z.ZodObject<{
        state: z.ZodEnum<["pause", "resume", "stop"]>;
    }, "strip", z.ZodTypeAny, {
        state: "resume" | "pause" | "stop";
    }, {
        state: "resume" | "pause" | "stop";
    }>;
    gcode: z.ZodObject<{
        gcodes: z.ZodArray<z.ZodString, "many">;
    }, "strip", z.ZodTypeAny, {
        gcodes: string[];
    }, {
        gcodes: string[];
    }>;
    resume: z.ZodObject<{
        cleanPrintError: z.ZodOptional<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        cleanPrintError?: boolean | undefined;
    }, {
        cleanPrintError?: boolean | undefined;
    }>;
    ams_control: z.ZodObject<{
        param: z.ZodAny;
    }, "strip", z.ZodTypeAny, {
        param?: any;
    }, {
        param?: any;
    }>;
    refreshPrinterState: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
    ams_filament_settings: z.ZodObject<{
        ams_id: z.ZodNumber;
        tray_id: z.ZodNumber;
        filament_id: z.ZodString;
        setting_id: z.ZodString;
        color: z.ZodString;
        filament_type: z.ZodString;
        nozzle_temp_min: z.ZodNumber;
        nozzle_temp_max: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        ams_id: number;
        tray_id: number;
        filament_id: string;
        setting_id: string;
        color: string;
        filament_type: string;
        nozzle_temp_min: number;
        nozzle_temp_max: number;
    }, {
        ams_id: number;
        tray_id: number;
        filament_id: string;
        setting_id: string;
        color: string;
        filament_type: string;
        nozzle_temp_min: number;
        nozzle_temp_max: number;
    }>;
    loadFilament: z.ZodObject<{
        trayId: z.ZodNumber;
        oldTemp: z.ZodOptional<z.ZodNumber>;
        newTemp: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        trayId: number;
        oldTemp?: number | undefined;
        newTemp?: number | undefined;
    }, {
        trayId: number;
        oldTemp?: number | undefined;
        newTemp?: number | undefined;
    }>;
    unloadFilament: z.ZodObject<{
        oldTemp: z.ZodOptional<z.ZodNumber>;
        newTemp: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        oldTemp?: number | undefined;
        newTemp?: number | undefined;
    }, {
        oldTemp?: number | undefined;
        newTemp?: number | undefined;
    }>;
    axisControl: z.ZodObject<{
        axis: z.ZodEnum<["X", "Y", "Z", "E"]>;
        distance: z.ZodNumber;
        unit: z.ZodOptional<z.ZodNumber>;
        speed: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        axis: "X" | "Y" | "Z" | "E";
        distance: number;
        unit?: number | undefined;
        speed?: number | undefined;
    }, {
        axis: "X" | "Y" | "Z" | "E";
        distance: number;
        unit?: number | undefined;
        speed?: number | undefined;
    }>;
    autoLevel: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
    goHome: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
    cleanPrintError: z.ZodObject<{
        subtaskId: z.ZodString;
        printError: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        subtaskId: string;
        printError: number;
    }, {
        subtaskId: string;
        printError: number;
    }>;
    powerLossRecovery: z.ZodObject<{
        action: z.ZodEnum<["resume", "stop"]>;
        subtaskId: z.ZodString;
        printError: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        subtaskId: string;
        printError: number;
        action: "resume" | "stop";
    }, {
        subtaskId: string;
        printError: number;
        action: "resume" | "stop";
    }>;
    camera: z.ZodObject<{
        operation: z.ZodEnum<["ipcam_record_set", "ipcam_timelapse", "ipcam_resolution_set"]>;
        value: z.ZodUnion<[z.ZodBoolean, z.ZodString]>;
    }, "strip", z.ZodTypeAny, {
        value: string | boolean;
        operation: "ipcam_record_set" | "ipcam_timelapse" | "ipcam_resolution_set";
    }, {
        value: string | boolean;
        operation: "ipcam_record_set" | "ipcam_timelapse" | "ipcam_resolution_set";
    }>;
};
type CommandSchemas = typeof commandSchemas;
declare function validateCommandParams<T extends keyof CommandSchemas>(command: T, params: unknown): {
    success: true;
    data: z.infer<CommandSchemas[T]>;
} | {
    success: false;
    error: z.ZodError;
};

type CommandCategory = "info" | "pushing" | "system" | "print";
declare enum LightEffect {
    ON = "on",
    OFF = "off",
    FLASHING = "flashing"
}
declare enum LightNode {
    CHAMBER = "chamber_light",
    WORK = "work_light"
}
interface LightOptions {
    onTime?: number;
    offTime?: number;
    loops?: number;
    interval?: number;
}
declare enum CameraOperation {
    RECORD = "ipcam_record_set",
    TIMELAPSE = "ipcam_timelapse",
    RESOLUTION = "ipcam_resolution_set"
}
declare enum FanType {
    PART_COOLING = 1,
    AUXILIARY = 2,
    CHAMBER = 3
}
type Axis = "X" | "Y" | "Z" | "E";
declare const VALID_COMMANDS: readonly ["updateLight", "updateFan", "updateSpeed", "updateTemp", "updateState", "gcode", "resume", "ams_control", "refreshPrinterState", "ams_filament_settings", "loadFilament", "unloadFilament", "axisControl", "autoLevel", "goHome", "cleanPrintError", "powerLossRecovery", "camera", "cleanPrintError"];
type CommandType = (typeof VALID_COMMANDS)[number];
type CommandParams = {
    updateLight: {
        light: LightNode;
        mode: LightEffect;
        loopOptions?: LightOptions;
    };
    updateFan: {
        fan: FanType;
        speed: NumberRange<0, 100>;
    };
    updateSpeed: {
        speed: SpeedLevel;
    };
    updateTemp: {
        part: "bed" | "nozzle" | "chamber";
        temperature: NumberRange<0, 300>;
    };
    updateState: {
        state: "pause" | "resume" | "stop";
    };
    gcode: {
        gcodes: string[];
    };
    resume: {
        cleanPrintError?: boolean;
    };
    ams_control: {
        param: AMSControlAction;
    };
    refreshPrinterState: Record<string, never>;
    ams_filament_settings: {
        ams_id: number;
        tray_id: number;
        filament_id: string;
        setting_id: string;
        color: string;
        filament_type: string;
        nozzle_temp_min: number;
        nozzle_temp_max: number;
    };
    loadFilament: {
        trayId: number;
        oldTemp?: number;
        newTemp?: number;
    };
    unloadFilament: {
        oldTemp?: number;
        newTemp?: number;
    };
    axisControl: {
        axis: Axis;
        distance: number;
        unit?: number;
        speed?: number;
    };
    autoLevel: Record<string, never>;
    goHome: Record<string, never>;
    cleanPrintError: {
        subtaskId: string;
        printError: number;
    };
    powerLossRecovery: {
        action: "resume" | "stop";
        subtaskId: string;
        printError: number;
    };
    camera: {
        operation: CameraOperation;
        value: boolean | string;
    };
};
interface CommandResponse {
    sequence_id?: string;
    status?: "success" | "error";
    error?: string;
}
declare const createCommand: <T extends CommandType>(command: T, params: CommandParams[T]) => {
    command: T;
    params: CommandParams[T];
};
declare const isValidCommand: (command: string) => command is CommandType;

/**
 * Error codes that indicate a job has failed
 */
declare const ERROR_CODES_JOB_FAILED: readonly [83902466, 83902467, 83902468, 83902469, 83902470, 83902471, 83902472, 83902473, 83902474, 83902475, 117456897, 83902476, 83902477, 83902478, 83902484, 83902485, 83902486, 83902509, 83902510, 83902511, 83902519, 83902520, 83902522, 83918867, 83935248, 83968052, 50348032, 50348033, 50348034, 50348045, 50364424, 50364430, 50364432];
/**
 * Error code for local cancellation
 */
declare const LOCAL_CANCEL_CODE = 50348044;
/**
 * Type for all possible Bambu Lab error codes
 */
type BambuErrorCode = keyof typeof ALL_ERRORS;
/**
 * Complete mapping of Bambu Lab error codes to their descriptions
 */
declare const ALL_ERRORS: {
    readonly 5324857: "Device login has expired, please try to bind again.";
    readonly 50348032: "Printing stopped because homing Z axis failed.";
    readonly 50348033: "The printer timed out waiting for the nozzle to cool down before homing.";
    readonly 50348034: "Printing Stopped because Auto Bed Leveling failed.";
    readonly 50348037: "The nozzle fan speed is abnormal.";
    readonly 50348038: "The nozzle is clogged.";
    readonly 50348040: "The AMS failed to change filament.";
    readonly 50348041: "Homing XY axis failed.";
    readonly 50348042: "Mechanical resonance frequency identification failed.";
    readonly 50348043: "Internal communication exception.";
    readonly 50348044: "Printing was cancelled.";
    readonly 50348045: "Resume failed after power loss.";
    readonly 50348046: "The motor self-check failed.";
    readonly 50364416: "Printing was paused for unknown reason. You can tap \"Resume\" to resume the print job.";
    readonly 50364417: "Printing was paused by the user. You can tap \"Resume\" to resume the print job.";
    readonly 50364418: "First layer defects were detected by the Micro Lidar. Please check the quality of the printed model before continuing your print.";
    readonly 50364419: "Spaghetti defects were detected by the AI Print Monitoring. Please check the quality of the printed model before continuing your print.";
    readonly 50364420: "Filament ran out. Please load new filament.";
    readonly 50364421: "Toolhead front cover fell off. Please remount the front cover and check to make sure your print is going okay.";
    readonly 50364422: "The build plate marker was not detected. Please confirm the build plate is correctly positioned on the heatbed with all four corners aligned, and the maker is clear.";
    readonly 50364423: "There was an unfinished print job when the printer lost power. If the model is still adhered to the build plate, you can try resuming the print job.";
    readonly 50364424: "Printing Stopped because nozzle temperature problem.";
    readonly 50364425: "Heatbed temperature malfunction.";
    readonly 50364426: "A Filament pile-up was detected by the AI Print Monitoring. Please clean the filament from the waste chute.";
    readonly 50364427: "The cutter is stuck. Please make sure the cutter handle is out.";
    readonly 50364428: "Skipping step detected, auto-recover complete; please resume print and check if there are any layer shift problems.";
    readonly 50364429: "Some objects have fallen down, or the extruder is not extruding normally. If the defects are acceptable, click \"Resume\" button to resume the print job.";
    readonly 50364430: "The print file is not available. Please check to see if the storage media has been removed.";
    readonly 50364431: "The door seems to be open, so printing was paused.";
    readonly 50364432: "Printing stopped because the hotend fan speed is abnormal.";
    readonly 50364433: "Detected build plate is not the same as the Gcode file. Please adjust slicer settings or use the correct plate.";
    readonly 50364435: "Printing was paused by the user. You can select \"Resume\" to continue printing.";
    readonly 50364436: "The nozzle is covered with filaments, or the build plate is installed incorrectly. Please cancel this printing and clean the nozzle or adjust the build plate according to the actual status, or tap \"Resume\" button to resume the print job.";
    readonly 50364437: "The filament has run out, please load new filament in the \"filament\" page.";
    readonly 50364438: "The nozzle is clogged up with filaments. Please cancel this printing and clean the nozzle according to the actual status, or tap \"Resume\" button to resume the print job.";
    readonly 50364439: "Foreign objects detected on hotbed, Please check and clean the hotbed, Then tap \"Resume\" button to resume the print job.";
    readonly 50364440: "Chamber temperature malfunction.";
    readonly 50364441: "No build plate is placed.";
    readonly 83902465: "Failed to connect to Bambu Cloud. Please check your network connection.";
    readonly 83902466: "Unsupported print file path or name. Please resend the printing job.";
    readonly 83902467: "Printing stopped because the printer was unable to parse the file. Please resend your print job.";
    readonly 83902468: "The printer can't receive new print jobs while printing. Resend after the current print finishes.";
    readonly 83902469: "Print jobs are not allowed to be sent while updating firmware.";
    readonly 83902470: "There is not enough free storage space for the print job. Restoring to factory settings can release available space.";
    readonly 83902471: "Print jobs are not allowed to be sent while force updating or when repair updating is required.";
    readonly 83902472: "Starting printing failed. please power cycle the printer and resend the print job.";
    readonly 83902473: "Print jobs are not allowed to be sent while updating logs.";
    readonly 83902474: "The file name is not supported. Please rename and restart the printing job.";
    readonly 83902475: "There was a problem downloading a file. Please check you network connection and resend the printing job.";
    readonly 83902476: "Please insert a MicroSD card and restart the printing job.";
    readonly 83902477: "Please run a self-test and restart the printing job.";
    readonly 83902478: "Printing was cancelled.";
    readonly 83902484: "Slicing for the print job failed. Please check your settings and restart the print job.";
    readonly 83902485: "There is not enough free storage space for the print job. Please format or clean MicroSD card to release available space.";
    readonly 83902486: "The MicroSD Card is write-protected. Please replace the MicroSD Card.";
    readonly 83902487: "Binding failed. Please retry or restart the printer and retry.";
    readonly 83902488: "Binding configuration information parsing failed, please try again.";
    readonly 83902489: "The printer has already been bound. Please unbind it and try again.";
    readonly 83902490: "Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the printer closer to the router or checking the router configuration and then try again.";
    readonly 83902491: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902492: "Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902493: "Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.";
    readonly 83902494: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902495: "Authorization timed out. Please make sure that your phone or PC has access to the internet, and ensure that the Bambu Studio/Bambu Handy APP is running in the foreground during the binding operation.";
    readonly 83902496: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902497: "Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.";
    readonly 83902498: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902499: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902500: "Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the printer closer to the router or checking the router configuration before you try again.";
    readonly 83902501: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902502: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902503: "Cloud access failed; this may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.";
    readonly 83902504: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902505: "Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83902506: "Failed to connect to the router, which may be caused by wireless interference or being too far away from the router. Please try again or move the printer closer to the router and try again.";
    readonly 83902507: "Router connection failed due to incorrect password. Please check the password and try again.";
    readonly 83902508: "Failed to obtain IP address, which may be caused by wireless interference resulting in data transmission failure or DHCP address pool of the router being full. Please move the printer closer to the router and try again. If the issue persists, please check router settings to see whether the IP addresses have been exhausted.";
    readonly 83902509: "System exception.";
    readonly 83902510: "The system does not support the file system currently used by the Micro SD card. Please replace the Micro SD card or format the current Micro SD card to FAT32.";
    readonly 83902511: "The Micro SD card sector data is damaged. Please use the SD card repair tool to repair or format it. If it still cannot be identified, please replace the Micro SD card.";
    readonly 83902519: "Your sliced file is not compatible with current printer model. This file can't be printed on this printer.";
    readonly 83902520: "The nozzle diameter in sliced file is not consistent with the current nozzle setting. This file can't be printed.";
    readonly 83902522: "The current temperature is too low. In order to protect you and your printer. Printing task, moving axis and other operations is disabled. Please move the printer to an environment above 10 celsius degree.";
    readonly 83918867: "The print file is not available. Please check to see if the storage media has been removed.";
    readonly 83918902: "Your sliced file is not consistent with the current printer model. Continue?";
    readonly 83935248: "MicroSD Card read/write exception. please reinsert or replace MicroSD Card.";
    readonly 83968023: "Binding failed. Please retry or restart the printer and retry.";
    readonly 83968024: "Binding configuration information parsing failed, please try again.";
    readonly 83968025: "The printer has already been bound. Please unbind it and try again.";
    readonly 83968026: "Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the printer closer to the router or checking the router configuration and then try again.";
    readonly 83968027: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968028: "Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968029: "Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.";
    readonly 83968030: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968031: "Authorization timed out. Please make sure that your phone or PC has access to the internet, and ensure that the Bambu Studio/Bambu Handy APP is running in the foreground during the binding operation.";
    readonly 83968032: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968033: "Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.";
    readonly 83968034: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968035: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968036: "Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the printer closer to the router or checking the router configuration before you try again.";
    readonly 83968037: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968038: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968039: "Cloud access failed; this may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.";
    readonly 83968040: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968041: "Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer service.";
    readonly 83968049: "Device discovery binding is in progress, and the QR code cannot be displayed on the screen. You can wait for the binding to finish or abort the device discovery binding process in the APP/Studio and retry scanning the QR code on the screen for binding.";
    readonly 83968050: "QR code binding is in progress, so device discovery binding cannot be performed. You can scan the QR code on the screen for binding or exit the QR code display page on screen and try device discovery binding.";
    readonly 83968051: "Your APP region is not matched with your printer, please download the APP in the corresponding region and register your account again.";
    readonly 83968052: "The slicing progress has not been updated for a long time, and the printing task has exited. Please confirm the parameters and reinitiate printing.";
    readonly 83968053: "The device is in the process of binding and cannot respond to new binding requests.";
    readonly 83968056: "The regional settings do not match the printer, please check the printer's regional settings.";
    readonly 117456897: "The AMS has been disabled for a print, but it still has filament loaded. Please unload the AMS filament , and switch to the spool holder filament for printing.";
    readonly 117473281: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 117473282: "The cutter is stuck. Please make sure the cutter handle is out.";
    readonly 117473283: "Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.";
    readonly 117473284: "AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.";
    readonly 117473285: "The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.";
    readonly 117473286: "Unable to feed filament into the extruder. This could be due to entangled filament or a stuck spool. If not, please check if the AMS PTFE tube is connected.";
    readonly 117473287: "Extruding filament failed. The extruder might be clogged.";
    readonly 117473296: "The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.";
    readonly 117473297: "AMS filament ran out. Please insert a new filament into the same AMS slot.";
    readonly 117473298: "Failed to get AMS mapping table; please click \"Retry\" to continue.";
    readonly 117473299: "Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 117522433: "Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.";
    readonly 117538817: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 117538818: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 117538819: "Failed to pull out the filament from the extruder. There may be an extruder clog or broken filament inside the extruder.";
    readonly 117538820: "AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.";
    readonly 117538821: "The AMS failed to send filament. You canclip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.";
    readonly 117538822: "Unable to feed filament into the extruder. This could be due to entangled filament or a stuck spool.";
    readonly 117538823: "Failed to extrude the filament. Please check if the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 117538832: "The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.";
    readonly 117538833: "AMS filament ran out. Please insert a new filament into the same AMS slot.";
    readonly 117538834: "Failed to get AMS mapping table; please click \"Retry\" to continue.";
    readonly 117538835: "Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 117587969: "Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.";
    readonly 117604353: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 117604354: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 117604355: "Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 117604356: "Failed to pull back the filament from the toolhead to AMS. Please check whether the filament or the spool is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117604357: "Failed to feed the filament outside the AMS. Please clip the end of the filament flat and check to see if the spool is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117604358: "Failed to feed the filament into the toolhead. Please check whether the filament or the spool is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117604359: "Failed to extrude the filament. Please check if the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 117604368: "AMS assist motor is overloaded. Please check if the spool or filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117604369: "AMS filament ran out. Please insert a new filament into the same AMS slot.";
    readonly 117604370: "Failed to get AMS mapping table; please click \"Retry\" to continue.";
    readonly 117604371: "Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 117653505: "Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.";
    readonly 117669889: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 117669890: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 117669891: "Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 117669892: "Failed to pull back the filament from the toolhead to AMS. Please check whether the filament or the spool is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117669893: "Failed to feed the filament outside the AMS. Please clip the end of the filament flat and check to see if the spool is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117669894: "Failed to feed the filament into the toolhead. Please check whether the filament or the spool is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117669895: "Failed to extrude the filament. Please check if the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 117669904: "AMS assist motor is overloaded. Please check if the spool or filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 117669905: "AMS filament ran out. Please insert a new filament into the same AMS slot.";
    readonly 117669906: "Failed to get AMS mapping table; please click \"Retry\" to continue.";
    readonly 117669907: "Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 134168577: "Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.";
    readonly 134184961: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 134184962: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 134184963: "Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder. (Connect PTFE tube if you are about to use AMS)";
    readonly 134184964: "Failed to pull back the filament from the toolhead to AMS. Please check whether the filament or the spool is stuck. After troubleshooting, click the \"retry\" button.";
    readonly 134184965: "Failed to feed the filament outside the AMS. Please clip the end of the filament flat and check to see if the spool is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 134184966: "Please feed filament into the PTFE tube until it can not be pushed any farther.";
    readonly 134184967: "Please observe the nozzle. If the filament has been extruded, click \"Done\"; if it is not, please push the filament forward slightly and then click \"Retry\".";
    readonly 134184976: "AMS assist motor is overloaded. Please check if the spool or filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 134184977: "AMS filament ran out. Please put a new filament into AMS and click the \"Retry\" button.";
    readonly 134184978: "Failed to get AMS mapping table; please click \"Retry\" to continue.";
    readonly 134184979: "Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 134201347: "Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder or PTFE Tube. (Connect PTFE tube if you are about to use AMS)";
    readonly 134201350: "Please feed filament into the PTFE tube until it can not be pushed any farther.";
    readonly 201359361: "First layer defects were detected. If the defects are acceptable, click \"Resume\" button to resume the print job.";
    readonly 201359362: "Spaghetti failure was detected.";
    readonly 201359365: "Purged filament has piled up in the waste chute, which may cause a tool head collision.";
    readonly 201359369: "Build plate localization marker was not found.";
    readonly 201359370: "The detected build plate is not the same as in G-code.";
    readonly 201375747: "Possible defects were detected in the first layer.";
    readonly 201375748: "Possible spaghetti failure was detected.";
    readonly 201375750: "Purged filament may have piled up in the waste chute.";
    readonly 268484609: "High bed temperature may lead to filament clogging in the nozzle. Please ensure ventilation for the printer.";
    readonly 268484610: "Printing CF material with stainless steel may cause nozzle damage.";
    readonly 268484611: "Enabling traditional timelapse might lead to defects. Please enable it as needed?";
    readonly 268550145: "Timelapse is not supported because Spiral vase is enabled in slicing presets.";
    readonly 268550146: "Timelapse is not supported because Print sequence is set to \"By object\".";
    readonly 302006273: "Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.";
    readonly 302022657: "Cutting the filament failed. Please check to see if the cutter is stuck. Refer to the Assistant for solutions.";
    readonly 302022658: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 302022659: "Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 302022660: "Failed to pull back the filament from the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302022661: "Failed to feed the filament. Please load the filament, then click the \"Retry\" button.";
    readonly 302022662: "Failed to feed the filament into the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302022663: "Failed to extrude the filament. This might be caused by clogged extruder or stuck filament. Refer to the Assistant for solutions.";
    readonly 302022672: "Filament or spool may be stuck.";
    readonly 302022673: "AMS filament ran out. Please insert a new filament into the same AMS slot.";
    readonly 302022674: "Failed to get AMS mapping table. Please click the \"Retry\" button to continue.";
    readonly 302022675: "Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 302022676: "The filament location in the toolhead was not found. Refer to the Assistant for solutions.";
    readonly 302022677: "Failed to pull out the filament from the toolhead. Please check if the filament is stuck, or the filament is broken inside the extruder or PTFE tube.";
    readonly 302022678: "The extruder is not extruding normally, please refer to the HMS. After trouble shooting. If the defects are acceptable, please click \"Retry\" button.";
    readonly 302071809: "Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.";
    readonly 302088193: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 302088194: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 302088195: "Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 302088196: "Failed to pull back the filament from the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302088197: "Failed to feed the filament. Please load the filament and then click the \"Retry\" button.";
    readonly 302088198: "Failed to feed the filament into the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302088199: "Failed to extrude the filament. The extruder may be clogged or the filament may be stuck, please refer to HMS. After troubleshooting, click \"Retry\" button.";
    readonly 302088208: "Please check if the spool or filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302088209: "AMS filament has run out. Please insert a new filament into the AMS and click the \"Retry\" button.";
    readonly 302088210: "Failed to get AMS mapping table; please click the \"Retry\" button to continue.";
    readonly 302088211: "Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 302088212: "Failed to check the filament location in the tool head; please refer to the HMS. After troubleshooting, click the \"Retry\" button.";
    readonly 302088213: "Failed to pull back the filament from the toolhead. Please check if the filament is stuck or the filament is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 302088214: "The extruder is not extruding normally, please refer to the HMS. After trouble shooting. If the defects are acceptable, please click \"Retry\" button.";
    readonly 302137345: "Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.";
    readonly 302153729: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 302153730: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 302153731: "Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 302153732: "Failed to pull back the filament from the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302153733: "Failed to feed the filament. Please load the filament, then click the \"Retry\" button.";
    readonly 302153734: "Failed to feed the filament into the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302153735: "Failed to extrude the filament. The extruder may be clogged or the filament may be stuck, please refer to HMS. After troubleshooting, click \"Retry\" button.";
    readonly 302153744: "Please check if the spool or filament is stuck. After troublesho";
    readonly 302153745: "AMS filament has run out. Please insert a new filament into the AMS and click the \"Retry\" button.";
    readonly 302153746: "Failed to get AMS mapping table; please click the \"Retry\" button to continue.";
    readonly 302153747: "Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 302153748: "Failed to check the filament location in the tool head, please refer to the HMS. After troubleshooting, click the \"Retry\" button.";
    readonly 302153749: "Failed to pull back the filament from the toolhead. Please check if the filament is stuck or is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 302153750: "The extruder is not extruding normally, please refer to the HMS. After trouble shooting. If the defects are acceptable, please click \"Retry\" button.";
    readonly 302202881: "Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.";
    readonly 302219265: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 302219266: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 302219267: "Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 302219268: "Failed to pull back the filament from the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302219269: "Failed to feed the filament. Please load the filament, then click the \"Retry\" button.";
    readonly 302219270: "Failed to feed the filament into the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302219271: "Failed to extrude the filament. The extruder may be clogged or the filament may be stuck, please refer to HMS. After troubleshooting, click \"Retry\" button.";
    readonly 302219280: "Please check if the spool or filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 302219281: "AMS filament has run out. Please insert a new filament into the AMS and click the \"Retry\" button.";
    readonly 302219282: "Failed to get AMS mapping table; please click the \"Retry\" button to continue.";
    readonly 302219283: "Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 302219284: "Failed to check the filament location in the tool head; please refer to the HMS. After troubleshooting, click the \"Retry\" button.";
    readonly 302219285: "Failed to pull back the filament from the toolhead. Please check if the filament is stuck or is broken inside the extruder. After troubleshooting, click the \"Retry\" button.";
    readonly 302219286: "The extruder is not extruding normally, please refer to the HMS. After trouble shooting. If the defects are acceptable, please click \"Retry\" button.";
    readonly 318717953: "Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.";
    readonly 318734337: "Failed to cut the filament. Please check the cutter. After troubleshooting, click the \"Retry\" button.";
    readonly 318734338: "The cutter is stuck. Please pull out the cutter handle and click the \"Retry\" button.";
    readonly 318734339: "Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder or PTFE Tube. (Connect PTFE tube if you are about to use AMS)";
    readonly 318734340: "Failed to pull back the filament from the toolhead. Please check whether the filament is stuck. After troubleshooting, click the \"Retry\" button.";
    readonly 318734341: "Failed to feed the filament. Please load the filament, then click the \"Retry\" button.";
    readonly 318734342: "Please feed filament into the PTFE tube until it can not be pushed any farther.";
    readonly 318734343: "Check nozzle. Click \"Done\" if filament was extruded, otherwise push filament forward slightly and click \"Retry.\"";
    readonly 318734352: "Please check if the filament or the spool is stuck.";
    readonly 318734353: "AMS filament has run out. Please insert a new filament into the AMS and click the \"Retry\" button.";
    readonly 318734354: "Failed to get AMS mapping table; please click the \"Retry\" button to continue.";
    readonly 318734355: "Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged. After troubleshooting, click the \"Retry\" button.";
    readonly 318750723: "Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder or PTFE Tube. (Connect PTFE tube if you are about to use AMS)";
    readonly 318750726: "Please feed filament into the PTFE tube until it can not be pushed any farther.";
};
/**
 * Helper function to get error message for a given error code
 */
declare function getErrorMessage(code: BambuErrorCode): string;
/**
 * Check if an error code indicates a job failure
 */
declare function isJobFailureError(code: number): boolean;
/**
 * Check if an error code is a local cancel code
 */
declare function isLocalCancelCode(code: number): boolean;
/**
 * HMS Message Severity Levels
 * Based on BambuStudio's implementation
 */
declare enum HMSMessageLevel {
    HMS_UNKNOWN = 0,
    HMS_FATAL = 1,
    HMS_SERIOUS = 2,
    HMS_COMMON = 3,
    HMS_INFO = 4
}
/**
 * Error categories to distinguish between different types of errors
 */
declare enum ErrorCategory {
    PRINT_ERROR = "print_error",
    HMS_ERROR = "hms_error",
    UNKNOWN = "unknown"
}
/**
 * Structure for HMS error codes
 */
interface HMSErrorInfo {
    moduleId: number;
    moduleNum: number;
    partId: number;
    msgLevel: HMSMessageLevel;
    msgCode: number;
    category: ErrorCategory;
}
/**
 * Parse HMS error code into its components
 * Based on BambuStudio's implementation
 * @param code The numeric HMS error code
 * @returns Parsed HMS error information
 */
declare function parseHMSErrorCode(code: number): HMSErrorInfo;
/**
 * Get the HMS module name based on module ID
 * @param moduleId The module ID from HMS error code
 * @returns Human-readable module name
 */
declare function getHMSModuleName(moduleId: number): string;
/**
 * Get the severity level description
 * @param level HMS message severity level
 * @returns Human-readable severity description
 */
declare function getHMSSeverityName(level: HMSMessageLevel): string;
/**
 * Determine the error category based on the error code
 * @param code The error code
 * @returns The error category
 */
declare function getErrorCategory(code: number): ErrorCategory;

declare enum AmsStatusMain {
    AMS_STATUS_MAIN_IDLE = 0,
    AMS_STATUS_MAIN_FILAMENT_CHANGE = 1,
    AMS_STATUS_MAIN_RFID_IDENTIFYING = 2,
    AMS_STATUS_MAIN_ASSIST = 3,
    AMS_STATUS_MAIN_CALIBRATION = 4,
    AMS_STATUS_MAIN_SELF_CHECK = 5,
    AMS_STATUS_MAIN_DEBUG = 6,
    AMS_STATUS_MAIN_UNKNOWN = 7
}
/**
 * Filament change steps during AMS operation
 */
declare enum FilamentStep {
    STEP_IDLE = 0,
    STEP_HEAT_NOZZLE = 2,
    STEP_CUT_FILAMENT = 3,
    STEP_PULL_CURR_FILAMENT = 4,
    STEP_PUSH_NEW_FILAMENT = 5,
    STEP_CONFIRM_EXTRUDED = 6,
    STEP_PURGE_OLD_FILAMENT = 7,
    STEP_CHECK_POSITION = 8
}
/**
 * Type of filament operation being performed
 */
declare enum FilamentOperation {
    LOAD = 0,
    UNLOAD = 1
}
interface AMSTray {
    id: number;
    tray_color: string;
    tray_type: string;
    tray_sub_brands: string;
    is_bbl: boolean;
    read_done: boolean;
}
interface AMSUnit {
    id: number;
    tray: AMSTray[];
}
declare class MachineObject {
    ams_status_main: AmsStatusMain;
    ams_status_sub: number;
    hw_switch_state: number;
    m_tray_now: string;
    ams_exist_bits: number;
    tray_exist_bits: number;
    tray_is_bbl_bits: number;
    tray_read_done_bits: number;
    ams_version?: number;
    amsList: AMSUnit[];
    constructor(state?: PushAllResponse);
    /**
     * Check if printer has any AMS units
     */
    hasAms(): boolean;
    /**
     * Get number of AMS units
     */
    getAmsCount(): number;
    /**
     * Check if specific AMS exists
     */
    isAmsExist(ams_id: number): boolean;
    /**
     * Check if tray exists in specific AMS
     */
    isTrayExist(ams_id: number, tray_id: number): boolean;
    /**
     * Check if tray contains Bambu Lab filament
     */
    isBambuFilament(ams_id: number, tray_id: number): boolean;
    /**
     * Check if tray RFID has been read
     */
    isRfidReadDone(ams_id: number, tray_id: number): boolean;
    /**
     * Parse AMS status from raw status value
     * @param ams_status Raw AMS status value from printer
     */
    private _parse_ams_status;
    /**
     * Parse full printer state from PushAllResponse
     * @param state Printer state response
     */
    parseState(state: PushAllResponse): void;
    /**
     * Check if AMS is waiting for filament load confirmation
     * @returns true if waiting for confirmation, false otherwise
     */
    isWaitingFilamentConfirmation(): boolean;
    /**
     * Check if filament is at extruder
     * @returns true if filament is detected at extruder
     */
    isFilamentAtExtruder(): boolean;
    /**
     * Static method to check if printer state indicates waiting for filament confirmation
     * @param state Full printer state response
     * @returns true if waiting for confirmation, false otherwise
     */
    static isWaitingFilamentConfirmation(state: PushAllResponse): boolean;
    /**
     * Get the current filament step
     * @returns Current FilamentStep or STEP_IDLE if not in filament change
     */
    getCurrentFilamentStep(): FilamentStep;
    /**
     * Get human-readable status text for the current filament operation
     * @returns Status text describing current operation
     */
    getFilamentStatusText(): string;
    /**
     * Check if currently performing a filament change operation
     * @returns true if in filament change mode
     */
    isInFilamentChange(): boolean;
    /**
     * Get the current filament operation type
     * @returns FilamentOperation.LOAD or FilamentOperation.UNLOAD
     */
    getFilamentOperation(): FilamentOperation;
    /**
     * Get AMS unit by ID
     * @param ams_id AMS unit ID
     * @returns AMSUnit if found, undefined otherwise
     */
    getAmsUnit(ams_id: number): AMSUnit | undefined;
    /**
     * Get tray by AMS ID and tray ID
     * @param ams_id AMS unit ID
     * @param tray_id Tray ID within the AMS unit
     * @returns AMSTray if found, undefined otherwise
     */
    getTray(ams_id: number, tray_id: number): AMSTray | undefined;
    /**
     * Check if two trays are compatible (same type and color)
     * @param ams_id1 First AMS unit ID
     * @param tray_id1 First tray ID
     * @param ams_id2 Second AMS unit ID
     * @param tray_id2 Second tray ID
     * @returns true if trays are compatible
     */
    areTraysCompatible(ams_id1: number, tray_id1: number, ams_id2: number, tray_id2: number): boolean;
    /**
     * Find all compatible trays for a given tray
     * @param ams_id AMS unit ID
     * @param tray_id Tray ID
     * @returns Array of compatible tray locations
     */
    findCompatibleTrays(ams_id: number, tray_id: number): Array<{
        ams_id: number;
        tray_id: number;
    }>;
    /**
     * Get the state of a specific tray
     * @param ams_id AMS unit ID
     * @param tray_id Tray ID
     * @returns Object containing tray state information
     */
    getTrayState(ams_id: number, tray_id: number): {
        exists: boolean;
        isBambuLab: boolean;
        rfidRead: boolean;
        tray?: AMSTray;
    };
    /**
     * Parses the home_flag bitfield from BambuStudio and returns an object with all extracted flags.
     * @param home_flag The integer bitfield from the printer status (e.g., from pushall response)
     * @returns An object with all extracted flags as booleans or numbers
     */
    static parseHomeFlag(home_flag: number): {
        is220V: boolean;
        xcamAutoRecoveryStepLoss: boolean;
        cameraRecording: boolean;
        amsCalibrateRemain: boolean;
        sdcardState: number;
        amsAutoSwitchFilament: boolean;
        xcamAllowPromptSound: boolean;
        isSupportPromptSound: boolean;
        isSupportFilamentTangleDetect: boolean;
        xcamFilamentTangleDetect: boolean;
        isSupportMotorNoiseCali: boolean;
        isSupportUserPreset: boolean;
        nozzleBlobDetectionEnabled: boolean;
        isSupportNozzleBlobDetection: boolean;
        installedPlus: boolean;
        supportedPlus: boolean;
        amsAirPrintStatus: boolean;
        isSupportAirPrintDetection: boolean;
        isSupportAgora: boolean;
    };
}
/**
 * Check if AMS is waiting for filament load confirmation
 * @param ams_status The raw ams_status value from printer state
 * @returns true if waiting for confirmation, false otherwise
 *
 * Status format:
 * - High byte (main status): 0x01 = AMS_STATUS_MAIN_FILAMENT_CHANGE
 * - Low byte (sub status): 0x06 = Waiting for confirmation
 * Example: status 260 (0x104) = Waiting for confirmation
 */
declare function isWaitingFilamentConfirmation(ams_status: number): boolean;
/**
 * Calculates filament backup groups based on compatible filaments in AMS slots.
 * Compatible filaments must have the same type and color.
 *
 * @param printerData - The printer data containing AMS information
 * @returns Array of bitmap values where each bit represents an AMS slot in that backup group
 */
interface FilamentBackupGroup {
    slots: number[];
}
/**
 * Parses filam_bak bitmaps to determine which filament slots are compatible backups
 * @param filam_bak Array of bitmaps where each bit represents an AMS slot
 * @returns Array of FilamentBackupGroup objects, each containing compatible slot indices
 *
 * @example
 * // Input: [3, 12]  (binary: 0011 and 1100)
 * // Returns: [
 * //   { slots: [0, 1] },   // Slots 0 and 1 are compatible
 * //   { slots: [2, 3] }    // Slots 2 and 3 are compatible
 * // ]
 */
declare function parseFilamBak(filam_bak: number[]): FilamentBackupGroup[];
interface EnrichedTray {
    ams_id: number;
    tray_id: number;
    type: string;
    color: string;
    backup_slots?: {
        ams_id: number;
        tray_id: number;
    }[];
}
interface EnrichedAms {
    id: number;
    trays: EnrichedTray[];
}
declare function getEnrichedAmsData(printerData: PushAllResponse): EnrichedAms[];
declare function calculateFilamBak(printerData: PushAllResponse): number[];

interface ModelSpecificSettings {
    setting_id?: string;
    compatible_printers?: string[];
    [key: string]: any;
}
interface FilamentTypeSettings {
    filament_id: string;
    vendor: string;
    base_settings: {
        [key: string]: any;
    };
    model_settings: {
        [printerModel: string]: ModelSpecificSettings;
    };
}
interface FilamentMapping {
    [materialType: string]: FilamentTypeSettings;
}
declare const FILAMENT_MAPPINGS: FilamentMapping;
/**
 * Get the filament ID for a given material type
 * @param materialType The type of material (e.g., "PLA Basic", "ABS")
 * @returns The filament ID or null if not found
 */
declare function getFilamentId(materialType: string): string | null;
/**
 * Get all settings for a material type and printer model
 * @param materialType The type of material (e.g., "PLA Basic", "ABS")
 * @param printerModel The printer model (e.g., "X1C", "A1")
 * @returns Combined settings (base + model specific) or null if not found
 */
declare function getMaterialSettings(materialType: string, printerModel: string): any | null;
/**
 * List all compatible materials for a given printer model
 * @param printerModel The printer model (e.g., "X1C", "A1")
 * @returns Array of compatible material types
 */
declare function getCompatibleMaterials(printerModel: string): string[];
/**
 * Get all supported printer models
 * @returns Array of supported printer models
 */
declare function getSupportedPrinters(): string[];
/**
 * Check if a material type exists in the mapping
 * @param materialType The material type to check
 * @returns boolean indicating if the material type exists
 */
declare function isMaterialTypeSupported(materialType: string): boolean;
/**
 * Get the vendor for a given material type
 * @param materialType The material type
 * @returns The vendor name or null if material type not found
 */
declare function getMaterialVendor(materialType: string): string | null;
/**
 * Get base settings for a material type
 * @param materialType The type of material (e.g., "PLA Basic", "ABS")
 * @returns Base settings or null if not found
 */
declare function getBaseSettings(materialType: string): any | null;
/**
 * Get settings for a material type and printer model, with fallback to defaults
 * @param materialType The type of material (e.g., "PLA Basic", "ABS")
 * @param printerModel The printer model (e.g., "X1C", "A1")
 * @returns Combined settings (model-specific + base) or null if material not found
 */
declare function getFilamentSettings(materialType: string, printerModel: string): any | null;
/**
 * Check if model-specific settings exist for a material and printer combination
 * @param materialType The type of material (e.g., "PLA Basic", "ABS")
 * @param printerModel The printer model (e.g., "X1C", "A1")
 * @returns boolean indicating if model-specific settings exist
 */
declare function hasModelSpecificSettings(materialType: string, printerModel: string): boolean;
/**
 * Get a specific setting value for a material and printer combination
 * @param materialType The type of material (e.g., "PLA Basic", "ABS")
 * @param printerModel The printer model (e.g., "X1C", "A1")
 * @param settingKey The setting key to retrieve
 * @returns The setting value or null if not found
 */
declare function getFilamentSetting(materialType: string, printerModel: string, settingKey: string): any | null;
/**
 * Get all available setting keys for a material type
 * @param materialType The type of material (e.g., "PLA Basic", "ABS")
 * @returns Array of setting keys or empty array if material not found
 */
declare function getAvailableSettings(materialType: string): string[];

export { ALL_ERRORS, type AMS, AMSControlAction, type AMSTray$1 as AMSTray, AMS_LETTER_MAP, type AMS_PREFIX, AmsRFIDStatus, AmsStatusMain, type Axis, type BambuClientPrinterStatus, type BambuErrorCode, type BaseFilamentConfig, CONNECT_RETURN_CODE_DESC, CameraOperation, type CommandCategory, type CommandParams, type CommandResponse, type CommandSchemas, type CommandType, ERROR_CODES_JOB_FAILED, type EnrichedStageInfo, ErrorCategory, type ExtendedFilamentConfig, type ExternalTray, FILAMENT_MAPPINGS, FanType, type FilamentConfig, type FilamentConfigs, FilamentOperation, FilamentStep, FilamentType, type HMS, type HMSErrorInfo, HMSMessageLevel, LOCAL_CANCEL_CODE, LightEffect, LightNode, type LightOptions, type LightReport, MachineObject, type NumberRange, PRINTER_MODEL_LONG_NAME_MAP, PRINTER_MODEL_MAP, type PrintMessage, type PrintMessageCommand, type PrintMessageCommands, PrintStage, PrintStageDetails, type PrintStageInfo, type PrinterLongNames, PrinterModelIDs, PrinterModelNamesShort, type PrinterStatus, type PushAllResponse, SpeedLevel, type State, type StringBoolean, type StringNumber, type StringNumberRange, UpgradeDisplayState, UpgradeErrorCode, UpgradeStatusFinishState, UpgradeStatusProgressState, VALID_COMMANDS, calculateFilamBak, commandSchemas, createCommand, filamentConfigs, getAvailableSettings, getBaseSettings, getCompatibleMaterials, getEnrichedAmsData, getEnrichedStages, getErrorCategory, getErrorMessage, getFilamentConfig, getFilamentId, getFilamentSetting, getFilamentSettings, getHMSModuleName, getHMSSeverityName, getMaterialSettings, getMaterialVendor, getStageFromCurr, getStagesFromArray, getSupportedPrinters, hasModelSpecificSettings, isJobFailureError, isLocalCancelCode, isMaterialTypeSupported, isPrintMessage, isPushAllCommand, isValidCommand, isWaitingFilamentConfirmation, parseFilamBak, parseHMSErrorCode, stageCurrToStage, validateCommandParams };
