@apatrida I’m not sure that it is the right approach. As far as I understand JSR logic, running the script with different bindings means fresh rerun, without taking history into account.
My thought was to place repl state, including history, outside of the repl classes and for JSR 223 wrappers keep it in the binding itself, or create anew if it is not yet there.