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 agent template editor

Ahmed Essam4daa8c75ffff
diff --git a/packages/app/src/backend/routes/api/page/builder.ts b/packages/app/src/backend/routes/api/page/builder.ts
index 6ef0d6e7..c52fb23e 100644
--- a/packages/app/src/backend/routes/api/page/builder.ts
+++ b/packages/app/src/backend/routes/api/page/builder.ts
@@ -1,6 +1,5 @@
import crypto, { randomUUID } from 'crypto';
import express from 'express';
-import path from 'path';
import config from '../../../config';
import { includeTeamDetails } from '../../../middlewares/auth.mw';
import { getAgentSetting, updateOrInsertAgentSetting } from '../../../services/agent-data.service';
@@ -46,7 +45,7 @@ import { isCustomLLMAllowed } from '../../../utils/customLLM';
import { customLLMHelper } from '../../router.helpers/customLLM.helper';
import { serverlessCodeHelper } from '../../router.helpers/serverlessCode.helper';
import { getKeyIdFromTemplateVar } from '../../router.helpers/vault.helper';
-import { countVaultKeys, getVaultKeys, readAgentTemplates, setVaultKey } from '../../router.utils';
+import { countVaultKeys, getVaultKeys, setVaultKey } from '../../router.utils';
const smythFS = new SmythFS();
@@ -326,15 +325,6 @@ router.get('/me', includeTeamDetails, async (req, res) => {
return res.send({ success: true, data: { email, countTeamVaultKeys: countKeys } });
});
-router.get('/agent-templates', async (req, res) => {
- try {
- const templates = await readAgentTemplates(req);
- return res.send({ success: true, data: templates });
- } catch (error) {
- return res.send({ success: true, data: {} });
- }
-});
-
router.get('/agent-auth/:agentId', async (req, res) => {
const agentId = req.params.agentId;
const token = req.user.accessToken;
@@ -369,74 +359,6 @@ router.put('/agent-auth/:agentId', async (req, res) => {
}
});
-// Keep only the 10 most recent agent template files
-async function keepRecentFiles(filePath: string) {
- const maxFiles = 10;
- const directory = path.dirname(filePath);
- const filename = path.basename(filePath);
-
- const files = await smythFS.readDirectory(directory);
-
- // Match files with the same name but different timestamp
- const matchedFiles = files.filter((file) => {
- const parts = file.split('-');
- parts.pop(); // Remove the timestamp
- const nameWithoutTimestamp = parts.join('-');
- return filename.startsWith(nameWithoutTimestamp);
- });
-
- // Extract timestamp from filename and sort files by timestamp in descending order
- const sortedFiles = matchedFiles.sort((a, b) => {
- const timestampA = Number(path.parse(a).name.split('-').pop());
- const timestampB = Number(path.parse(b).name.split('-').pop());
- return timestampB - timestampA;
- });
-
- // Remove all but the 10 most recent files
- for (let i = maxFiles; i < sortedFiles.length; i++) {
- try {
- await smythFS.deleteFile(path.join(directory, sortedFiles[i]));
- } catch (error) {
- continue;
- }
- }
-}
-
-router.put('/agent-templates', async (req, res) => {
- if (!isSmythStaff(req?._user)) {
- return res
- .status(403)
- .send({ success: false, error: 'You are not authorized to save agent templates' });
- }
-
- const { templateInfo } = req.body;
- const templatesPath = path.join(config.env.DATA_PATH, 'templates/agents');
- const templateArchivePath = path.join(config.env.DATA_PATH, `templates/archive/agents`);
- const filePath = path.join(templatesPath, `${templateInfo.id}.smyth`);
-
- try {
- const hasFile = await smythFS.hasFile(filePath);
-
- if (hasFile) {
- // TODO: remove the ensure directory logic after deploying it to production
- // Make archive directory if not exists
- await smythFS.ensureDirectory(templateArchivePath);
-
- const newFilePath = path.join(templateArchivePath, `${templateInfo.id}-${Date.now()}.smyth`);
- await smythFS.moveFile(filePath, newFilePath);
-
- // Keep only the 10 most recent files [don't need 'await' for this]
- keepRecentFiles(newFilePath);
- }
-
- await smythFS.writeJsonFile(filePath, req.body);
-
- return res.send({ success: true, data: { id: templateInfo.id } });
- } catch {
- return res.status(500).send({ success: false, error: 'Error saving agent template' });
- }
-});
-
const componentsMWHandler = forwardToSmythM2MAPIMiddleware();
router.get('/app-config/components', componentsMWHandler);
diff --git a/packages/app/src/builder-ui/pages/builder/agent-settings.ts b/packages/app/src/builder-ui/pages/builder/agent-settings.ts
index 6da6967d..22d758c5 100644
--- a/packages/app/src/builder-ui/pages/builder/agent-settings.ts
+++ b/packages/app/src/builder-ui/pages/builder/agent-settings.ts
@@ -605,7 +605,7 @@ async function loadAgentDomainsList() {
}
async function loadAgentTemplatesList() {
- const result = await fetch('/api/page/builder/agent-templates', {
+ const result = await fetch('/api/enterprise/page/builder/agent-templates', {
method: 'GET',
headers: { 'Content-Type': 'application/json' },
})
diff --git a/packages/app/src/builder-ui/pages/builder/agent-template.ts b/packages/app/src/builder-ui/pages/builder/agent-template.ts
deleted file mode 100644
index 3c782d06..00000000
--- a/packages/app/src/builder-ui/pages/builder/agent-template.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-import { errorToast, successToast } from '@src/shared/components/toast';
-import { createSpinner, generateAgentTemplateId } from '../../utils';
-import { Workspace } from '../../workspace/Workspace.class';
-
-export async function setupAgentTemplateScripts(workspace: Workspace) {
- const templateEnabled = isTemplateEnabled(workspace?.userData);
-
- const toggleBtnElm = document.getElementById('left-sidebar-template-btn');
- const settingsSectionElm = document.getElementById('agent-template');
-
- if (!templateEnabled) {
- toggleBtnElm?.remove();
- settingsSectionElm?.remove();
- return;
- }
- toggleBtnElm?.classList?.remove('hidden');
-
- setTemplateInfo(workspace);
-
- initEvents(workspace);
-}
-
-function initEvents(workspace: Workspace) {
- // Save Template
- const saveBtn = document.getElementById('agent-template-save-btn');
-
- saveBtn?.addEventListener('click', async (event) => {
- const target = event.target as HTMLButtonElement;
- const spinner = createSpinner('white', 'mr-2 mt-[-3px]');
- target.disabled = true;
- target.textContent = 'Saving...';
- target.prepend(spinner);
-
- try {
- await workspace.saveTemplate();
- setTemplateInfo(workspace);
-
- successToast('Template saved');
- } catch {
- errorToast('Error saving template');
- } finally {
- target.disabled = false;
- spinner.remove();
- target.textContent = 'Save Template';
- }
- });
-
- // Export Template only [No need to set template info, as we're not saving the template info to the agent]
- const exportBtn = document.getElementById('agent-template-export-btn');
-
- exportBtn?.addEventListener('click', async (event) => {
- event.preventDefault();
-
- try {
- await workspace.exportTemplate();
- } catch {
- errorToast('Error exporting template');
- }
- });
-
- window['Coloris']({
- el: '.coloris input',
- theme: 'pill',
- //formatToggle: true,
- closeButton: true,
- //clearButton: true,
- swatches: [
- '#264653',
- '#2a9d8f',
- '#e9c46a',
- '#f4a261',
- '#e76f51',
- '#d62828',
- '#023e8a',
- '#0077b6',
- '#0096c7',
- '#00b4d8',
- '#48cae4',
- ],
- });
-}
-
-function setTemplateInfo(workspace) {
- const templateInfo = workspace.agent.data?.templateInfo || {};
-
- if (Object.keys(templateInfo).length) {
- const templateIdElm = document.getElementById('agent-template-id-input') as HTMLInputElement;
- const templateNameElm = document.getElementById(
- 'agent-template-name-input',
- ) as HTMLInputElement;
- const templateDescElm = document.getElementById(
- 'agent-template-description-input',
- ) as HTMLInputElement;
- const templateIconElm = document.getElementById(
- 'agent-template-icon-input',
- ) as HTMLInputElement;
- const templateCategoryElm = document.getElementById(
- 'agent-template-category-input',
- ) as HTMLInputElement;
- const publishElm = document.getElementById('agent-template-publish-input') as HTMLInputElement;
- const colorElm = document.getElementById('agent-template-color-input') as HTMLInputElement;
- const imageUrlElm = document.getElementById(
- 'agent-template-image-url-input',
- ) as HTMLInputElement;
- const docLinkElm = document.getElementById('agent-template-doc-link-input') as HTMLInputElement;
- const videoLinkElm = document.getElementById(
- 'agent-template-video-link-input',
- ) as HTMLInputElement;
- const valuePropositionElm = document.getElementById(
- 'agent-template-value-proposition-input',
- ) as HTMLInputElement;
-
- const name = templateInfo.name;
-
- templateIdElm.value = templateInfo?.id || generateAgentTemplateId(name);
- templateNameElm.value = templateInfo?.name || '';
- templateDescElm.value = templateInfo?.description || '';
- templateIconElm.value = templateInfo?.icon || '';
- templateCategoryElm.value = templateInfo.category || '';
- publishElm.checked = templateInfo?.publish || false;
- colorElm.value = templateInfo?.color || '#000000';
-
- imageUrlElm.value = templateInfo?.imageUrl || '';
- docLinkElm.value = templateInfo?.docLink || '';
- videoLinkElm.value = templateInfo?.videoLink || '';
- valuePropositionElm.value = templateInfo?.valueProposition || '';
- }
-}
-
-type UserData = {
- acl: Record<string, string>;
- isSmythStaff: boolean;
- email: string;
-};
-
-function isTemplateEnabled(userData: UserData) {
- return userData?.acl?.['/templates'] == 'rw' && userData?.isSmythStaff;
-}
diff --git a/packages/app/src/builder-ui/pages/builder/index.ts b/packages/app/src/builder-ui/pages/builder/index.ts
index 272235d1..a0b04403 100644
--- a/packages/app/src/builder-ui/pages/builder/index.ts
+++ b/packages/app/src/builder-ui/pages/builder/index.ts
@@ -15,7 +15,6 @@ import { delay } from '../../utils';
import { registerCanvasContextMenu } from '../../workspace/CanvasContextMenu';
import { setupAgentAuthScripts } from './agent-auth';
import { setupAgentScripts } from './agent-settings';
-import { setupAgentTemplateScripts } from './agent-template';
import { setupComponentsScripts } from './components-menu';
import { handleBuilderReactInjects, setupModals } from './modals';
import { preloadDataScripts } from './preload-data';
@@ -221,19 +220,16 @@ export default async function scripts() {
setupAgentScripts(workspace).then(() => {
renderAgentDeploymentSidebar({ rootID: 'agent-sidebar-root' });
setupAgentAuthScripts(workspace);
- setupAgentTemplateScripts(workspace);
const matchedPlugins = plugins.getPluginsByTarget(
PluginTarget.BuilderLoadScript,
PluginType.Function,
);
- console.log('matchedPlugins: d', matchedPlugins);
matchedPlugins.forEach((plugin) => {
(plugin as any).function(workspace);
});
- //load Chat Agent Builder
setupModals(workspace);
});
diff --git a/packages/app/src/builder-ui/workspace/Workspace.helper.ts b/packages/app/src/builder-ui/workspace/Workspace.helper.ts
index 20426eb0..c9606f54 100644
--- a/packages/app/src/builder-ui/workspace/Workspace.helper.ts
+++ b/packages/app/src/builder-ui/workspace/Workspace.helper.ts
@@ -66,7 +66,7 @@ export async function saveTemplate() {
}
const templateId = data?.templateInfo?.id;
- await fetch('/api/page/builder/agent-templates', {
+ await fetch('/api/enterprise/page/builder/agent-templates', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
diff --git a/packages/app/views/pages/partials/studio/left-sidebar-item.ejs.old b/packages/app/views/pages/partials/studio/left-sidebar-item.ejs.old
deleted file mode 100644
index 37b866d0..00000000
--- a/packages/app/views/pages/partials/studio/left-sidebar-item.ejs.old
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="flex">
- <a href="#" data-label="<%= label %>"
- class="cpt-item flex w-[100%] space-x-2 text-gray-700 transition-colors rounded-lg group hover:bg-gray-100 hover:text-gray-800"
- smt-component="<%= name %>" <% for (const attr in attributes) { %><%= attr %>="<%= attributes[attr] %>" <% } %>>
- <span aria-hidden="true"
- class="p-2 flex items-center transition-colors rounded-lg group-hover:bg-gray-200 group-hover:text-white">
- <span class="icon "><span class="svg-icon <%= icon %> w-6 h-6"></span></span>
- </span>
- <span class="name align-middle p-2"><%= label %></span>
- </a>
- <!-- <button aria-hidden="true" class="p-2 transition-colors rounded-lg">
- <span class="icon"><span class="svg-icon <%= icon %> w-6 h-6"></span></span>
- </button> -->
-
-</div>
\ No newline at end of file
diff --git a/packages/app/views/pages/partials/studio/left-sidebar-template.ejs b/packages/app/views/pages/partials/studio/left-sidebar-template.ejs
deleted file mode 100644
index 696e2dad..00000000
--- a/packages/app/views/pages/partials/studio/left-sidebar-template.ejs
+++ /dev/null
@@ -1,268 +0,0 @@
-<div id="agent-template" x-data="{ currentAuthTab: 'none' }">
- <div class="h-16 flex flex-shrink-0 p-4">
- <div class="flex items-center justify-between w-full">
- <div class="flex items-center gap-2">
- <svg
- width="24"
- fill="none"
- height="24"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: #374151;
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 2.973958 13.161458 C 2.973958 11.690104 4.135417 9.859375 7.479167 9.859375 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- ></path>
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: #374151;
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 10.359375 4.877604 C 10.359375 6.466146 9.070312 7.755208 7.481771 7.755208 C 5.893229 7.755208 4.604167 6.466146 4.604167 4.877604 C 4.604167 3.289062 5.893229 2 7.481771 2 C 9.070312 2 10.359375 3.289062 10.359375 4.877604 Z M 10.359375 4.877604 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- ></path>
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: #374151;
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 11.210938 13.132812 L 11.28125 12.942708 C 11.546875 12.223958 12.114583 11.65625 12.830729 11.390625 L 13.023438 11.320312 L 12.830729 11.25 C 12.114583 10.984375 11.546875 10.416667 11.28125 9.697917 L 11.210938 9.507812 L 11.140625 9.697917 C 10.875 10.416667 10.309896 10.984375 9.591146 11.25 L 9.401042 11.320312 L 9.591146 11.390625 C 10.309896 11.65625 10.875 12.223958 11.140625 12.942708 Z M 11.210938 13.132812 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- ></path>
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: #374151;
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 7.507812 14 C 7.627604 13.606771 7.934896 13.299479 8.328125 13.179688 C 7.934896 13.059896 7.627604 12.75 7.507812 12.356771 C 7.388021 12.75 7.080729 13.059896 6.6875 13.179688 C 7.080729 13.299479 7.388021 13.606771 7.507812 14 Z M 7.507812 14 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- ></path>
- </svg>
- <span class="text-2xl font-semibold text-v2-gray-darker">Template</span>
- </div>
- <button
- type="button"
- class="close-btn p-0.5 rounded-full text-[#757575]"
- data-tooltip-target="tooltip-close-template"
- data-tooltip-placement="left"
- @click="toggleSidebar"
- >
- <%- include('icons/close-icon'); -%>
- </button>
- <div
- id="tooltip-close-template"
- role="tooltip"
- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-family: 'Inter', sans-serif"
- >
- Close
- </div>
- </div>
- </div>
-
- <div id="agent-agent-template-feature-wrapper" class="p-4">
- <input
- type="hidden"
- id="agent-template-id-input"
- class="mb-4 h-9 w-full bg-white border text-gray-900 rounded block outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal px-[10px] border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- placeholder="Template ID"
- value=""
- />
-
- <label
- for="agent-template-name-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Name</label
- >
- <input
- type="text"
- id="agent-template-name-input"
- class="mb-2 h-9 w-full bg-white border text-gray-900 rounded block outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal px-[10px] border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus:visible:border-b-blue-500"
- placeholder="Template Name"
- required
- value=""
- />
-
- <label
- for="agent-template-description-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Description</label
- >
- <textarea
- id="agent-template-description-input"
- rows="4"
- class="mb-2 block w-full bg-white border text-gray-900 rounded outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal py-2 px-3 border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- placeholder="Template description goes here ..."
- ></textarea>
-
- <label
- for="agent-template-icon-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Font Awesome Class or SVG</label
- >
- <textarea
- id="agent-template-icon-input"
- rows="4"
- class="mb-2 block w-full bg-white border text-gray-900 rounded outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal py-2 px-3 border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- ></textarea>
-
- <label
- for="agent-template-color-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Color</label
- >
- <div class="mb-2 coloris">
- <input
- type="text"
- id="agent-template-color-input"
- class="w-full border-0 py-2"
- value="#000000"
- />
- </div>
-
- <label
- for="agent-template-category-input"
- class="flex mb-2 text-sm font-medium text-gray-900 dark:text-white justify-between"
- >
- Category
- </label>
- <select
- id="agent-template-category-input"
- class="mb-2 h-9 w-full bg-white border text-gray-900 rounded block outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal px-[10px] border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- >
- <option value="">Select Category</option>
- <option value="marketing">Marketing</option>
- <option value="sales">Sales</option>
- <option value="dev">Dev</option>
- <option value="research">Research</option>
- <option value="platform">Platform</option>
- <option value="analysis">Analysis</option>
- <option value="chat">Chat</option>
- <option value="legal">Legal</option>
- <option value="hr">HR</option>
- <option value="education">Education</option>
- <option value="finance">Finance</option>
- <option value="ops">Ops</option>
- <option value="success">Success</option>
- </select>
-
- <label
- for="agent-template-image-url-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Image URL</label
- >
- <input
- type="text"
- id="agent-template-image-url-input"
- class="mb-2 h-9 w-full bg-white border text-gray-900 rounded block outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal px-[10px] border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- />
-
- <label
- for="agent-template-doc-link-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Documentation Link</label
- >
- <input
- type="text"
- id="agent-template-doc-link-input"
- class="mb-2 h-9 w-full bg-white border text-gray-900 rounded block outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal px-[10px] border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- />
-
- <label
- for="agent-template-video-link-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Video Tutorial Link</label
- >
- <input
- type="text"
- id="agent-template-video-link-input"
- class="mb-2 h-9 w-full bg-white border text-gray-900 rounded block outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal px-[10px] border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- />
-
- <label
- for="agent-template-value-proposition-input"
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
- >Value Proposition</label
- >
- <input
- type="text"
- id="agent-template-value-proposition-input"
- class="mb-2 h-9 w-full bg-white border text-gray-900 rounded block outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none text-sm font-normal placeholder:text-sm placeholder:font-normal px-[10px] border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"
- />
-
- <label
- class="flex mt-4 mb-2 text-sm font-medium text-gray-900 dark:text-white items-center cursor-pointer"
- >
- <input type="checkbox" id="agent-template-publish-input" class="mr-2 focus:outline-none" />
- Publish
- </label>
-
- <button
- id="agent-template-save-btn"
- class="flex items-center justify-center text-sm font-normal border border-solid text-base px-4 py-2 text-center rounded transition-all duration-200 outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-shadow-none w-full justify-center bg-smythos-blue-500 text-white border-transparent hover:bg-smyth-blue mt-4"
- >
- Save Template
- </button>
-
- <a
- href="#"
- id="agent-template-export-btn"
- class="block w-full mt-3 text-center text-gray-900 underline hover:no-underline"
- >
- Export Template
- </a>
- </div>
-</div>
-
-<div
- class="px-4agent-menu-loading-overlay absolute top-0 left-0 w-full h-full flex items-center justify-center border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-800 dark:border-gray-700 hidden"
->
- <div
- class="flex gap-2 items-center px-3 py-2 text-xs font-medium leading-none text-center text-gray-800 bg-gray-200 rounded-lg animate-pulse dark:bg-gray-900 dark:text-gray-400"
- >
- <span>Loading</span>
- <div role="status">
- <svg
- aria-hidden="true"
- class="inline w-4 h-4 text-white animate-spin fill-gray-950"
- viewBox="0 0 100 101"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
- fill="currentColor"
- />
- <path
- d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
- fill="currentFill"
- />
- </svg>
- <span class="sr-only">Loading...</span>
- </div>
- </div>
-</div>
diff --git a/packages/app/views/pages/partials/studio/left-sidebar.ejs b/packages/app/views/pages/partials/studio/left-sidebar.ejs
index 47562f2d..5e1d8ef7 100644
--- a/packages/app/views/pages/partials/studio/left-sidebar.ejs
+++ b/packages/app/views/pages/partials/studio/left-sidebar.ejs
@@ -194,93 +194,6 @@
</div>
</div>
- <div class="relative group internal-templates-btn">
- <button
- id="left-sidebar-template-btn"
- class="relative w-full flex items-center h-10 justify-center hidden"
- @click="setSidebarTab('templateTab')"
- data-tooltip-target="tooltip-internal-templates"
- data-tooltip-placement="right"
- >
- <div
- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"
- :class="{'!bg-gray-700': currentSidebarTab === 'templateTab' && isSidebarOpen}"
- >
- <svg
- width="20"
- fill="none"
- height="20"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- :class="{'[&>path]:!stroke-white': currentSidebarTab === 'templateTab' && isSidebarOpen}"
- >
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: rgb(3.529412%, 3.529412%, 4.313726%);
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 2.973958 13.161458 C 2.973958 11.690104 4.135417 9.859375 7.479167 9.859375 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- />
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: rgb(3.529412%, 3.529412%, 4.313726%);
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 10.359375 4.877604 C 10.359375 6.466146 9.070312 7.755208 7.481771 7.755208 C 5.893229 7.755208 4.604167 6.466146 4.604167 4.877604 C 4.604167 3.289062 5.893229 2 7.481771 2 C 9.070312 2 10.359375 3.289062 10.359375 4.877604 Z M 10.359375 4.877604 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- />
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: rgb(3.529412%, 3.529412%, 4.313726%);
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 11.210938 13.132812 L 11.28125 12.942708 C 11.546875 12.223958 12.114583 11.65625 12.830729 11.390625 L 13.023438 11.320312 L 12.830729 11.25 C 12.114583 10.984375 11.546875 10.416667 11.28125 9.697917 L 11.210938 9.507812 L 11.140625 9.697917 C 10.875 10.416667 10.309896 10.984375 9.591146 11.25 L 9.401042 11.320312 L 9.591146 11.390625 C 10.309896 11.65625 10.875 12.223958 11.140625 12.942708 Z M 11.210938 13.132812 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- />
- <path
- style="
- fill: none;
- stroke-width: 1;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke: rgb(3.529412%, 3.529412%, 4.313726%);
- stroke-opacity: 1;
- stroke-miterlimit: 4;
- "
- d="M 7.507812 14 C 7.627604 13.606771 7.934896 13.299479 8.328125 13.179688 C 7.934896 13.059896 7.627604 12.75 7.507812 12.356771 C 7.388021 12.75 7.080729 13.059896 6.6875 13.179688 C 7.080729 13.299479 7.388021 13.606771 7.507812 14 Z M 7.507812 14 "
- transform="matrix(1.5,0,0,1.5,0,0)"
- />
- </svg>
- </div>
- </button>
- <div
- id="tooltip-internal-templates"
- role="tooltip"
- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- data-popper-reference-hidden=""
- data-popper-escaped=""
- data-popper-placement="bottom"
- >
- Template Editor (Internal)
- </div>
- </div>
-
<!-- separator -->
<div class="w-full h-[1px] bg-[#00000080] my-2"></div>
@@ -733,14 +646,6 @@
<%- include('left-sidebar-build', { menu: menu }); -%>
</section>
- <section
- x-show="(currentSidebarTab == 'templateTab')"
- class="templateTab pb-4 m-0 relative w-full overflow-y-auto md:overflow-hidden md:hover:overflow-y-auto h-[100%] [&>*]:w-[calc(100%+5px)]"
- style="scrollbar-gutter: stable"
- >
- <%- include('left-sidebar-template'); -%>
- </section>
-
<section
x-show="(currentSidebarTab == 'deployTab')"
class="deployTab pb-4 m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%] [&>*]:w-[calc(100%+5px)]"
diff --git a/packages/app/views/pages/partials/studio/left-sidebar.old.ejs b/packages/app/views/pages/partials/studio/left-sidebar.old.ejs
deleted file mode 100644
index 2b05103d..00000000
--- a/packages/app/views/pages/partials/studio/left-sidebar.old.ejs
+++ /dev/null
@@ -1,277 +0,0 @@
-<div class="flex flex-shrink-0 transition-all duration-300 border-r-[1px] border-r-gray-300/70 border-solid"
- x-data="sidebarState()"
- :class="{
- 'w-[304px]': isSidebarOpen && currentSidebarTab !== 'agentBuilderTab',
- 'w-[480px]': isSidebarOpen && currentSidebarTab === 'agentBuilderTab',
- 'w-12': !isSidebarOpen
- }" id="left-sidebar">
- <!-- Left mini bar -->
- <nav aria-label="Options"
- class="flex-col items-center flex-shrink-0 w-12 py-2 bg-white border-r-2 border-emerald-100 shadow-md flex">
- <!-- Logo -->
- <div class="flex flex-col items-center flex-1 p-1">
- <div>&nbsp;</div>
- <!-- Agent button -->
-
- <button
- @click="(isSidebarOpen && currentSidebarTab == 'agentTab') ? isSidebarOpen = false : isSidebarOpen = true; currentSidebarTab = 'agentTab'"
- class="mb-5 p-1 c-pointer sidebarMainIcon rounded-full transition-colors hover:bg-[#2AAD8E] hover:fill-white hover:outline-none 1"
- :class="(isSidebarOpen && currentSidebarTab == 'agentTab') ? 'bg-[#2AAD8E]' : 'bg-[#C2C4CD]'"
- data-tooltip-target="tooltip-agent" data-tooltip-placement="right" type="button">
- <svg width="25" height="25"
- :class="(isSidebarOpen && currentSidebarTab == 'agentTab') ? 'fill-white' : 'fill-[#505876]'"
- viewBox="0 0 16 17" xmlns="http://www.w3.org/2000/svg">
- <path
- d="M11.9784 2.02125C11.7298 2.04483 11.4857 2.10563 11.2556 2.20422C11.1476 2.24657 11.0445 2.29827 10.9459 2.35453C10.9365 2.35453 10.932 2.35935 10.9226 2.3639L7.52044 4.33036C7.51722 4.33036 7.51561 4.33187 7.51561 4.33491L5.23492 5.649L5.19257 5.65383L5.14569 5.70071C5.08461 5.73821 5.02836 5.78509 4.97663 5.82742L4.97181 4.39144C4.96243 3.12906 5.47869 1.92777 6.36092 1.05947C6.48763 0.937579 6.6189 0.820234 6.75983 0.712266C6.91469 0.590375 7.08373 0.47303 7.26189 0.369607L7.29484 0.350855H7.29967L7.44032 0.266184C7.67017 0.130087 7.92846 0.0644531 8.18645 0.0644531C8.44442 0.0644531 8.70724 0.130087 8.93738 0.266184L11.9781 2.02125H11.9784Z" />
- <path
- d="M15.484 9.54368V10.3509C15.484 11.5945 14.8129 12.7535 13.7383 13.3777L10.9836 14.9779C10.9836 14.9779 10.9885 14.9731 10.9885 14.9685C11.0447 14.8887 11.101 14.8088 11.1482 14.7245C11.1575 14.7151 11.1669 14.7057 11.1718 14.6915C11.2374 14.5884 11.2936 14.4849 11.3453 14.3773C11.3877 14.3068 11.4203 14.2363 11.4485 14.1613C11.5283 14.0016 11.5894 13.8374 11.6457 13.6686C11.688 13.5561 11.7207 13.434 11.7491 13.3166C11.7678 13.2604 11.782 13.2041 11.7911 13.1476C11.8099 13.0771 11.8241 13.0066 11.8335 12.9364C11.8664 12.7677 11.8852 12.5986 11.8991 12.425C11.9085 12.3264 11.913 12.2278 11.913 12.1292V12.0167L11.9037 9.61413C11.9082 9.58146 11.9082 9.55788 11.9082 9.53913V6.86889C11.9082 6.77512 11.8988 6.68591 11.8801 6.59668L14.7333 8.24379C15.1933 8.51598 15.4843 9.01349 15.4843 9.54368H15.484Z" />
- <path
- d="M11.4433 12.0167C11.4433 12.1434 11.4384 12.2701 11.4293 12.3969C11.4245 12.4861 11.4151 12.575 11.4012 12.6642C11.3918 12.7395 11.3824 12.8145 11.3682 12.8896C11.3634 12.8989 11.3634 12.9131 11.3589 12.9225C11.3495 12.9788 11.3353 13.035 11.3214 13.0916C11.2793 13.2791 11.2228 13.4623 11.1572 13.6405C11.129 13.7203 11.0961 13.8002 11.0634 13.8797C11.0304 13.9547 10.9977 14.0252 10.9602 14.1002C10.9179 14.1894 10.871 14.2787 10.8196 14.363C10.7398 14.504 10.6505 14.6398 10.5519 14.7713C10.5144 14.8276 10.4721 14.8793 10.4252 14.9356C10.3221 15.0717 10.2093 15.1984 10.0874 15.3157C9.94647 15.4566 9.79646 15.5927 9.63223 15.7146C9.47254 15.8414 9.29895 15.9541 9.12079 16.0573C9.12079 16.0621 9.11596 16.0621 9.11596 16.0621L8.95657 16.1559C8.49657 16.4236 7.92405 16.4236 7.4595 16.1559L4.40454 14.3914C4.47019 14.3866 4.54065 14.3772 4.60628 14.3633C4.64378 14.3585 4.67674 14.3539 4.70971 14.3446C4.79409 14.3304 4.87392 14.3071 4.95377 14.2835C5.02423 14.2599 5.09924 14.2366 5.16487 14.2082C5.27285 14.1661 5.37598 14.1144 5.47458 14.0582L8.9003 12.0778C8.9003 12.0778 8.90515 12.0778 8.90515 12.0732L11.1623 10.7685L11.2466 10.7216C11.3171 10.6793 11.3779 10.6324 11.439 10.5762L11.4438 12.017L11.4433 12.0167Z" />
- <path
- d="M7.7643 12.1908L5.23954 13.6501C5.15969 13.6969 5.07076 13.7393 4.9861 13.772C4.92047 13.8001 4.85937 13.8237 4.79374 13.8376C4.72811 13.8563 4.66702 13.8751 4.60138 13.8893H4.592C4.50762 13.908 4.42296 13.9174 4.3434 13.9268C4.29652 13.9316 4.2448 13.9316 4.19792 13.9316H4.13684C4.08058 13.9316 4.01949 13.9268 3.96323 13.9223C3.90215 13.9174 3.84589 13.908 3.78964 13.8987C3.78479 13.8987 3.78026 13.8987 3.77571 13.8938C3.71944 13.889 3.66774 13.8751 3.61603 13.8609C3.46572 13.8185 3.32026 13.7623 3.18443 13.6873C3.1796 13.6825 3.17023 13.6779 3.16568 13.6779C3.15147 13.6685 3.13755 13.6592 3.1188 13.6498L1.17139 12.5235L4.74259 10.4727L5.19294 10.7355L7.51598 12.0729C7.59581 12.1197 7.67537 12.1621 7.76459 12.1902L7.7643 12.1908Z" />
- <path
- d="M4.50773 9.53944C4.50773 9.6332 4.51711 9.72241 4.53586 9.81164L1.68264 8.16455C1.22264 7.8969 0.936523 7.39967 0.936523 6.86466V6.05745C0.936523 4.81864 1.6028 3.65486 2.67738 3.03062L5.41325 1.44434C4.8126 2.29389 4.47478 3.32611 4.48416 4.40552L4.49353 6.80811H4.51228C4.50745 6.8317 4.50746 6.85045 4.50746 6.8692V9.53944H4.50773Z" />
- <path
- d="M15.2492 3.88464L11.678 5.93549L11.2464 5.68687L11.2276 5.67267L8.90487 4.33527C8.82501 4.2884 8.74063 4.25089 8.65625 4.21792L11.181 2.75864C11.2467 2.72114 11.3123 2.68818 11.3782 2.66488C11.3876 2.65551 11.4018 2.65068 11.4112 2.65068C11.4768 2.62255 11.5424 2.59896 11.6083 2.58021C12.1479 2.42054 12.7346 2.47225 13.2321 2.74444L13.2415 2.72569C13.2603 2.73506 13.2745 2.74444 13.3026 2.75864L15.25 3.88492L15.2492 3.88464Z" />
- </svg>
- </button>
- <div id="tooltip-agent" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 12px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Agent
- </div>
-
- <!-- Build button -->
- <button
- @click="(isSidebarOpen && currentSidebarTab == 'buildTab') ? isSidebarOpen = false : isSidebarOpen = true; currentSidebarTab = 'buildTab'"
- class="mb-5 p-1 c-pointer sidebarSettingIcon rounded-full transition-colors hover:bg-[#2AAD8E] hover:fill-white hover:outline-none 1"
- :class="(isSidebarOpen && currentSidebarTab == 'buildTab') ? 'bg-[#2AAD8E]' : 'bg-[#C2C4CD]'"
- data-tooltip-target="tooltip-build" data-tooltip-placement="right" type="button">
- <svg viewBox="0 0 17 18" width="25" height="25"
- :class="(isSidebarOpen && currentSidebarTab == 'buildTab') ? 'stroke-white ' : 'stroke-[#505876]'"
- fill="none" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" clip-rule="evenodd"
- d="M15.5901 5.44952L15.072 4.55048C14.6336 3.78975 13.6623 3.52731 12.9005 3.96381C12.5379 4.17742 12.1052 4.23803 11.6979 4.13226C11.2905 4.02649 10.942 3.76304 10.7291 3.4C10.5921 3.16925 10.5186 2.90642 10.5158 2.6381C10.5281 2.20791 10.3658 1.79103 10.0658 1.48244C9.76586 1.17385 9.35375 0.999823 8.92338 1H7.87957C7.45795 1 7.0537 1.16801 6.75628 1.46686C6.45886 1.76571 6.29279 2.17076 6.29481 2.59238C6.28232 3.46289 5.57303 4.16199 4.70243 4.16191C4.43411 4.15912 4.17128 4.08553 3.94053 3.94857C3.17876 3.51207 2.20741 3.77451 1.7691 4.53524L1.21291 5.44952C0.775129 6.2093 1.03399 7.18004 1.79196 7.62095C2.28465 7.9054 2.58816 8.43109 2.58816 9C2.58816 9.56891 2.28465 10.0946 1.79196 10.379C1.03495 10.817 0.775809 11.7854 1.21291 12.5429L1.73862 13.4495C1.94399 13.8201 2.28856 14.0935 2.69608 14.2094C3.10361 14.3252 3.54049 14.2738 3.91005 14.0667C4.27335 13.8547 4.70628 13.7966 5.11261 13.9053C5.51893 14.0141 5.86499 14.2806 6.07386 14.6457C6.21082 14.8765 6.28441 15.1393 6.28719 15.4076C6.28719 16.2871 7.00013 17 7.87957 17H8.92338C9.79986 17 10.5116 16.2917 10.5158 15.4152C10.5137 14.9923 10.6808 14.5861 10.9799 14.287C11.279 13.9879 11.6852 13.8208 12.1081 13.8229C12.3758 13.83 12.6376 13.9033 12.8701 14.0362C13.6298 14.474 14.6006 14.2151 15.0415 13.4571L15.5901 12.5429C15.8024 12.1784 15.8607 11.7443 15.752 11.3368C15.6433 10.9292 15.3766 10.5818 15.011 10.3714C14.6454 10.1611 14.3787 9.81367 14.27 9.4061C14.1613 8.99854 14.2196 8.56446 14.432 8.2C14.57 7.95892 14.7699 7.75903 15.011 7.62095C15.7644 7.18028 16.0227 6.21521 15.5901 5.45714V5.44952Z"
- stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
- <path
- d="M8.40522 11.1972C9.61709 11.1972 10.5995 10.2148 10.5995 9.00288C10.5995 7.79101 9.61709 6.80859 8.40522 6.80859C7.19335 6.80859 6.21094 7.79101 6.21094 9.00288C6.21094 10.2148 7.19335 11.1972 8.40522 11.1972Z"
- stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
- </svg>
- </button>
- <div id="tooltip-build" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 12px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Build
- </div>
-
- <!-- Deploy button -->
- <button
- @click="(isSidebarOpen && currentSidebarTab == 'deployTab') ? isSidebarOpen = false : isSidebarOpen = true; currentSidebarTab = 'deployTab'"
- class="mb-5 p-1 c-pointer sidebarMainIcon rounded-full transition-colors hover:bg-[#2AAD8E] hover:fill-white hover:outline-none 1"
- :class="(isSidebarOpen && currentSidebarTab == 'deployTab') ? 'bg-[#2AAD8E]' : 'bg-[#C2C4CD]'"
- data-tooltip-target="tooltip-deploy" data-tooltip-placement="right" type="button">
- <svg width="25" height="25" viewBox="0 0 15 16"
- :class="(isSidebarOpen && currentSidebarTab == 'deployTab') ? 'fill-white' : 'fill-[#505876]'"
- xmlns="http://www.w3.org/2000/svg">
- <path
- d="M6.09524 0.209524C6.33651 0.0698413 6.59048 0 6.85714 0C7.12381 0 7.37778 0.0698413 7.61905 0.209524L12.9524 3.27619C13.1937 3.41587 13.381 3.6 13.5143 3.82857C13.6476 4.05714 13.7143 4.31111 13.7143 4.59048V7.82857C13.4857 7.66349 13.2444 7.52064 12.9905 7.4C12.7365 7.27937 12.4698 7.1746 12.1905 7.08571V5.40952L9.44762 6.99048C8.73651 7.16825 8.09206 7.46984 7.51429 7.89524C6.93651 8.32063 6.46349 8.8381 6.09524 9.44762V8.05714L1.52381 5.40952V10.6286L5.37143 12.8571C5.42222 13.2635 5.51746 13.654 5.65714 14.0286C5.79683 14.4032 5.9746 14.7556 6.19048 15.0857C6.16508 15.073 6.14921 15.0635 6.14286 15.0571C6.13651 15.0508 6.12064 15.0413 6.09524 15.0286L0.761905 11.9619C0.520635 11.8222 0.333333 11.6381 0.2 11.4095C0.0666667 11.181 0 10.927 0 10.6476V4.59048C0 4.31111 0.0666667 4.05714 0.2 3.82857C0.333333 3.6 0.520635 3.41587 0.761905 3.27619L6.09524 0.209524ZM6.85714 1.52381L2.34286 4.13333L6.85714 6.74286L11.3714 4.13333L6.85714 1.52381ZM10.6667 14.4762L12.9524 12.1905L12.419 11.6571L11.0476 13.0286V9.90476H10.2857V13.0286L8.91429 11.6571L8.38095 12.1905L10.6667 14.4762ZM10.6667 16C9.6127 16 8.71429 15.6286 7.97143 14.8857C7.22857 14.1429 6.85714 13.2444 6.85714 12.1905C6.85714 11.1365 7.22857 10.2381 7.97143 9.49524C8.71429 8.75238 9.6127 8.38095 10.6667 8.38095C11.7206 8.38095 12.619 8.75238 13.3619 9.49524C14.1048 10.2381 14.4762 11.1365 14.4762 12.1905C14.4762 13.2444 14.1048 14.1429 13.3619 14.8857C12.619 15.6286 11.7206 16 10.6667 16Z" />
- </svg>
- </button>
- <div id="tooltip-deploy" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 12px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Deploy
- </div>
- <!-- Auth button -->
- <button
- @click="(isSidebarOpen && currentSidebarTab == 'authTab') ? isSidebarOpen = false : isSidebarOpen = true; currentSidebarTab = 'authTab'"
- class="mb-5 p-1 c-pointer sidebarMainIcon rounded-full transition-colors hover:bg-[#2AAD8E] hover:fill-white hover:outline-none 1"
- :class="(isSidebarOpen && currentSidebarTab == 'authTab') ? 'bg-[#2AAD8E]' : 'bg-[#C2C4CD]'"
- data-tooltip-target="tooltip-auth" data-tooltip-placement="right" type="button">
- <!-- <svg width="24" height="24" viewBox="0 0 24 24" fill="none"
- :class="(isSidebarOpen && currentSidebarTab == 'authTab') ? 'fill-white stroke-white' : 'fill-[#505876]'"
- xmlns="http://www.w3.org/2000/svg">
- <path
- d="M10.875 14.75H13.125L12.6938 12.3313C12.9438 12.2063 13.1406 12.025 13.2844 11.7875C13.4281 11.55 13.5 11.2875 13.5 11C13.5 10.5875 13.3531 10.2344 13.0594 9.94063C12.7656 9.64688 12.4125 9.5 12 9.5C11.5875 9.5 11.2344 9.64688 10.9406 9.94063C10.6469 10.2344 10.5 10.5875 10.5 11C10.5 11.2875 10.5719 11.55 10.7156 11.7875C10.8594 12.025 11.0563 12.2063 11.3063 12.3313L10.875 14.75ZM12 20C10.2625 19.5625 8.82813 18.5656 7.69688 17.0094C6.56563 15.4531 6 13.725 6 11.825V7.25L12 5L18 7.25V11.825C18 13.725 17.4344 15.4531 16.3031 17.0094C15.1719 18.5656 13.7375 19.5625 12 20ZM12 18.425C13.3 18.0125 14.375 17.1875 15.225 15.95C16.075 14.7125 16.5 13.3375 16.5 11.825V8.28125L12 6.59375L7.5 8.28125V11.825C7.5 13.3375 7.925 14.7125 8.775 15.95C9.625 17.1875 10.7 18.0125 12 18.425Z" />
- </svg> -->
- <svg width="24" height="24" viewBox="0 0 21 24"
- :class="(isSidebarOpen &amp;&amp; currentSidebarTab == 'authTab') ? 'fill-white' : 'fill-[#505876]'"
- xmlns="http://www.w3.org/2000/svg" class="fill-[#505876] ml-px">
- <path
- d="M8.21875 16.3542H11.7812L11.0984 12.5246C11.4943 12.3266 11.806 12.0397 12.0336 11.6636C12.2612 11.2876 12.375 10.872 12.375 10.4167C12.375 9.76362 12.1424 9.20451 11.6773 8.7394C11.2122 8.2743 10.6531 8.04175 10 8.04175C9.34687 8.04175 8.78776 8.2743 8.32266 8.7394C7.85755 9.20451 7.625 9.76362 7.625 10.4167C7.625 10.872 7.7388 11.2876 7.96641 11.6636C8.19401 12.0397 8.50573 12.3266 8.90156 12.5246L8.21875 16.3542ZM10 24.6667C7.24896 23.974 4.97786 22.3957 3.18672 19.9316C1.39557 17.4675 0.5 14.7313 0.5 11.723V4.47925L10 0.916748L19.5 4.47925V11.723C19.5 14.7313 18.6044 17.4675 16.8133 19.9316C15.0221 22.3957 12.751 23.974 10 24.6667ZM10 22.173C12.0583 21.5199 13.7604 20.2136 15.1062 18.2542C16.4521 16.2949 17.125 14.1178 17.125 11.723V6.11206L10 3.44019L2.875 6.11206V11.723C2.875 14.1178 3.54792 16.2949 4.89375 18.2542C6.23958 20.2136 7.94167 21.5199 10 22.173Z">
- </path>
- </svg>
- </button>
- <div id="tooltip-auth" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 12px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Auth
- </div>
- <!-- Template button -->
- <button
- @click="(isSidebarOpen && currentSidebarTab == 'templateTab') ? isSidebarOpen = false : isSidebarOpen = true; currentSidebarTab = 'templateTab'"
- class="mb-5 p-1 c-pointer sidebarMainIcon rounded-full transition-colors hover:bg-[#2AAD8E] hover:text-white hover:outline-none hidden"
- :class="(isSidebarOpen && currentSidebarTab == 'templateTab') ? 'bg-[#2AAD8E]' : 'bg-[#C2C4CD]'"
- data-tooltip-target="tooltip-template" data-tooltip-placement="right" type="button"
- id="left-sidebar-template-btn">
- <i class="fa-solid fa-screwdriver-wrench w-[24px] text-[#505876] hover:text-white"
- :class="(isSidebarOpen &amp;&amp; currentSidebarTab == 'templateTab') ? 'text-white' : 'text-[#505876]'"></i>
- </button>
- <div id="tooltip-template" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 12px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Templates
- </div>
-
-
-
- <!-- Agent builder button -->
- <button
- @click="(isSidebarOpen && currentSidebarTab == 'agentBuilderTab') ? isSidebarOpen = false : isSidebarOpen = true; currentSidebarTab = 'agentBuilderTab'"
- class="mb-5 p-1 c-pointer sidebarMainIcon rounded-full transition-colors hover:bg-[#2AAD8E] hover:text-white hover:outline-none hidden"
- :class="(isSidebarOpen && currentSidebarTab == 'agentBuilderTab') ? 'bg-[#2AAD8E]' : 'bg-[#C2C4CD]'"
- data-tooltip-target="tooltip-agentBuilder" data-tooltip-placement="right" type="button"
- id="left-sidebar-agentBuilder-btn">
- <i class="fa-regular fa-message w-[24px] text-[#505876] hover:text-white"
- :class="(isSidebarOpen &amp;&amp; currentSidebarTab == 'agentBuilderTab') ? 'text-white' : 'text-[#505876]'"></i>
- </button>
- <div id="tooltip-agentBuilder" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 12px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Agent Builder (alpha)
- </div>
-
- </div>
-
- <!-- bottom buttons -->
- <div class="relative flex items-center">
- <button id="cmp-collapse-btn"
- class="p-1 transition-colors text-black hover:text-white hover:bg-smyth-emerald-400 hover:outline-none hover:ring hover:ring-emerald-600 hover:ring-offset-white hover:ring-offset-1 w-10"
- data-tooltip-target="tooltip-collapse" data-tooltip-placement="right" type="button">
- <span class="icon mif-unfold-less"></span>
- </button>
- <div id="tooltip-collapse" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 11px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Fold/Unfold<br />
- Components
- </div>
- </div>
- <div class="relative w-full flex items-center">
- <a href="https://discord.gg/smythos" target="_blank" rel="noopener noreferrer"
- class="relative w-full flex items-center h-12 text-indigo-500 justify-center transition-colors hover:text-white hover:bg-smyth-emerald-400"
- data-tooltip-target="tooltip-discord" data-tooltip-placement="right">
- <i class="fa-brands fa-discord"></i>
- </a>
- <div id="tooltip-discord" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 11px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- Discord Support
- </div>
- </div>
- <div class="relative w-full flex items-center">
- <button
- class="w-full flex items-center h-12 text-gray-600 justify-center transition-all duration-300 hover:text-white hover:bg-smyth-emerald-400"
- @click="isSidebarOpen = !isSidebarOpen" data-tooltip-target="tooltip-collapse-expand"
- data-tooltip-placement="right">
- <i class="fa-solid fa-arrow-right-from-bracket transition-transform duration-300"
- :class="{ 'rotate-180': isSidebarOpen }">
- </i>
- </button>
- <div id="tooltip-collapse-expand" role="tooltip"
- class="tooltip absolute z-10 inline-block bg-smyth-emerald-400 shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-size: 11px" data-popper-reference-hidden="" data-popper-escaped=""
- data-popper-placement="bottom">
- <span x-text="isSidebarOpen ? 'Collapse' : 'Expand'"></span>
- </div>
- </div>
- </nav>
-
- <div x-show="isSidebarOpen" x-transition:enter="transition-opacity duration-300"
- x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100"
- x-transition:leave="transition-opacity duration-300" x-transition:leave-start="opacity-100"
- x-transition:leave-end="opacity-0"
- class="inset-y-0 left-0 flex-shrink-0 bg-white border-r-2 border-emerald-100 shadow-lg w-full">
- <nav aria-label="Main" class="flex flex-col h-full w-full">
- <section x-show="(currentSidebarTab == 'agentTab')"
- class="agentTab py-6 m-0 relative w-64 overflow-hidden hover:overflow-y-auto h-[100%]">
- <%- include('left-sidebar-agent', {agentId:agentId}); -%>
- </section>
-
- <section x-show="(currentSidebarTab == 'buildTab')" class="buildTab py-6 m-0 relative w-64">
- <%- include('left-sidebar-build', {menu:menu}); -%>
- </section>
-
- <section x-show="(currentSidebarTab == 'deployTab')"
- class="deployTab py-6 m-0 relative w-64 overflow-hidden hover:overflow-y-auto h-[100%]">
- <%- include('left-sidebar-deploy'); -%>
- </section>
-
- <section x-show="(currentSidebarTab == 'authTab')"
- class="authTab py-6 m-0 relative w-64 overflow-hidden hover:overflow-y-auto h-[100%]">
- <%- include('left-sidebar-auth'); -%>
- </section>
-
- <section x-show="(currentSidebarTab == 'templateTab')"
- class="templateTab py-6 m-0 relative w-64 overflow-hidden hover:overflow-y-auto h-[100%]">
- <%- include('left-sidebar-template'); -%>
- </section>
-
-
- <% if (isSmythStaff || isSmythAlpha) { %>
- <section x-show="(currentSidebarTab == 'agentBuilderTab')"
- class="agentBuilderTab py-6 m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%]">
- <%- include('left-sidebar-agent-builder'); -%>
- </section>
- <% } %>
- </nav>
- </div>
-
- <script>
- document.addEventListener('alpine:init', () => {
- Alpine.data('sidebarState', () => ({
- /**
- * @type {boolean}
- */
- isSidebarOpen: (() => {
- const storedState = localStorage.getItem('sidebarOpen');
- return storedState !== null ? storedState === 'true' : true;
- })(),
-
- /**
- * @type {string}
- */
- currentSidebarTab: localStorage.getItem('currentSidebarTab') || 'agentTab',
-
- /**
- * Initializes the component by setting up watchers for state changes.
- */
- init() {
- this.$watch('isSidebarOpen', (value) => {
- try {
- localStorage.setItem('sidebarOpen', value.toString());
- } catch (error) {
- console.error('Failed to save sidebar state:', error);
- }
- });
-
- this.$watch('currentSidebarTab', (value) => {
- try {
- localStorage.setItem('currentSidebarTab', value);
- } catch (error) {
- console.error('Failed to save current sidebar tab:', error);
- }
- });
- }
- }));
- });
- </script>
-</div>
\ No newline at end of file