import { employeeRoleRegistry } from './employeeRole'; import { positionRegistry } from './position'; /** * Every conversation a skill can be bound to, by the id its `flow:` names. * * A skill declares `flow: position`; this is what that word resolves to. Adding * a conversation is adding a registry here and a `flow:` line in the skill file * — there is no branch in the router, and nothing in the engine learns a new * name. That is §3's "specs are data" applied to conversations. */ export const FLOWS = { [positionRegistry.id]: positionRegistry, [employeeRoleRegistry.id]: employeeRoleRegistry, }; /** The registry a parsed skill is bound to, or `null` if it declares none. */ export const flowFor = (skill) => (skill?.flow ? FLOWS[skill.flow] || null : null);