feat(ai): Storybook story — AIChat drives a real artipod sandbox (MCPToolCall) - #404
Draft
horner wants to merge 1 commit into
Draft
feat(ai): Storybook story — AIChat drives a real artipod sandbox (MCPToolCall)#404horner wants to merge 1 commit into
horner wants to merge 1 commit into
Conversation
artipod-layer-plan Phase 2 acceptance (the original just-bash-plan Phase 6 acceptance): AIChat wired to @artipod/core — every prompt executes through the agent bash tool over just-bash + ZenFS InMemory, rendering as MCPToolCall blocks with live status/duration/result. No model involved (Decision #8). Deps: @artipod/core via github: (retarget to a published version later), just-bash/@zenfs/core/isomorphic-git/diff as devDeps; pnpm onlyBuiltDependencies allows the package's prepare (tsc) build.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Storybook acceptance story that wires AIChat to a real in-browser Artipod sandbox, rendering each command execution as an MCPToolCall and showing the command output, while introducing the required dev dependencies and pnpm config to support the GitHub-sourced @artipod/core.
Changes:
- Add
AIChatArtipodSandboxstory that boots ZenFS + Artipod sandbox and executes each user prompt via thebashtool. - Add
@artipod/core(GitHub ref) and supporting packages (@zenfs/core,just-bash,diff,isomorphic-git) to devDependencies. - Update pnpm workspace config (
onlyBuiltDependencies) and lockfile to build the GitHub dependency.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/components/AI/AIChatArtipodSandbox.stories.tsx | New Storybook story: boot sandbox, run prompts as bash, render as MCPToolCall + output. |
| pnpm-workspace.yaml | Allows building @artipod/core when installed from GitHub. |
| package.json | Adds Artipod/ZenFS-related dev deps for the story. |
| pnpm-lock.yaml | Locks new dependencies introduced for the story and its transitive graph. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+105
to
+120
| let stdout = ''; | ||
| let stderr = ''; | ||
| let exitCode = -1; | ||
| try { | ||
| const result = await bash!.execute({ command }); | ||
| const parsed = JSON.parse(result.content || '{}') as { | ||
| stdout?: string; | ||
| stderr?: string; | ||
| exitCode?: number; | ||
| }; | ||
| stdout = parsed.stdout ?? ''; | ||
| stderr = parsed.stderr ?? ''; | ||
| exitCode = parsed.exitCode ?? -1; | ||
| } catch (e) { | ||
| stderr = e instanceof Error ? e.message : String(e); | ||
| } |
Comment on lines
+128
to
+132
| result: { | ||
| type: exitCode === 0 ? 'text' : 'error', | ||
| data: { stdout, stderr, exitCode }, | ||
| summary: exitCode === 0 ? `exit 0 · ${stdout.length} bytes` : `exit ${exitCode}`, | ||
| }, |
| "tailwind-merge": "^2.6.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@artipod/core": "github:mieweb/artipod#phase-2-import-sandbox", |
| }, | ||
| error: exitCode === 0 ? undefined : stderr.trim() || `exit ${exitCode}`, | ||
| }; | ||
| const outputBlock = (stdout || stderr).trimEnd(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 acceptance story from mieweb/artipod's artipod-layer-plan (originally just-bash-plan Phase 6): AIChat drives a real in-browser artipod sandbox (just-bash over ZenFS InMemory) through @artipod/core's agent bash tool; each command renders as an MCPToolCall with live status, duration, exit summary and output — including the sudo EPERM denial.
Verified locally: story runs, pipeline command executes (exit 0), sudo renders the error tool call.
Draft until: mieweb/artipod#37 merges and @artipod/core publishes — the devDep is currently
github:mieweb/artipod#phase-2-import-sandboxand should be retargeted (or switched to the npm version) before landing.