feat: agent node
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { ScrollText, Sparkles, Variable, Code2, Database } from 'lucide-react'
|
||||
import { ScrollText, Sparkles, Variable, Code2, Database, Bot } from 'lucide-react'
|
||||
import { registerNodeType } from './nodeRegistry'
|
||||
import { NODE_HELP } from './nodeHelp'
|
||||
import ConfigNode from '../components/nodes/ConfigNode'
|
||||
@@ -12,6 +12,7 @@ import RenderingNode from '../components/nodes/RenderingNode'
|
||||
import VariableNode from '../components/nodes/VariableNode'
|
||||
import FunctionNode from '../components/nodes/FunctionNode'
|
||||
import DataNode from '../components/nodes/DataNode'
|
||||
import AgentNode from '../components/nodes/AgentNode'
|
||||
|
||||
const ICON_CLASS = 'mr-2 h-4 w-4'
|
||||
|
||||
@@ -26,7 +27,7 @@ export function registerBuiltinNodes(): void {
|
||||
hasOutput: true,
|
||||
classification: 'psyche',
|
||||
allowedSourceTypes: ['config', 'variable', 'function', 'data'],
|
||||
allowedTargetTypes: ['config', 'render'],
|
||||
allowedTargetTypes: ['config', 'render', 'agent'],
|
||||
help: NODE_HELP.config,
|
||||
menuLabel: 'Config',
|
||||
menuIcon: <ScrollText className={ICON_CLASS} />,
|
||||
@@ -52,13 +53,30 @@ export function registerBuiltinNodes(): void {
|
||||
hasInput: true,
|
||||
hasOutput: false,
|
||||
classification: 'pneuma',
|
||||
allowedSourceTypes: ['config'],
|
||||
allowedSourceTypes: ['config', 'agent'],
|
||||
help: NODE_HELP.render,
|
||||
menuLabel: 'Renderer',
|
||||
menuIcon: <Sparkles className={ICON_CLASS} />,
|
||||
connectionLabel: 'rendering',
|
||||
})
|
||||
|
||||
registerNodeType({
|
||||
id: 'agent',
|
||||
component: AgentNode,
|
||||
defaultStyle: { width: 360, height: 320 },
|
||||
defaultData: { context: '' },
|
||||
idPrefix: 'agt_',
|
||||
hasInput: true,
|
||||
hasOutput: true,
|
||||
classification: 'archon',
|
||||
allowedSourceTypes: ['config', 'variable', 'data'],
|
||||
allowedTargetTypes: ['render'],
|
||||
help: NODE_HELP.agent,
|
||||
menuLabel: 'Agent',
|
||||
menuIcon: <Bot className={ICON_CLASS} />,
|
||||
connectionLabel: 'prompt/context',
|
||||
})
|
||||
|
||||
registerNodeType({
|
||||
id: 'variable',
|
||||
component: VariableNode,
|
||||
@@ -68,7 +86,7 @@ export function registerBuiltinNodes(): void {
|
||||
hasInput: false,
|
||||
hasOutput: true,
|
||||
classification: 'psyche',
|
||||
allowedTargetTypes: ['config', 'function'],
|
||||
allowedTargetTypes: ['config', 'function', 'agent'],
|
||||
help: NODE_HELP.variable,
|
||||
menuLabel: 'Variable',
|
||||
menuIcon: <Variable className={ICON_CLASS} />,
|
||||
@@ -83,7 +101,7 @@ export function registerBuiltinNodes(): void {
|
||||
hasInput: false,
|
||||
hasOutput: true,
|
||||
classification: 'physis',
|
||||
allowedTargetTypes: ['config'],
|
||||
allowedTargetTypes: ['config', 'agent'],
|
||||
help: NODE_HELP.data,
|
||||
menuLabel: 'Data',
|
||||
menuIcon: <Database className={ICON_CLASS} />,
|
||||
|
||||
Reference in New Issue
Block a user