@@ -399,6 +399,7 @@ test('client throws AppError for daemon failures', async () => {
399399 ) ;
400400} ) ;
401401
402+ // fallow-ignore-next-line complexity
402403test ( 'replay.run serializes client-collected AD_VAR shell env into daemon request' , async ( ) => {
403404 const previousAppId = process . env . AD_VAR_APP_ID ;
404405 const previousWaitMs = process . env . AD_VAR_WAIT_MS ;
@@ -419,6 +420,7 @@ test('replay.run serializes client-collected AD_VAR shell env into daemon reques
419420 assert . equal ( setup . calls [ 0 ] ?. command , 'replay' ) ;
420421 assert . deepEqual ( setup . calls [ 0 ] ?. positionals , [ './flows/login.ad' ] ) ;
421422 assert . deepEqual ( setup . calls [ 0 ] ?. flags ?. replayEnv , [ 'APP_ID=cli-override' ] ) ;
423+ assert . equal ( setup . calls [ 0 ] ?. flags ?. replayBackend , undefined ) ;
422424 const replayShellEnv = setup . calls [ 0 ] ?. flags ?. replayShellEnv as
423425 | Record < string , string >
424426 | undefined ;
@@ -435,6 +437,36 @@ test('replay.run serializes client-collected AD_VAR shell env into daemon reques
435437 }
436438} ) ;
437439
440+ test ( 'replay.run forwards backend without knowing the concrete syntax' , async ( ) => {
441+ const setup = createTransport ( async ( ) => ( { ok : true , data : { } } ) ) ;
442+ const client = createAgentDeviceClient ( setup . config , { transport : setup . transport } ) ;
443+
444+ await client . replay . run ( {
445+ path : './flows/login.yaml' ,
446+ backend : 'external-flow' ,
447+ } ) ;
448+
449+ assert . equal ( setup . calls . length , 1 ) ;
450+ assert . equal ( setup . calls [ 0 ] ?. command , 'replay' ) ;
451+ assert . deepEqual ( setup . calls [ 0 ] ?. positionals , [ './flows/login.yaml' ] ) ;
452+ assert . equal ( setup . calls [ 0 ] ?. flags ?. replayBackend , 'external-flow' ) ;
453+ } ) ;
454+
455+ test ( 'replay.run keeps deprecated maestro option as backend alias' , async ( ) => {
456+ const setup = createTransport ( async ( ) => ( { ok : true , data : { } } ) ) ;
457+ const client = createAgentDeviceClient ( setup . config , { transport : setup . transport } ) ;
458+
459+ await client . replay . run ( {
460+ path : './flows/login.yaml' ,
461+ maestro : true ,
462+ } ) ;
463+
464+ assert . equal ( setup . calls . length , 1 ) ;
465+ assert . equal ( setup . calls [ 0 ] ?. command , 'replay' ) ;
466+ assert . deepEqual ( setup . calls [ 0 ] ?. positionals , [ './flows/login.yaml' ] ) ;
467+ assert . equal ( setup . calls [ 0 ] ?. flags ?. replayBackend , 'maestro' ) ;
468+ } ) ;
469+
438470test ( 'client.command.wait prepares selector options and rejects invalid selectors' , async ( ) => {
439471 const setup = createTransport ( async ( ) => ( {
440472 ok : true ,
0 commit comments