  We derive stochastic master equation for a quantum system interacting with an
environment prepared in a continuous-mode $N$-photon state. To determine the
conditional evolution of the quantum system depending on continuous in time
measurements of the output field the model of repeated interactions and
measurements is applied. The environment is defined as an infinite chain of
harmonic oscillators which do not interact between themselves and they are
prepared initially in an entangled state being a discrete analogue of a
continuous-mode $N$-photon state. We provide not only the quantum trajectories
but also the analytical formulae for the whole statistics of the output photons
and the solution to the master equation. The solution in the continuous case is
represented by a simple diagrammatic technique with very transparent "Feynmann
rules". This technique considerably simplifies the structure of the solution
and enables one to find physical interpretation for the solution in terms of a
few elementary processes.
