From a7d7c8e2401580a55a5724b670ae3ffe1b110069 Mon Sep 17 00:00:00 2001 From: noreplydev Date: Wed, 30 Oct 2024 18:32:35 +0100 Subject: [PATCH] Rename spawnAgent api context function to registerAgent --- .../src/bundles/agents/agents/context/index.ts | 4 ++-- .../context/{spawnAgent.ts => registerAgent.ts} | 0 .../masks/{SpawnAgent.tsx => RegisterAgent.tsx} | 12 ++++++------ .../src/bundles/agents/agents/masks/index.tsx | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename packages/protolib/src/bundles/agents/agents/context/{spawnAgent.ts => registerAgent.ts} (100%) rename packages/protolib/src/bundles/agents/agents/masks/{SpawnAgent.tsx => RegisterAgent.tsx} (87%) diff --git a/packages/protolib/src/bundles/agents/agents/context/index.ts b/packages/protolib/src/bundles/agents/agents/context/index.ts index a4151c0f4..9753b5ac4 100644 --- a/packages/protolib/src/bundles/agents/agents/context/index.ts +++ b/packages/protolib/src/bundles/agents/agents/context/index.ts @@ -1,5 +1,5 @@ -import spawnAgent from "./spawnAgent" +import registerAgent from "./registerAgent" export default { - spawnAgent + registerAgent } \ No newline at end of file diff --git a/packages/protolib/src/bundles/agents/agents/context/spawnAgent.ts b/packages/protolib/src/bundles/agents/agents/context/registerAgent.ts similarity index 100% rename from packages/protolib/src/bundles/agents/agents/context/spawnAgent.ts rename to packages/protolib/src/bundles/agents/agents/context/registerAgent.ts diff --git a/packages/protolib/src/bundles/agents/agents/masks/SpawnAgent.tsx b/packages/protolib/src/bundles/agents/agents/masks/RegisterAgent.tsx similarity index 87% rename from packages/protolib/src/bundles/agents/agents/masks/SpawnAgent.tsx rename to packages/protolib/src/bundles/agents/agents/masks/RegisterAgent.tsx index e4fc8cd8c..762a4f752 100644 --- a/packages/protolib/src/bundles/agents/agents/masks/SpawnAgent.tsx +++ b/packages/protolib/src/bundles/agents/agents/masks/RegisterAgent.tsx @@ -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 ( - +

Client

@@ -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) => , + getComponent: (node, nodeData, children) => , filterChildren: filterObject({ keys: { agentName: 'input', @@ -72,7 +72,7 @@ export default { getInitialData: () => { return { await: true, - to: 'context.agents.spawnAgent', + to: 'context.agents.registerAgent', "mask-agentName": { value: "", kind: "StringLiteral" diff --git a/packages/protolib/src/bundles/agents/agents/masks/index.tsx b/packages/protolib/src/bundles/agents/agents/masks/index.tsx index 76618e2ef..b08879430 100644 --- a/packages/protolib/src/bundles/agents/agents/masks/index.tsx +++ b/packages/protolib/src/bundles/agents/agents/masks/index.tsx @@ -1,6 +1,6 @@ -import SpawnAgent from "./SpawnAgent"; +import RegisterAgent from './RegisterAgent' export const agentBusTypes = ["mqtt"] export default [ - SpawnAgent + RegisterAgent ]; \ No newline at end of file