/**
 * @license
 * Copyright 2025-2026 Open Home Foundation
 * SPDX-License-Identifier: Apache-2.0
 */
import {
  TEST_NODE_START,
  UpdateSource
} from "@matter-server/ws-client";
var ServerErrorCode = /* @__PURE__ */ ((ServerErrorCode2) => {
  ServerErrorCode2[ServerErrorCode2["UnknownError"] = 0] = "UnknownError";
  ServerErrorCode2[ServerErrorCode2["NodeCommissionFailed"] = 1] = "NodeCommissionFailed";
  ServerErrorCode2[ServerErrorCode2["NodeInterviewFailed"] = 2] = "NodeInterviewFailed";
  ServerErrorCode2[ServerErrorCode2["NodeNotReady"] = 3] = "NodeNotReady";
  ServerErrorCode2[ServerErrorCode2["NodeNotResolving"] = 4] = "NodeNotResolving";
  ServerErrorCode2[ServerErrorCode2["NodeNotExists"] = 5] = "NodeNotExists";
  ServerErrorCode2[ServerErrorCode2["VersionMismatch"] = 6] = "VersionMismatch";
  ServerErrorCode2[ServerErrorCode2["SDKStackError"] = 7] = "SDKStackError";
  ServerErrorCode2[ServerErrorCode2["InvalidArguments"] = 8] = "InvalidArguments";
  ServerErrorCode2[ServerErrorCode2["InvalidCommand"] = 9] = "InvalidCommand";
  ServerErrorCode2[ServerErrorCode2["UpdateCheckError"] = 10] = "UpdateCheckError";
  ServerErrorCode2[ServerErrorCode2["UpdateError"] = 11] = "UpdateError";
  return ServerErrorCode2;
})(ServerErrorCode || {});
class ServerError extends Error {
  constructor(code, message, cause) {
    super(message, { cause });
    this.code = code;
    this.name = "ServerError";
  }
  static unknownError(message, cause) {
    return new ServerError(0 /* UnknownError */, message, cause);
  }
  static nodeCommissionFailed(message, cause) {
    return new ServerError(1 /* NodeCommissionFailed */, message, cause);
  }
  static nodeInterviewFailed(message, cause) {
    return new ServerError(2 /* NodeInterviewFailed */, message, cause);
  }
  static nodeNotReady(nodeId, cause) {
    return new ServerError(3 /* NodeNotReady */, `Node ${nodeId} is not ready`, cause);
  }
  static nodeNotResolving(nodeId, cause) {
    return new ServerError(4 /* NodeNotResolving */, `Node ${nodeId} is not resolving`, cause);
  }
  static nodeNotExists(nodeId) {
    return new ServerError(5 /* NodeNotExists */, `Node ${nodeId} does not exist`);
  }
  static versionMismatch(message) {
    return new ServerError(6 /* VersionMismatch */, message);
  }
  static sdkStackError(message, cause) {
    return new ServerError(7 /* SDKStackError */, message, cause);
  }
  static invalidArguments(message) {
    return new ServerError(8 /* InvalidArguments */, message);
  }
  static invalidCommand(command) {
    return new ServerError(9 /* InvalidCommand */, `Unknown command: ${command}`);
  }
  static updateCheckError(message, cause) {
    return new ServerError(10 /* UpdateCheckError */, message, cause);
  }
  static updateError(message, cause) {
    return new ServerError(11 /* UpdateError */, message, cause);
  }
}
export {
  ServerError,
  ServerErrorCode,
  TEST_NODE_START,
  UpdateSource
};
//# sourceMappingURL=WebSocketMessageTypes.js.map
