AiSandboxPreview

Sandbox Preview

Sandbox stdout/stderr streaming with exit code and file artifacts.

npm run build
completed
> project@1.0.0 build
> vite build
 
vite v6.0.0 building for production...
dist/index.js 12.4 kB | gzip: 4.2 kB
warn: sourcemap generation is disabled
Build completed in 1.2s
Exit code: 0

Artifacts

Usage

<AiSandboxPreview :state="sandboxState" @run="run" @stop="stop">
  <template #header="{ state }">
    <div class="sandbox-header">
      <code>{{ state.command }}</code>
      <span :data-status="state.status">{{ state.status }}</span>
    </div>
  </template>
  <template #line="{ line }">
    <span :data-stream="line.stream">{{ line.content }}</span>
  </template>
  <template #artifact="{ artifact, formatSize }">
    <button type="button" @click="download(artifact)">
      {{ artifact.name }} · {{ formatSize(artifact.size!) }}
    </button>
  </template>
</AiSandboxPreview>

Props

Prop Type Default Description
state*AiSandboxStateSandbox execution state
showCommandbooleantrueShow the command header
showArtifactsbooleantrueShow file artifacts section
maxLinesnumberMax visible output lines (scrolls from bottom)

Slots

  • default
  • header
  • command
  • actions
  • output
  • line
  • status
  • artifacts
  • artifact