Heat oven to 350°F. Line an 8-inch square pan with a parchment sling and lightly grease.
Melt butter and chopped chocolate in a heatproof bowl over simmering water, stirring until smooth.
Cool 5 minutes, then whisk in granulated and brown sugars until combined.
Whisk in the beaten eggs and vanilla until the batter looks glossy and thick.
In another bowl, whisk flour, cocoa, fine salt, and espresso powder.
Fold dry ingredients into the chocolate mixture just until no dry spots remain.
Fold in half the raspberries and the chocolate chips.
Spread batter in the pan. Dot with jam and swirl gently with a knife.
Scatter remaining raspberries over the top. Sprinkle flaky salt, if using.
Bake 30-33 minutes, until edges set and the center is slightly soft.
Cool in the pan on a rack for 1 hour. Chill 30 minutes for clean cuts.
Cut into squares and serve warm or at room temperature.