Workbench Remote Components
A Remote Component is a View Extension rendering mode for plugin-owned custom UI inside Assistant Workbench. The View Extension defines where the view appears, who can see it, and which capabilities it may use. The Remote Component defines how those capabilities are presented and used inside an iframe. It is not a standalone plugin type and does not replace the server-side View Provider.When to use one
Use a Remote Component when the Workbench needs:- A multi-panel business Workbench, editor, or canvas.
- Complex interactions such as drag and drop, a timeline, or graphical editing.
- Several paged datasets with targeted refresh behavior.
- Coordination with Assistant chat, file previews, or other Workbench views.
Recommended project structure
Separate maintained source from generated assets:src/**/*.tsandsrc/**/*.tsxare the source of truth.app.jsandapp.cssare generated assets; do not edit them manually.- The plugin build must generate and copy the Remote Component assets.
- Add a dedicated TypeScript typecheck for the remote source.
vue and esm runtimes; the current product executes iframe isolation.
Define stable keys
<providerKey>__<manifestKey>. component.entry is a provider-local entry key, not a browser URL.
Register the View Provider
The View Provider returns the Workbench manifest and handles its data and actions:REVIEW_FEATURE. The Workbench host exposes the view only after the Assistant connects that middleware.
For a fixed Workbench entry, return the same manifest from agent.workbench.fixed and add workbench.fixed and menu configuration.
Return the Remote Component entry
The provider returns a complete HTML document fromgetRemoteComponentEntry(). Use the Plugin SDK HTML helper:
Implement the frontend entry
Install the bridge listener first, then render business UI afterinit arrives:
Data and actions
A Remote Component does not call platform APIs directly. It requests data through the host bridge:parameters accepts only scalar values or scalar arrays; do not send nested filter objects directly.
Run mutations through declared executeAction or executeFileAction capabilities. A successful action may return refresh: true; a complex Remote Component can instead refresh only the affected region from the returned business identifier.
Theme, components, and layout
- Build buttons, inputs, dialogs, tables, and other standard controls with
@xpert-ai/plugin-shadcn-ui. - Load the shared stylesheet once and call
installShadcnThemeVars()after applying the host--xui-*tokens. - Compile Tailwind against the Remote Component TSX and emit production
app.css. - Keep
html,body,#root, and the outer application atwidth: 100%andheight: 100%. - Set
min-width: 0,min-height: 0, and controlled overflow through flex and grid ancestors. - Make navigation or inspector panels collapsible when they compete with the primary workspace.
- Use
AlertDialogfor consequential confirmations; do not use browser-native confirmation dialogs.
Internationalization
Treat hostinit.locale as authoritative and normalize it once at the entry boundary. Maintain at least en-US and zh-Hans; do not map every zh-* locale to Simplified Chinese.
Components should use semantic translation keys and shared Intl formatters, without locale === ... copy branches in JSX. Keep { en_US, zh_Hans } localized objects at the manifest boundary.
State and debugging
- Keep ephemeral UI state in React state or refs.
- Persist durable business state through the host bridge.
- Do not read or write
localStorageorsessionStorage. - Gate detailed logs with host-provided
init.debug.enabled; keep them off by default in production. - Never log tokens, tenant or organization IDs, file contents, full snapshots, or personally sensitive data.
Optional: open from a tool result
A persistent Workbench entry is listed from its host slot. Usexpert.extension_view only when the view should appear after a particular tool call:
Validation checklist
- The View Provider is registered in the plugin server module.
- The manifest includes
sourceand the correctactivation.requiredFeatures. - Removing the owning Feature removes both the Agent tools and the View.
- Remote entry, local view, and public view keys are stable and tested.
- The production build regenerates
app.jsandapp.cssand checks for stale output. - Iframe messages validate the source window, protocol version, instance ID, and request ID.
- Data, JSON actions, file actions, client commands, and host events are declared in the manifest.
- Provider reads and mutations enforce tenant, organization, user, and business authorization.
- Theme installation works in light, dark, and every supported density.
- English and Chinese catalogs keep matching keys and interpolation parameters.
- Workbench E2E loads the real generated assets.
- Platform-dependent permissions, files, and installation behavior receive an installed-host pass.