Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

remove enterprise sre components

Ahmed Essam7fe45801c6a2
diff --git a/package.json b/package.json
index c01a4de9..2761eb5a 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
- "author": "",
+ "author": "Ahmed Essam",
"license": "ISC",
"packageManager": "[email protected]",
"workspaces": [
diff --git a/packages/app/src/backend/routes/api/page/builder.ts b/packages/app/src/backend/routes/api/page/builder.ts
index d30d0db4..6ef0d6e7 100644
--- a/packages/app/src/backend/routes/api/page/builder.ts
+++ b/packages/app/src/backend/routes/api/page/builder.ts
@@ -13,7 +13,6 @@ import {
smythAPI,
smythAPIReq,
} from '../../../utils/';
-import { refreshMenu } from '../../pages/builder-sidebar';
import { getIntegrations } from '../../router.utils/templates.utils';
import axios, { AxiosError, AxiosResponse } from 'axios';
@@ -459,11 +458,9 @@ router.get('/integrations', async (req, res) => {
});
router.post('/app-config/components', (req, res) => {
- setTimeout(() => refreshMenu(), 2000);
return componentsMWHandler(req, res);
});
router.put('/app-config/components/:id', (req, res) => {
- setTimeout(() => refreshMenu(), 2000);
return componentsMWHandler(req, res);
});
diff --git a/packages/app/src/backend/routes/pages/builder-sidebar.ts b/packages/app/src/backend/routes/pages/builder-sidebar.ts
index 19dddf71..da1447d8 100644
--- a/packages/app/src/backend/routes/pages/builder-sidebar.ts
+++ b/packages/app/src/backend/routes/pages/builder-sidebar.ts
@@ -1,5 +1,5 @@
+import { plugins, PluginTarget, PluginType } from '@src/react/shared/plugins/Plugins';
import config from '../../config';
-import { getIntegrations } from '../router.utils';
type MenuItem = {
name?: string;
@@ -23,7 +23,7 @@ type Menu = {
[groupName: string]: MenuItem[] | DynamicMenuItem;
};
-const menu: Menu = {
+const baseMenu: Menu = {
Base: [
{ name: 'APIEndpoint', label: 'Agent Skill (APIEndpoint)', description: '' },
{ name: 'GenAILLM', description: 'GenAI LLM', label: 'GenAI LLM', icon: '' },
@@ -31,17 +31,6 @@ const menu: Menu = {
{ name: 'Classifier', description: 'Classifier' },
{ name: 'Note', label: 'Note', description: '' },
{ name: 'APIOutput', label: 'API Output', description: '' },
- /* { name: 'POST_APIEndpoint', label: 'API Endpoint [POST only]', description: '' }, */
- //{ name: 'Redirect', label: 'Redirect', description: '' },
- //{ name: 'SchedulerEndpoint', label: 'Scheduler Endpoint', description: '' },
-
- /*
- { name: 'GmailSender', description: 'Gmail sender', label: 'Gmail Sender' },
- { name: 'Memory', description: 'Memory' },
- /*
- { name: 'DBInsert', label: 'DB Insert' },
- { name: 'FormParser', label: 'Form Parser' },
- */
],
Advanced: [
@@ -57,38 +46,8 @@ const menu: Menu = {
{ name: 'Await', label: 'Await', description: '' },
],
- // ! TEMPORARY DISABLED FOR PRODUCTION RELEASE
- // Image: [
- // { name: 'TextToImage', description: 'Text To Image', label: 'Text To Image' },
- // { name: 'ImageToImage', description: 'Image To Image', label: 'Image To Image' },
- // { name: 'ImageToText', description: 'Image To Text', label: 'Image To Text' },
- // // { name: 'BackgroundRemoval', description: 'Background Removal', label: 'Background Removal' },
- // { name: 'ImageUpscaling', description: 'Image Upscaling', label: 'Image Upscaling' },
- // {
- // name: 'RestyleControlNet',
- // description: 'Restyle (ControlNet)',
- // label: 'Restyle (ControlNet)',
- // },
- // // {
- // // name: 'RestyleIPAdapter',
- // // description: 'Restyle (IP-Adapter)',
- // // label: 'Restyle (IP-Adapter)',
- // // },
- // { name: 'Inpainting', description: 'Inpainting', label: 'Inpainting' },
- // { name: 'Outpainting', description: 'Outpainting', label: 'Outpainting' },
- // ],
Tools: [
{ name: 'ServerlessCode', label: 'NodeJS', description: '', icon: 'Code' },
-
- { name: 'WebSearch', label: 'Web Search', description: '' },
- { name: 'WebScrape', label: 'Web Scrape', description: '' },
-
- {
- name: 'ComputerUse',
- label: 'Computer Use (Beta)',
- description: '',
- },
-
{ name: 'MCPClient', label: 'MCP Client', description: '', icon: 'MCP' },
],
Memory: [
@@ -131,37 +90,6 @@ const menu: Menu = {
icon: 'LogicAtMost',
},
],
- /*
- Skills: [
- { name: 'DataSourceLookup', label: 'Data Lookup', description: '' },
-
- { name: 'Base64Encoder', label: 'Base64 Encoder', description: '' },
-
- { name: 'FileExporter', label: 'PDF Export', attributes: { 'smt-format': 'pdf' } },
- { name: 'FileExporter', label: 'Docx Export', attributes: { 'smt-format': 'docx' } },
- { name: 'FileExporter', label: 'Html Export', attributes: { 'smt-format': 'html' } },
- { name: 'FileExporter', label: 'Markdown Export', attributes: { 'smt-format': 'md' } },
- { name: 'GoogleSheet', label: 'Google Sheet', description: '' },
-
- ],
- */
- /*'Email & Notifications': [*/
- /*{ name: 'GmailReader', description: 'Gmail reader', label: 'Gmail Reader' },*/
- /*{ name: 'GmailSender', description: 'Gmail sender', label: 'Gmail Sender' },*/
- /* { name: 'SMSSender', label: 'SMS Sender', description: '' },*/
- /*],*/
- /*
- TTS: [
- { name: 'ElevenTTS', label: '', description: '' },
- { name: 'GoogleTTS', label: '', description: '' },
- { name: 'AzureTTS', label: '', description: '' },
- { name: 'AWSTTS', label: '', description: '' },
- ],
- */
- // Social: [
- // { name: 'Twitter', label: '', description: '' },
- // { name: 'LinkedIn', label: '', description: '' },
- // ],
/* Menu item empty means component will be added dynamically */
GPTPlugin: { label: 'OpenAPI', type: 'dynamic', actionLabel: 'Import' },
@@ -179,79 +107,44 @@ const menu: Menu = {
],
Integrations: [],
- /*: [
- {
- name: 'Gmail',
- label: 'Gmail',
- description: '',
- icon: 'fa-regular fa-envelope',
- color: '#ee0000',
- children: [
- { name: 'GmailReader', description: 'Gmail reader', label: 'Gmail Reader' },
- { name: 'GmailSender', description: 'Gmail sender', label: 'Gmail Sender' },
- ],
- },
- ]*/
};
-if (config.env.NODE_ENV === 'PROD') {
- // Hide Serverless Code in PROD
- // const fileStoreIndex = (menu.Advanced as any[]).findIndex((p) => p.name === 'FileStore');
- // if (fileStoreIndex > -1) {
- // (menu.Advanced as any[]).splice(fileStoreIndex, 1);
- // }
-
- // const webSearchIndex = (menu.Tools as any[]).findIndex((p) => p.name === 'WebSearch');
- // if (webSearchIndex > -1) {
- // (menu.Tools as any[]).splice(webSearchIndex, 1);
- // }
-
- // //remove async component
- // const asyncIndex = (menu.Advanced as any[]).findIndex((p) => p.name === 'Async');
- // if (asyncIndex > -1) {
- // (menu.Advanced as any[]).splice(asyncIndex, 1);
- // }
-
- // //remove await component
- // const awaitIndex = (menu.Advanced as any[]).findIndex((p) => p.name === 'Await');
- // if (awaitIndex > -1) {
- // (menu.Advanced as any[]).splice(awaitIndex, 1);
- // }
-
- //remove multi modal llm
- // const multimodalIndex = (menu.Base as any[]).findIndex((p) => p.name === 'MultimodalLLM');
- // if (multimodalIndex > -1) {
- // (menu.Base as any[]).splice(multimodalIndex, 1);
- // }
+if (config.env.NODE_ENV === 'PROD') {
//remove memory section
- delete menu.Memory;
+ delete baseMenu.Memory;
}
-/**
- * Refreshes the menu with integration data and schedules periodic updates.
- * @returns {Promise<void>}
- */
-export async function refreshMenu(): Promise<void> {
- try {
- const data = await getIntegrations();
- menu.Integrations = data.sort((a, b) => a.name.localeCompare(b.name));
-
- // Check if menu.Integrations is null, undefined, or empty
- if (!menu.Integrations || menu.Integrations.length === 0) {
- console.warn('No integrations found during menu refresh');
+export const getBuilderSidebarMenu = () => {
+ const menuClone = JSON.parse(JSON.stringify(baseMenu));
+
+ const pluginMenuItems = (
+ plugins.getPluginsByTarget(PluginTarget.BuilderSidebarComponentItems, PluginType.Config) as {
+ config: {
+ name: string;
+ label: string;
+ description: string;
+ icon: string;
+ section: string;
+ };
+ }[]
+ )
+ .flatMap((item) => item.config)
+ .filter(Boolean);
+
+ // loop over each item in pluginMenuItems and add it to the menu section it belongs to
+ for (const item of pluginMenuItems) {
+ const section = item.section || 'Plugins';
+ if (!menuClone[section]) {
+ menuClone[section] = [];
}
- } catch (error) {
- console.error('Error refreshing menu:', error);
+ (menuClone[section] as MenuItem[]).push({
+ name: item.name,
+ label: item.label,
+ description: item.description,
+ });
}
- // Schedule the next refresh after 5 minutes
- setTimeout(
- () => {
- refreshMenu();
- },
- 5 * 60 * 1000,
- ); // 5 minutes in milliseconds
-}
+ return menuClone;
+};
-refreshMenu();
-export default menu;
+export default baseMenu;
diff --git a/packages/app/src/backend/routes/pages/router.ts b/packages/app/src/backend/routes/pages/router.ts
index ad4de68e..dad47417 100644
--- a/packages/app/src/backend/routes/pages/router.ts
+++ b/packages/app/src/backend/routes/pages/router.ts
@@ -6,7 +6,7 @@ import { SMYTHOS_DOCS_URL } from '../../../shared/constants/general';
import config from '../../config';
import ejsHelper from '../../ejsHelper';
import { UserSettingsKey } from '../../types/user-data';
-import builderSidebar from './builder-sidebar';
+import { getBuilderSidebarMenu } from './builder-sidebar';
import { getNavPages, profilePages } from './menus';
import { checkOnboarding as checkOnboardingMW } from './onboarding.mw';
@@ -74,7 +74,7 @@ router.get('/builder', checkOnboardingMW, llmModelsLoaderMiddleware, async (req,
res.render('index', {
page: 'builder',
agentId: '',
- menu: builderSidebar,
+ menu: getBuilderSidebarMenu(),
showTopMenuBar: false,
plan,
...res.locals.ejsOnboardingData,
@@ -100,7 +100,7 @@ router.get('/builder/:agentId', checkOnboardingMW, llmModelsLoaderMiddleware, as
res.render('index', {
page: 'builder',
agentId: req.params.agentId,
- menu: builderSidebar,
+ menu: getBuilderSidebarMenu(),
showTopMenuBar: false,
agent: agentData ? { ...agentData, avatar: agentAvatar } : { avatar: agentAvatar },
plan,
@@ -116,7 +116,7 @@ router.get('/logs/:agentId', async (req, res) => {
res.render('index', {
page: 'logs',
agentId,
- menu: builderSidebar,
+ menu: getBuilderSidebarMenu(),
tag: req.query?.tag || '',
sessionID: req.query?.sessionID || '',
showTopMenuBar: true,
diff --git a/packages/app/src/builder-ui/components/ComputerUse.class.ts b/packages/app/src/builder-ui/components/ComputerUse.class.ts
deleted file mode 100644
index a363b960..00000000
--- a/packages/app/src/builder-ui/components/ComputerUse.class.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import { Component } from './Component.class';
-
-export class ComputerUse extends Component {
- protected async prepare() {
- return true;
- }
-
- protected async init() {
- this.settings = this.generateSettings();
-
- const dataEntries = [
- 'prompt',
- // , 'environment'
- ];
-
- for (let item of dataEntries) {
- if (typeof this.data[item] === 'undefined') {
- this.data[item] = this.settings[item].value;
- }
- }
-
- this.properties.defaultOutputs = ['Output'];
- this.properties.defaultInputs = ['Prompt'];
-
- this.drawSettings.displayName = 'Computer Use';
- this.drawSettings.iconCSSClass = 'svg-icon ' + this.constructor.name;
- this.drawSettings.componentDescription =
- 'Control a virtual computer to perform tasks using natural language commands';
- this.drawSettings.shortDescription = 'AI-powered computer automation';
- this.drawSettings.color = '#65a698';
-
- this._ready = true;
- }
-
- private generateSettings() {
- return {
- prompt: {
- type: 'textarea',
- label: 'Prompt',
- validate: 'required minlength=2',
- validateMessage: 'Please provide a prompt with at least 2 characters',
- value: '{{Prompt}}',
- attributes: {
- 'data-template-vars': 'true',
- placeholder:
- 'Describe what you want the computer to do. For example: "Go to google.com and search for SmythOS"',
- },
- help: 'Natural language instructions for what you want the computer to do',
- },
- // environment: {
- // type: 'select',
- // label: 'Environment',
- // value: 'browser',
- // options: ['browser', 'desktop'],
- // section: 'Advanced',
- // hint: 'The type of computer environment to use',
- // hintPosition: 'left',
- // },
- };
- }
-
- protected async run() {
- // Add any runtime event listeners or initialization here
- this.addEventListener('settingsOpened', this.handleSettingsOpened.bind(this));
- }
-
- private async handleSettingsOpened(sidebar, component) {
- if (component !== this) return;
-
- // Handle environment-dependent field visibility
- // const envSelect = sidebar.querySelector('#environment');
- // if (envSelect) {
- // const updateFieldVisibility = () => {
- // const env = envSelect.value;
- // const browserOnlyFields = sidebar.querySelectorAll('[data-supported-env="browser"]');
- // browserOnlyFields.forEach((field) => {
- // const parent = field.closest('.form-group');
- // if (parent) {
- // parent.style.display = env === 'browser' ? '' : 'none';
- // }
- // });
- // };
-
- // envSelect.addEventListener('change', updateFieldVisibility);
- // // Initial visibility update
- // updateFieldVisibility();
- // }
- }
-
- public redraw(triggerSettings?: boolean): any {
- super.redraw(triggerSettings);
-
- const computerStateContainer = document.createElement('div');
- computerStateContainer.className =
- 'computer-state-container mt-4 p-1 border border-gray-300 rounded-lg shadow-sm bg-white';
- const computerStateImage = document.createElement('img');
- computerStateImage.className =
- 'computer-state-img w-full h-auto rounded-md object-contain max-h-[400px]';
- // add placeholder image
- computerStateImage.src = '/img/builder/computer-use-ui-placeholder.png';
- computerStateImage.onerror = () => {
- computerStateImage.src = '/img/builder/computer-use-ui-placeholder.png';
- };
- // Add a title/label above the image
- // const computerStateLabel = document.createElement('div');
- // computerStateLabel.className = 'text-sm font-medium text-gray-700 mb-2';
- // computerStateLabel.textContent = 'Computer Screen';
- // computerStateContainer.appendChild(computerStateLabel);
-
- computerStateContainer.appendChild(computerStateImage);
- this.domElement.appendChild(computerStateContainer);
-
- return this.domElement;
- }
-}
diff --git a/packages/app/src/builder-ui/components/WebScrape.class.ts b/packages/app/src/builder-ui/components/WebScrape.class.ts
deleted file mode 100644
index 07e28708..00000000
--- a/packages/app/src/builder-ui/components/WebScrape.class.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { Component } from './Component.class';
-
-export class WebScrape extends Component {
- protected async init() {
- this.settings = {
- // includeImages: {
- // type: 'checkbox',
- // label: 'Include Images Results',
- // hint: 'Include images in the results',
- // value: false,
- // },
- format: {
- type: 'select',
- label: 'Format',
- hint: 'Format of the results',
- value: 'markdown',
- options: [
- { text: 'Markdown', value: 'markdown' },
- { text: 'Markdown (Exclude images)', value: 'markdown:no_images' },
- { text: 'Markdown (Exclude links)', value: 'markdown:no_links' },
- { text: 'Raw', value: 'raw' },
- { text: 'Text', value: 'text' },
- { text: 'Clean HTML', value: 'clean_html' },
- { text: 'JSON', value: 'json' },
- ],
- },
- antiScrapingProtection: {
- type: 'checkbox',
- label: 'Bypass Anti-Bot Protection',
- help: 'Enable if the website is protected by bot detection methods like Captchas.',
- value: false,
- },
- javascriptRendering: {
- type: 'checkbox',
- label: 'Javascript Rendering',
- help: 'This will render the page using a headless browser and extract the text and images. Useful for websites that use javascript to load content.',
- value: false,
- },
- autoScroll: {
- type: 'checkbox',
- label: 'Auto Scroll',
- help: 'To automatically scroll the page till the bottom and extract the text and images. Useful for websites that load content on scroll.',
- value: false,
- },
- };
-
- const dataEntries = ['format', 'antiScrapingProtection', 'javascriptRendering', 'autoScroll'];
- for (let item of dataEntries) {
- if (typeof this.data[item] === 'undefined') this.data[item] = this.settings[item].value;
- }
- this.properties.defaultOutputs = ['Results', 'FailedURLs'];
- if (this.properties.inputs.length == 0)
- this.properties.inputs = ['URLs'];
-
- this.drawSettings.displayName = 'Web Scrape';
- this.drawSettings.iconCSSClass = 'svg-icon ' + this.constructor.name;
-
- this.drawSettings.componentDescription = 'Extract text and images from URLs';
- this.drawSettings.shortDescription = 'Extract text and images from URLs';
- this.drawSettings.color = '#65a698';
-
- this._ready = true;
- }
-}
diff --git a/packages/app/src/builder-ui/components/WebSearch.class.ts b/packages/app/src/builder-ui/components/WebSearch.class.ts
deleted file mode 100644
index 6d654a09..00000000
--- a/packages/app/src/builder-ui/components/WebSearch.class.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { Component } from './Component.class';
-
-export class WebSearch extends Component {
- protected async init() {
- this.settings = {
- sourcesLimit: {
- type: 'number',
- label: 'Sources Limit',
- help: 'The maximum number of search results to return. Ceiling is 20.',
- value: 4,
- validate: 'min=1 max=20',
- },
- searchTopic: {
- type: 'select',
- label: 'Search Topic',
- value: 'general',
- options: ['general', 'news'],
- help: `This will optimize the search for the selected topic. Currently, only supports &#34;general&#34; and &#34;news&#34; (default: &#34;general&#34;).`,
- },
- includeQAs: {
- type: 'checkbox',
- label: 'Include Questions and Answers',
- help: 'If selected, includes a rich summary based on the information found in the results. Response time will be longer if selected.',
- value: false,
- },
- includeImages: {
- type: 'checkbox',
- label: 'Include Image Results',
- help: 'If selected, includes public images relevant to the query.',
- value: false,
- },
- timeRange: {
- type: 'select',
- label: 'Time Range',
- value: 'None',
- options: ['None', 'day', 'week', 'month', 'year'],
- help: '[Optional] Select the time range to filter the search results.',
- },
- includeRawContent: {
- type: 'checkbox',
- label: 'Include Raw Content',
- help: 'If selected, returns the parsed html content for each source.',
- value: true,
- },
- excludeDomains: {
- type: 'textarea',
- label: 'Exclude Domains',
- help: 'A list of domains to exclude from search results. Separate multiple domains with a comma.',
- value: '',
- },
- };
-
- const dataEntries = ['sourcesLimit', 'searchTopic', 'includeQAs', 'includeImages', 'timeRange', 'includeRawContent', 'excludeDomains'];
- for (let item of dataEntries) {
- if (typeof this.data[item] === 'undefined') this.data[item] = this.settings[item].value;
- }
- this.properties.defaultOutputs = ['Results', 'Images', 'Answer'];
- this.properties.defaultInputs = ['SearchQuery'];
-
- this.drawSettings.displayName = 'Web Search';
- this.drawSettings.iconCSSClass = 'svg-icon ' + this.constructor.name;
-
- this.drawSettings.componentDescription = 'Fetch web results from a query';
- this.drawSettings.shortDescription = 'Fetch web results from a query';
- this.drawSettings.color = '#65a698';
- this._ready = true;
- }
-
-}
diff --git a/packages/app/src/builder-ui/components/index.ts b/packages/app/src/builder-ui/components/index.ts
index f721d30d..e6949046 100644
--- a/packages/app/src/builder-ui/components/index.ts
+++ b/packages/app/src/builder-ui/components/index.ts
@@ -1,3 +1,4 @@
+import { plugins, PluginTarget, PluginType } from '@src/react/shared/plugins/Plugins';
import { AgentCard } from './AgentCard.class';
import { AgentPlugin } from './AgentPlugin.class';
import { APICall } from './APICall.class';
@@ -9,7 +10,6 @@ import { Base64Encoder } from './Base64Encoder.class';
import { Classifier } from './Classifier.class';
import { Code } from './Code.class';
import { Component } from './Component.class';
-import { ComputerUse } from './ComputerUse.class';
import { DataSourceCleaner } from './DataSourceCleaner.class';
import { DataSourceIndexer } from './DataSourceIndexer.class';
import { DataSourceLookup } from './DataSourceLookup.class';
@@ -64,10 +64,9 @@ import { SMSSender } from './SMSSender';
import { TTS } from './TTS.class';
import { Twitter } from './Twitter.class';
import { VisionLLM } from './VisionLLM.class';
-import { WebScrape } from './WebScrape.class';
-import { WebSearch } from './WebSearch.class';
import { ZapierAction } from './ZapierAction.class';
-const components = {
+
+const baseComponents = {
Component,
Classifier,
PromptGenerator,
@@ -127,8 +126,6 @@ const components = {
MultimodalLLM,
GenAILLM,
FileStore,
- WebScrape,
- WebSearch,
ImageGenerator,
TextToImage,
ImageToImage,
@@ -140,8 +137,25 @@ const components = {
Outpainting,
Inpainting,
AgentCard,
- ComputerUse,
MCPClient,
};
-export default components;
+export const getBuilderComponents = () => {
+ const pluginComponents = (
+ plugins.getPluginsByTarget(PluginTarget.BuilderSREComponents, PluginType.Config) as {
+ [key: string]: any;
+ }[]
+ ).reduce((acc, item) => {
+ return {
+ ...acc,
+ ...item.config,
+ };
+ }, {});
+
+ return {
+ ...baseComponents,
+ ...pluginComponents,
+ };
+};
+
+export default baseComponents;
diff --git a/packages/app/src/builder-ui/workspace/Workspace.class.ts b/packages/app/src/builder-ui/workspace/Workspace.class.ts
index d0baed82..5dbc25c0 100644
--- a/packages/app/src/builder-ui/workspace/Workspace.class.ts
+++ b/packages/app/src/builder-ui/workspace/Workspace.class.ts
@@ -7,7 +7,7 @@ import { builderStore } from '../../shared/state_stores/builder/store';
import { Agent } from '../Agent.class';
import { AgentCard } from '../components/AgentCard.class';
import { Component } from '../components/Component.class';
-import components from '../components/index';
+import { getBuilderComponents } from '../components/index';
import { registerDbgMonitorUI } from '../debugger';
import EventEmitter from '../EventEmitter.class';
import { extendJsPlumb } from '../overrides/jsplumb.override';
@@ -376,7 +376,7 @@ export class Workspace extends EventEmitter {
if (!_sourceComponent || !_targetComponent) return;
_connection.removeAllOverlays();
-
+
const sourceBR = _source.getBoundingClientRect();
const targetBR = _target.getBoundingClientRect();
const sourceComponentBR = _sourceComponent.getBoundingClientRect();
@@ -862,6 +862,7 @@ export class Workspace extends EventEmitter {
if (properties.sender) {
properties.sender.classList.remove('active');
}
+ const components = getBuilderComponents();
const Component = components[name] || components['Component'];
const component = new Component(this, { ...properties }, triggerSettings);
@@ -1213,6 +1214,7 @@ export class Workspace extends EventEmitter {
};
}
+ const components = getBuilderComponents();
const Component = components[name] || components['Component'];
const component = new Component(this, { ...properties }, triggerSettings);
@@ -1233,7 +1235,7 @@ export class Workspace extends EventEmitter {
targetComponentId: string | HTMLElement,
sourceEndpointID: string | number,
targetEndpointID: string | number,
- repaint = true
+ repaint = true,
) {
const sourceComponent =
typeof sourceComponentId === 'string'
@@ -1294,12 +1296,12 @@ export class Workspace extends EventEmitter {
//Repaint the source and target components after a delay to ensure the connection is properly rendered
if (repaint) {
- setTimeout(() => {
- this.jsPlumbInstance.repaint(sourceComponent);
+ setTimeout(() => {
+ this.jsPlumbInstance.repaint(sourceComponent);
this.jsPlumbInstance.repaint(targetComponent);
}, 300);
}
-
+
return con;
}
@@ -1607,19 +1609,15 @@ export class Workspace extends EventEmitter {
showOverlay('Connecting Components ...');
-
// Load the connections after a delay to ensure endpoints are registered properly
await delay(300);
const connections = {};
-
-
const sTime = Date.now();
//(jsPlumb as any).batch(() =>{
this._suspendConnectionRestyle = true;
configuration.connections.forEach(async (connection) => {
-
const conId = `${connection.sourceId}.${connection.sourceIndex}:${connection.targetId}.${connection.targetIndex}`;
if (connections[conId]) return; //skip existing connections ==> avoid duplicate connections
@@ -1628,27 +1626,21 @@ export class Workspace extends EventEmitter {
connection.targetId,
connection.sourceIndex,
connection.targetIndex,
- false
+ false,
);
connections[conId] = con;
-
-
- });
-
- //});
- this._suspendConnectionRestyle = false;
+ });
+ //});
+ this._suspendConnectionRestyle = false;
-
for (const con of Object.values(connections)) {
setImmediate(() => {
this.updateConnectionStyle(con);
});
}
-
-
- console.log('time taken', Date.now() - sTime);
+ console.log('time taken', Date.now() - sTime);
this.renderAgentCard(configuration);
@@ -1656,7 +1648,7 @@ export class Workspace extends EventEmitter {
showOverlay('Almost Ready ...');
await delay(200);
-
+
this.redraw();
//await delay(500);
diff --git a/packages/app/src/react/shared/plugins/Plugins.ts b/packages/app/src/react/shared/plugins/Plugins.ts
index 8aa0c5bf..ef1dc22a 100644
--- a/packages/app/src/react/shared/plugins/Plugins.ts
+++ b/packages/app/src/react/shared/plugins/Plugins.ts
@@ -7,6 +7,8 @@ export enum PluginTarget {
AgentSettingsTasksTabWidget = 'agentSettings/tasksTabWidget',
AgentSettingsWidgets = 'agentSettings/widgets',
AgentSettingsSkillsWidgetSkillButton = 'agentSettings/skillsWidget/skillButton',
+ BuilderSidebarComponentItems = 'builder/sidebarComponentItems',
+ BuilderSREComponents = 'builder/sreComponents',
}
export enum PluginType {