Visual editing

Changes of behavior are drawn using the Rosmaro Visual Editor. It produces a human-readable JSON file.

Dynamic graphs

The children of a composite node may be specified using a function of the context.

The right model for the job

The behavior-related state is expressed by a state machine, while the data-related state lives in a dictionary.

Async / await just works

The whole model may be fully synchronous, but if anything needs to be asynchronous, it just works.

Graph-based dispatch

Method calls are dispatched based on the current node of the state machine. There's no need to check the current state.

Ready for the back-end

Locking prevents the model from going into an inconsistent state.
The storage may be asynchronous.

Rosmaro 101


Draw changes of behavior.

Nodes represent different behaviors which never change. Arrows symbolize events.


Code different behaviors.

Associate drawn nodes with code handling method calls.


const Prince = {
  introduceYourself: () => "I am The Prince of Rosmaro!",
  eat: ({dish}) => {
    if (dish === 'pizza') return {arrow: 'ate pizza'};
  }
};

const Frog = {
  introduceYourself: () => "Ribbit! Ribbit!"
};
              

Have fun!

The model is stateful.
Method calls are dispatched based upon the graph.


> model.introduceYourself();
'I am The Prince of Rosmaro!'

> model.eat({dish: 'yakisoba'});
undefined

> model.introduceYourself();
'I am The Prince of Rosmaro!'

> model.eat({dish: 'pizza'});
undefined

> model.introduceYourself();
'Ribbit! Ribbit!'