import type { NodeDef } from '../../NodeRegistry'; import { asNumber } from '../../values'; import { num, withDefault } from '../shared'; export const Random: NodeDef = { type: 'Random', label: 'Random', category: 'data', description: 'A random number between min and max (min included, max not).', inputs: [withDefault(num('min'), 0), withDefault(num('max'), 1)], outputs: [num('result')], params: [], run: (_ctx, inputs) => { const min = asNumber(inputs.min); return { outputs: { result: min + Math.random() * (asNumber(inputs.max) - min) } }; }, };