AiSandboxPreview
Sandbox Preview
Sandbox stdout/stderr streaming with exit code and file artifacts.
npm run build> 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* | AiSandboxState | — | Sandbox execution state |
| showCommand | boolean | true | Show the command header |
| showArtifacts | boolean | true | Show file artifacts section |
| maxLines | number | — | Max visible output lines (scrolls from bottom) |
Slots
defaultheadercommandactionsoutputlinestatusartifactsartifact