qcad-3.28.2-pro-linux-x86_64.tar.gz missing script source code

All resources are present in an installation package, most only in compiled form.
Proprietary code of QCAD pro is only present in compiled form.
These are not/not well documented, may change over time, may be replaced or even removed without notice.

You might find some details here:

No, probably not, do not expect this to be simple.
The question remains if that suits your needs, Polyline from Segments (OG) requires interaction to indicate segments.
But for example it includes resources to merge indicated segments as good as it gets, approximating things, chopping up, …
Another option is Polyline from Selection (OC) … See: PolylineFromSelection and getAffectedObjects

With some luck you might find other topics with usage or details scattered around on the forum.

I’ll repeat Andrew’s note:
Please keep in mind that PolylineFromSelection is not part of the public API but part of the proprietary API of QCAD Professional.
Feel free to call this from your script, but keep in mind that this API might change in a future version.

Regards,
CVH