import type { NodeDef } from '../../NodeRegistry'; import { writeTyped } from '../../values'; import { any, exec, variableParam } from '../shared'; export const SetVariable: NodeDef = { type: 'SetVariable', label: 'Set variable', category: 'variable', description: "Writes one of this behavior's variables.", inputs: [exec(), any('value')], outputs: [exec()], params: [variableParam], run: (ctx, inputs, params) => { const key = String(params.variable ?? ''); if (key) writeTyped(ctx.variables, key, inputs.value); return { next: 'exec' }; }, };