Spain's major political parties, ranging from the Communists to the conservative Popular Alliance, have prepared a communique to be issued Friday calling for the uncovering of "those who carried out, assisted or inspired" the unsuccessful military coup this week.

But in response to a statement made privately to them Tuesday by King Juan Carlos, the communique will also pay tribute to the armed forces as a whole.

As Spain's government worked to put itself back together today, it became more clear that Juan Carlos had emerged from the attempted coup in a stronger position, also reinforced as a proponent of democracy.

There has been a positive response to the king's appeal to treat the armed forces gently. At the same time, after the new premier, Leopoldo Calvo-Sotelo, was sworn in today, it was announced that the deputy Army chief of staff dismissed earlier this week for his role in the attempted coup had been arrested, along with another general who commanded an armed division just outside Madrid.

Calvo-Sotelo also announced his Cabinet today.

On the major newstands of the Spanish capital, two books are sold side by side whose titles sum up the contradictions and ambiguities of post-Franco Spain that led to this week's unsuccessful coup attempt: "Viva Franco (With Apologies)" and a biography of Juan Carlos entitled "Every Inch a King."

The democratic rule that started to emerge in 1976 after the 40-year dictatorship of Generalissimo Franciso Franco sought no changes in the personnel who made up basic institutions of the fascist corporate state -- the armed forces, the police, the judiciary, the church, the investment banks and big industry.

Juan Carlos, who was handpicked by Franco to succeed him, proved his democratic mettle this week by refusing to go along with generals considered among those closest to him. They evidently had the mistaken impression that he shared their distaste for democracy. Observers say it is hard to escape the conclusion that ambiguity in his relations with them had fostered a basic misunderstanding.

The king underlined that in a statement to major party leaders after their release from the Civil Guardsmen who seized the parlimanent Tuesday. A leaked text was published today.

"It would be very inadviable," he said, "for the political parties to react strongly against those who committed acts of subversion in the past few hours. But it would be even more counterproductive to generalize that reaction to all of the police and armed forces."

Praising the "discipline, partriotism and loyality to the crown" of the armed forces, Juan Carlos cautioned the political chiefs the "delicate" situation created by the failed coup must be treated "with maximum serenity and moderation."

Calvo-Sotelo, the new premier voted into the office by parliament yesterday, released the same Cabinet list he had in his pocket Monday when the voting to install him was interrupted by gun-wielders.

Despite criticism of the apparent failure of police intelligence to report the apparently well-known coup reprearations, the interior minister in charge of the police forces remained in the post he held under former premier Adolfo Suarez.

Alberto Oliart Sausol, a close political friend of Calvo-Sotelo, was named defense minister the armed forces had been resisting his designation.

Twelve others from Suarez' Cabinet remained in their jobs. Suarez, Stressing that he really is out of the picture, left today with his wife for a previously scheduled month's vacation in the United States primarily in California. Before he left, the king named him a duke of the realm.

Tonight it was announced that the deputy Army chief staff, Gen. Alfonso Armada, dismissed earlier this week, had been arrested. Also arrested was Gen. Luis Torres Rojas, a former commander of the crack Brunete Armored Division.

A third general, Jose Leon Pizarro was relieved of his command of an armored division in Valencia. His commanding officer, Gen. Jaime Milans del Bosch was arrested Tuesday for sending tanks into the streets during the attack on the parliament.

It is reported that in recorded telephone conversations with representatives of the king, Gen Armada -- who was negotiating with the leader of the hostage-takers in parliament -- said: "The king has comprised the crown and separated himself from the armed forces.

Armada reportedly said the king had made "a mistake" in standing up against the coup, that he "should not have appeared before the country" on television and that the coup attempt was " a military matter which must be resolved by the military" rather than the king.

Given Armada's previous personal closeness to the king as his one-time tutor and executive aide, the misunderstanting takes on immense proportions.

Communist leader Santiago Carrillo, one of those who responded positively to the king's appeal to treat the armed forces gently, said after leaving the palace that he agreed with everything the king had said. Calls for investigations into responsibility for the attempt have been strikingly muted and are obviously meant to keep the indictments limited to the relatively few officers who committed overt acts.

Their call for an investigation "can be interpreted reasonably," said Popular Alliance leader Manuel Faraga Iribarne in an interview. "We must not have a witchhunt."

There are many politicians here who readily concede, however, that failure to conduct a thorough-going military purge after this week's events presents the danger of another coup attempt that the king might not be able to stop.

"Sure it's a gamble, but what other choice do we have?" said Enrique Mugica, a Socialist member of the parliament held hostage Monday.

The view that the king is democracy's only effective shield goes far to explain why the leftist opposition parties are honoring the monarch's demand to go easy on the armed forces.

As Premier Calvo-Sotelo put it, "What happened was not a dress rehearsal for something bigger, and we will have to take precautions so that tht remote possibility is entirely eliminated. We will take precautions to ensure that we are not taken by surprise if it recurs and above all to ensure that it does not recur."