At the risk of taking on something well out of my weight class, I think I disagree with Hypersmurf.
Summon Monster 1 has this blurb about the summoned monsters:
Summon Monster 1 said:
It appears where you designate and acts immediately, on your turn. It attacks your opponents to the best of its ability. [BOLD]If you can communicate with the creature[/BOLD], you can direct it not to attack, to attack particular enemies, or to perform other actions
The creature is acting on its own, but taking orders. Most DM's let the summoner direct the creature as they please. However, a DM would be well within his rights to declare that the player cannot direct its opponents unless he speaks a language the creature can understand (if it does not speak common, and the caster cannot speak Fiendish or Celestial).
When you are directing a summoned creature and invisible, you are speaking to it. The actions the creature takes are not coming out of your actions. But:
- Retargeting a spiritual weapon takes a move action from the caster
- Moving a flaming sphere takes a move action from the caster
For purposes of the Invisibility spell, I would define an attack as any action by the caster that results in an opponent taking damage, making a saving throw, or suffering an attack. Aside from Summon Monster spells, I suspect that Illusions may also not count as attacks, but that has never come up.
I think there is a case to be made that a player can cast Spiritual Hammer, then go invisible, then let it attack on its own and stay invisible. But I do not think the caster can stay visible if he is taking an action that results in an opponent being attacked.
END COMMUNICATION