In Sproutcore there is a statechart framework I can use for giving the application states which holds actions for what you can do in different states.
I wonder if there is a similar standalone statechart framework I can use outside Sproutcore eg. in conjunction with YUI3.
You were about ten days early asking the question. Michael Cohen found this: https://github.com/jakesgordon/javascript-state-machine/ which appears to have surfaced June 1.