Builds a bundle from a local build and pushes it, routing to the SCAPI or legacy backend per the given preference (with safe auto fallback). When a targetSlug is given the bundle is also deployed; otherwise it is uploaded only. The returned backend pins which --wait strategy the caller uses.
Bundle format: SCAPI always uploads the v2 format. Legacy defaults to the v1 combined upload+deploy; set v2 to route the legacy push through the v2 endpoint instead (upload, then a separate deploy when a target is given), so the rootDir/configPath/matchMode options take effect on legacy too.
Fallback safety: only the SCAPI upload is fallback-eligible — if it fails with a safe pre-execution error nothing was created, so auto retries on legacy. Once the upload succeeds a bundle exists on SCAPI, so a failure of the subsequent create-deployment is re-thrown as a plain Error (not a fallback trigger) to avoid re-uploading the whole build on legacy.