Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
6437613
docs(studio-bridge): add persistent session planning documents
Quenty Feb 23, 2026
6b14ce5
feat(cli-output-helpers): add table formatter for command output
Quenty Feb 23, 2026
2de0740
feat(cli-output-helpers): add JSON formatter for command output
Quenty Feb 23, 2026
79befa1
feat(cli-output-helpers): add watch renderer for live-updating output
Quenty Feb 23, 2026
edff8b1
feat(cli-output-helpers): add output mode selector and barrel export
Quenty Feb 23, 2026
1a1030d
feat(studio-bridge): add v2 protocol type definitions and codec funct…
Quenty Feb 23, 2026
909bf05
feat(studio-bridge): add request/response correlation layer
Quenty Feb 23, 2026
9285633
Merge branch 'worktree-agent-af2c51c5' into feat/studio-bridge
Quenty Feb 23, 2026
7052de6
feat(studio-bridge): add transport layer and bridge host infrastructure
Quenty Feb 23, 2026
d6469eb
feat(studio-bridge): add v2 handshake and capability negotiation
Quenty Feb 23, 2026
8f21c6b
feat(studio-bridge): add Luau protocol module and Lune test harness
Quenty Feb 23, 2026
5bc4b36
Merge branch 'worktree-agent-ac8973ee' into feat/studio-bridge
Quenty Feb 23, 2026
b4d459b
feat(studio-bridge): add session tracker and bridge session types
Quenty Feb 23, 2026
ae93d07
feat(studio-bridge): add discovery state machine for plugin connectio…
Quenty Feb 23, 2026
e3c62ab
feat(studio-bridge): add action router and message buffer for plugin
Quenty Feb 23, 2026
caa6a57
feat(studio-bridge): add bridge client and host protocol layer
Quenty Feb 23, 2026
643b46d
feat(studio-bridge): add action dispatch with request correlation
Quenty Feb 23, 2026
6fc3673
Merge branch 'worktree-agent-a9658e21' into feat/studio-bridge
Quenty Feb 23, 2026
0dde0f5
feat(studio-bridge): add integration tests for plugin modules
Quenty Feb 23, 2026
4be26b2
feat(studio-bridge): add BridgeConnection with role detection
Quenty Feb 23, 2026
0dc0fc9
feat(studio-bridge): add session listing to BridgeConnection
Quenty Feb 23, 2026
c0e63ed
feat(studio-bridge): add instance-aware session resolution
Quenty Feb 23, 2026
13ab00e
feat(studio-bridge): add session wait and lifecycle events
Quenty Feb 23, 2026
8a67c50
Merge remote-tracking branch 'origin/feat/studio-bridge' into worktre…
Quenty Feb 23, 2026
c69b578
feat(studio-bridge): add bridge module barrel export
Quenty Feb 23, 2026
7aa69b7
Merge branch 'worktree-agent-a653dd14' into feat/studio-bridge
Quenty Feb 23, 2026
a711695
feat(studio-bridge): add shared CLI utilities for session resolution …
Quenty Feb 23, 2026
848df8e
feat(studio-bridge): export bridge module types from package root
Quenty Feb 23, 2026
e8490ab
feat(cli-output-helpers): add table formatter for command output
Quenty Feb 23, 2026
8d78db3
feat(cli-output-helpers): add JSON formatter for command output
Quenty Feb 23, 2026
f01749d
feat(cli-output-helpers): add watch renderer for live-updating output
Quenty Feb 23, 2026
5423acb
feat(cli-output-helpers): add output mode selector and barrel export
Quenty Feb 23, 2026
c88f66f
feat(studio-bridge): add sessions command with barrel export pattern
Quenty Feb 23, 2026
14fcd9c
feat(studio-bridge): add health endpoint to StudioBridgeServer
Quenty Feb 23, 2026
05e306d
Merge branch 'worktree-agent-aedca01c' into feat/studio-bridge
Quenty Feb 23, 2026
d5f87a4
feat(studio-bridge): add serve command for dedicated bridge host
Quenty Feb 23, 2026
110c02f
feat(studio-bridge): add remote and local flags for split server mode
Quenty Feb 23, 2026
a1b5ca4
feat(studio-bridge): add devcontainer auto-detection for remote bridg…
Quenty Feb 23, 2026
33c9f12
feat(studio-bridge): add unified plugin entry point with Layer 2 glue
Quenty Feb 23, 2026
949c0ed
feat(studio-bridge): add host failover detection and takeover protocol
Quenty Feb 23, 2026
d071d86
Merge branch 'worktree-agent-a66230a3' into feat/studio-bridge
Quenty Feb 23, 2026
c8c4bf7
feat(studio-bridge): add failover observability and debug logging
Quenty Feb 23, 2026
57b2f23
feat(studio-bridge): add failover integration tests
Quenty Feb 23, 2026
d5f55f2
feat(studio-bridge): add plugin manager and installer commands
Quenty Feb 23, 2026
4c906b0
feat(studio-bridge): add state query command
Quenty Feb 23, 2026
0f98447
Merge branch 'worktree-agent-a4823e75' into feat/studio-bridge
Quenty Feb 23, 2026
d2bbca1
feat(studio-bridge): add CI-aware plugin detection
Quenty Feb 23, 2026
e395ec5
feat(studio-bridge): add log query command
Quenty Feb 23, 2026
37ed822
feat(studio-bridge): add screenshot capture command
Quenty Feb 23, 2026
aafb22c
feat(studio-bridge): add persistent plugin detection and fallback
Quenty Feb 23, 2026
7e2d101
Merge branch 'worktree-agent-ab25bd55' into feat/studio-bridge
Quenty Feb 23, 2026
b00d3e3
feat(studio-bridge): add execute action handler with request correlation
Quenty Feb 23, 2026
2ab817c
feat(studio-bridge): add DataModel query command
Quenty Feb 23, 2026
067307e
feat(studio-bridge): refactor exec and run commands to handler pattern
Quenty Feb 23, 2026
18a5ba4
Merge branch 'worktree-agent-afe66f8b' into feat/studio-bridge
Quenty Feb 23, 2026
7e3a498
feat(studio-bridge): wire terminal dot-commands to shared command han…
Quenty Feb 23, 2026
11b8054
feat(studio-bridge): add comprehensive E2E test suite and v2 protocol…
Quenty Feb 23, 2026
ba04925
feat(studio-bridge): add MCP server with tool adapter
Quenty Feb 23, 2026
a597cde
docs(studio-bridge): add migration guide for persistent sessions
Quenty Feb 23, 2026
c724bc0
feat(studio-bridge): update public API exports for v2
Quenty Feb 23, 2026
9d2c719
Merge branch 'worktree-agent-a9cbfcff' into feat/studio-bridge
Quenty Feb 23, 2026
98233d1
fix(studio-bridge): resolve tsc --build type errors
Quenty Feb 24, 2026
1a5b8da
fix(studio-bridge): avoid Handlebars parse error in plugin template
Quenty Feb 24, 2026
e2e403f
fix(studio-bridge): move plugin tests out of Handlebars template dire…
Quenty Feb 24, 2026
a51b943
fix(studio-bridge): wait for plugin connection in sessions command
Quenty Feb 24, 2026
c8b2d27
fix(studio-bridge): fix plugin reentrancy and disconnect handling
Quenty Feb 24, 2026
63f1073
fix(studio-bridge): handle client protocol messages and broadcast ses…
Quenty Feb 24, 2026
c4082b6
test(studio-bridge): add integration tests for host↔client protocol a…
Quenty Feb 24, 2026
37e9725
fix(studio-bridge): fix idle timer race and spurious failover on disc…
Quenty Feb 24, 2026
91ea623
fix(studio-bridge): parallel port scanning and no backoff on disconnect
Quenty Feb 24, 2026
5f5f5b8
test(studio-bridge): update Lune tests for new disconnect behavior an…
Quenty Feb 24, 2026
3aa4be8
fix(studio-bridge): send graceful shutdown to plugins before closing
Quenty Feb 24, 2026
acff97b
feat(studio-bridge): use readable session IDs for unpublished places
Quenty Feb 24, 2026
5078b30
test(studio-bridge): add tests for unpublished place session ID format
Quenty Feb 24, 2026
8dcd28d
fix(studio-bridge): improve plugin log output for debugging
Quenty Feb 24, 2026
a054f16
feat(studio-bridge): wire host-mode sessions to plugin WebSockets
Quenty Feb 24, 2026
32a0004
feat(studio-bridge): add QueryDataModelAction to plugin
Quenty Feb 24, 2026
bc80d6e
docs(studio-bridge): rewrite README for v2 persistent bridge architec…
Quenty Feb 24, 2026
22a195f
fix(studio-bridge): return 503 during shutdown to prevent plugin reco…
Quenty Feb 24, 2026
7f48b12
fix(studio-bridge): improve plugin error messages and shutdown drain
Quenty Feb 24, 2026
5daca8a
feat(studio-bridge): implement remaining plugin action handlers
Quenty Feb 24, 2026
746c815
feat(studio-bridge): implement screenshot capture via CaptureService …
Quenty Feb 24, 2026
8c2c5a7
feat(studio-bridge): encode screenshots as PNG in plugin via png-luau
Quenty Feb 24, 2026
5a1d768
style(studio-bridge): apply stylua formatting to plugin Luau files
Quenty Feb 24, 2026
7fbacf2
fix(studio-bridge): fix multi-Studio session connectivity
Quenty Feb 24, 2026
36f0624
refactor(studio-bridge): rename resolveSession to resolveSessionAsync
Quenty Feb 24, 2026
b3681af
refactor(studio-bridge): extract BridgeConnection lifecycle helpers
Quenty Feb 24, 2026
f4cfd82
fix(studio-bridge): fix logs returning empty results and session reso…
Quenty Feb 24, 2026
17e531b
fix(studio-bridge): list session IDs in multi-instance error message
Quenty Feb 24, 2026
31e7201
fix(studio-bridge): fix coroutine resume race and skip play-mode cont…
Quenty Feb 24, 2026
cf9cc1a
refactor(studio-bridge): reorganize CLI into declarative grouped comm…
Quenty Feb 25, 2026
b407c04
feat(studio-bridge): implement CLI output formatting, file writes, an…
Quenty Feb 26, 2026
66e241b
feat(studio-bridge): action lifecycle redesign with invoker-driven re…
Quenty Mar 1, 2026
62a501e
feat(studio-bridge): capture print/warn output from executed scripts
Quenty Mar 1, 2026
9eae007
fix(studio-bridge): fix premature disconnect, action loader path, and…
Quenty Mar 1, 2026
f44528e
fix(studio-bridge): fix session targeting, exit codes, JSON output, a…
Quenty Mar 1, 2026
78aa686
fix(studio-bridge): use child_process.spawn for process launch to pre…
Quenty Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 192 additions & 0 deletions docs/studio-bridge-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Studio Bridge: Persistent Sessions Migration Guide

Studio Bridge v0.7 introduces persistent sessions -- the plugin stays running in Roblox Studio and maintains a WebSocket connection to a bridge server. This replaces the one-shot launch-execute-exit workflow with a persistent connection that supports multiple commands, multiple Studio instances, and AI agent integration via MCP.

## 1. Install the Persistent Plugin

The persistent plugin runs inside Roblox Studio and auto-discovers the bridge server on port 38741. No manual port configuration is needed.

```bash
# Install the plugin into your local Roblox Studio plugins folder
studio-bridge install-plugin

# Verify: open Studio, then check for connected sessions
studio-bridge sessions

# Remove the plugin later if needed
studio-bridge uninstall-plugin
```

The plugin is copied to your OS plugins folder:
- **macOS**: `~/Library/Application Support/Roblox/Plugins/`
- **Windows**: `%LOCALAPPDATA%/Roblox/Plugins/`

After installing, restart any open Studio instances. The plugin connects automatically when Studio starts.

## 2. New CLI Commands

All session-targeting commands accept `--session <id>`, `--instance <id>`, and `--context <edit|client|server>`. These are optional when only one Studio instance is connected. When multiple instances are connected, use `--session` or `--instance` to disambiguate.

### sessions -- list connected Studio instances

```bash
studio-bridge sessions
studio-bridge sessions --json
```

### state -- query Studio mode and place info

```bash
studio-bridge state
studio-bridge state --session abc123
```

### screenshot -- capture the Studio viewport

```bash
studio-bridge screenshot --output viewport.png
studio-bridge screenshot --base64 # print raw base64 to stdout
studio-bridge screenshot --json # JSON with dimensions and data
```

### logs -- retrieve output log history

```bash
studio-bridge logs # last 50 entries (default)
studio-bridge logs --tail 100 # last 100 entries
studio-bridge logs --head 20 # oldest 20 entries
studio-bridge logs --level Error,Warning # filter by level
studio-bridge logs --all # include internal messages
studio-bridge logs --follow # stream new entries (planned)
```

### query -- inspect the DataModel tree

```bash
studio-bridge query Workspace
studio-bridge query Workspace.SpawnLocation --properties
studio-bridge query game.ReplicatedStorage --children
studio-bridge query Workspace --descendants --depth 3
studio-bridge query Workspace.Part --attributes
```

### serve -- start a standalone bridge server

```bash
studio-bridge serve # listen on default port 38741
studio-bridge serve --port 9000 # custom port
```

Runs a long-lived bridge host. Use this for split-server mode (see section 3).

### terminal -- interactive REPL with dot-commands

```bash
studio-bridge terminal
studio-bridge terminal --script init.lua # run a file on connect
studio-bridge terminal --script-text 'print("ready")'
```

Inside terminal mode, dot-commands provide quick access to bridge features:

| Command | Description |
|---------|-------------|
| `.sessions` | List connected sessions |
| `.connect <id>` | Switch to a session |
| `.disconnect` | Detach from the active session |
| `.state` | Query Studio state |
| `.screenshot` | Capture a screenshot |
| `.logs` | Show recent log entries |
| `.query <path>` | Query the DataModel |
| `.help` | Show all commands |
| `.exit` | Exit terminal mode |

### exec and run -- session targeting

The existing `exec` and `run` commands now support persistent sessions:

```bash
# Persistent session (fast, no Studio launch)
studio-bridge exec 'print(workspace:GetChildren())' --session abc123

# Legacy one-shot (launches Studio, executes, exits)
studio-bridge exec 'print("hello")'
```

When `--session`, `--instance`, or `--context` is passed, the command uses the persistent bridge connection. Otherwise it falls back to the original one-shot behavior.

## 3. Split-Server Mode (Devcontainers)

When developing inside Docker, a devcontainer, or GitHub Codespaces, the CLI cannot reach Roblox Studio directly. Run the bridge server on the host OS and connect from inside the container.

**On the host OS** (where Studio runs):

```bash
studio-bridge serve
```

**Inside the container:**

```bash
# Automatic detection works if port 38741 is forwarded
studio-bridge sessions

# Or specify the host explicitly
studio-bridge sessions --remote host.docker.internal:38741
studio-bridge exec 'print("hello")' --remote localhost:38741
```

Port 38741 must be forwarded from the container to the host. In VS Code devcontainers, add to `devcontainer.json`:

```json
{
"forwardPorts": [38741]
}
```

Use `--local` to skip devcontainer auto-detection and force local mode.

## 4. MCP Integration for AI Agents

Studio Bridge exposes its commands as MCP tools for AI agents like Claude Code.

### Configuration

Add to `.mcp.json` or your Claude Code MCP config:

```json
{
"mcpServers": {
"studio-bridge": {
"command": "studio-bridge",
"args": ["mcp"]
}
}
}
```

For devcontainer environments, pass `--remote`:

```json
{
"mcpServers": {
"studio-bridge": {
"command": "studio-bridge",
"args": ["mcp", "--remote", "localhost:38741"]
}
}
}
```

### Available MCP Tools

| Tool | Description |
|------|-------------|
| `studio_sessions` | List active Studio sessions |
| `studio_state` | Query Studio mode and place info |
| `studio_screenshot` | Capture a viewport screenshot (returns PNG image) |
| `studio_logs` | Retrieve buffered log history |
| `studio_query` | Query the DataModel instance tree |
| `studio_exec` | Execute inline Luau code |

All tools except `studio_sessions` accept optional `sessionId` and `context` parameters for targeting specific sessions.
Loading
Loading