mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
Fix browser wait during daemon startup
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,7 +4,8 @@ use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use bsk_protocol::system::{
|
||||
HandshakeParams, HandshakeResult, PingParams, PingResult, StatusParams, StatusResult,
|
||||
BrowserListParams, HandshakeParams, HandshakeResult, PingParams, PingResult, StatusParams,
|
||||
StatusResult,
|
||||
};
|
||||
use bsk_protocol::tools::*;
|
||||
use bsk_protocol::{CancelParams, CancelResult};
|
||||
@@ -34,6 +35,7 @@ fn main() {
|
||||
dump!(PingResult, "system_ping_result");
|
||||
dump!(StatusParams, "system_status_params");
|
||||
dump!(StatusResult, "system_status_result");
|
||||
dump!(BrowserListParams, "browser_list_params");
|
||||
|
||||
dump!(CancelParams, "cancel_params");
|
||||
dump!(CancelResult, "cancel_result");
|
||||
|
||||
@@ -12,8 +12,8 @@ pub use error::{DecodeError, ErrorCode, RpcError};
|
||||
pub use frame::{EventFrame, EventKind, Frame, RequestFrame, ResponseBody, ResponseFrame, RpcId};
|
||||
pub use method::Method;
|
||||
pub use system::{
|
||||
BrowserPeerInfo, BrowserStatusEntry, HandshakeCompat, HandshakeParams, HandshakeResult,
|
||||
PingParams, PingResult, SessionStatusEntry, StatusParams, StatusResult, VersionSkewEntry,
|
||||
compare_protocol, evaluate_handshake_compat,
|
||||
BrowserListParams, BrowserPeerInfo, BrowserStatusEntry, HandshakeCompat, HandshakeParams,
|
||||
HandshakeResult, PingParams, PingResult, SessionStatusEntry, StatusParams, StatusResult,
|
||||
VersionSkewEntry, compare_protocol, evaluate_handshake_compat,
|
||||
};
|
||||
pub use tools::*;
|
||||
|
||||
@@ -531,9 +531,25 @@ pub struct SessionStatusEntry {
|
||||
pub created_at_ms: i64,
|
||||
}
|
||||
|
||||
/// `system.status` request payload. Empty.
|
||||
/// `system.status` request payload.
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct StatusParams {}
|
||||
pub struct StatusParams {
|
||||
/// When set, the daemon polls the browser registry for up to this many
|
||||
/// milliseconds before returning a snapshot. Only applies while zero
|
||||
/// browsers are registered; an existing connection returns immediately.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub wait_for_browser_ms: Option<u64>,
|
||||
}
|
||||
|
||||
/// `browser.list` request payload.
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct BrowserListParams {
|
||||
/// When set, the daemon polls the browser registry for up to this many
|
||||
/// milliseconds before returning a list. Only applies while zero browsers
|
||||
/// are registered; an existing connection returns immediately.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub wait_for_browser_ms: Option<u64>,
|
||||
}
|
||||
|
||||
/// One entry per connected browser whose protocol version drifts from
|
||||
/// the daemon's (same major). Surfaced in `system.status` for
|
||||
|
||||
Reference in New Issue
Block a user