Skip to content

Self-improving AI Employees for everyone

feat(schema): Wave 8 - slim chatNodes + filesystemNodes (-155 LOC)

trohitg6c6e7a14cbf9
diff --git a/client/src/nodeDefinitions/chatNodes.ts b/client/src/nodeDefinitions/chatNodes.ts
index 528b9a32..77350b9b 100644
--- a/client/src/nodeDefinitions/chatNodes.ts
+++ b/client/src/nodeDefinitions/chatNodes.ts
@@ -27,47 +27,8 @@ export const chatNodes: Record<string, INodeTypeDescription> = {
type: 'main' as NodeConnectionType,
description: 'message_id, status, timestamp'
}],
- properties: [
- // Connection settings
- {
- displayName: 'Host',
- name: 'host',
- type: 'string',
- default: 'localhost',
- description: 'Chat server host'
- },
- {
- displayName: 'Port',
- name: 'port',
- type: 'number',
- default: 8080,
- description: 'Chat server port'
- },
- {
- displayName: 'Session ID',
- name: 'session_id',
- type: 'string',
- default: 'default',
- description: 'Chat session identifier'
- },
- {
- displayName: 'API Key',
- name: 'api_key',
- type: 'string',
- default: '',
- description: 'API key for authentication'
- },
- // Message
- {
- displayName: 'Message',
- name: 'content',
- type: 'string',
- default: '',
- required: true,
- typeOptions: { rows: 3 },
- description: 'Message content to send'
- }
- ]
+ // Wave 8: schema lives on backend (ChatSendParams).
+ properties: [],
},
// Chat Get History Node
@@ -92,44 +53,9 @@ export const chatNodes: Record<string, INodeTypeDescription> = {
type: 'main' as NodeConnectionType,
description: 'messages array'
}],
- properties: [
- {
- displayName: 'Host',
- name: 'host',
- type: 'string',
- default: 'localhost',
- description: 'Chat server host'
- },
- {
- displayName: 'Port',
- name: 'port',
- type: 'number',
- default: 8080,
- description: 'Chat server port'
- },
- {
- displayName: 'Session ID',
- name: 'session_id',
- type: 'string',
- default: 'default',
- description: 'Chat session identifier'
- },
- {
- displayName: 'API Key',
- name: 'api_key',
- type: 'string',
- default: '',
- description: 'API key for authentication'
- },
- {
- displayName: 'Limit',
- name: 'limit',
- type: 'number',
- default: 50,
- description: 'Maximum number of messages to retrieve'
- }
- ]
- }
+ // Wave 8: schema lives on backend (ChatHistoryParams).
+ properties: [],
+ },
};
export const CHAT_NODE_TYPES = ['chatSend', 'chatHistory'];
diff --git a/client/src/nodeDefinitions/filesystemNodes.ts b/client/src/nodeDefinitions/filesystemNodes.ts
index d3249df7..32211d97 100644
--- a/client/src/nodeDefinitions/filesystemNodes.ts
+++ b/client/src/nodeDefinitions/filesystemNodes.ts
@@ -16,32 +16,8 @@ export const filesystemNodes: Record<string, INodeTypeDescription> = {
{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'File contents' },
{ name: 'tool', displayName: 'Tool', type: 'main' as NodeConnectionType, description: 'Connect to AI Agent tool handle' },
],
- properties: [
- {
- displayName: 'File Path',
- name: 'file_path',
- type: 'string' as any,
- default: '',
- required: true,
- description: 'Path to the file to read',
- },
- {
- displayName: 'Offset',
- name: 'offset',
- type: 'number' as any,
- default: 0,
- typeOptions: { minValue: 0 },
- description: 'Line number to start reading from (0-indexed)',
- },
- {
- displayName: 'Limit',
- name: 'limit',
- type: 'number' as any,
- default: 100,
- typeOptions: { minValue: 1, maxValue: 10000 },
- description: 'Maximum number of lines to read',
- },
- ],
+ // Wave 8: schema lives on backend (FileReadParams).
+ properties: [],
},
fileModify: {
@@ -58,62 +34,8 @@ export const filesystemNodes: Record<string, INodeTypeDescription> = {
{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'Operation result' },
{ name: 'tool', displayName: 'Tool', type: 'main' as NodeConnectionType, description: 'Connect to AI Agent tool handle' },
],
- properties: [
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options' as any,
- default: 'write',
- options: [
- { name: 'Write', value: 'write' },
- { name: 'Edit', value: 'edit' },
- ],
- description: 'Write creates/overwrites a file. Edit performs string replacement.',
- },
- {
- displayName: 'File Path',
- name: 'file_path',
- type: 'string' as any,
- default: '',
- required: true,
- description: 'Path to the file',
- },
- {
- displayName: 'Content',
- name: 'content',
- type: 'string' as any,
- default: '',
- typeOptions: { rows: 5 },
- description: 'File content to write',
- displayOptions: { show: { operation: ['write'] } },
- },
- {
- displayName: 'Old String',
- name: 'old_string',
- type: 'string' as any,
- default: '',
- typeOptions: { rows: 3 },
- description: 'Exact text to find and replace',
- displayOptions: { show: { operation: ['edit'] } },
- },
- {
- displayName: 'New String',
- name: 'new_string',
- type: 'string' as any,
- default: '',
- typeOptions: { rows: 3 },
- description: 'Text to replace old_string with',
- displayOptions: { show: { operation: ['edit'] } },
- },
- {
- displayName: 'Replace All',
- name: 'replace_all',
- type: 'boolean' as any,
- default: false,
- description: 'Replace all occurrences (default: first only, old_string must be unique)',
- displayOptions: { show: { operation: ['edit'] } },
- },
- ],
+ // Wave 8: schema lives on backend (FileModifyParams).
+ properties: [],
},
shell: {
@@ -130,25 +52,8 @@ export const filesystemNodes: Record<string, INodeTypeDescription> = {
{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'Command output' },
{ name: 'tool', displayName: 'Tool', type: 'main' as NodeConnectionType, description: 'Connect to AI Agent tool handle' },
],
- properties: [
- {
- displayName: 'Command',
- name: 'command',
- type: 'string' as any,
- default: '',
- required: true,
- typeOptions: { rows: 3 },
- description: 'Shell command to execute',
- },
- {
- displayName: 'Timeout (seconds)',
- name: 'timeout',
- type: 'number' as any,
- default: 30,
- typeOptions: { minValue: 1, maxValue: 300 },
- description: 'Maximum execution time in seconds',
- },
- ],
+ // Wave 8: schema lives on backend (ShellParams).
+ properties: [],
},
fsSearch: {
@@ -165,43 +70,8 @@ export const filesystemNodes: Record<string, INodeTypeDescription> = {
{ name: 'main', displayName: 'Output', type: 'main' as NodeConnectionType, description: 'Search results' },
{ name: 'tool', displayName: 'Tool', type: 'main' as NodeConnectionType, description: 'Connect to AI Agent tool handle' },
],
- properties: [
- {
- displayName: 'Mode',
- name: 'mode',
- type: 'options' as any,
- default: 'ls',
- options: [
- { name: 'List Directory', value: 'ls' },
- { name: 'Glob Pattern', value: 'glob' },
- { name: 'Grep Contents', value: 'grep' },
- ],
- description: 'Search mode: list directory, glob file patterns, or grep file contents',
- },
- {
- displayName: 'Path',
- name: 'path',
- type: 'string' as any,
- default: '.',
- description: 'Directory path to search in',
- },
- {
- displayName: 'Pattern',
- name: 'pattern',
- type: 'string' as any,
- default: '',
- description: 'Glob pattern (e.g., **/*.py) or grep search text',
- displayOptions: { show: { mode: ['glob', 'grep'] } },
- },
- {
- displayName: 'File Filter',
- name: 'file_filter',
- type: 'string' as any,
- default: '',
- description: 'Glob pattern to filter which files to grep (e.g., *.py)',
- displayOptions: { show: { mode: ['grep'] } },
- },
- ],
+ // Wave 8: schema lives on backend (FsSearchParams).
+ properties: [],
},
};
diff --git a/server/models/nodes.py b/server/models/nodes.py
index d559fb4b..0e026489 100644
--- a/server/models/nodes.py
+++ b/server/models/nodes.py
@@ -905,19 +905,36 @@ class FileReadParams(BaseNodeParams):
class FileModifyParams(BaseNodeParams):
type: Literal["fileModify"]
- operation: Literal["write", "edit"] = "write"
+ operation: Literal["write", "edit"] = Field(
+ default="write",
+ json_schema_extra={
+ "options": [
+ {"name": "Write", "value": "write"},
+ {"name": "Edit", "value": "edit"},
+ ]
+ },
+ )
file_path: str = Field(default="", alias="filePath")
content: str = Field(
default="",
- json_schema_extra={"displayOptions": {"show": {"operation": ["write"]}}},
+ json_schema_extra={
+ "displayOptions": {"show": {"operation": ["write"]}},
+ "rows": 5,
+ },
)
old_string: str = Field(
default="", alias="oldString",
- json_schema_extra={"displayOptions": {"show": {"operation": ["edit"]}}},
+ json_schema_extra={
+ "displayOptions": {"show": {"operation": ["edit"]}},
+ "rows": 3,
+ },
)
new_string: str = Field(
default="", alias="newString",
- json_schema_extra={"displayOptions": {"show": {"operation": ["edit"]}}},
+ json_schema_extra={
+ "displayOptions": {"show": {"operation": ["edit"]}},
+ "rows": 3,
+ },
)
replace_all: bool = Field(
default=False, alias="replaceAll",
@@ -927,14 +944,31 @@ class FileModifyParams(BaseNodeParams):
class FsSearchParams(BaseNodeParams):
type: Literal["fsSearch"]
- mode: Literal["ls", "glob", "grep"] = "ls"
+ mode: Literal["ls", "glob", "grep"] = Field(
+ default="ls",
+ json_schema_extra={
+ "options": [
+ {"name": "List Directory", "value": "ls"},
+ {"name": "Glob Pattern", "value": "glob"},
+ {"name": "Grep Contents", "value": "grep"},
+ ]
+ },
+ )
path: str = "."
- pattern: str = ""
+ pattern: str = Field(
+ default="",
+ json_schema_extra={"displayOptions": {"show": {"mode": ["glob", "grep"]}}},
+ )
+ file_filter: str = Field(
+ default="",
+ alias="fileFilter",
+ json_schema_extra={"displayOptions": {"show": {"mode": ["grep"]}}},
+ )
class ShellParams(BaseNodeParams):
type: Literal["shell"]
- command: str = ""
+ command: str = Field(default="", json_schema_extra={"rows": 3})
timeout: int = Field(default=30, ge=1, le=600)
cwd: Optional[str] = None
@@ -1002,14 +1036,29 @@ class FileHandlerParams(BaseNodeParams):
# =============================================================================
class ChatSendParams(BaseNodeParams):
- """Parameters for chat send node."""
+ """Parameters for chat send node (JSON-RPC 2.0 WebSocket chat backend)."""
type: Literal["chatSend"]
- message: str = ""
+ host: str = "localhost"
+ port: int = Field(default=8080, ge=1, le=65535)
+ session_id: str = Field(default="default", alias="sessionId")
+ api_key: str = Field(
+ default="", alias="apiKey",
+ json_schema_extra={"password": True},
+ )
+ content: str = Field(default="", json_schema_extra={"rows": 3})
+ message: str = "" # legacy alias
class ChatHistoryParams(BaseNodeParams):
- """Parameters for chat history node."""
+ """Parameters for chat history retrieval node."""
type: Literal["chatHistory"]
+ host: str = "localhost"
+ port: int = Field(default=8080, ge=1, le=65535)
+ session_id: str = Field(default="default", alias="sessionId")
+ api_key: str = Field(
+ default="", alias="apiKey",
+ json_schema_extra={"password": True},
+ )
limit: int = Field(default=50, ge=1, le=1000)