Skip to content

feat: add bsk console command#7

Merged
BB-fat merged 1 commit into
mainfrom
feat/console-command
Jul 7, 2026
Merged

feat: add bsk console command#7
BB-fat merged 1 commit into
mainfrom
feat/console-command

Conversation

@BB-fat

@BB-fat BB-fat commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Implements the bsk console portion of #2Feature request: read console logs & network activity. The bsk network command is left for a follow-up PR.

Summary

  • Add bsk console to read buffered browser console, log, and exception messages via CDP event capture (closes Feature request: read console logs & network activity #2, console portion only).
  • Implement per-tab ring buffers in the extension (Runtime.consoleAPICalled, Runtime.exceptionThrown, Log.entryAdded) with context-safety defaults: 50-entry limit, 1000-char text cap, optional --include-stack, and truncated flags.
  • Wire the full stack: tool.console protocol 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-protocol
  • cargo test -p bsk --test cli_parse --test tools_ipc --test session_user_interrupt
  • pnpm --dir apps/extension test src/browser-driver/__tests__/chromium-cdp.test.ts src/tools/__tests__/console.test.ts src/tools/__tests__/dispatcher.test.ts
  • Manual end-to-end validation with cargo run -p bsk -- console --session <id> against a live session

Co-authored-by: Cursor <cursoragent@cursor.com>
@BB-fat BB-fat merged commit c987e42 into main Jul 7, 2026
1 check passed
@BB-fat BB-fat deleted the feat/console-command branch July 7, 2026 03:27
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: read console logs & network activity

1 participant