/** * fun 结点注册表:新增结点只需 1)在 actions/fun/ 新建脚本(只实现 executeXxx(input),入参由 in 规定、出参由 out 规定)2)在此添加一条配置。 * 通用逻辑(解析 inVars、取值、写回 variableContext、logOutVars)由 fun-parser 统一处理,脚本不写 parseNode/runNode。 * 配置项:type, category, in(入参名数组), inAlt?(字段别名), execute(脚本导出的函数名), script?(默认 type+'.js'), displayName?。出参由工作流 action.outVars[0] 指定。 * 仅当需要完全自定义解析或执行时,才配 customParse/customRun 并在脚本中导出 parseNode、runNode。 */ module.exports = [ { type: 'download', category: 'io', in: ['url', 'savePath'], inAlt: { savePath: 'save-path' }, execute: 'executeDownload', script: 'download.js', }, { type: 'text2text', category: 'io', in: ['prompt', 'model'], execute: 'executeText2text', script: 'ai/text2text.js', displayName: 'ai text2text' }, { type: 'img2text', category: 'io', in: ['prompt', 'model', 'imageUrl'], execute: 'executeImg2text', script: 'ai/img2text.js', displayName: 'ai img2text' }, { type: 'text2img', category: 'io', in: ['prompt', 'model', 'savePath'], execute: 'executeText2img', script: 'ai/text2img.js', displayName: 'ai text2img' }, { type: 'img2img', category: 'io', in: ['prompt', 'model', 'imageUrl', 'savePath'], execute: 'executeImg2img', script: 'ai/img2img.js', displayName: 'ai img2img' }, ]