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.
JavaScript a2aagentic-aiai-agentsdevtoolsmcp-clientn8n-alternativeno-codeopen-sourceorchestrationsmythosvisual-builder
"try debugging" behavior to auto-open debug modal
ali-inkco0a8a9cbe3a06
diff --git a/packages/app/src/builder-ui/components/Component.class/index.ts b/packages/app/src/builder-ui/components/Component.class/index.tsindex f2b79e48..3575099d 100644--- a/packages/app/src/builder-ui/components/Component.class/index.ts+++ b/packages/app/src/builder-ui/components/Component.class/index.ts@@ -2907,7 +2907,11 @@ export class Component extends EventEmitter {}}- public async openDebugDialog(event, operation: 'step' | 'run' = 'step') {+ public async openDebugDialog(+ event,+ operation: 'step' | 'run' = 'step',+ prefillValues?: Record<string, any>,+ ) {PostHog.track('app_debug_inject_click', {});event.stopPropagation();event.stopImmediatePropagation();@@ -2976,6 +2980,7 @@ export class Component extends EventEmitter {}},operation,+ prefillValues,);});}diff --git a/packages/app/src/builder-ui/debugger.ts b/packages/app/src/builder-ui/debugger.tsindex 85ab3097..607fc410 100644--- a/packages/app/src/builder-ui/debugger.ts+++ b/packages/app/src/builder-ui/debugger.ts@@ -2372,23 +2372,28 @@ export function createDebugInjectDialog(outputs,callback,operation: 'step' | 'run' = 'step',+ prefillValues?: Record<string, any>,) {const createInputList = (array, type) => {return array.map((el, index) => {if (el.type === 'file') {+ const prefillValue = prefillValues?.[el.name] || '';return `- <div class="flex mb-5">- <span class="inline-flex w-40 items-center px-3 text-sm text-gray-900 bg-gray-200 border border-e-0 border-gray-300 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600 break-all">- ${el.name}- </span>- <input type="file" name="${el.name}" id="${type}-input-${index}" class="${type}-input input- block w-full text-sm text-slate-500- file:mr-4 file:py-2 file:px-4 file:rounded-md- file:border-0 file:text-sm file:font-semibold- file:bg-gray-200 file:text-gray-900- hover:file:bg-gray-300 pl-5- " multiple>+ <div class="mb-5">+ <div class="flex">+ <span class="inline-flex w-40 items-center px-3 text-sm text-gray-900 bg-gray-200 border border-e-0 border-gray-300 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600 break-all">+ ${el.name}+ </span>+ <input type="file" name="${el.name}" id="${type}-input-${index}" class="${type}-input input+ block w-full text-sm text-slate-500+ file:mr-4 file:py-2 file:px-4 file:rounded-md+ file:border-0 file:text-sm file:font-semibold+ file:bg-gray-200 file:text-gray-900+ hover:file:bg-gray-300 pl-5+ " multiple>+ </div>+ ${prefillValue ? `<div class="mt-2 text-xs text-gray-600">Previously selected: ${prefillValue.substring(0, 100)}${prefillValue.length > 100 ? '...' : ''}</div>` : ''}</div>`;} else {return `@@ -2923,6 +2928,16 @@ export function createDebugInjectDialog(setupTooltip('#tooltip-container');setupTooltip('#default-values-tooltip');setupTooltip('#default-values-tooltip-outputs');++ // Set prefill values if provided+ if (prefillValues) {+ inputs.forEach((input, index) => {+ const inputElement: HTMLTextAreaElement = dialog.querySelector(`#inputs-input-${index}`);+ if (inputElement && prefillValues[input.name] && inputElement.type !== 'file') {+ inputElement.value = prefillValues[input.name].toString();+ }+ });+ }},});diff --git a/packages/app/src/react/features/builder/components/endpoint-form-preview-sidebar/views/ResponseView.tsx b/packages/app/src/react/features/builder/components/endpoint-form-preview-sidebar/views/ResponseView.tsxindex d1b2d6ba..74620a3c 100644--- a/packages/app/src/react/features/builder/components/endpoint-form-preview-sidebar/views/ResponseView.tsx+++ b/packages/app/src/react/features/builder/components/endpoint-form-preview-sidebar/views/ResponseView.tsx@@ -15,6 +15,7 @@ const ResponseView = () => {lastResponse,mode,agentSkillErrors,+ selectedSkill,} = useEndpointFormPreview();const [isCopied, setIsCopied] = useState(false);@@ -141,13 +142,29 @@ const ResponseView = () => {Something went wrong? try{' '}<spanclassName="font-semibold border-b border-solid pb-0.5 cursor-pointer text-blue-500 border-blue-500"- onClick={() => {- //Toggle debug bar+ onClick={async () => {+ // Toggle debug barconst debugSwitcher = document.querySelector('.debug-switcher');// trigger click on debug barif (debugSwitcher && !debugSwitcher?.classList.contains('active')) {debugSwitcher.dispatchEvent(new Event('click', { bubbles: true }));}++ // Open debug modal for the current skill+ const componentElement = document.getElementById(selectedSkill?.skillId);+ if (componentElement) {+ const component = componentElement['_control'];+ if (component && typeof component.openDebugDialog === 'function') {+ // Fire telemetry event+ const { PostHog } = await import('@src/shared/posthog');+ PostHog.track('debug_modal_opened', {+ source: 'test_as_form',+ });++ // Open the debug dialog with 'run' operation+ await component.openDebugDialog(new Event('click'), 'run', lastFormValues);+ }+ }}}>debugging