Warning of a threat to the nation's existence, Poland's national assembly appealed today for an end to all strikes and condemned what were described as extremist forces in the independent trade union Solidarity.

In a resolution passed unanimously at the end of a two-day session, the assembly, the Sejm, said it would consider giving the government extra powers to deal with the crisis should its appeal fail. But the resolution stopped short of declaring an outright ban on strikes as demanded last week by the Communist Party's Central Committee.

The compromise resolution drafted by deputies reflected the growing independence of the Sejm despite the Communist Party's solid majority. It is a phenomenon that could make it more difficult for the party leadership to engineer a final showdown with Solidarity by introducing drastic measures such as martial law.

Earlier the Democratic Party, which has 39 out of 460 seats in the assembly, had described a legal ban on strikes as wrong since it would remove only the "external manifestations" of industrial unrest and not the causes. Until recently, such open opposition to a Communist Party-sponsored proposal would have been unthinkable from a junior coalition ally.

Last month an open rebellion by Communist members of the Sejm forced the party leadership to accept a compromise worked out with Solidarity over the method of appointing factory managers under a new self-management law. It was believed to mark the first occasion that a traditionally rubber-stamp legislature in a Soviet Bloc country had overruled the wishes of the authorities on an important issue.

In fact parliament's latest demonstration of independence may turn out to serve the purposes of the new party leader, Gen. Wojciech Jaruzelski, quite well. It appears to remove the danger of an immediate confrontation with Solidarity while holding out a vague threat of tougher action in the future.

In his speech yesterday, Jaruzelski said he would ask for "extraordinary" powers to end strikes as a matter of urgency if industrial unrest continued. The Sejm's final resolution weakened this formula still further by promising only "to examine a proposal for giving the government such legal means as demanded by the situation."

The phrase appeared deliberately ambiguous and could cover various types of emergency measures, even a declaration of martial law. According to the Polish constitution, parliament's approval is required before the government can declare a state of emergency.

In an amendment inserted in the appeal at the last moment, the deputies recorded their appreciation for efforts by trade unions, including Solidarity, to prevent industrial unrest. This followed a call by Solidarity's presidium for a suspension of strikes and disciplinary measures against members who defied union instructions.

The assembly's resolution said dramatic division lines were being created in the country as a result of a rapidly worsening political and economic crisis. It expressed special concern "over attempts by extremist forces in Solidarity to undermine the socialist basis of our system."

The resolution added: "In the face of a threat to the nation's existence and in order to provide for the basic needs of citizens, the Sejm calls for the immediate renouncing of all strike actions which are destroying the country."

Around a quarter of a million Polish workers are at present believed to be on strike with grievances ranging from chronic food shortages to corrupt local officials. In addition, strike alerts have been declared in another 17 towns or villages, according to government officials.

It was the third formal appeal by parliament for an end to strikes this year. The first was in mid-February when the legislature supported a call by Jaruzelski, on his appointment as premier, for 90 strike-free days. The truce collapsed just over a month later following the beatings of Solidarity activists in the northern town of Bydgoszcz.

On April 10, the assembly passed a second resolution calling for a suspension of strikes for two months. Soon afterward, the government began detailed negotiations with Solidarity over a wide range of issues including the registration of an independent farmers' union, greater access to the mass media and the release of political prisoners.

This period of relative calm ended after the Communist Party congress in June when there were mounting protests over food shortages and price increases mounted. The party came under increasing pressure from the Kremlin to crack down on Solidarity.

In the new appeal no time limit was set for the duration of the strike truce.

During the parliamentary debate, several deputies attacked remarks attributed to Solidarity's regional leader in the northwestern port of Szczecin, Marian Jurczyk, who was quoted in the press as calling for a showdown with the authorities.

Jurczyk, who finsished second behind Lech Walesa in Solidarity's leadership elections last month, described the government and the Sejm as "traitors to Poland" and "Moscow's front office." He said Poland, which belongs to the Soviet-led Warsaw Pact defense alliance, should become a neutral state with its borders guaranteed by the superpowers.

Contacted by telephone in Szczecin, Jurczyk said the press accounts of his speech were correct except that some phrases had been taken out of context.

He also dismissed the danger of martial law, saying that Jaruzelski was unable to "place a soldier by each worker."

Meanwhile, details emerged in neighboring Czechoslovakia of a speech earlier this week by Premier Lubomir Strougal, admitting serious economic difficulties. Addressing the Communist Party Central Committee, he is reported to have said that most firms were not fulfilling their plans, that problems in the building industry were growing and the grain harvest was falling short.

Strougal said supplies of energy and coal had been reduced as a result of economic difficulties in Poland and Romania.