Skip to content

feat(ai): Storybook story — AIChat drives a real artipod sandbox (MCPToolCall) - #404

Draft
horner wants to merge 1 commit into
mainfrom
feat/artipod-sandbox-story
Draft

feat(ai): Storybook story — AIChat drives a real artipod sandbox (MCPToolCall)#404
horner wants to merge 1 commit into
mainfrom
feat/artipod-sandbox-story

Conversation

@horner

@horner horner commented Aug 31, 2026

Copy link
Copy Markdown
Member

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-sandbox and should be retargeted (or switched to the npm version) before landing.

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.
Copilot AI lite review requested due to automatic review settings August 31, 2026 01:47
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 80f0428
Status:🚫  Build failed.

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AIChatArtipodSandbox story that boots ZenFS + Artipod sandbox and executes each user prompt via the bash tool.
  • 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}`,
},
Comment thread package.json
"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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants