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 active state management for debugger UI sessions

Muhammad Hamza Khaned77177f461b
diff --git a/packages/app/src/builder-ui/debugger.ts b/packages/app/src/builder-ui/debugger.ts
index 3605f66c..e513b3e5 100644
--- a/packages/app/src/builder-ui/debugger.ts
+++ b/packages/app/src/builder-ui/debugger.ts
@@ -3138,6 +3138,7 @@ export async function registerDbgMonitorUI(monitor: Monitor) {
const comp = document.querySelector(`#${e.data.id}`);
if (!comp) return;
comp.classList.remove('dbg-running');
+ comp.classList.remove('dbg-active');
// hide overlay
// if duration was below 500ms, wait for 500ms - duration before hiding to give the visual feedback
if (e.data.duration < 500) {
@@ -3155,11 +3156,27 @@ export async function registerDbgMonitorUI(monitor: Monitor) {
if (!comp) return;
workspace.refreshComponentSelection(comp as HTMLElement);
comp.classList.add('dbg-running');
+ comp.classList.add('dbg-active');
// show overlay
$(comp.querySelector('.cpt-overlay')).show();
}
});
+ // Listen to the agent event
+ monitor.on('agent', (e: any) => {
+ const data = e.data;
+
+ // Session START: when there's startTime but no endTime/duration
+ if (data.startTime && !data.endTime && !data.duration) {
+ workspace.domElement.classList.add('debugging');
+ }
+
+ // Session END: when there's endTime or duration
+ if (data.endTime || data.duration) {
+ workspace.domElement.classList.remove('debugging');
+ }
+ });
+
monitor.on('computer-use/ui-state', (e: any) => {
const comp = document.querySelector(`#${e.data.componentId}`);
if (!comp) return;