@blade-hq/agent-client 2610.0.0-beta.47 → 2610.0.0-beta.49

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.
@@ -0,0 +1,11 @@
1
+ /** Scheduling policy for read-only polling; never sends or replays a request. */
2
+ export declare class PollingBackoff {
3
+ private readonly intervalMs;
4
+ private failures;
5
+ private nextAt;
6
+ constructor(intervalMs: number);
7
+ reset(): void;
8
+ failed(error: unknown): void;
9
+ /** Zero means ready, false means stop, otherwise wait at least this many ms. */
10
+ waitMs(): number | false;
11
+ }
@@ -19,4 +19,8 @@ export declare class ChatProjectsResource {
19
19
  name?: string;
20
20
  instructions?: string;
21
21
  }): Promise<ChatProject>;
22
+ delete(projectId: string): Promise<{
23
+ deleted: boolean;
24
+ deleted_sessions: number;
25
+ }>;
22
26
  }
@@ -8,13 +8,18 @@ import { type SessionDefinition } from "../session/definition";
8
8
  import type { SessionProfile } from "../types/sdk-profile";
9
9
  export interface SessionPlugin {
10
10
  name: string;
11
- installed: boolean;
11
+ /** Whether BH lists this plugin for the current user; null means BH was unavailable. */
12
+ installed: boolean | null;
13
+ /** Persisted session choice, independent of preparation success. */
12
14
  active: boolean;
15
+ /** Previously prepared skills may remain after deselection. */
13
16
  projected: boolean;
14
17
  projection_source?: string | null;
15
18
  status: string;
16
19
  reason?: string | null;
17
20
  }
21
+ /** Selection/preparation result; installed facts are obtained from the BH-backed list. */
22
+ export type SessionPluginActivation = Pick<SessionPlugin, "name" | "active" | "status" | "reason">;
18
23
  export interface CreateSessionRequest {
19
24
  intent?: string;
20
25
  template_id?: TemplateId;
@@ -229,7 +234,7 @@ export declare class SessionsResource {
229
234
  sync_pending: boolean;
230
235
  }>;
231
236
  setSessionPluginActivation(sessionId: string, name: string, active: boolean, init?: RequestInit): Promise<{
232
- plugin: SessionPlugin;
237
+ plugin: SessionPluginActivation;
233
238
  sync_version: number;
234
239
  }>;
235
240
  /** 创建新会话并直接连接,返回可收发消息的 AgentSession。 */
@@ -22,6 +22,7 @@ export declare class SessionHub {
22
22
  private readonly connectionListeners;
23
23
  private bound;
24
24
  private hasConnected;
25
+ private readonly authBusyReconnect;
25
26
  constructor(client: BladeClient);
26
27
  /** 当前 Socket.IO 连接状态。 */
27
28
  getConnection(): ConnectionStatus;
@@ -0,0 +1,9 @@
1
+ /** Return the server-requested delay for a typed temporary auth rejection. */
2
+ export declare function authBusyRetryDelayMs(error: unknown): number | null;
3
+ /** One pending manual reconnect for Socket.IO CONNECT_ERROR auth overloads. */
4
+ export declare class AuthBusyReconnect {
5
+ private timer;
6
+ get pending(): boolean;
7
+ schedule(error: unknown, reconnect: () => void): boolean;
8
+ cancel(): void;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blade-hq/agent-client",
3
- "version": "2610.0.0-beta.47",
3
+ "version": "2610.0.0-beta.49",
4
4
  "description": "Blade Agent 框架无关客户端:会话实时状态机、REST 通道、弹窗登录、页面协作。浏览器与 Node.js 通用。",
5
5
  "repository": {
6
6
  "type": "git",
package/public-api.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
4
4
  > 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
5
5
 
6
- 共 177 个公开声明。
6
+ 共 181 个公开声明。
7
7
 
8
8
  ## `acceptedPostChatFollowupCompletesLatestRun` (function)
9
9
 
@@ -164,6 +164,20 @@ cli: AppCliDefinition | undefined
164
164
  getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
165
165
  ```
166
166
 
167
+ ## `AuthBusyReconnect` (class)
168
+
169
+ ```ts
170
+ cancel: () => void
171
+ pending: boolean
172
+ schedule: (error: unknown, reconnect: () => void) => boolean
173
+ ```
174
+
175
+ ## `authBusyRetryDelayMs` (function)
176
+
177
+ ```ts
178
+ authBusyRetryDelayMs: (error: unknown) => number | null
179
+ ```
180
+
167
181
  ## `AuthResource` (class)
168
182
 
169
183
  ```ts
@@ -318,6 +332,7 @@ updated_at: string
318
332
 
319
333
  ```ts
320
334
  create: (payload: { name: string; instructions?: string; }) => Promise<ChatProject>
335
+ delete: (projectId: string) => Promise<{ deleted: boolean; deleted_sessions: number; }>
321
336
  list: () => Promise<ChatProject[]>
322
337
  update: (projectId: string, payload: { name?: string; instructions?: string; }) => Promise<ChatProject>
323
338
  ```
@@ -942,6 +957,14 @@ services: Partial<Record<"os" | "hub" | "agent" | "oauth" | "llmGateway" | "gite
942
957
  export type PlatformServiceName = (typeof PLATFORM_SERVICE_NAMES)[number]
943
958
  ```
944
959
 
960
+ ## `PollingBackoff` (class)
961
+
962
+ ```ts
963
+ failed: (error: unknown) => void
964
+ reset: () => void
965
+ waitMs: () => number | false
966
+ ```
967
+
945
968
  ## `PostChatFollowup` (interface)
946
969
 
947
970
  ```ts
@@ -1330,7 +1353,7 @@ SessionInfo = type({
1330
1353
 
1331
1354
  ```ts
1332
1355
  active: boolean
1333
- installed: boolean
1356
+ installed: boolean | null
1334
1357
  name: string
1335
1358
  projected: boolean
1336
1359
  projection_source: string | null | undefined
@@ -1338,6 +1361,12 @@ reason: string | null | undefined
1338
1361
  status: string
1339
1362
  ```
1340
1363
 
1364
+ ## `SessionPluginActivation` (type)
1365
+
1366
+ ```ts
1367
+ export type SessionPluginActivation = Pick<SessionPlugin, "name" | "active" | "status" | "reason">
1368
+ ```
1369
+
1341
1370
  ## `SessionPortMapping` (interface)
1342
1371
 
1343
1372
  ```ts
@@ -1420,7 +1449,7 @@ revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }
1420
1449
  rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
1421
1450
  searchOwnedContent: (params: { q: string; limit?: number; }) => Promise<GlobalSearchResult>
1422
1451
  setSessionEnv: (sessionId: string, env: Record<string, string>) => Promise<SessionDetail>
1423
- setSessionPluginActivation: (sessionId: string, name: string, active: boolean, init?: RequestInit) => Promise<{ plugin: SessionPlugin; sync_version: number; }>
1452
+ setSessionPluginActivation: (sessionId: string, name: string, active: boolean, init?: RequestInit) => Promise<{ plugin: SessionPluginActivation; sync_version: number; }>
1424
1453
  shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
1425
1454
  startReplaySession: (sourceSessionId: string, speed?: ReplaySpeed) => Promise<{ session_id: string; }>
1426
1455
  stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTaskStopResult>