feat: integrate d-back browser runtime for live mock actors#7
Closed
feat: integrate d-back browser runtime for live mock actors#7
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
Experimental PR, not suited for production. It uses the backend of https://nntin.xyz/d-zone/ to spawn the agents and have them send messages.
This code is AI slop pure. It works but comes with large technical debt. It's better when proper interfaces have been established. |
12 tasks
- Add src/plugin/types.ts: IPixelAgentsPlugin, IAgentProvider, IAgentHandle, IMessageBridge, IRuntimeUI, PostMessage, and related interfaces - Add src/plugin/registry.ts: registerPlugin/getPlugin singleton - Add src/vscode/VSCodePlugin.ts: WebviewViewProvider + IPixelAgentsPlugin impl - Add src/vscode/VSCodeAgentProvider.ts: terminal lifecycle via IAgentProvider - Add src/vscode/VSCodeMessageBridge.ts: webview ↔ extension bridge - Add src/vscode/VSCodeRuntimeUI.ts: VS Code dialog/state APIs via IRuntimeUI - Add src/core/agentLifecycle.ts: runtime-agnostic agent + message coordination - Replace vscode.Webview param with PostMessage in fileWatcher, transcriptParser, timerManager, assetLoader - Replace ExtensionContext param with IRuntimeUI in layoutPersistence - Replace AgentState.terminalRef with AgentState.handle (IAgentHandle) - Remove PersistedAgent from types.ts (replaced by PersistedAgentHandle) - Delete PixelAgentsViewProvider.ts and agentManager.ts (replaced by new modules) - Slim extension.ts to only wire up the plugin and lifecycle Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The /api/dev-assets endpoint was Vite dev-server only (configureServer hook), causing 404 in the production static build on Vercel. Added a generateBundle hook to emit dev-assets.json alongside the JS/CSS artifacts so browser mock asset loading works in production. Also renamed the dev middleware path to /dev-assets.json for consistency. Removed broken /vite.svg favicon reference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds DBackRuntime — a browser-side plugin that connects to a d-back WebSocket server (default: wss://hermes.nntin.xyz/dzone) and maps Discord users to pixel agents in real time. - src/dback/DBackRuntime.ts: WebSocket client that handles the d-back protocol (server-list → connect → server-join, presence, message). Each Discord user becomes a pixel agent; presence updates drive agent status; chat messages trigger short Write-tool animations. Reconnects automatically on disconnect. - main.tsx: starts DBackRuntime in browser mode alongside asset loading - .gitignore: ignore the cloned d-back/ directory The live d-back instance at wss://hermes.nntin.xyz/dzone (D-World server, id: dworld) is used by default. Override via VITE_DBACK_WS_URL / VITE_DBACK_SERVER env vars. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
d6c2fcf to
9593feb
Compare
Owner
Author
|
succeeded by #9 |
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
feat/stubbing-vscode-commentsfeature branch (asset loading pipeline, Vite dev middleware, runtime detection,browserMock.ts)d-back/to.gitignore(reference clone, not project source)How it works
In browser mode (
npm run devinwebview-ui/), the app:initBrowserMock()inmain.tsx(sprites, layouts — pre-decoded by Vite middleware in dev, decoded in-browser in prod)wss://hermes.nntin.xyz/dzone(6 s timeout)existingAgentsbeforelayoutLoadedso users are buffered and seated correctlypresence: online/dnd→agentStatus: 'active'(agent walks to desk, types)presence: idle/offline→agentStatuspropagated (agent wanders)messageevent →agentToolStart+agentToolDone(3 s activity window)Falls back gracefully to an empty office if d-back is unreachable.
New file
webview-ui/src/dbackRuntime.ts— WebSocket client, uid→agentId mapping, presence + message handlersTest plan
cd webview-ui && npm run devopens browser athttp://localhost:3000with agents from the live d-back Hermes instance visible in the pixel officeisBrowserRuntimeguard)npm run buildsucceeds withdbackRuntimein its own chunknpm testpasses (2/2)🤖 Generated with Claude Code