@blade-hq/agent-client 2610.0.0-beta.87 → 2610.0.0-beta.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/socket.d.ts CHANGED
@@ -4,6 +4,8 @@ import type { ClientToServerEvents, ServerToClientEvents } from "./types/socket-
4
4
  export type TypedSocket = Socket<ServerToClientEvents, ClientToServerEvents>;
5
5
  export interface CreateSocketOptions extends AuthOptions {
6
6
  baseUrl: string;
7
+ /** MV3 service workers have WebSocket but no XMLHttpRequest. */
8
+ transports?: ("polling" | "websocket")[];
7
9
  path?: string;
8
10
  }
9
11
  export declare function createSocket(options: CreateSocketOptions): TypedSocket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blade-hq/agent-client",
3
- "version": "2610.0.0-beta.87",
3
+ "version": "2610.0.0-beta.88",
4
4
  "description": "Blade Agent 框架无关客户端:会话实时状态机、REST 通道、弹窗登录、页面协作。浏览器与 Node.js 通用。",
5
5
  "repository": {
6
6
  "type": "git",
package/public-api.md CHANGED
@@ -297,6 +297,7 @@ models: ModelsResource
297
297
  onSocketReplaced: (listener: () => void) => () => void
298
298
  options: BladeClientOptions
299
299
  plugins: PluginsResource
300
+ requestCommand: (event: string, payload: Record<string, unknown>, timeoutMs: number) => Promise<Record<string, unknown>>
300
301
  responseFromInit: (path: string, init?: RequestInit) => Promise<Response>
301
302
  sessions: SessionsResource
302
303
  setBaseUrl: (baseUrl: string) => void
@@ -312,6 +313,7 @@ token: string | null
312
313
 
313
314
  ```ts
314
315
  baseUrl: string
316
+ commandTransport: ((event: string, payload: Record<string, unknown>, send: () => Promise<Record<string, unknown>>) => Promise<Record<string, unknown>>) | undefined
315
317
  fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
316
318
  onRefreshSuccess: (() => void | Promise<void>) | undefined
317
319
  socketToken: string | (() => string | null | undefined) | undefined
@@ -647,6 +649,7 @@ createSocket: (options: CreateSocketOptions) => TypedSocket
647
649
  baseUrl: string
648
650
  path: string | undefined
649
651
  token: string | (() => string | null | undefined) | undefined
652
+ transports: ("polling" | "websocket")[] | undefined
650
653
  ```
651
654
 
652
655
  ## `DEFAULT_REPLAY_SPEED` (const)