Skip to content

feat: introduce plugin system for runtime extensibility#8

Open
NNTin wants to merge 3 commits intomainfrom
feat/plugin-system-for-runtime-extensibility
Open

feat: introduce plugin system for runtime extensibility#8
NNTin wants to merge 3 commits intomainfrom
feat/plugin-system-for-runtime-extensibility

Conversation

@NNTin
Copy link
Owner

@NNTin NNTin commented Mar 17, 2026

Summary

  • Introduces a plugin interface layer (src/plugin/types.ts) that abstracts IAgentProvider, IMessageBridge, and IRuntimeUI
  • Extracts all VS Code-specific code into a first-party plugin (src/vscode/) — VSCodePlugin, VSCodeAgentProvider, VSCodeMessageBridge, VSCodeRuntimeUI
  • Creates a runtime-agnostic core orchestrator (src/core/agentLifecycle.ts) that replaces the old PixelAgentsViewProvider + agentManager — no vscode.* imports
  • Removes vscode.Webview coupling from fileWatcher.ts, transcriptParser.ts, timerManager.ts, assetLoader.ts — all now use a PostMessage callback type
  • Updates layoutPersistence.ts to accept IRuntimeUI instead of ExtensionContext
  • Deletes src/PixelAgentsViewProvider.ts and src/agentManager.ts (fully replaced)
  • Build passes with no type errors

Architecture

IPixelAgentsPlugin (one registered plugin)
  ├── IAgentProvider   — how agents are spawned/tracked
  ├── IMessageBridge   — how the webview communicates
  └── IRuntimeUI       — file dialogs, notifications, workspace folders, state persistence

src/vscode/  ← VS Code implementation of all three
src/core/    ← runtime-agnostic orchestration
src/plugin/  ← interfaces + registry

Community plugins can implement these interfaces to support different environments (browser, other IDEs) or different agent types.

Test plan

  • Extension builds (npm run build) — verified ✅
  • F5 Extension Dev Host: opens pixel office, agents spawn via + Agent
  • Agent JSONL monitoring works (tool start/done/waiting bubbles appear)
  • Layout save/load/import/export works
  • Settings (sound toggle) persists across reloads
  • Agent restoration after window reload

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pixel-agents Ready Ready Preview, Comment Mar 18, 2026 5:03pm

NNTin and others added 3 commits March 18, 2026 17:59
- 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>
@NNTin NNTin force-pushed the feat/plugin-system-for-runtime-extensibility branch from fc1daaf to 6242e5d Compare March 18, 2026 17:03
@NNTin
Copy link
Owner Author

NNTin commented Mar 18, 2026

❗ Collision ❗
In VS Code it is not possible to write a plugin for a plugin.

What is possible is to write something that collaborates with it. E.g. over an API: WebSocket, RPC, ... .
Therefore need to re-evaluate the approach to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant