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.

Add weaver availability check and update sidebar tab logic

Muhammad Hamza Khan39e8b25bf40b
diff --git a/packages/app/src/builder-ui/debugger.ts b/packages/app/src/builder-ui/debugger.ts
index af6dc657..8bcd786e 100644
--- a/packages/app/src/builder-ui/debugger.ts
+++ b/packages/app/src/builder-ui/debugger.ts
@@ -534,6 +534,35 @@ export async function init() {
updateServerStatus();
handleEmbodimentRPCDebug();
+
+ checkWeaverAvailability();
+}
+
+function checkWeaverAvailability() {
+ const currentSidebarTab = localStorage.getItem('currentSidebarTab');
+ const sidebarOpen = localStorage.getItem('sidebarOpen');
+ // Switch to components if weaver is not enabled
+ if (
+ (!sidebarOpen || sidebarOpen === 'true') &&
+ currentSidebarTab === 'agentBuilderTab' &&
+ window?.SMYTHOS_EDITION !== 'enterprise'
+ ) {
+ setSidebarTab('buildTab');
+ }
+}
+
+function setSidebarTab(tab) {
+ localStorage.setItem('currentSidebarTab', tab);
+ localStorage.setItem('previousTab', null);
+ window.dispatchEvent(
+ new CustomEvent('sidebarStateChanged', {
+ detail: {
+ isSidebarOpen: true,
+ currentSidebarTab: tab,
+ rightSidebarOpen: false,
+ },
+ }),
+ );
}
function waitDebugStep() {
diff --git a/packages/app/src/shared/types/global.d.ts b/packages/app/src/shared/types/global.d.ts
index d255b070..c5e27fca 100644
--- a/packages/app/src/shared/types/global.d.ts
+++ b/packages/app/src/shared/types/global.d.ts
@@ -1,6 +1,7 @@
declare global {
interface Window {
__LLM_MODELS__: Record<string, any>;
+ SMYTHOS_EDITION: string;
}
}
diff --git a/packages/app/views/pages/builder.ejs b/packages/app/views/pages/builder.ejs
index ccb6921e..c65f26be 100644
--- a/packages/app/views/pages/builder.ejs
+++ b/packages/app/views/pages/builder.ejs
@@ -143,6 +143,10 @@
<div id="self-contained-builder-modals" class="z-20"></div>
</div>
+<script>
+ window.SMYTHOS_EDITION = '<%= process.env.SMYTHOS_EDITION %>';
+</script>
+
<script src="/js/alpine.min.js" defer></script>
<script>