Isn't their some law that gives border agents essentially unlimited rights to search and confiscate (no warrant required) so long as they are within 100 miles of any US border?
Founding legal theory is that as long as you're on the other side of the line, "outside" the USA, normal restrictions on government agents do not apply wrt to searches and so on.
BUT, my understanding is also that NO ONE, not any agent of any law enforcement branch, ever, under any circumstances, can deny entry to a US citizen. They may be able to legally (in theory at least) tell you that if you don't hand over your passwords you cannot enter with your stuff, but if you're willing to tell them, "yeah, OK, have a nice day" and walk away from your laptop, they can't prevent that. (Beyond long enough to search your luggage, verify your passport, etc.)