Skip to content

Commit

Permalink
Rename spawnAgent api context function to registerAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
noreplydev committed Oct 30, 2024
1 parent 6d9b086 commit a7d7c8e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/protolib/src/bundles/agents/agents/context/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import spawnAgent from "./spawnAgent"
import registerAgent from "./registerAgent"

export default {
spawnAgent
registerAgent
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { useColorFromPalette } from 'protoflow/src/diagram/Theme'
import { Split } from '@tamagui/lucide-icons';
import { agentBusTypes } from './index';

const SpawnAgent = ({ node = {}, nodeData = {}, children }: any) => {
const RegisterAgent = ({ node = {}, nodeData = {}, children }: any) => {
const color = useColorFromPalette(10)

return (
<Node icon={Split} node={node} isPreview={!node.id} title='Spawn Agent' color={color} id={node.id} skipCustom={true}>
<Node icon={Split} node={node} isPreview={!node.id} title='Register Agent' color={color} id={node.id} skipCustom={true}>
<p style={{ fontSize: "22px" }}>Client</p>
<NodeParams id={node.id} params={[{ label: 'Agent name', field: 'mask-agentName', type: 'input' }]} />
<NodeParams id={node.id} params={[{ label: 'Exposed Subsystems', field: 'mask-subsystems', type: 'input' }]} />
Expand All @@ -33,14 +33,14 @@ const SpawnAgent = ({ node = {}, nodeData = {}, children }: any) => {
}

export default {
id: 'agents.spawnAgent',
id: 'agents.registerAgent',
type: 'CallExpression',
category: "Agents",
keywords: ["Agents", "remote", "connection"],
check: (node, nodeData) => {
return node.type == "CallExpression" && nodeData.to?.startsWith('context.agents.spawnAgent')
return node.type == "CallExpression" && nodeData.to?.startsWith('context.agents.registerAgent')
},
getComponent: (node, nodeData, children) => <SpawnAgent node={node} nodeData={nodeData} children={children} />,
getComponent: (node, nodeData, children) => <RegisterAgent node={node} nodeData={nodeData} children={children} />,
filterChildren: filterObject({
keys: {
agentName: 'input',
Expand Down Expand Up @@ -72,7 +72,7 @@ export default {
getInitialData: () => {
return {
await: true,
to: 'context.agents.spawnAgent',
to: 'context.agents.registerAgent',
"mask-agentName": {
value: "",
kind: "StringLiteral"
Expand Down
4 changes: 2 additions & 2 deletions packages/protolib/src/bundles/agents/agents/masks/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SpawnAgent from "./SpawnAgent";
import RegisterAgent from './RegisterAgent'

export const agentBusTypes = ["mqtt"]
export default [
SpawnAgent
RegisterAgent
];

0 comments on commit a7d7c8e

Please sign in to comment.