import type { ParamFieldDef } from '@/types/workflow'

/** 等待事件：双出口 —— 触发 / 超时 */
export function waitEventParams(): ParamFieldDef[] {
  return [
    {
      key: 'eventName',
      label: '事件名',
      type: 'string',
      required: true,
      placeholder: '如 site.arrived'
    },
    {
      key: 'timeoutSec',
      label: '超时(秒)',
      type: 'number',
      defaultValue: 60,
      placeholder: '超时后走「超时」连线；0 表示不超时'
    }
  ]
}

/** 等待事件节点的出口 handle id */
export const WAIT_EVENT_HANDLES = {
  triggered: 'triggered',
  timeout: 'timeout'
} as const

export const WAIT_EVENT_HANDLE_LABELS: Record<string, string> = {
  triggered: '正常执行',
  timeout: '超时执行'
}
