Skip to content

@sqlrooms/webcontainer / createWebContainerSandbox

Function: createWebContainerSandbox()

createWebContainerSandbox(getState): Sandbox

Adapts the WebContainer slice into the Sandbox interface.

  • readFile prefers in-memory editor content (dirty files) so the LLM always sees what the user sees.
  • writeFiles routes through updateFileContent + saveAllOpenFiles so changes flow through the editor state and trigger proper UI updates.
  • executeCommand delegates to executeBashCommand which handles just-bash lifecycle, terminal output logging, and filesystem sync.

Parameters

ParameterType
getState() => WebContainerSliceState

Returns

Sandbox