Add embedding seams: BrowserManager::from_client, output capture, pluggable artifact writer - #2
Closed
Glavin001 wants to merge 4 commits into
Closed
Conversation
Co-Authored-By: glavin@coframe.com <glavin.wiechert@gmail.com>
Co-Authored-By: glavin@coframe.com <glavin.wiechert@gmail.com>
Co-Authored-By: glavin@coframe.com <glavin.wiechert@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: glavin@coframe.com <glavin.wiechert@gmail.com>
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.
Summary
Stacked on #1. Adds the three remaining seams a library host needs to embed the browser-automation core without a filesystem, a spawnable Chrome, or a process stdout. No behavior change on the native CLI path: every seam defaults to exactly what the code did before.
BrowserManager::from_client(native/browser.rs) — the body ofconnect_cdp_innerafter the WebSocket connect, extracted so hosts that build aCdpClientviaCdpClient::from_transport(#1) can get a fully initialized manager (target discovery/attach or direct-page setup) without a native WebSocket:Output capture (
output.rs) — all printing in the output module now goes throughoutln!/out!/errln!macros that write to the process streams by default, or into a buffer while a capture is active:This is what gives embedders byte-for-byte CLI stdout parity: they reuse the real formatting code instead of reimplementing it. The macro conversion is mechanical (
println!→outln!etc., 139 sites, same format strings).Pluggable artifact writer (
artifacts.rs, new) — screenshot/PDF/HAR/diff-image writes route throughartifacts::write(path, bytes), which falls back tostd::fs::writeunless a host installs a writer viaset_artifact_writer(e.g. to persist into object storage on wasm, wherestd::fsfails at runtime). Path selection and response shapes ({ "path": ... }) are unchanged.Verification
From
cli/:cargo check --all-targets,cargo check --lib --target wasm32-unknown-unknown,cargo clippy --all-targets -- -D warnings,cargo fmt -- --check,cargo test(1065 passed, 0 failed) all green.Link to Devin session: https://app.devin.ai/sessions/3a5dcc4bfa3d492dbe280f24b4de6cc0
Requested by: @Glavin001
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.