It would be great to allow plugins to expose hooks that other plugins could tie into.
A hook is a routine that is encapsulated by an event emitter where each hook listener can interact with the hook's inputs and outputs.
Plugins can wrap various logic in a named hook. The result is a function that when called is passed an object of params. When a hook is invoked, an event is dispatched to all listeners in series and waits until they finish before continuing.
The Titanium CLI hooks allow for both event hooks and function hooks. The Appc Daemon will only allow event hooks.
The Titanium CLI hooked functions allow multiple arguments. The Appc Daemon only allow a single optional argument which would be an object.
The Titanium CLI allowed any data types for the arguments. The Appc Daemon only allows serializable data such as undefined, null, strings, numbers, booleans, arrays, and object literals. Object instances (those with contexts) and functions are not permitted.