fix(api): disconnect if process instance is ended
fix(console): execution context & history

* evaluate script in context of current execution
* add history for console