@@ -30,6 +30,7 @@ function isMissingQaRuntimeError(error: unknown) {
3030 ) ;
3131}
3232
33+ /** Load the bundled QA lab runtime surface, throwing when the private bundle is absent. */
3334export function loadQaRuntimeModule ( ) : QaRuntimeSurface {
3435 const env = resolvePrivateQaBundledPluginsEnv ( ) ;
3536 return loadBundledPluginPublicSurfaceModuleSync < QaRuntimeSurface > ( {
@@ -39,6 +40,7 @@ export function loadQaRuntimeModule(): QaRuntimeSurface {
3940 } ) ;
4041}
4142
43+ /** Check whether the bundled QA lab runtime surface is present without hiding other load errors. */
4244export function isQaRuntimeAvailable ( ) : boolean {
4345 try {
4446 loadQaRuntimeModule ( ) ;
@@ -51,6 +53,7 @@ export function isQaRuntimeAvailable(): boolean {
5153 }
5254}
5355
56+ /** Normalized options passed from live-transport QA CLIs into lane runners. */
5457export type LiveTransportQaCommandOptions = {
5558 repoRoot ?: string ;
5659 outputDir ?: string ;
@@ -85,16 +88,19 @@ type LiveTransportQaCommanderOptions = {
8588 credentialRole ?: string ;
8689} ;
8790
91+ /** Commander registration hook for one live-transport QA subcommand. */
8892export type LiveTransportQaCliRegistration = {
8993 commandName : string ;
9094 register ( qa : Command ) : void ;
9195} ;
9296
97+ /** Help text customizations for live credential source and role flags. */
9398export type LiveTransportQaCredentialCliOptions = {
9499 sourceDescription ?: string ;
95100 roleDescription ?: string ;
96101} ;
97102
103+ /** Declarative command metadata and runner used to install a live-transport QA CLI. */
98104export type LiveTransportQaCliRegistrationOptions = {
99105 commandName : string ;
100106 credentialOptions ?: LiveTransportQaCredentialCliOptions ;
@@ -111,6 +117,7 @@ export type LiveTransportQaCliRegistrationOptions = {
111117 run : ( opts : LiveTransportQaCommandOptions ) => Promise < void > ;
112118} ;
113119
120+ /** Memoize a lazy CLI runtime import so repeated command paths share one loaded module. */
114121export function createLazyCliRuntimeLoader < T > ( load : ( ) => Promise < T > ) {
115122 let promise : Promise < T > | null = null ;
116123 return async ( ) => {
@@ -195,6 +202,7 @@ function registerLiveTransportQaCli(
195202 } ) ;
196203}
197204
205+ /** Build a Commander registration object for one live-transport QA command. */
198206export function createLiveTransportQaCliRegistration (
199207 params : LiveTransportQaCliRegistrationOptions ,
200208) : LiveTransportQaCliRegistration {
@@ -209,12 +217,14 @@ export function createLiveTransportQaCliRegistration(
209217 } ;
210218}
211219
220+ /** One top-level check row in a rendered QA markdown report. */
212221export type QaReportCheck = {
213222 name : string ;
214223 status : "pass" | "fail" | "skip" ;
215224 details ?: string ;
216225} ;
217226
227+ /** One scenario section in a rendered QA markdown report. */
218228export type QaReportScenario = {
219229 name : string ;
220230 status : "pass" | "fail" | "skip" ;
@@ -231,12 +241,14 @@ export {
231241 type LiveTransportStandardScenarioId ,
232242} from "./qa-live-transport-scenarios.js" ;
233243
244+ /** Docker command runner abstraction used by QA Docker helpers and tests. */
234245export type QaDockerRunCommand = (
235246 command : string ,
236247 args : string [ ] ,
237248 cwd : string ,
238249) => Promise < { stdout : string ; stderr : string } > ;
239250
251+ /** Minimal fetch-like health probe used by QA Docker runtime helpers. */
240252export type QaDockerFetchLike = ( input : string ) => Promise < { ok : boolean } > ;
241253
242254const DEFAULT_QA_DOCKER_COMMAND_TIMEOUT_MS = 120_000 ;
@@ -250,6 +262,7 @@ function pushQaReportDetailsBlock(lines: string[], label: string, details: strin
250262 lines . push ( "" , "```text" , details , "```" ) ;
251263}
252264
265+ /** Render checks, scenarios, timeline, and notes into the standard QA markdown report format. */
253266export function renderQaMarkdownReport ( params : {
254267 title : string ;
255268 startedAt : Date ;
@@ -329,10 +342,12 @@ export function renderQaMarkdownReport(params: {
329342 return lines . join ( "\n" ) ;
330343}
331344
345+ /** Append a formatted live-lane issue while preserving the caller-owned issue list. */
332346export function appendQaLiveLaneIssue ( issues : string [ ] , label : string , error : unknown ) {
333347 issues . push ( `${ label } : ${ formatErrorMessage ( error ) } ` ) ;
334348}
335349
350+ /** Format a live-lane failure message that includes artifact labels and paths. */
336351export function buildQaLiveLaneArtifactsError ( params : {
337352 heading : string ;
338353 artifacts : Record < string , string > ;
@@ -346,6 +361,7 @@ export function buildQaLiveLaneArtifactsError(params: {
346361 ] . join ( "\n" ) ;
347362}
348363
364+ /** Print live-transport QA artifact paths with a lane label for CI log parsers. */
349365export function printLiveTransportQaArtifacts (
350366 laneLabel : string ,
351367 artifacts : Record < string , string > ,
@@ -397,6 +413,7 @@ async function findFreeQaDockerPort() {
397413 } ) ;
398414}
399415
416+ /** Return the preferred Docker host port unless it is unpinned and already occupied. */
400417export async function resolveQaDockerHostPort ( preferredPort : number , pinned : boolean ) {
401418 if ( pinned || ( await isQaDockerPortFree ( preferredPort ) ) ) {
402419 return preferredPort ;
@@ -471,6 +488,7 @@ async function isQaDockerHealthy(url: string, fetchImpl: QaDockerFetchLike) {
471488 }
472489}
473490
491+ /** Create Docker command, health-check, and compose helpers for QA harnesses. */
474492export function createQaDockerRuntime ( params : {
475493 auditContext : string ;
476494 commandTimeoutMs ?: number | null ;
@@ -639,6 +657,7 @@ export function createQaDockerRuntime(params: {
639657
640658type ProcessWriteCallback = ( err ?: Error | null ) => void ;
641659
660+ /** Tee stdout and stderr into a private artifact file until the returned stop hook runs. */
642661export async function startLiveTransportQaOutputTee ( params : {
643662 fileName : string ;
644663 outputDir : string ;
0 commit comments