Add local WebLLM and NodePod browser runtime#32
Merged
Conversation
751e5d7 to
5e4b0e4
Compare
There was a problem hiding this comment.
Pull request overview
Adds a browser-focused demo/runtime stack: a shared browser MCP workspace sidecar (@fledgling/mcp-workspace-browser), a NodePod-backed workspace runtime, and a Vite-based web demo that can run either a remote OpenAI model or a local WebLLM Qwen model (with a manual tool-call fallback when function calling isn’t available).
Changes:
- Introduce
@fledgling/mcp-workspace-browseras the shared browser workspace runtime + MCP sidecar/tooling layer, and refactor WebContainer runtime to reuse it. - Add
@fledgling/workspace-nodepodimplementing the shared workspace runtime interface on top of NodePod. - Add
@fledgling/web-demo(Vite + React) with OpenAI and WebLLM/Qwen model options, plus NodePod/WebContainer runtime switching.
Reviewed changes
Copilot reviewed 44 out of 46 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rush.json | Adds new workspace packages to the Rush monorepo. |
| packages/mcp-workspace-browser/package.json | New shared browser workspace sidecar package definition. |
| packages/mcp-workspace-browser/tsconfig.json | TS config for the new browser workspace package. |
| packages/mcp-workspace-browser/vitest.config.ts | Vitest config for the new browser workspace package. |
| packages/mcp-workspace-browser/eslint.config.cjs | ESLint rig wiring for the new browser workspace package. |
| packages/mcp-workspace-browser/config/rig.json | Heft rig config for the new browser workspace package. |
| packages/mcp-workspace-browser/src/index.ts | Exports the new browser workspace runtime + sidecar. |
| packages/mcp-workspace-browser/src/runtime.ts | Defines shared IWorkspaceRuntime + path helpers for browser workspaces. |
| packages/mcp-workspace-browser/src/runtime.test.ts | Unit tests for the shared browser workspace helpers. |
| packages/mcp-workspace-browser/src/sidecar.ts | Implements MCP sidecar + tool registration for browser workspaces. |
| packages/mcp-workspace-webcontainer/package.json | Adds dependency on @fledgling/mcp-workspace-browser. |
| packages/mcp-workspace-webcontainer/src/runtime.ts | Refactors runtime to reuse shared browser workspace helpers/types. |
| packages/mcp-workspace-webcontainer/src/index.ts | Re-exports shared browser workspace APIs from the webcontainer package. |
| packages/workspace-nodepod/package.json | New NodePod-backed browser workspace runtime package definition. |
| packages/workspace-nodepod/tsconfig.json | TS config for the new NodePod runtime package. |
| packages/workspace-nodepod/vitest.config.ts | Vitest config for the new NodePod runtime package. |
| packages/workspace-nodepod/eslint.config.cjs | ESLint rig wiring for the new NodePod runtime package. |
| packages/workspace-nodepod/config/rig.json | Heft rig config for the new NodePod runtime package. |
| packages/workspace-nodepod/src/index.ts | Exports the NodePod workspace runtime. |
| packages/workspace-nodepod/src/runtime.ts | Implements IWorkspaceRuntime on top of NodePod FS + process APIs. |
| packages/workspace-nodepod/src/runtime.test.ts | Unit tests for path normalization and command execution behavior. |
| packages/web-agent/package.json | Switches dependency from webcontainer workspace package to browser workspace package. |
| packages/web-agent/src/index.ts | Re-exports browser workspace APIs (instead of webcontainer workspace APIs). |
| packages/web-agent/src/dependencies.ts | Uses the new shared browser workspace sidecar factory. |
| packages/web-agent/src/tool-provider.ts | Retypes sidecar dependency to the new shared browser workspace sidecar. |
| packages/web-agent/src/web-agent.test.ts | Updates IWorkspaceRuntime import to come from the shared browser workspace package. |
| packages/web-demo/package.json | New Vite/React demo app with WebLLM + NodePod dependencies. |
| packages/web-demo/tsconfig.json | TS config for the demo app with bundler module resolution. |
| packages/web-demo/vite.config.ts | Vite config with NodePod plugin + chunking strategy + node:* shims. |
| packages/web-demo/index.html | New demo HTML entrypoint. |
| packages/web-demo/.env.example | Documents demo env vars for OpenAI + WebLLM model selection. |
| packages/web-demo/src/main.tsx | React entrypoint wiring. |
| packages/web-demo/src/styles.css | Demo UI styling. |
| packages/web-demo/src/components.tsx | Demo UI components (chat + file browser + runtime panel). |
| packages/web-demo/src/App.tsx | Demo state machine: workspace boot, session wiring, streaming transcript updates. |
| packages/web-demo/src/acp-demo.ts | In-browser ACP wiring + workspace/runtime factory for NodePod/WebContainer. |
| packages/web-demo/src/model-runner.ts | Model runner abstraction supporting OpenAI + WebLLM (manual tool protocol fallback). |
| packages/web-demo/src/webllm-worker.ts | WebLLM worker entrypoint. |
| packages/web-demo/src/node-module-shim.ts | Shim for node:module import in the demo build. |
| packages/web-demo/src/node-process-shim.ts | Shim for node:process import in the demo build. |
| packages/agent-core/src/index.ts | Exports the new AiSdkModelTurnRunner. |
| packages/agent-core/src/ai-sdk-model-turn-runner.ts | Adds reusable Vercel AI SDK model-turn runner wrapper. |
| packages/agent-core/src/ai-sdk-model-turn-runner.test.ts | Unit tests for the new model-turn runner wrapper. |
| packages/acp-agent/src/agent.ts | Refactors Node ACP agent model runner to use the new shared AI SDK runner. |
| common/config/rush/pnpm-lock.yaml | Lockfile updates for new packages/deps. |
| .gitignore | Ignores additional local env file patterns. |
Files not reviewed (1)
- common/config/rush/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Stacking note
This PR is stacked on #31. Review/merge #31 first, then rebase this branch onto main.
Validation