NEW HAVEN, Conn. — James Bundy, artistic director of Yale Repertory Theater and dean of the prestigious Yale School of Drama, is recovering from Tuesday’s open heart surgery, in which his infected aortic valve was replaced.

A spokeswoman for the theater said Wednesday that Bundy, 46, was in critical condition in the intensive care unit at Yale-New Haven Hospital. She added that doctors were “cautiously optimistic,” noting that Bundy is still fighting off a massive infection.

“But he is awake and alert,” said Victoria Nolan, Yale Rep’s managing director.

Bundy was in the midst of rehearsing the final production of the season — “All’s Well That Ends Well,” featuring Kathleen Chalfant — when he went home ill Friday. He grew increasingly sick with flu-like symptoms, and Sunday checked into the hospital. Bundy is in his fourth year of a five-year contract at Yale.

Mark Rucker, a grad from the School of Drama and an associate artist at South Coast Repertory, takes over helming “All’s Well” starting Thursday. The production will go on as scheduled, with perfs beginning April 21.