@blade-hq/agent-client 2610.0.0-beta.4 → 2610.0.0-beta.41

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,2 @@
1
+ /** Return true for non-null, non-array objects. */
2
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
@@ -32,6 +32,8 @@ export declare namespace ChatSendPayloadSchema {
32
32
  [k: string]: unknown;
33
33
  } | null);
34
34
  type CompactionRatio = (number | null);
35
+ type NativeApprovalPolicy = (("unlessTrusted" | "never") | null);
36
+ type KbIds = (number[] | null);
35
37
  interface ChatSendPayload {
36
38
  session_id: SessionId;
37
39
  message: Message;
@@ -48,6 +50,8 @@ export declare namespace ChatSendPayloadSchema {
48
50
  runtime_env?: RuntimeEnv;
49
51
  app_context?: AppContext;
50
52
  compaction_ratio?: CompactionRatio;
53
+ native_approval_policy?: NativeApprovalPolicy;
54
+ kb_ids?: KbIds;
51
55
  [k: string]: unknown;
52
56
  }
53
57
  interface Message {
@@ -72,9 +76,11 @@ export type ChatStopPayload = ChatStopPayloadSchema.ChatStopPayload;
72
76
  export declare namespace ChatAppendPayloadSchema {
73
77
  type SessionId = string;
74
78
  type Message = string;
79
+ type ClientRequestId = (string | null);
75
80
  interface ChatAppendPayload {
76
81
  session_id: SessionId;
77
82
  message: Message;
83
+ client_request_id?: ClientRequestId;
78
84
  [k: string]: unknown;
79
85
  }
80
86
  }
@@ -93,14 +99,12 @@ export declare namespace SessionSubscribePayloadSchema {
93
99
  type EventFormat = "raw";
94
100
  type AfterSequence = number;
95
101
  type Resume = boolean;
96
- type StreamTokens = boolean;
97
102
  interface SessionSubscribePayload {
98
103
  session_id: SessionId;
99
104
  mode?: Mode;
100
105
  event_format?: EventFormat;
101
106
  after_sequence?: AfterSequence;
102
107
  resume?: Resume;
103
- stream_tokens?: StreamTokens;
104
108
  [k: string]: unknown;
105
109
  }
106
110
  }
@@ -116,7 +120,6 @@ export declare namespace SessionSubscribeBatchPayloadSchema {
116
120
  type EventFormat = "raw";
117
121
  type AfterSequence = number;
118
122
  type Resume = boolean;
119
- type StreamTokens = boolean;
120
123
  interface SessionSubscribeBatchPayload {
121
124
  sessions: Sessions;
122
125
  [k: string]: unknown;
@@ -127,7 +130,6 @@ export declare namespace SessionSubscribeBatchPayloadSchema {
127
130
  event_format?: EventFormat;
128
131
  after_sequence?: AfterSequence;
129
132
  resume?: Resume;
130
- stream_tokens?: StreamTokens;
131
133
  [k: string]: unknown;
132
134
  }
133
135
  }
@@ -183,6 +185,14 @@ export declare namespace ChatEndPayloadSchema {
183
185
  }
184
186
  }
185
187
  export type ChatEndPayload = ChatEndPayloadSchema.ChatEndPayload;
188
+ export declare namespace SessionCreatedPayloadSchema {
189
+ type SessionId = string;
190
+ interface SessionCreatedPayload {
191
+ session_id: SessionId;
192
+ [k: string]: unknown;
193
+ }
194
+ }
195
+ export type SessionCreatedPayload = SessionCreatedPayloadSchema.SessionCreatedPayload;
186
196
  export declare namespace SessionUpdatedPayloadSchema {
187
197
  type SessionId = string;
188
198
  type Model = (string | null);
@@ -270,6 +280,20 @@ export declare namespace TurnEventsPayloadSchema {
270
280
  }
271
281
  }
272
282
  export type TurnEventsPayload = TurnEventsPayloadSchema.TurnEventsPayload;
283
+ export declare namespace TurnTimingPayloadSchema {
284
+ type SessionId = string;
285
+ type LoopName = string;
286
+ type TurnId = string;
287
+ type FirstTokenDeliveryMs = number;
288
+ interface TurnTimingPayload {
289
+ session_id: SessionId;
290
+ loop_name: LoopName;
291
+ turn_id: TurnId;
292
+ first_token_delivery_ms: FirstTokenDeliveryMs;
293
+ [k: string]: unknown;
294
+ }
295
+ }
296
+ export type TurnTimingPayload = TurnTimingPayloadSchema.TurnTimingPayload;
273
297
  export declare namespace AsrReadyPayloadSchema {
274
298
  type RequestId = string;
275
299
  type Provider = string;
@@ -405,11 +429,13 @@ export interface ServerToClientEvents {
405
429
  "chat:start": (payload: ChatStartPayload) => void;
406
430
  "chat:end": (payload: ChatEndPayload) => void;
407
431
  "chat:append:ack": (payload: unknown) => void;
432
+ "session:created": (payload: SessionCreatedPayload) => void;
408
433
  "session:updated": (payload: SessionUpdatedPayload) => void;
409
434
  "workspace:files_changed": (payload: WorkspaceFilesChangedPayload) => void;
410
435
  "system:error": (payload: SystemErrorPayload) => void;
411
436
  "system:notification": (payload: SystemNotificationPayload) => void;
412
437
  "turn:events": (payload: TurnEventsPayload) => void;
438
+ "turn:timing": (payload: TurnTimingPayload) => void;
413
439
  "task:updated": (payload: unknown) => void;
414
440
  "task:synced": (payload: unknown) => void;
415
441
  "artifact:created": (payload: unknown) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blade-hq/agent-client",
3
- "version": "2610.0.0-beta.4",
3
+ "version": "2610.0.0-beta.41",
4
4
  "description": "Blade Agent 框架无关客户端:会话实时状态机、REST 通道、弹窗登录、页面协作。浏览器与 Node.js 通用。",
5
5
  "repository": {
6
6
  "type": "git",