Lightly braise onion in a pan with some frying oil. Add spinach and stew for a few minutes over low heat, stirring occasionally. Put aside.
Cut tofu in half and then into about 1 inch slices. Sauté in a pan, then deglaze with tamari/ soy sauce. Put aside.
Mix together soy flour with a little water until you end up with a spreadable paste.
Preheat oven to 200° C (400° F).
Roll out puff pastry and cut into squares. Spread about 1 tsp pesto onto each square, leaving about half an inch from the edges. Spread some spinach onto the middle of each square, followed by a slice of tofu, dried tomatoes and pine nuts.
Using a pastry brush, brush along around each square with the soy flour water mixture. Fold sqaures into triangles and press firmly down (using a fork) to seal pockets.
Brush each pocket with the soy flour water mixture (or just plant milk) and sprinkle some sesame seeds on top.
Bake for 15-20 minutes until golden brown.