feat(m3.8): browser workflow nodes#35
Merged
Merged
Conversation
Adds browser nodes to @tronbrowser/workflow-engine (PRD §21.1), driving
automation from a workflow graph with the same SDK primitives as the CLI/MCP.
- nodes/browser.ts: one BrowserNode handler dispatching config.action ->
open/snapshot/click/fill/type/extract/screenshot/analyze/runTask on a shared
SDK page. Mutating actions output a fresh snapshot; screenshot writes the file
and outputs its path. Missing required config throws a BrowserNodeError with
recovery guidance. sdkBrowser() is the default managed-session backing.
- runner.ts: runWorkflow walks the graph from entry, threads each output into
ctx.variables[nodeId], and closes the browser on completion. exportWorkflowJson
serializes results; a failed node reports { nodeId, error, recovery } (e.g. a
stale ref suggests inserting a snapshot node).
- index.ts: richer BrowserNodeConfig (action + url/ref/value/mode/path/goal/data).
Tests (+10): every browser action against a fake page, and the runner
(graph execution + output threading + browser close, JSON export, failure with
recovery, missing-handler). Full workspace suite green in CI order.
Completes the M3 milestones (M3.1–M3.8).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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.
Implements M3.8 — workflow-engine integration (PRD §21.1), the final M3 milestone. Base
main.What's here
nodes/browser.ts— oneBrowserNodehandler dispatchingconfig.action→open/snapshot/click/fill/type/extract/screenshot/analyze/runTaskon a shared SDK page (same primitives as CLI/MCP). Mutating actions output a fresh snapshot; screenshot writes the file and outputs its path. Missing config throws aBrowserNodeErrorwith recovery guidance.sdkBrowser()is the default managed-session backing.runner.ts—runWorkflowwalks the graph fromentry, threads each output intoctx.variables[nodeId], and closes the browser on completion.exportWorkflowJsonserializes results; a failed node reports{ nodeId, error, recovery: { recoverable, suggestion } }(e.g. a stale ref → "insert a snapshot node").index.ts— richerBrowserNodeConfig.Acceptance criteria (PRD §22)
Verification — +10 tests
Scope
Library milestone — no CLI/dispatcher wiring. Runner is linear-first (
next[0]); branching builds on the sameNodeHandlercontract. Seedocs/workflow-nodes.md.This completes M3.1–M3.8. 🎉
🤖 Generated with Claude Code