ToolBox Architecture — VS Code Extension
How the Power Platform ToolBox VS Code Extension is structured, and how it hosts tools inside VS Code webviews.
Overview
The extension follows a two-part architecture common to VS Code extensions: an extension host process (Node.js, runs in the background) and one or more webviews (Chromium-based, render UI), communicating over VS Code's postMessage bridge.
Extension Host
Source lives under src/:
- Name
extension.ts- Description
Entry point — activates the extension, registers commands, views, and panels.
- Name
managers/- Description
Business logic: connections, tool installation, marketplace, settings.
- Name
panels/- Description
Webview panel wrappers —
connectionPanel.ts,cspPermissionsPanel.ts,toolHostPanel.ts,toolPanel.ts.
- Name
providers/- Description
Tree data providers for the Activity Bar views (connections, installed tools, marketplace).
- Name
registrations/- Description
Command registrations (
pptb.tools.launch,pptb.connections.connect, etc.).
- Name
statusbar/- Description
Status bar items (e.g. active connection indicator).
- Name
polyfill/toolboxAPI.js- Description
The
toolboxAPIruntime injected into each tool's webview.
Webview UI
Source lives under webviews/, written in React/TypeScript:
- connection/ — connection management UI
- toolHost/ — hosts the list of installed/marketplace tools and launches them
- toolTool/ — renders an individual tool inside its own webview
Tool Bridge
A tool calls window.toolboxAPI.* the same way it would in the Desktop App. The polyfill/toolboxAPI.js runtime translates each call into an invoke() message sent via postMessage to toolPanel.ts in the extension host, which handles it in a command switch and posts the result back.
Current Parity Notes
The extension implements most of the Desktop App's tool-facing surface, but a few capabilities are still rolling out. See the Feature Comparison table in the vscode-extension repo for the full breakdown. Notably, toolPanel.ts currently throws "Tool invocation is not yet available in VS Code host." for launchTool() — Inter-Tool Invocation, Agent Integration (MCP), headless invocation, and the standalone CLI are Desktop-only today. These are flagged with a