Have others join by sharing the following url:

The Debug feature is currently in beta. You may encounter unexpected behavior or limitations.

By continuing, you acknowledge that this feature is experimental.

{#snippet actions()} {/snippet}
{#if args} { if (wsProvider?.shouldConnect) { disableCollaboration() } else { setCollaborationMode() } }} on:showDiffMode={showDiffMode} on:hideDiffMode={hideDiffMode} customUi={customUi?.editorBar} collabLive={wsProvider?.shouldConnect} {collabMode} {validCode} iconOnly={width < EDITOR_BAR_WIDTH_THRESHOLD} on:collabPopup={() => (showCollabPopup = true)} {editor} {lang} on:createScriptFromInlineScript {websocketAlive} collabUsers={peers} kind={asKind(kind)} {template} {args} {noHistory} {saveToWorkspace} lastDeployedCode={lastDeployedCode && lastDeployedCode !== code ? lastDeployedCode : undefined} {diffMode} bind:showHistoryDrawer > {#snippet right()} {@render editorBarRight?.()} {/snippet} {/if} {#if !noSyncFromGithub && customUi?.editorBar?.useVsCode != false}
{/if}
{#if lang === 'ansible' && ansibleAlternativeExecutionMode != null} {@render editorContent()}

File Browser

{:else} {@render editorContent()} {/if}
{#if showTabs}
{#if hasPreprocessor}
{/if} {#if isWac}
{/if}
{/if} {#if debugMode && isDebuggableScript}
{/if} {#if selectedTab === 'diagram'}
{:else} {#if previewLayout !== 'bottom'}
{#if !(debugMode && isDebuggableScript)}
{#if testIsLoading} {:else} {@const disableTriggerButton = customUi?.previewPanel?.disableTriggerButton === true} {#if !disableTriggerButton} {/if} {/if}
{#if lastRecording}
{/if}
{#if customUi?.previewPanel?.disableJsonView !== true} {/if} recordAndTest() } ]} />
{/if} {#if customUi?.previewPanel?.hideArgs}
{#if testIsLoading} {:else if (customUi?.previewPanel?.downstreamSubscribers ?? 0) > 0} {@const downstream = customUi!.previewPanel!.downstreamSubscribers!}
{#snippet trigger()} {/snippet} {#snippet content({ close })}
{/snippet}
{:else} {/if}
{ historyTabActive = tab === 'history' if (historyTabActive) { loadPastTests() } }} previewIsLoading={debugMode ? $debugState.running && !$debugState.stopped : testIsLoading} {editor} {diffEditor} args={activeModuleTab !== null ? testPanelArgs : args} {showCaptures} customUi={customUi?.previewPanel} showCustomResultPanel={showDebugPanel} > {#if scriptProgress && !debugMode} {/if}
{:else} {#key previewLayout} {#if previewLayout === 'bottom' && !(debugMode && isDebuggableScript)}
{#if testIsLoading} {:else} {/if}
{/if} {#if jsonView}
{ if (e.detail) { if (activeModuleTab !== null) { testPanelArgs = e.detail } else { args = e.detail } } }} updateOnBlur={false} placeholder={`Write args as JSON.

Example:

{
  "foo": "12"
}`} />
{:else}
{#key argsRender} {#if activeModuleTab !== null} {:else} {/if} {/key} {#if showPsCommonParams}
{/if}
{/if}
{#if scriptProgress && !debugMode} {/if} {#snippet capturesTab()}
{/snippet} {#snippet customResultPanel()} {/snippet}
{/key} {/if} {/if}
{#snippet addModuleForm(close: () => void)}
{ modulePathError = validateModulePath(modulePathInput) }} onkeydown={(e) => { if (e.key === 'Enter') addModule() if (e.key === 'Escape') close() }} /> {#if modulePathError}

{modulePathError}

{/if}

Supports subfolders, e.g. utils/math{allowedModuleExtensions[0] ?? '.ts'}

{/snippet} {#snippet renameModuleForm(oldPath: string, close: () => void)}
{ renameModuleError = validateRenameModulePath(renameModuleInput, oldPath) }} onkeydown={(e) => { if (e.key === 'Enter') { renameModule(oldPath) close() } if (e.key === 'Escape') close() }} /> {#if renameModuleError}

{renameModuleError}

{/if}
{/snippet} {#snippet editorContent()}
{#if supportsModules}
{#each Object.keys(modules ?? {}) as modulePath}
{#snippet trigger()} { e.stopPropagation() renameModuleInput = modulePath renameModuleError = '' }} onkeydown={(e) => { if (e.key === 'Enter') { e.stopPropagation() renameModuleInput = modulePath renameModuleError = '' } }} > {/snippet} {#snippet content({ close })} {@render renameModuleForm(modulePath, close)} {/snippet} { e.stopPropagation() removeModule(modulePath) }} onkeydown={(e) => { if (e.key === 'Enter') { e.stopPropagation() removeModule(modulePath) } }} >
{/each} {#snippet trigger()} {/snippet} {#snippet content({ close })} {@render addModuleForm(close)} {/snippet}
{/if}
{#if assets?.length} {/if} {#if isDebuggableScript && customUi?.editorBar?.debug != false} {/if} {#if lang === 'ansible' && hasDelegateToGitRepo} {/if} {#if testPanelSize === 0}
{#if debugConsoleVisible} {@render editorPane()} (showDebugConsole = false)} workspace={$workspaceStore} jobId={debugSessionJobId ?? undefined} /> {:else}
{@render editorPane()}
{/if}
{/snippet} {#snippet editorPane()} {#key effectiveLang} { if (activeModuleTab === null) { code = editorCode lastSyncedCode = code inferSchema(e.detail) } else { flushModuleContent() inferModuleSchema() } // Refresh breakpoint positions when code changes (decorations track their lines) if (debugMode && breakpointDecorations.length > 0) { refreshBreakpointPositions() } }} on:saveDraft on:toggleTestPanel={toggleTestPanel} cmdEnterAction={async () => { if (activeModuleTab === null) { await inferSchema(editorCode) } else { await inferModuleSchema() } runTest() }} formatAction={async () => { if (activeModuleTab === null) { await inferSchema(editorCode) } try { localStorage.setItem(path ?? 'last_save', activeModuleTab === null ? editorCode : code) } catch (e) { console.error('Could not save last_save to local storage', e) } dispatch('format') }} class="flex flex-1 h-full !overflow-visible" scriptLang={effectiveLang} automaticLayout={true} {fixedOverflowWidgets} {args} workflowAsCode={workflowAsCodeAiContext} {enablePreprocessorSnippet} preparedAssetsSqlQueries={preparedSqlQueries.current} customTag={tag} /> { showHistoryDrawer = true } }, { text: 'Quit diff mode', onClick: () => { hideDiffMode() }, color: 'red' } ] : []} /> {/key} {/snippet}