diff --git a/src/hooks/useAutoLaunchRuntime.ts b/src/hooks/useAutoLaunchRuntime.ts index ca0bf1ed..074b877a 100644 --- a/src/hooks/useAutoLaunchRuntime.ts +++ b/src/hooks/useAutoLaunchRuntime.ts @@ -217,44 +217,3 @@ export function useAutoLaunchRuntime( clearError, }; } - -/** - * Higher-order function to wrap execution functions with auto-launch - * - * Usage: - * ```ts - * const { ensureRuntime } = useAutoLaunchRuntime(); - * const executeWithAutoLaunch = withAutoLaunch(ensureRuntime, executeCell); - * ``` - */ -export function withAutoLaunch Promise>( - ensureRuntime: () => Promise, - executionFn: T -): T { - return (async (...args: Parameters) => { - const runtimeAvailable = await ensureRuntime(); - - if (!runtimeAvailable) { - console.warn( - "⚠️ Could not ensure runtime availability, proceeding with execution anyway" - ); - } - - return executionFn(...args); - }) as T; -} - -/** - * Simple hook for components that just need basic auto-launch functionality - */ -export function useSimpleAutoLaunch( - runtimeType: AutoLaunchRuntimeType = "html" -) { - const { ensureRuntime, status } = useAutoLaunchRuntime({ runtimeType }); - - return { - ensureRuntime, - isLaunching: status.isLaunching, - lastError: status.lastError, - }; -}