add js/wasm browser build with OpenRouter PKCE, agentic loop, and demo page#2672
Merged
dgageot merged 1 commit intodocker:mainfrom May 6, 2026
Merged
add js/wasm browser build with OpenRouter PKCE, agentic loop, and demo page#2672dgageot merged 1 commit intodocker:mainfrom
dgageot merged 1 commit intodocker:mainfrom
Conversation
|
❌ PR Review Failed — The review agent encountered an error and could not complete the review. View logs. |
rumpl
approved these changes
May 6, 2026
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.
What this is
A
GOOS=js GOARCH=wasmentry point undercmd/wasmthat exposes a slice of docker-agent — config parsing plus a streaming agentic loop with tool calling — to a JavaScript host (browser or Node). It is a proof-of-concept, not a port of the full agent (see Limits below).The static demo at
cmd/wasm/web/index.htmlruns against OpenRouter via the PKCE OAuth flow.See
cmd/wasm/README.mdfor full build / run instructions and architecture notes.What it does
pkg/config)session_start,turn_start,pre_tool_use,post_tool_use)dockerAgent.abort()A JS API is registered on
globalThis.dockerAgent:What it intentionally does NOT do
os/execunder js/wasm)pkg/runtimeorpkg/teamloaderdirectly (both are blocked by sqlite under wasm) — insteadcmd/wasm/runtime_wasm.gobuilds agents from config usingpkg/agentdirectly and runs a simplified streaming loopBuild & test
The generated artifacts (
cmd/wasm/web/docker-agent.wasm,cmd/wasm/web/wasm_exec.js, and awasmdebug binary) are in.gitignore— they are built locally.Cross-platform plumbing this required
Several packages had unix-only files that incidentally matched
GOOS=js. To make the wasm target compile, a small set of_js.gostubs was added alongside the existing_unix.go/_windows.gofiles:pkg/cache/lock_js.go— file-lock no-op (single-process under wasm)pkg/desktop/connection_js.go+sockets_js.go— Docker Desktop connection stubspkg/desktop/connection_other.go— tightened build tag to!windows && !jspkg/model/provider/factory_js.go— provider factory without OS-specific depspkg/tools/builtin/shell/cmd_js.go— process-group stubspkg/tools/builtin/shell/cmd_unix.go— tightened build tag to!windows && !js(it was using `syscall.SysProcAttr.Setpgid` which doesn't exist under js/wasm)Validation
Assisted-By: docker-agent