Lebanese politicians and Palestine Liberation Organization officials expressed confidence today that the threat of an Israeli ground assault against West Beirut had passed following PLO Chairman Yasser Arafat's signing of an agreement in principle last night for his forces to leave Lebanon.

"We have entered a new phase, which has made the specter haunting everyone disappear," Prime Minister Shafiq Wazzan said.

As the Israeli invasion neared the end of its first month--and the encirclement of predominantly Moslem West Beirut its third week--this optimism contrasted with continuing, sporadic shelling near the airport and the strongly-worded demand by the Israeli Cabinet that the PLO could not leave even a token military force or political office in Lebanon.

Lebanese Moslem politicians and Palestinian officials were less impressed by the Israeli Cabinet's tough talk than by the renewed Israeli willingness to allow more time to American special envoy Philip C. Habib for negotiations to spare West Beirut and arrange for the PLO's departure.

Palestinians and Moslem Lebanese politicians--if not their increasingly frustrated Christian colleagues, whose sympathies lie in many cases with Israel--believed the next step was up to the United States.

Their reasoning was that the Israelis would not have agreed to more talks unless the Americans at least had found some positive points in the document that Arafat signed last night in accordance with Habib's longstanding request for a written Palestinian statement of its negotiating position.

Phalangist Christian militia officials in East Beirut said they doubted that a political solution was possible and indicated that a military solution would be preferable from their point of view, Washington Post correspondent William Branigin reported.

Phalangist leaders feel that only an invasion of West Beirut would sufficiently deal with the Lebanese leftist militiamen who, with the Palestinians, rule the streets of the Moslem sector of the city and are the Phalangists' long-time foes.

The document signed by Arafat provides for departure from Lebanon of PLO troops and leaders but sets several conditions: guarantees for Palestinian civilians remaining in Lebanon, creation of an international military force to protect them and mutual disengagement of the combatants.

Some reports suggested that the document also provided for a small Palestinian military presence in Lebanon at least until the last Syrian and Israeli troops left the country. The Israeli Cabinet this morning explicitly rejected allowing such a presence.

However, Saeb Salam, the veteran Moslem leader and former prime minister who has played a key mediating role between the Americans and Palestinians, denied that the document dealt with the question of a token military force. Government sources had said yesterday that the document left the issue to be negotiated later.

The document was said to consecrate the PLO's "definitive decision" to leave Lebanon, although nothing has been said officially on that score. Hani Hassan, a senior Arafat aide, suggested that "Tunis or Damascus" seemed likely alternative sites for a new PLO headquarters.

PLO official spokesman Mahmoud Labadi described the document as a "declaration of principles, which go into effect" if the PLO conditions are met.

Palestinian officials and Moslem politicians here noted French and American interest in the document's demand for the international force, which would serve alongside the Lebanese Army to guarantee the security of Palestinian civilians remaining in Lebanon. The Lebanese government, as represented by Christian President Elias Sarkis and Christian Foreign Minister Fuad Boutros, and the Lebanese Christian militia both oppose such a force.

Salam summed up in an interview today the uncertainty of many in West Beirut. Speaking of the Israelis, he said, "Our quandary is, are they playing for time and looking for a pretext to attack us, or are they seriously responding to efforts to negotiate?"

Some Lebanese reason that Israeli Prime Minister Menachem Begin and Defense Minister Ariel Sharon had found no practical way to liquidate the PLO short of a massive onslaught likely to be costly in Israeli casualties and credibility abroad.

As a result, any Israeli military action is increasingly expected to take a limited form--such as the now two-day-old blockade of persons and goods going into West Beirut.

An unidentified Israeli military commander quoted by Israeli Army radio said West Beirut's water and electricity--in any case limited to four hours a day on a rotating basis on both sides of this divided capital--would be cut, but today at least that proved not to be the case.

The artillery firing on the southern outskirts of the city breached the nine-day-old cease-fire between Israeli forces and the PLO.

A PLO spokesman charged that the Israelis "randomly shelled" a Palestinian refugee camp and Palestinian targets around the Beirut airport, The Associated Press reported.

The shelling continued sporadically throughout the night and intensified after dawn Monday, correspondent William Branigin reported from East Beirut. Columns of smoke rose from an area on the southern outskirts of West Beirut.

Israeli warplanes were keeping up psychological pressure on West Beirut late tonight, dropping flares and making sonic bombs over the Moslem-dominated sector of the city.

One example of the defiant mood among Beirut's Moslems was Prime Minister Wazzan's refusal to deliver Arafat's document of about 10 lines to Habib as had been expected. Wazzan said he would leave West Beirut and travel to Habib's residence only after the Israelis lifted the blockade.

Salam said Habib was "happy" with the contents of the Arafat document and was "working on relieving the blockade."

Meanwhile, Wafa, the Palestinian news agency, disclosed the names of 381 Israeli soldiers that it said had been killed in the war, a number that was sharply higher than Israeli statistics. Mubarak Calls on Reagan To Preserve Cease-Fire Special to The Washington Post

CAIRO, July 4--Egyptian President Hosni Mubarak has urged the United States to use its leverage to prevent a breakdown of the fragile cease-fire in Lebanon and end the Israeli troops' encirclement of its capital, officials said today.

In a message to President Reagan, Mubarak also demanded that the United States seek a settlement of the crisis in Lebanon on the basis of self-determination for the Palestinians.