/** * AI node config - prompt, query, document options per node type. * Prompt/query fields support static value or node reference (Data Picker). */ import React from 'react'; import type { NodeConfigRendererProps } from './types'; import { DynamicValueField } from '../shared/DynamicValueField'; const AI_FIELD_CONFIG: Record = { 'ai.prompt': [{ label: 'Prompt', key: 'prompt', type: 'textarea' }], 'ai.webResearch': [{ label: 'Query', key: 'query', type: 'dynamic' }], 'ai.summarizeDocument': [ { label: 'Summary length', key: 'summaryLength', type: 'select', options: ['short', 'medium', 'long'] }, ], 'ai.translateDocument': [{ label: 'Target language', key: 'targetLanguage', type: 'input' }], 'ai.convertDocument': [ { label: 'Target format', key: 'targetFormat', type: 'select', options: ['pdf', 'docx', 'txt', 'md'] }, ], 'ai.generateDocument': [{ label: 'Prompt', key: 'prompt', type: 'dynamic' }], 'ai.generateCode': [ { label: 'Prompt', key: 'prompt', type: 'dynamic' }, { label: 'Language', key: 'language', type: 'select', options: ['python', 'javascript', 'typescript', 'sql'] }, ], }; export const AiNodeConfig: React.FC = ({ params, updateParam, nodeType = 'ai.prompt' }) => { const fields = AI_FIELD_CONFIG[nodeType] ?? AI_FIELD_CONFIG['ai.prompt']; return ( <> {fields.map((f) => { if (f.type === 'dynamic') { return ( ); } if (f.type === 'textarea') { return (