web Plugin
Structured web search, document reading, and Playwright/CDP browser capabilities through replaceable providers
web Plugin
web is a real web-capability plugin. It no longer only injects methodology or returns installation prompts. It composes providers explicitly supplied by the host and does not bind the SDK to a search vendor, cloud browser, or Computer Use model.
Playwright/CDP
import {
PlaywrightBrowserProvider,
WebPlugin,
} from "@downcity/plugins/web";
const web = new WebPlugin({
browser: new PlaywrightBrowserProvider({
cdp_url: "http://127.0.0.1:9222",
}),
});PlaywrightBrowserProvider connects to an already-running Chrome/Chromium CDP endpoint. It does not download browsers or execute installation commands. Browserbase, Browserless, Kitesurf, and other CDP-compatible backends can implement the same BrowserProvider protocol.
Actions
| Action | Purpose |
|---|---|
search | Delegate to the configured search provider |
open | Read a known URL through the configured document provider |
browser_create_session | Create a browser session |
browser_observe | Read URL, title, visible text, and an optional screenshot |
browser_act | Run goto, click, fill, press, scroll, or wait |
browser_semantic_act | Run a natural-language action through a Stagehand, Computer Use, or other semantic adapter |
browser_extract | Extract text from a CSS selector or the body |
browser_semantic_extract | Extract content through a semantic provider |
browser_close_session | Close a session and release its page |
Provider composition
const web = new WebPlugin({
search: (input) => search_service.search(input),
open: (input) => reader_service.open(input),
browser: browser_provider,
});Semantic capabilities are injected through an adapter and are not tied to one model vendor:
import { SemanticBrowserProviderAdapter } from "@downcity/plugins/web";
const browser = new SemanticBrowserProviderAdapter({
name: "stagehand",
browser: playwright_browser,
semantic_act: (input) => stagehand_service.act(input),
semantic_extract: (input) => stagehand_service.extract(input),
});Computer Use can use ComputerUseBrowserProviderAdapter. It captures an observation with a screenshot before handing the goal to an OpenAI, Anthropic, Gemini, or custom model loop. The model never receives Playwright objects.
Use search or HTTP reading first. Create a browser for dynamic rendering, logged-in state, or interaction. Stagehand can be added inside a provider for semantic actions, while Computer Use should remain a visual fallback for pages that cannot be handled reliably through the DOM.
Lifecycle and safety
WebPluginrequires at least one configured provider.- The provider owns browser sessions and is disposed when the Agent or Plugin is disposed.
browser_actexposes deterministic browser actions. Host approval is required for consequential actions such as submit, send, purchase, upload, or delete.- Playwright
Browser,Page, andBufferobjects never cross the Plugin action boundary; results are JSON-serializable. - Skill installation, discovery, and
SKILL.mdloading remain responsibilities ofSkillPlugin.