mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
feat: support Agent Window sizing (session start --width/--height, window resize) (#52)
- `bsk session start --width <px> --height <px>` opens the Agent Window with the given outer size (chrome.windows.create) - new `bsk window resize --session <id> --width <px> --height <px>` resizes the Agent Window at runtime (chrome.windows.update) - both validated on CLI, daemon and extension sides (100..=7680 CSS px) - protocol: new tool.window_resize method (BrowserMutation) and optional width/height on tool.session_start params; schemas regenerated
This commit is contained in:
@@ -401,6 +401,8 @@ pub async fn start_session(
|
||||
sessions: &Arc<SessionRegistry>,
|
||||
queues: &Arc<ToolQueueRegistry>,
|
||||
requested: Option<&str>,
|
||||
// Optional Agent Window outer size as `(width, height)` CSS pixels.
|
||||
window_size: Option<(u32, u32)>,
|
||||
connect_wait: Duration,
|
||||
timeout_dur: Duration,
|
||||
) -> Result<Session, StartSessionError> {
|
||||
@@ -427,6 +429,8 @@ pub async fn start_session(
|
||||
let params = SessionStartParams {
|
||||
session_id: session_id.0.clone(),
|
||||
browser_instance_id: Some(client.id.0.clone()),
|
||||
width: window_size.map(|(width, _)| width),
|
||||
height: window_size.map(|(_, height)| height),
|
||||
};
|
||||
let rpc_id = next_rpc_id("sess-start");
|
||||
let request = RequestFrame {
|
||||
|
||||
Reference in New Issue
Block a user