Not sure If that's the best option but looks like you can take a bus to Krosno (3.5 h) next a bus from Krosno to Barwinek (0.5 h) which is a village at the border... then you've got around 15 km left, not sure If there's any cross border bus line, at worst you can walk (3h) :))
There is also a version with changing a bus in Miejsce Piastowe instead of Krosno - look at E-podroznik.pl.
I don't know if the buses to Barwinek reach the border. If not, you must walk about 2 km.
There are Slovakian buses from the border in Barwinek/Vysny Komarnik ("Vyšný Komárnik,,št.hr." stop; "št.hr." means the border) to Svidnik - look here: