Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
feat(schema): Wave 8 - first 3 frontend nodeDefinitions files slimmed
trohitg9f748f8cc88f
diff --git a/client/src/nodeDefinitions/codeNodes.ts b/client/src/nodeDefinitions/codeNodes.tsindex ed26bb9c..d49a50d6 100644--- a/client/src/nodeDefinitions/codeNodes.ts+++ b/client/src/nodeDefinitions/codeNodes.ts@@ -14,17 +14,18 @@ export const codeNodes: Record<string, INodeTypeDescription> = {uiHints: { hasCodeEditor: true },inputs: [{ name: 'main', displayName: 'Input', type: 'main' as NodeConnectionType, description: 'Input data as input_data variable' }],outputs: [{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'Python execution result' }],+ // Wave 8: schema lives on backend (PythonExecutorParams).+ // Starter code preserved via per-property merge.properties: [{displayName: 'Code',name: 'code',type: 'string',default: '# Python Executor - Transform and process data\n#\n# Available:\n# input_data - dict with connected node outputs\n# math, json - imported modules\n# print() - for debugging\n#\n# Set the "output" variable with your result\n\n# Example: Get data from connected node\ndata = input_data.get("start", {}) or input_data\n\n# Process data\nresult = {\n "message": "Hello from Python!",\n "input_received": data,\n "processed": True\n}\n\n# Set output (required)\noutput = result',- required: true,typeOptions: { rows: 5, editor: 'code', editorLanguage: 'python' },- placeholder: '# Write your Python code here...'- }- ]+ placeholder: '# Write your Python code here...',+ },+ ],},javascriptExecutor: {@@ -39,17 +40,17 @@ export const codeNodes: Record<string, INodeTypeDescription> = {uiHints: { hasCodeEditor: true },inputs: [{ name: 'main', displayName: 'Input', type: 'main' as NodeConnectionType, description: 'Input data as input_data variable' }],outputs: [{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'JavaScript execution result' }],+ // Wave 8: schema lives on backend (JavaScriptExecutorParams).properties: [{displayName: 'Code',name: 'code',type: 'string',default: '// JavaScript Executor - Transform and process data\n//\n// Available:\n// input_data - object with connected node outputs\n// console.log() - for debugging\n//\n// Set the "output" variable with your result\n\n// Example: Get data from connected node\nconst data = input_data?.start || input_data || {};\n\n// Process data\nconst result = {\n message: "Hello from JavaScript!",\n input_received: data,\n processed: true\n};\n\n// Set output (required)\noutput = result;',- required: true,typeOptions: { rows: 5, editor: 'code', editorLanguage: 'javascript' },- placeholder: '// Write your JavaScript code here...'- }- ]+ placeholder: '// Write your JavaScript code here...',+ },+ ],},typescriptExecutor: {@@ -64,18 +65,18 @@ export const codeNodes: Record<string, INodeTypeDescription> = {uiHints: { hasCodeEditor: true },inputs: [{ name: 'main', displayName: 'Input', type: 'main' as NodeConnectionType, description: 'Input data as input_data variable' }],outputs: [{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'TypeScript execution result' }],+ // Wave 8: schema lives on backend (TypeScriptExecutorParams).properties: [{displayName: 'Code',name: 'code',type: 'string',default: '// TypeScript Executor - Transform and process data with type safety\n//\n// Available:\n// input_data - object with connected node outputs\n// console.log() - for debugging\n//\n// Set the "output" variable with your result\n\ninterface Result {\n message: string;\n input_received: unknown;\n processed: boolean;\n}\n\n// Example: Get data from connected node\nconst data = input_data?.start || input_data || {};\n\n// Process data with type safety\nconst result: Result = {\n message: "Hello from TypeScript!",\n input_received: data,\n processed: true\n};\n\n// Set output (required)\noutput = result;',- required: true,typeOptions: { rows: 5, editor: 'code', editorLanguage: 'typescript' },- placeholder: '// Write your TypeScript code here...'- }- ]- }+ placeholder: '// Write your TypeScript code here...',+ },+ ],+ },};export const CODE_NODE_TYPES = ['pythonExecutor', 'javascriptExecutor', 'typescriptExecutor'];diff --git a/client/src/nodeDefinitions/processNodes.ts b/client/src/nodeDefinitions/processNodes.tsindex 47462aae..1bd6305c 100644--- a/client/src/nodeDefinitions/processNodes.ts+++ b/client/src/nodeDefinitions/processNodes.ts@@ -24,79 +24,14 @@ export const processNodes: Record<string, INodeTypeDescription> = {{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'Process operation result' },{ name: 'tool', displayName: 'Tool', type: 'main' as NodeConnectionType, description: 'Connect to AI Agent tool handle' },],+ // Wave 8: parameter schema lives on the backend (ProcessManagerParams).+ // Local placeholders retained via the per-property merge in+ // lib/nodeSpec.ts.properties: [- // Tool config- {- displayName: 'Tool Name',- name: 'toolName',- type: 'string',- default: 'process_manager',- description: 'Name of this tool when used by AI Agent',- },- {- displayName: 'Tool Description',- name: 'toolDescription',- type: 'string',- default: 'Start, stop, and manage long-running processes. Use for dev servers, watchers, build tools. Output streams to Terminal.',- typeOptions: { rows: 2 },- description: 'Description shown to AI Agent',- },-- // Operation- {- displayName: 'Operation',- name: 'operation',- type: 'options',- default: 'start',- options: [- { name: 'Start', value: 'start', description: 'Start a new process' },- { name: 'Stop', value: 'stop', description: 'Stop a running process' },- { name: 'Restart', value: 'restart', description: 'Restart a process' },- { name: 'Send Input', value: 'send_input', description: 'Send text to process stdin' },- { name: 'List', value: 'list', description: 'List running processes' },- { name: 'Get Output', value: 'get_output', description: 'Get buffered output history' },- ],- description: 'Process operation to perform',- },-- // Conditional parameters- {- displayName: 'Process Name',- name: 'name',- type: 'string',- default: '',- placeholder: 'my-server',- description: 'Unique name for this process',- displayOptions: { show: { operation: ['start', 'stop', 'restart', 'send_input', 'get_output'] } },- },- {- displayName: 'Command',- name: 'command',- type: 'string',- default: '',- required: true,- placeholder: 'python -m http.server 8080',- description: 'Shell command to run as a long-lived process',- displayOptions: { show: { operation: ['start'] } },- },- {- displayName: 'Working Directory',- name: 'working_directory',- type: 'string',- default: '',- placeholder: 'Uses workflow workspace if empty',- description: 'Working directory for the process',- displayOptions: { show: { operation: ['start'] } },- },- {- displayName: 'Input Text',- name: 'text',- type: 'string',- default: '',- placeholder: 'Text to send to stdin',- description: 'Text to write to the process stdin (newline appended automatically)',- displayOptions: { show: { operation: ['send_input'] } },- },+ { displayName: 'Process Name', name: 'name', type: 'string', default: '', placeholder: 'my-server' },+ { displayName: 'Command', name: 'command', type: 'string', default: '', placeholder: 'python -m http.server 8080' },+ { displayName: 'Working Directory', name: 'cwd', type: 'string', default: '', placeholder: 'Uses workflow workspace if empty' },+ { displayName: 'Input Text', name: 'input', type: 'string', default: '', placeholder: 'Text to send to stdin' },],},};diff --git a/client/src/nodeDefinitions/workflowNodes.ts b/client/src/nodeDefinitions/workflowNodes.tsindex 19b823c0..ff03fac3 100644--- a/client/src/nodeDefinitions/workflowNodes.ts+++ b/client/src/nodeDefinitions/workflowNodes.ts@@ -23,19 +23,19 @@ export const workflowNodes: Record<string, INodeTypeDescription> = {type: 'main' as NodeConnectionType,description: 'Workflow start output'}],+ // Wave 8: properties retain the non-empty `default` placeholder+ // blob which the merge in lib/nodeSpec.ts preserves over the+ // backend's "{}" default. Everything else (type, rows,+ // description) now comes from StartNodeParams.properties: [{displayName: 'Initial Data',name: 'initialData',type: 'string',default: '{}',- typeOptions: {- rows: 6- },- description: 'JSON data to pass to connected nodes',- placeholder: '{\n "message": "Hello World",\n "value": 123\n}'- }- ]+ placeholder: '{\n "message": "Hello World",\n "value": 123\n}',+ },+ ],},// Task Trigger - Event-driven trigger for child agent completion@@ -55,42 +55,9 @@ export const workflowNodes: Record<string, INodeTypeDescription> = {type: 'main' as NodeConnectionType,description: 'task_id, status, agent_name, result/error, parent_node_id'}],- properties: [- {- displayName: 'Task ID Filter',- name: 'task_id',- type: 'string',- default: '',- description: 'Optional: Only trigger for specific task ID'- },- {- displayName: 'Agent Name Filter',- name: 'agent_name',- type: 'string',- default: '',- description: 'Optional: Only trigger for agents containing this name'- },- {- displayName: 'Status Filter',- name: 'status_filter',- type: 'options',- default: 'all',- options: [- { name: 'All', value: 'all' },- { name: 'Completed Only', value: 'completed' },- { name: 'Errors Only', value: 'error' }- ],- description: 'Filter by completion status'- },- {- displayName: 'Parent Node ID',- name: 'parent_node_id',- type: 'string',- default: '',- description: 'Optional: Only trigger for delegations from specific parent agent'- }- ]- }+ // Wave 8: parameter schema lives on the backend (TaskTriggerParams).+ properties: [],+ },};export const WORKFLOW_NODE_TYPES = ['start', 'taskTrigger'];diff --git a/server/models/nodes.py b/server/models/nodes.pyindex 587d2ccf..d559fb4b 100644--- a/server/models/nodes.py+++ b/server/models/nodes.py@@ -415,7 +415,11 @@ class TeamMonitorParams(BaseNodeParams):class StartNodeParams(BaseNodeParams):"""Parameters for start node."""type: Literal["start"]- initial_data: str = Field(default="{}", alias="initialData")+ initial_data: str = Field(+ default="{}",+ alias="initialData",+ json_schema_extra={"rows": 6},+ )class CronSchedulerParams(BaseNodeParams):@@ -443,7 +447,18 @@ class TaskTriggerParams(BaseNodeParams):type: Literal["taskTrigger"]task_id: str = Field(default="", alias="taskId")agent_name: str = Field(default="", alias="agentName")- status_filter: Literal["all", "completed", "error"] = Field(default="all", alias="statusFilter")+ status_filter: Literal["all", "completed", "error"] = Field(+ default="all",+ alias="statusFilter",+ json_schema_extra={+ "options": [+ {"name": "All", "value": "all"},+ {"name": "Completed Only", "value": "completed"},+ {"name": "Errors Only", "value": "error"},+ ]+ },+ )+ parent_node_id: str = Field(default="", alias="parentNodeId")parent_node_id: str = Field(default="", alias="parentNodeId")