feat: add bsk console command#7
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 7, 2026
hjxccc
added a commit
to hjxccc/BrowserSkill
that referenced
this pull request
Jul 7, 2026
Add `bsk network` as a sibling of the `console` command from Tencent#7, reading the buffered network responses / failures for a tab. Fills the remaining half of the request in Tencent#2 (console landed in Tencent#7; network did not). Mirrors the console command's conventions exactly: bsk network --session <id> [--tab-id N] [--since C] [--limit N] [--max-text-chars N] The extension enables `Network` on attach (best-effort) and buffers `responseReceived` / `loadingFailed` events per tab with a monotonic sequence, correlating them to `requestWillBeSent` for method/URL. Reads are cursor-paginated (`since` -> `next_since`) and bounded (`limit`, `max_text_chars`) for agent-context safety, same as console. Entries carry the real HTTP status code (response) or the CDP failure reason (failure) — things `performance.getEntriesByType('resource')` can't give. Classified read-only (pass-through under the pending-interrupt gate); defaults to the Agent Window's active tab. Wires bsk-protocol (Method + params/result/entry structs + schema), bsk-cli (network subcommand + daemon dispatch allow-list) and the extension (handler + dispatcher route), with unit / parse / IPC tests paralleling the console command. Refs Tencent#2.
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 the
bsk consoleportion of #2 — Feature request: read console logs & network activity. Thebsk networkcommand is left for a follow-up PR.Summary
bsk consoleto read buffered browser console, log, and exception messages via CDP event capture (closes Feature request: read console logs & network activity #2, console portion only).Runtime.consoleAPICalled,Runtime.exceptionThrown,Log.entryAdded) with context-safety defaults: 50-entry limit, 1000-char text cap, optional--include-stack, andtruncatedflags.tool.consoleprotocol types, extension handler/dispatcher, CLI command, and daemon IPC forwarding. Classified as read-only so it passes through pending user interrupts.Test plan
cargo test -p bsk-protocolcargo test -p bsk --test cli_parse --test tools_ipc --test session_user_interruptpnpm --dir apps/extension test src/browser-driver/__tests__/chromium-cdp.test.ts src/tools/__tests__/console.test.ts src/tools/__tests__/dispatcher.test.tscargo run -p bsk -- console --session <id>against a live session