feat(office): add Agent Office 3D real-time visualization#60
Open
therichardngai-code wants to merge 1 commit intonextlevelbuilder:mainfrom
Open
feat(office): add Agent Office 3D real-time visualization#60therichardngai-code wants to merge 1 commit intonextlevelbuilder:mainfrom
therichardngai-code wants to merge 1 commit intonextlevelbuilder:mainfrom
Conversation
Adds GET /office — a browser-based 3D isometric view of the agent office. Every agent appears as an animated character on its own platform zone. State streams via SSE with a 3-second server-side heartbeat as safety net. ## UI - Isometric orthographic camera with orbit pan/zoom (buttons + mouse) - Platform zones: Home (idle), channel (Telegram/Discord/etc), team (managed mode) - 14 animated Kenney characters, deterministic per agent ID - Neon-green agent labels with live status dot - Speech bubbles: "Processing..." (always), "••• tool" (tool calls), live LLM text (when channel streaming enabled) - Delegation arcs: marching-ants during handshake, agents walk toward each other - Platform decoration: L-shaped walls (arcade/market theme), corner crate, 2 machines per platform, back-left column - Space nebula background ## Backend (new package internal/office/) - state.go — mutex-protected OfficeState (agents, teams, delegations) - bridge.go — bus subscriber, maps EventAgent subtypes to state mutations - sse.go — SSE hub, fan-out via buffered channel (cap 512) - handler.go — HTTP: /office, /office/state, /office/events, /office/assets/ - office.go — top-level controller + 3-second heartbeat goroutine ## Wiring changes - internal/agent/loop.go — emit channel name in run.started payload - internal/agent/router.go — AgentInfo gains DisplayName + AgentType - internal/gateway/methods/teams.go — publishTeamState() on create/update - internal/gateway/server.go — SetOfficeHandler() - cmd/gateway.go — create Office, Bridge, seed agents+teams - pkg/protocol/events.go — EventTeamUpserted constant ## Assets (CC0 Kenney.nl, embedded via go:embed) - 14 character GLBs + animated variants (idle, walk, talk) - Arcade walls, market walls, machines, crate, column + colormaps ## Tests - state_test.go 509 lines - bridge_test.go 649 lines - sse_test.go 377 lines
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
Adds
GET /office— a browser-based 3D isometric view of the GoClaw agent office. Every agent appears as an animated character on its own platform zone. State streams via SSE with a 3-second server-side heartbeat as safety net.What's New
Agent Office UI (
/office)Processing...always ·••• toolduring tool calls · live LLM text when channel streaming is enabledReal-time State Pipeline
New Go Package
internal/office/state.goOfficeState— agents, teams, delegations, notificationsbridge.goEventAgentsubtypes to state mutationssse.gohandler.go/office,/office/state,/office/events,/office/assets/office.goWiring Changes to Existing Files
internal/agent/loop.go— emitchannelname inrun.startedpayloadinternal/agent/router.go—AgentInfogainsDisplayName+AgentTypeinternal/gateway/methods/teams.go—publishTeamState()on team create/updateinternal/gateway/server.go—SetOfficeHandler()cmd/gateway.go— create Office, Bridge, seed agents + teams at startuppkg/protocol/events.go—EventTeamUpsertedconstantAssets (CC0 Kenney.nl, embedded via
go:embed)Tests
state_test.gobridge_test.gosse_test.goHow to Access
Same token as
gateway.tokeninconfig.json. Auth bypassed when no token configured.Security
GET /office— no auth (HTML shell only, no data)GET /office/stateandGET /office/events— require gateway token, constant-time compareKnown Limitations (follow-up issues)
teams.deletedoes not remove the team platform; persists until page refreshTARGET_H = 1.3; some models may look slightly offcamera.far = 300; may clip on very large scenes (>20 platforms)dm_stream: true/group_stream: truein channel config;Processing...fallback shown otherwise