4:15 PM PT -- The judge ruled that Kyle must stay away from Jamie, and we've obtained the documents filed by the actress alleging torment. King alleges Kyle has tracked her electronically, isolated her from friends and work opportunities and has taken hundreds of thousands of dollars out of their account. She says she feels sick to her stomach with every encounter with Kyle.
2:22 PM PT -- A rep for King tells us, "This is another vicious, failed attempt of Kyle to continue his abuse of Jaime and manipulate the court system. Today Kyle was denied all requests for emergency orders and the judge granted Jaime shared legal custody of their two children. The temporary domestic violence restraining order remains in place to protect Jaime."
Jaime King and Kyle Newman are in an all-out war for their kids ... with Kyle now saying he needs sole physical custody because her alleged opioid and alcohol addiction is out of control.
The director requested an emergency hearing Friday morning, asking the judge to let him take custody of their 6 and 4-year-old sons, James and Leo. According to the docs, obtained by TMZ, Kyle claims the actress/model has "spent the last decade high" and refuses to get any meaningful help for her opioid addictions.
Kyle says things came to a head on January 12, when he and 14 of Jaime's friends staged an intervention ... begging her to get help. He gave her an ultimatum -- get treatment "or the kids and I need to leave for their own safety."
Kyle claims Jaime went to Cirque Lodge rehab facility in Utah, but left shortly after arriving because she tried to check in with a bunch of pills on her ... including Adderall and Clonazepam.
In the docs, he says Jaime was working in Canada in early February and asked him to send the boys to spend a couple weeks with her -- but 3 days into the visit she sent them back to Kyle. He claims she later admitted she was having an affair and using booze and drugs at the time.
Kyle says he and the boys have been quarantining in Pennsylvania, and Jaime has only seen them for 3 days in the past 2 months. On May 15, he says he and Jaime were laying out plans to divorce, when she accused him of "stealing" their kids ... even though she was the one who insisted they go to Pennsylvania. He tried to reassure her, but claims she got angrier and threatened to ruin him.
TMZ broke the story ... Jaime filed divorce docs on May 18, and also requested a restraining order to keep Kyle away from her and the kids. As we reported, the judge ruled the boys could remain with Kyle, who says Jaime blindsided him with her court filings.
Two nannies and one of Jaime's former assistants submitted declarations, describing her alleged addiction to opioids, and claim she's putting the children at risk by -- among other things -- driving with them while under the influence.
Kyle is asking for sole physical custody, shared legal custody and wants Jaime out of the family home in L.A. ... so he can live there with their sons.
Friday morning, the judge rejected his emergency order for custody, and said both sides can argue their cases at a later court date. So for now, it's status quo ... the kids can remain with Kyle in Pennsylvania.
We've reached out to Jaime's camp, but no word back yet.