@blade-hq/agent-client 2610.0.0-rc.0 → 2610.0.0

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.
Files changed (37) hide show
  1. package/README.md +202 -12
  2. package/dist/auth.d.ts +0 -1
  3. package/dist/blade-client.d.ts +22 -1
  4. package/dist/index.d.ts +31 -9
  5. package/dist/index.js +1851 -263
  6. package/dist/index.js.map +1 -1
  7. package/dist/polling-backoff.d.ts +11 -0
  8. package/dist/resources/chat-groups.d.ts +31 -0
  9. package/dist/resources/computers.d.ts +54 -2
  10. package/dist/resources/plugins.d.ts +43 -0
  11. package/dist/resources/sessions.d.ts +190 -1
  12. package/dist/resources/site-visits.d.ts +32 -0
  13. package/dist/rest.d.ts +8 -0
  14. package/dist/schemas/mcp-app.d.ts +30 -0
  15. package/dist/schemas/message-utils.d.ts +10 -0
  16. package/dist/schemas/message.d.ts +3 -0
  17. package/dist/schemas/projection.d.ts +25 -1
  18. package/dist/schemas/session.d.ts +7 -0
  19. package/dist/session/agent-session.d.ts +152 -18
  20. package/dist/session/definition.d.ts +6 -1
  21. package/dist/session/errors.d.ts +11 -0
  22. package/dist/session/events.d.ts +14 -2
  23. package/dist/session/history-page.d.ts +9 -0
  24. package/dist/session/hub.d.ts +1 -0
  25. package/dist/session/queue.d.ts +104 -0
  26. package/dist/session/state.d.ts +15 -1
  27. package/dist/shared/auth-busy.d.ts +9 -0
  28. package/dist/shared/projection/builder.d.ts +10 -0
  29. package/dist/shared/projection/helpers.d.ts +2 -2
  30. package/dist/shared/projection/index.d.ts +1 -1
  31. package/dist/shared/projection/state.d.ts +7 -0
  32. package/dist/shared/tool-ui-card.d.ts +60 -0
  33. package/dist/shared/type-guards.d.ts +2 -0
  34. package/dist/socket.d.ts +2 -0
  35. package/dist/types/socket-events.d.ts +186 -2
  36. package/package.json +1 -1
  37. package/public-api.md +747 -11
package/public-api.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
4
4
  > 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
5
5
 
6
- 共 162 个公开声明。
6
+ 共 247 个公开声明。
7
7
 
8
8
  ## `acceptedPostChatFollowupCompletesLatestRun` (function)
9
9
 
@@ -11,6 +11,34 @@
11
11
  acceptedPostChatFollowupCompletesLatestRun: (events: RawEvent[], updates: ProjectionUpdate[]) => boolean
12
12
  ```
13
13
 
14
+ ## `AccountComputer` (interface)
15
+
16
+ ```ts
17
+ arch: string | null | undefined
18
+ blade_home: string | null | undefined
19
+ created_at: string
20
+ daemon_version: string | null | undefined
21
+ hostname: string | null | undefined
22
+ id: string
23
+ label: string
24
+ last_seen_at: string | null | undefined
25
+ online: boolean
26
+ os: string | null | undefined
27
+ workspace: string | null | undefined
28
+ ```
29
+
30
+ ## `AccountComputerList` (interface)
31
+
32
+ ```ts
33
+ computers: AccountComputer[]
34
+ ```
35
+
36
+ ## `acknowledgeTurnEvents` (function)
37
+
38
+ ```ts
39
+ acknowledgeTurnEvents: (acknowledge?: () => void) => void
40
+ ```
41
+
14
42
  ## `ActiveCompactionState` (interface)
15
43
 
16
44
  ```ts
@@ -41,26 +69,48 @@ toolCallId: string
41
69
  ## `AgentSession` (class)
42
70
 
43
71
  ```ts
44
- append: (text: string) => void
45
72
  attach: (label: string, data: unknown) => void
46
73
  attachApp: (options: AttachAppOptions) => Promise<AppCliAttachment | null>
74
+ cancelPendingLocate: () => void
75
+ cancelQueuedMessage: (itemId: string, expectedVersion?: number) => Promise<QueueOperationResult>
47
76
  compact: () => Promise<Record<string, unknown>>
48
77
  countFiles: (dirPath?: string) => Promise<number>
78
+ deliverQueuedMessage: (itemId: string, expectedVersion: number) => Promise<QueueOperationResult>
49
79
  dispose: () => void
50
80
  downloadFile: (filePath: string, downloadName?: string) => Promise<void>
51
81
  exitReplay: () => Promise<void>
52
82
  getState: () => SessionState
83
+ hasOlderHistory: boolean
53
84
  insertText: (text: string) => void
54
85
  isDisposed: boolean
86
+ isStatic: boolean
55
87
  listDir: (dirPath?: string) => Promise<FileEntry[]>
88
+ loadOlderHistory: (options?: { beforeCommit?: () => void; }) => Promise<void>
89
+ loadTurnIndex: () => Promise<SessionTurnIndexItem[]>
90
+ locateEntry: (entryId: string) => Promise<boolean>
56
91
  off: <K extends keyof AgentSessionEvents>(name: K, handler: (event: AgentSessionEvents[K]) => void) => void
57
92
  on: <K extends keyof AgentSessionEvents>(name: K, handler: (event: AgentSessionEvents[K]) => void) => () => void
58
93
  onCommand: (action: string, handler: CommandHandler) => () => void
94
+ queueMessage: (content: string) => Promise<QueueOperationResult>
95
+ refreshQueue: () => Promise<QueueOperationResult>
96
+ reorderQueuedMessages: (expectedRevision: number, orderedIds: string[]) => Promise<QueueOperationResult>
97
+ resumeQueue: () => Promise<QueueOperationResult>
59
98
  send: (content: MessageContent, options?: SendOptions) => Promise<boolean>
60
99
  sessionId: string
61
100
  setReplaySpeed: (speed: ReplaySpeed) => Promise<void>
62
101
  stop: () => Promise<Record<string, unknown>>
63
102
  subscribe: (listener: () => void) => () => void
103
+ updateQueuedMessage: (itemId: string, expectedVersion: number, content: string) => Promise<QueueOperationResult>
104
+ ```
105
+
106
+ ## `AgentSessionError` (class)
107
+
108
+ ```ts
109
+ cause: unknown
110
+ code: string | undefined
111
+ message: string
112
+ name: "AgentSessionError"
113
+ stack: string | undefined
64
114
  ```
65
115
 
66
116
  ## `AgentSessionEventName` (type)
@@ -77,7 +127,7 @@ attachRequested: { label: string; content: string; }
77
127
  backgroundTask: { id: string; command: string; description?: string; status: "starting" | "running" | "cancelling" | "succeeded" | "failed" | "cancelled" | "lost"; failureReason?: string | null; exitCode?: number | null; elapsedSeconds: number; output?: string; }
78
128
  chatEnd: { status: string; }
79
129
  command: { action: string; payload: unknown; toolCallId?: string; }
80
- error: { message: string; }
130
+ error: { message: string; code?: string; }
81
131
  insertTextRequested: { text: string; }
82
132
  message: { message: ChatMessage; turn: TurnProjection; }
83
133
  modeChange: { mode: "planning" | "executing"; }
@@ -85,10 +135,10 @@ notification: { type: string; title: string; detail?: string; status: "info" | "
85
135
  replayMismatch: { actualMessage?: string; expectedMessage?: string; respond: (decision: "keep_replay" | "continue_replay") => void; }
86
136
  rewind: { checkpointId: string; }
87
137
  sandboxOom: { toolCallId: string; }
88
- sessionUpdated: { intent?: string; status?: SessionStatus; model?: string | null; boundSkillId?: string | null; replayState?: Record<string, unknown> | null; }
138
+ sessionUpdated: { workspacePath?: string; chatGroupId?: string | null; intent?: string; status?: SessionStatus; model?: string | null; boundSkillId?: string | null; replayState?: Record<string, unknown> | null; }
89
139
  taskListUpdated: { tasks: unknown[]; }
90
140
  toolCall: { toolCall: ToolCallInfo; turn: TurnProjection; }
91
- toolPreview: { toolCallId: string; type: "resource-html" | "resource-uri"; content: string; title: string; }
141
+ toolPreview: { sourcePath?: string; toolCallId: string; type: "resource-html" | "resource-uri" | "resource-file"; content: string; title: string; mcpApp?: McpAppData; }
92
142
  toolResult: { toolCall: ToolCallInfo; turn: TurnProjection; source: "live" | "bootstrap_replay" | "reconnect_replay"; }
93
143
  workspaceChanged: { filePath?: string; }
94
144
  ```
@@ -153,6 +203,20 @@ cli: AppCliDefinition | undefined
153
203
  getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
154
204
  ```
155
205
 
206
+ ## `AuthBusyReconnect` (class)
207
+
208
+ ```ts
209
+ cancel: () => void
210
+ pending: boolean
211
+ schedule: (error: unknown, reconnect: () => void) => boolean
212
+ ```
213
+
214
+ ## `authBusyRetryDelayMs` (function)
215
+
216
+ ```ts
217
+ authBusyRetryDelayMs: (error: unknown) => number | null
218
+ ```
219
+
156
220
  ## `AuthResource` (class)
157
221
 
158
222
  ```ts
@@ -218,6 +282,7 @@ statusText: string
218
282
  auth: AuthResource
219
283
  blob: (method: HttpMethod, path: string) => Promise<Blob>
220
284
  buildAuthedUrl: (path: string) => string
285
+ chatGroups: ChatGroupsResource
221
286
  computers: ComputersResource
222
287
  fetch: (method: HttpMethod, path: string, init?: BladeFetchInit, isRetry?: boolean) => Promise<Response>
223
288
  formData: (method: HttpMethod, path: string, form: FormData, options?: { expectOk?: boolean; onUploadProgress?: (progress: UploadProgress) => void; }) => Promise<Response>
@@ -231,10 +296,13 @@ logoutToken: () => void
231
296
  models: ModelsResource
232
297
  onSocketReplaced: (listener: () => void) => () => void
233
298
  options: BladeClientOptions
299
+ plugins: PluginsResource
300
+ requestCommand: (event: string, payload: Record<string, unknown>, timeoutMs: number) => Promise<Record<string, unknown>>
234
301
  responseFromInit: (path: string, init?: RequestInit) => Promise<Response>
235
302
  sessions: SessionsResource
236
303
  setBaseUrl: (baseUrl: string) => void
237
304
  setToken: (token: string | null) => void
305
+ siteVisits: SiteVisitsResource
238
306
  socket: () => TypedSocket
239
307
  text: (method: HttpMethod, path: string) => Promise<string>
240
308
  textFromInit: (path: string, init?: RequestInit) => Promise<string>
@@ -245,6 +313,7 @@ token: string | null
245
313
 
246
314
  ```ts
247
315
  baseUrl: string
316
+ commandTransport: ((event: string, payload: Record<string, unknown>, send: () => Promise<Record<string, unknown>>) => Promise<Record<string, unknown>>) | undefined
248
317
  fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
249
318
  onRefreshSuccess: (() => void | Promise<void>) | undefined
250
319
  socketToken: string | (() => string | null | undefined) | undefined
@@ -258,18 +327,71 @@ tokenStorage: TokenStorageMode | undefined
258
327
  buildMessageContent: (text: string, attachments: Array<{ kind: "file"; name: string; uploadedPath?: string; textContent?: string | null; mimeType?: string; }>) => MessageContent
259
328
  ```
260
329
 
330
+ ## `buildToolUiCardKey` (function)
331
+
332
+ ```ts
333
+ buildToolUiCardKey: (toolCallId: string, type: ToolUiCardContentType, content: string, sourcePath?: string) => string
334
+ ```
335
+
336
+ ## `canCancelQueuedMessage` (function)
337
+
338
+ ```ts
339
+ canCancelQueuedMessage: (item: QueuedMessage) => boolean
340
+ ```
341
+
342
+ ## `canDeliverQueuedMessage` (function)
343
+
344
+ ```ts
345
+ canDeliverQueuedMessage: (item: QueuedMessage) => boolean
346
+ ```
347
+
348
+ ## `canEditQueuedMessage` (function)
349
+
350
+ ```ts
351
+ canEditQueuedMessage: (item: QueuedMessage) => boolean
352
+ ```
353
+
261
354
  ## `canToggleComputer` (function)
262
355
 
263
356
  ```ts
264
357
  canToggleComputer: (computer: SessionComputer) => boolean
265
358
  ```
266
359
 
360
+ ## `ChatEnd` (interface)
361
+
362
+ ```ts
363
+ duration_ms: number
364
+ status: string
365
+ ```
366
+
267
367
  ## `chatErrorForDisplay` (function)
268
368
 
269
369
  ```ts
270
370
  chatErrorForDisplay: (message: string, developer?: boolean) => string
271
371
  ```
272
372
 
373
+ ## `ChatGroup` (interface)
374
+
375
+ ```ts
376
+ created_at: string
377
+ id: string
378
+ initiator: "ui" | "sdk" | null
379
+ instructions: string
380
+ name: string
381
+ session_count: number
382
+ updated_at: string
383
+ workspace_path: string
384
+ ```
385
+
386
+ ## `ChatGroupsResource` (class)
387
+
388
+ ```ts
389
+ create: (payload: { name: string; instructions?: string; initiator?: "ui" | "sdk"; }) => Promise<ChatGroup>
390
+ delete: (groupId: string, options?: { deleteWorkspace?: boolean; }) => Promise<{ deleted: boolean; deleted_sessions: number; }>
391
+ list: () => Promise<ChatGroup[]>
392
+ update: (groupId: string, payload: { name?: string; instructions?: string; }) => Promise<ChatGroup>
393
+ ```
394
+
273
395
  ## `ChatMessage` (interface)
274
396
 
275
397
  ```ts
@@ -300,6 +422,18 @@ reset: () => void
300
422
  seedSequence: (maxSeq: number) => void
301
423
  ```
302
424
 
425
+ ## `collectInlineToolUiCards` (function)
426
+
427
+ ```ts
428
+ collectInlineToolUiCards: (messages: ChatMessage[]) => InlineToolUiCardEntry[]
429
+ ```
430
+
431
+ ## `collectPreviewToolUiCards` (function)
432
+
433
+ ```ts
434
+ collectPreviewToolUiCards: (messages: ChatMessage[]) => PreviewToolUiCardEntry[]
435
+ ```
436
+
303
437
  ## `CommandEnvelope` (interface)
304
438
 
305
439
  ```ts
@@ -332,10 +466,35 @@ tokens_before: number | null | undefined
332
466
  trigger: "auto" | "manual" | "forced_retry" | null | undefined
333
467
  ```
334
468
 
469
+ ## `computerDaemonVersion` (function)
470
+
471
+ ```ts
472
+ computerDaemonVersion: (computer: SessionComputer) => string
473
+ ```
474
+
475
+ ## `computerOS` (function)
476
+
477
+ ```ts
478
+ computerOS: (computer: SessionComputer) => ComputerOS
479
+ ```
480
+
481
+ ## `ComputerOS` (type)
482
+
483
+ ```ts
484
+ export type ComputerOS = "macos" | "windows" | "linux" | "unknown"
485
+ ```
486
+
487
+ ## `computerPlatformLabel` (function)
488
+
489
+ ```ts
490
+ computerPlatformLabel: (computer: SessionComputer) => string
491
+ ```
492
+
335
493
  ## `ComputersResource` (class)
336
494
 
337
495
  ```ts
338
496
  list: (sessionId: string) => Promise<SessionComputerList>
497
+ listAccount: () => Promise<AccountComputerList>
339
498
  setEnabled: (sessionId: string, computer: string, enabled: boolean) => Promise<SessionComputer>
340
499
  ```
341
500
 
@@ -367,12 +526,20 @@ export type ConnectionStatus = "connecting" | "connected" | "reconnecting" | "di
367
526
 
368
527
  ```ts
369
528
  content: unknown
529
+ delivery_id: string | null | undefined
370
530
  display_name: string | null | undefined
371
531
  tool_call_id: string | null | undefined
372
532
  tool_name: string | null | undefined
373
533
  type: "text" | "thinking" | "tool_use" | "tool_result" | "tool_ui" | "tool_bridge" | "system_notification" | "mode_change" | "plan_status" | "ask_user_answer"
374
534
  ```
375
535
 
536
+ ## `ContentDelta` (interface)
537
+
538
+ ```ts
539
+ content: string
540
+ loop_name: string | undefined
541
+ ```
542
+
376
543
  ## `contentPreview` (function)
377
544
 
378
545
  ```ts
@@ -453,6 +620,7 @@ createInitialSessionState: (sessionId: string) => SessionState
453
620
  ```ts
454
621
  agent_runtime_id: string | null | undefined
455
622
  biz_role_id: string | null | undefined
623
+ chat_group_id: string | null | undefined
456
624
  compaction_ratio: number | null | undefined
457
625
  daemon_id: string | null | undefined
458
626
  disable_tools: string[] | null | undefined
@@ -482,6 +650,7 @@ createSocket: (options: CreateSocketOptions) => TypedSocket
482
650
  baseUrl: string
483
651
  path: string | undefined
484
652
  token: string | (() => string | null | undefined) | undefined
653
+ transports: ("polling" | "websocket")[] | undefined
485
654
  ```
486
655
 
487
656
  ## `DEFAULT_REPLAY_SPEED` (const)
@@ -513,6 +682,12 @@ iframe: HTMLIFrameElement | undefined
513
682
  EMPTY_PLATFORM_ENDPOINTS: PlatformEndpoints
514
683
  ```
515
684
 
685
+ ## `EMPTY_SESSION_QUEUE` (const)
686
+
687
+ ```ts
688
+ EMPTY_SESSION_QUEUE: SessionQueueSnapshot
689
+ ```
690
+
516
691
  ## `ExchangeCodeParams` (interface)
517
692
 
518
693
  ```ts
@@ -647,6 +822,12 @@ groupAdjacentContextRuns: (kinds: readonly (string | null)[]) => readonly (reado
647
822
  groupMessagesByLoop: (messages: ChatMessage[]) => MessageGroup[]
648
823
  ```
649
824
 
825
+ ## `hasChatRunEvent` (function)
826
+
827
+ ```ts
828
+ hasChatRunEvent: (events: RawEvent[]) => boolean
829
+ ```
830
+
650
831
  ## `HeadlessResource` (class)
651
832
 
652
833
  ```ts
@@ -655,10 +836,19 @@ runInSession: { <T = unknown>(sessionId: string, prompt: string, options: Headle
655
836
  runWithSession: { <T = unknown>(prompt: string, options: HeadlessRunOptions & { schema: JsonSchemaObject; }): Promise<HeadlessRunInSessionResult<T>>; (prompt: string, options?: HeadlessRunOptions): Promise<HeadlessRunInSessionResult<string>>; }
656
837
  ```
657
838
 
839
+ ## `HistoricalCommand` (interface)
840
+
841
+ ```ts
842
+ action: string
843
+ deliveryId: string
844
+ payload: unknown
845
+ toolCallId: string | undefined
846
+ ```
847
+
658
848
  ## `ImageUrlContentPart` (interface)
659
849
 
660
850
  ```ts
661
- image_url: { url: string; }
851
+ image_url: { url: string; source_path?: string; width?: number; height?: number; }
662
852
  type: "image_url"
663
853
  ```
664
854
 
@@ -683,12 +873,44 @@ direction: "host-to-agent"
683
873
  payload: unknown
684
874
  ```
685
875
 
876
+ ## `inferToolStatus` (function)
877
+
878
+ ```ts
879
+ inferToolStatus: (resultStr: string) => "done" | "error" | "cancelled"
880
+ ```
881
+
882
+ ## `InlineToolUiCardEntry` (interface)
883
+
884
+ ```ts
885
+ card: ToolUiCard
886
+ key: string
887
+ toolCallId: string
888
+ ```
889
+
890
+ ## `isAppDevToolUiCard` (function)
891
+
892
+ ```ts
893
+ isAppDevToolUiCard: (card: ToolUiCard, isAppDev: boolean) => boolean
894
+ ```
895
+
896
+ ## `isBackgroundWakeMessage` (function)
897
+
898
+ ```ts
899
+ isBackgroundWakeMessage: (message: Pick<ChatMessage, "blocks">) => boolean
900
+ ```
901
+
686
902
  ## `isCommandEnvelope` (function)
687
903
 
688
904
  ```ts
689
905
  isCommandEnvelope: (value: unknown) => value is CommandEnvelope
690
906
  ```
691
907
 
908
+ ## `isEntryGoneError` (function)
909
+
910
+ ```ts
911
+ isEntryGoneError: (error: unknown) => boolean
912
+ ```
913
+
692
914
  ## `isHiddenInternalMessage` (function)
693
915
 
694
916
  ```ts
@@ -701,6 +923,30 @@ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">, option
701
923
  isInboundEnvelope: (value: unknown) => value is InboundEnvelope
702
924
  ```
703
925
 
926
+ ## `isInternalStatusToolUiCard` (function)
927
+
928
+ ```ts
929
+ isInternalStatusToolUiCard: (card: { title?: string | null; } | null) => boolean
930
+ ```
931
+
932
+ ## `isMcpAppData` (function)
933
+
934
+ ```ts
935
+ isMcpAppData: (value: unknown) => value is McpAppData
936
+ ```
937
+
938
+ ## `isSessionQueueSnapshot` (function)
939
+
940
+ ```ts
941
+ isSessionQueueSnapshot: (value: unknown) => value is SessionQueueSnapshot
942
+ ```
943
+
944
+ ## `isToolUiCard` (function)
945
+
946
+ ```ts
947
+ isToolUiCard: (value: unknown) => value is ToolUiCard
948
+ ```
949
+
704
950
  ## `latestPostChatFollowup` (function)
705
951
 
706
952
  ```ts
@@ -723,6 +969,23 @@ export enum LayoutType {
723
969
  }
724
970
  ```
725
971
 
972
+ ## `LiveRevisionState` (interface)
973
+
974
+ ```ts
975
+ byTurnId: ReadonlyMap<string, number>
976
+ current: number
977
+ ```
978
+
979
+ ## `LlmResponseDone` (interface)
980
+
981
+ ```ts
982
+ content: string | null | undefined
983
+ loop_name: string | undefined
984
+ reasoning: string | null | undefined
985
+ role: string
986
+ tool_calls: { id: string; function: { name: string; arguments: string; }; }[] | undefined
987
+ ```
988
+
726
989
  ## `loadPlatformEndpoints` (function)
727
990
 
728
991
  ```ts
@@ -752,6 +1015,49 @@ token: string
752
1015
  user: { id?: string; username?: string; display_name?: string; } | undefined
753
1016
  ```
754
1017
 
1018
+ ## `McpAppArchive` (interface)
1019
+
1020
+ ```ts
1021
+ html: string
1022
+ mimeType: string
1023
+ plugin: string
1024
+ previousToolInput: Record<string, unknown> | undefined
1025
+ previousToolResult: Record<string, unknown> | undefined
1026
+ resourceMeta: Record<string, unknown>
1027
+ resourceUri: string
1028
+ sourceId: string
1029
+ toolInput: Record<string, unknown>
1030
+ toolResult: Record<string, unknown>
1031
+ ```
1032
+
1033
+ ## `McpAppContextState` (interface)
1034
+
1035
+ ```ts
1036
+ content: string
1037
+ plugin: string | null
1038
+ revision: string
1039
+ server_alias: string | null
1040
+ ```
1041
+
1042
+ ## `McpAppContextUpdate` (interface)
1043
+
1044
+ ```ts
1045
+ content: string
1046
+ expected_revision: string | null
1047
+ request_id: string
1048
+ ```
1049
+
1050
+ ## `McpAppData` (interface)
1051
+
1052
+ ```ts
1053
+ mimeType: string
1054
+ resourceMeta: Record<string, unknown>
1055
+ resourceUri: string
1056
+ sourceId: string
1057
+ toolInput: Record<string, unknown>
1058
+ toolResult: Record<string, unknown>
1059
+ ```
1060
+
755
1061
  ## `MemoryRef` (interface)
756
1062
 
757
1063
  ```ts
@@ -841,6 +1147,12 @@ content: string
841
1147
  label: string
842
1148
  ```
843
1149
 
1150
+ ## `parseQueueAck` (function)
1151
+
1152
+ ```ts
1153
+ parseQueueAck: (response: unknown, fallbackSessionId: string) => QueueOperationResult
1154
+ ```
1155
+
844
1156
  ## `PatchEnvelope` (interface)
845
1157
 
846
1158
  ```ts
@@ -851,6 +1163,14 @@ sequence: number
851
1163
  turn_id: string
852
1164
  ```
853
1165
 
1166
+ ## `PendingQuestionRef` (interface)
1167
+
1168
+ ```ts
1169
+ child_loop_name: string
1170
+ child_tool_call_id: string
1171
+ description: string | null | undefined
1172
+ ```
1173
+
854
1174
  ## `PlatformEndpoints` (interface)
855
1175
 
856
1176
  ```ts
@@ -863,6 +1183,31 @@ services: Partial<Record<"os" | "hub" | "agent" | "oauth" | "llmGateway" | "gite
863
1183
  export type PlatformServiceName = (typeof PLATFORM_SERVICE_NAMES)[number]
864
1184
  ```
865
1185
 
1186
+ ## `PluginCatalogEntry` (interface)
1187
+
1188
+ ```ts
1189
+ display_name: string | null
1190
+ icon: string | null
1191
+ installed: boolean
1192
+ name: string
1193
+ ```
1194
+
1195
+ ## `PluginsResource` (class)
1196
+
1197
+ ```ts
1198
+ catalog: (init?: RequestInit) => Promise<{ plugins: PluginCatalogEntry[]; }>
1199
+ fetchIcon: (name: string) => Promise<Blob>
1200
+ iconUrl: (name: string) => string
1201
+ ```
1202
+
1203
+ ## `PollingBackoff` (class)
1204
+
1205
+ ```ts
1206
+ failed: (error: unknown) => void
1207
+ reset: () => void
1208
+ waitMs: () => number | false
1209
+ ```
1210
+
866
1211
  ## `PostChatFollowup` (interface)
867
1212
 
868
1213
  ```ts
@@ -893,6 +1238,21 @@ bizRoleId: string | undefined
893
1238
  kind: "prepared"
894
1239
  ```
895
1240
 
1241
+ ## `prependOlder` (function)
1242
+
1243
+ ```ts
1244
+ prependOlder: (current: TurnProjection[], page: TurnProjection[]) => TurnProjection[]
1245
+ ```
1246
+
1247
+ ## `PreviewToolUiCardEntry` (interface)
1248
+
1249
+ ```ts
1250
+ blocks: ContentBlock[]
1251
+ card: ToolUiCard
1252
+ key: string
1253
+ toolCall: ToolCallInfo
1254
+ ```
1255
+
896
1256
  ## `PrimarySkillParallelMode` (interface)
897
1257
 
898
1258
  ```ts
@@ -913,6 +1273,21 @@ title: string
913
1273
  version: number
914
1274
  ```
915
1275
 
1276
+ ## `PrimarySkillStageSpec` (interface)
1277
+
1278
+ ```ts
1279
+ id: string
1280
+ name: string
1281
+ steps: PrimarySkillStepSpec[]
1282
+ ```
1283
+
1284
+ ## `PrimarySkillStepSpec` (interface)
1285
+
1286
+ ```ts
1287
+ label: string
1288
+ n: number
1289
+ ```
1290
+
916
1291
  ## `ProvidersResponse` (interface)
917
1292
 
918
1293
  ```ts
@@ -928,6 +1303,61 @@ export type PublishedSolutionRef =
928
1303
  | { source: "hub"; org: string; name: string }
929
1304
  ```
930
1305
 
1306
+ ## `QueueAck` (interface)
1307
+
1308
+ ```ts
1309
+ items: QueuedMessage[] | undefined
1310
+ message: string | null | undefined
1311
+ pause_reason: string | null | undefined
1312
+ paused: boolean | undefined
1313
+ revision: number | undefined
1314
+ running: boolean | undefined
1315
+ session_id: string | undefined
1316
+ status: "error" | "ok" | "conflict" | "queued"
1317
+ ```
1318
+
1319
+ ## `QueuedMessage` (interface)
1320
+
1321
+ ```ts
1322
+ content: string
1323
+ created_at: string
1324
+ error: string | undefined
1325
+ id: string
1326
+ position: number
1327
+ status: QueuedMessageStatus
1328
+ target_run_id: string | undefined
1329
+ updated_at: string
1330
+ version: number
1331
+ ```
1332
+
1333
+ ## `QueuedMessageStatus` (type)
1334
+
1335
+ ```ts
1336
+ export type QueuedMessageStatus = "pending" | "delivering" | "claimed" | "consumed" | "cancelled"
1337
+ ```
1338
+
1339
+ ## `queuedMessageStatusLabel` (function)
1340
+
1341
+ ```ts
1342
+ queuedMessageStatusLabel: (status: QueuedMessageStatus) => string
1343
+ ```
1344
+
1345
+ ## `QueueOperationResult` (interface)
1346
+
1347
+ ```ts
1348
+ code: string | undefined
1349
+ conflict: boolean
1350
+ message: string | null
1351
+ ok: boolean
1352
+ snapshot: SessionQueueSnapshot | null
1353
+ ```
1354
+
1355
+ ## `queuePauseReasonLabel` (function)
1356
+
1357
+ ```ts
1358
+ queuePauseReasonLabel: (reason: string | null | undefined) => string | null
1359
+ ```
1360
+
931
1361
  ## `RawEvent` (interface)
932
1362
 
933
1363
  ```ts
@@ -935,12 +1365,24 @@ payload: Record<string, unknown>
935
1365
  type: string
936
1366
  ```
937
1367
 
1368
+ ## `reconcileHistoricalUserTurns` (function)
1369
+
1370
+ ```ts
1371
+ reconcileHistoricalUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
1372
+ ```
1373
+
938
1374
  ## `reconcileOptimisticUserTurns` (function)
939
1375
 
940
1376
  ```ts
941
1377
  reconcileOptimisticUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
942
1378
  ```
943
1379
 
1380
+ ## `replaceWindow` (function)
1381
+
1382
+ ```ts
1383
+ replaceWindow: (current: TurnProjection[], page: TurnProjection[], liveRevisionAtStart: number, liveRevisions: LiveRevisionState) => TurnProjection[]
1384
+ ```
1385
+
944
1386
  ## `ReplayPreview` (interface)
945
1387
 
946
1388
  ```ts
@@ -981,6 +1423,12 @@ status: "replay" | "autonomous" | undefined
981
1423
  resolveServiceUrl: (endpoints: PlatformEndpoints, name: PlatformServiceName, path?: string) => string | null
982
1424
  ```
983
1425
 
1426
+ ## `resolveToolUiCardContent` (function)
1427
+
1428
+ ```ts
1429
+ resolveToolUiCardContent: (card: ToolUiCard) => { type: ToolUiCardContentType; content: string; } | null
1430
+ ```
1431
+
984
1432
  ## `ResultFeedback` (interface)
985
1433
 
986
1434
  ```ts
@@ -1027,6 +1475,17 @@ result: unknown
1027
1475
  sessionId: string
1028
1476
  ```
1029
1477
 
1478
+ ## `RunTiming` (interface)
1479
+
1480
+ ```ts
1481
+ duration_ms: number | null | undefined
1482
+ loop_id: string
1483
+ run_id: string
1484
+ scope: "chat" | "subagent"
1485
+ started_at: string | null | undefined
1486
+ status: "completed" | "paused" | "failed" | "cancelled" | "incomplete"
1487
+ ```
1488
+
1030
1489
  ## `RunTrace` (interface)
1031
1490
 
1032
1491
  ```ts
@@ -1055,6 +1514,7 @@ askUserAnswer: Record<string, unknown> | undefined
1055
1514
  kbIds: number[] | undefined
1056
1515
  mode: string | undefined
1057
1516
  model: string | undefined
1517
+ queueWhenRunning: boolean | undefined
1058
1518
  replayDecision: "keep_replay" | "continue_replay" | undefined
1059
1519
  thinkingOverride: boolean | undefined
1060
1520
  whatif: { from_step: number; quotes: Array<Record<string, unknown>>; deprecate_entry_ids: string[]; } | undefined
@@ -1125,14 +1585,17 @@ solution: SolutionDefinition | undefined
1125
1585
 
1126
1586
  ```ts
1127
1587
  agent_runtime_id: string | null | undefined
1588
+ ba_version: string | null | undefined
1128
1589
  biz_role_id: string | null | undefined
1129
1590
  bound_skill_id: string | null | undefined
1591
+ chat_group_id: string | null | undefined
1130
1592
  created_at: string
1131
1593
  daemon_id: string | null | undefined
1132
1594
  disable_tools: (string[] & string[]) | undefined
1133
1595
  enable_thinking: boolean | null | undefined
1134
1596
  env: Record<string, string> | undefined
1135
1597
  id: string
1598
+ initiator: "unknown" | "ui" | "sdk" | null | undefined
1136
1599
  intent: string
1137
1600
  is_example: boolean | undefined
1138
1601
  is_headless: boolean | undefined
@@ -1149,6 +1612,7 @@ primary_skill_id: string | null | undefined
1149
1612
  primary_skill_snapshot: PrimarySkillSnapshot | null | undefined
1150
1613
  replay_state: ReplayState | null | undefined
1151
1614
  runtime_type: string | null | undefined
1615
+ sandbox_version: string | null | undefined
1152
1616
  shared: boolean | undefined
1153
1617
  solution: Solution | null | undefined
1154
1618
  solution_id: string | null | undefined
@@ -1195,6 +1659,7 @@ SessionInfo = type({
1195
1659
  "shared?": "boolean",
1196
1660
  "memory_enabled?": "boolean",
1197
1661
  "is_persistent?": "boolean",
1662
+ "initiator?": "'ui' | 'sdk' | 'unknown' | null",
1198
1663
  "is_headless?": "boolean",
1199
1664
  "viewer_role?": "'owner' | 'viewer'",
1200
1665
  "template_id?": "string | null",
@@ -1219,10 +1684,82 @@ SessionInfo = type({
1219
1684
  "daemon_id?": "string | null",
1220
1685
  "agent_runtime_id?": "string | null",
1221
1686
  "workspace_path?": "string | null",
1687
+ "ba_version?": "string | null",
1688
+ "sandbox_version?": "string | null",
1689
+ "chat_group_id?": "string | null",
1222
1690
  "match?": "unknown",
1223
1691
  })
1224
1692
  ```
1225
1693
 
1694
+ ## `SessionPlugin` (interface)
1695
+
1696
+ ```ts
1697
+ active: boolean
1698
+ config: SessionPluginConfigSummary | undefined
1699
+ display_name: string | null | undefined
1700
+ icon: string | null | undefined
1701
+ installed: boolean | null
1702
+ name: string
1703
+ projected: boolean
1704
+ projection_source: string | null | undefined
1705
+ reason: string | null | undefined
1706
+ status: string
1707
+ ```
1708
+
1709
+ ## `SessionPluginActivation` (type)
1710
+
1711
+ ```ts
1712
+ export type SessionPluginActivation = Pick<SessionPlugin, "name" | "active" | "status" | "reason">
1713
+ ```
1714
+
1715
+ ## `SessionPluginConfigError` (interface)
1716
+
1717
+ ```ts
1718
+ message: string
1719
+ path: string
1720
+ ```
1721
+
1722
+ ## `SessionPluginConfigSet` (interface)
1723
+
1724
+ ```ts
1725
+ path: string
1726
+ value: unknown
1727
+ ```
1728
+
1729
+ ## `SessionPluginConfigState` (interface)
1730
+
1731
+ ```ts
1732
+ errors: SessionPluginConfigError[]
1733
+ reason: string | null
1734
+ revision: string | null
1735
+ schema: Record<string, unknown> | null
1736
+ state: SessionPluginConfigStateName
1737
+ values: Record<string, unknown>
1738
+ write_only: string[]
1739
+ ```
1740
+
1741
+ ## `SessionPluginConfigStateName` (type)
1742
+
1743
+ ```ts
1744
+ export type SessionPluginConfigStateName = "not_required" | "required" | "configured" | "error"
1745
+ ```
1746
+
1747
+ ## `SessionPluginConfigSummary` (type)
1748
+
1749
+ ```ts
1750
+ export type SessionPluginConfigSummary =
1751
+ | SessionPluginConfigStateName
1752
+ | "unchecked"
1753
+ ```
1754
+
1755
+ ## `SessionPluginConfigUpdate` (interface)
1756
+
1757
+ ```ts
1758
+ expected_revision: string | null | undefined
1759
+ remove: string[] | undefined
1760
+ set: SessionPluginConfigSet[] | undefined
1761
+ ```
1762
+
1226
1763
  ## `SessionPortMapping` (interface)
1227
1764
 
1228
1765
  ```ts
@@ -1242,6 +1779,23 @@ model: string | undefined
1242
1779
  solution: SolutionRef | undefined
1243
1780
  ```
1244
1781
 
1782
+ ## `SessionQueueSnapshot` (interface)
1783
+
1784
+ ```ts
1785
+ items: QueuedMessage[]
1786
+ pause_reason: string | null
1787
+ paused: boolean
1788
+ revision: number
1789
+ session_id: string
1790
+ ```
1791
+
1792
+ ## `SessionSearchMatch` (interface)
1793
+
1794
+ ```ts
1795
+ field: "title" | "content"
1796
+ snippet: { role: string; text: string; } | null
1797
+ ```
1798
+
1245
1799
  ## `SessionSetupError` (class)
1246
1800
 
1247
1801
  ```ts
@@ -1263,6 +1817,7 @@ export type SessionSetupStage = "solution" | "session" | "skill" | "connection"
1263
1817
 
1264
1818
  ```ts
1265
1819
  attachAppCli: (sessionId: string, definition: AppCliDefinition) => Promise<AppCliAttachment>
1820
+ callMcpApp: (sessionId: string, sourceId: string, request: { request_id: string; name: string; arguments: Record<string, unknown>; }, init?: RequestInit) => Promise<{ response: Record<string, unknown>; replayed: boolean; }>
1266
1821
  checkoutSession: (sessionId: string, checkpointId: string, position: "before" | "turn_end", mode?: "both" | "conversation" | "code", linear?: boolean) => Promise<{ id: string; content: string; position: string; mode?: string; files_restored?: boolean; linear?: boolean; }>
1267
1822
  connect: (sessionId: string) => Promise<AgentSession>
1268
1823
  copyFile: (sessionId: string, filePath: string) => Promise<{ path: string; }>
@@ -1276,24 +1831,36 @@ deleteFile: (sessionId: string, filePath: string) => Promise<void>
1276
1831
  deleteSession: (sessionId: string, options?: { deleteWorkspace?: boolean; }) => Promise<{ deleted: boolean; workspace_deleted?: boolean; }>
1277
1832
  downloadFile: (sessionId: string, filePath: string, downloadName?: string) => Promise<void>
1278
1833
  exportSession: (sessionId: string) => Promise<void>
1834
+ fetchImage: (sessionId: string, assetId: string, preview?: boolean) => Promise<Blob>
1835
+ fetchSessionPluginIcon: (sessionId: string, name: string) => Promise<Blob>
1836
+ fetchSharedImage: (token: string, assetId: string, preview?: boolean) => Promise<Blob>
1279
1837
  getBackgroundTask: (sessionId: string, taskId: string, tail?: number, init?: RequestInit) => Promise<BackgroundTask>
1280
1838
  getDownloadDirUrl: (sessionId: string, dirPath: string) => string
1839
+ getMcpApp: (sessionId: string, sourceId: string, init?: RequestInit) => Promise<McpAppArchive>
1840
+ getMcpAppContext: (sessionId: string, sourceId: string, init?: RequestInit) => Promise<McpAppContextState>
1281
1841
  getReplayPreview: (sessionId: string) => Promise<ReplayPreview>
1282
1842
  getSession: (sessionId: string, init?: RequestInit) => Promise<SessionDetail>
1283
1843
  getSessionCheckpoints: (sessionId: string, init?: RequestInit) => Promise<{ nodes: CheckpointNode[]; leaf_id: string | null; }>
1284
1844
  getSessionContextStats: (sessionId: string, init?: RequestInit) => Promise<SessionContextStats>
1285
1845
  getSessionHistory: (sessionId: string, init?: RequestInit) => Promise<SessionHistory>
1846
+ getSessionPluginConfig: (sessionId: string, name: string, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1286
1847
  getSessionTasks: (sessionId: string) => Promise<Task[]>
1848
+ getSessionTurnCommands: (sessionId: string) => Promise<HistoricalCommand[]>
1849
+ getSessionTurnIndex: (sessionId: string) => Promise<SessionTurnIndex>
1287
1850
  getSessionTurns: (sessionId: string) => Promise<TurnProjection[]>
1851
+ getSessionTurnsPage: (sessionId: string, options?: SessionTurnsQuery, init?: RequestInit) => Promise<SessionTurnsPage>
1288
1852
  getSharedSession: (token: string) => Promise<TurnProjection[]>
1289
1853
  importSession: (file: File, name?: string, solutionOverride?: string | null | ImportSessionOptions) => Promise<{ session_id: string; }>
1290
1854
  listBackgroundTasks: (sessionId: string, init?: RequestInit) => Promise<BackgroundTask[]>
1291
- listDir: (sessionId: string, dirPath: string) => Promise<FileEntry[]>
1855
+ listDir: (sessionId: string, dirPath: string, showHidden?: boolean) => Promise<FileEntry[]>
1292
1856
  listResultFeedback: (sessionId: string) => Promise<ResultFeedback[]>
1857
+ listSessionPlugins: (sessionId: string, init?: RequestInit) => Promise<{ plugins: SessionPlugin[]; sync_version: number; sync_pending: boolean; }>
1293
1858
  listSessions: (template_id_prefix?: string, solution_id?: string) => Promise<SessionInfo[]>
1294
- listSessionsPaginated: (params: { limit: number; offset: number; template_id_prefix?: string; solution_id?: string; solution_registry_id?: string; q?: string; }) => Promise<PaginatedSessionsResult>
1859
+ listSessionsPaginated: (params: { limit: number; offset: number; template_id_prefix?: string; solution_id?: string; solution_registry_id?: string; q?: string; chat_group_id?: string; }) => Promise<PaginatedSessionsResult>
1295
1860
  listSessionsWithSkillData: () => Promise<SkillDevSession[]>
1861
+ onMcpAppChanged: (sessionId: string, sourceId: string, listener: () => void) => () => void
1296
1862
  pinSession: (sessionId: string, pinned: boolean) => Promise<SessionInfo>
1863
+ prepareSessionPluginConfig: (sessionId: string, name: string, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1297
1864
  previewImport: (file: File) => Promise<ImportPreview>
1298
1865
  probeSessionUrl: (sessionId: string, url: string) => Promise<{ reachable: boolean; requires_proxy: boolean; }>
1299
1866
  putResultFeedback: (sessionId: string, assistantEntryId: string, feedback: { helpful: boolean; reason?: ResultFeedbackReason | null; }) => Promise<ResultFeedback>
@@ -1301,16 +1868,20 @@ renameFile: (sessionId: string, filePath: string, newName: string) => Promise<{
1301
1868
  revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }>
1302
1869
  rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
1303
1870
  searchOwnedContent: (params: { q: string; limit?: number; }) => Promise<GlobalSearchResult>
1871
+ sessionPluginIconUrl: (sessionId: string, name: string) => string
1304
1872
  setSessionEnv: (sessionId: string, env: Record<string, string>) => Promise<SessionDetail>
1873
+ setSessionPluginActivation: (sessionId: string, name: string, active: boolean, init?: RequestInit) => Promise<{ plugin: SessionPluginActivation; sync_version: number; }>
1305
1874
  shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
1306
1875
  startReplaySession: (sourceSessionId: string, speed?: ReplaySpeed) => Promise<{ session_id: string; }>
1307
1876
  stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTaskStopResult>
1308
1877
  switchBranch: (sessionId: string, checkpointId: string) => Promise<{ id: string; leaf_id: string; }>
1309
1878
  tokenizeMessages: (messages: Array<Record<string, unknown>>, options?: { model?: string; add_generation_prompt?: boolean; enable_thinking?: boolean | null; tools?: Array<Record<string, unknown>>; }) => Promise<TokenizeResult>
1310
1879
  tokenizePrompt: (prompt: string, model?: string) => Promise<TokenizeResult>
1880
+ updateMcpAppContext: (sessionId: string, sourceId: string, body: McpAppContextUpdate, init?: RequestInit) => Promise<{ status: "accepted"; revision: string; }>
1311
1881
  updateReplaySession: (sessionId: string, payload: { speed?: ReplaySpeed; status?: "autonomous"; }) => Promise<{ replay_state: SessionInfo["replay_state"]; }>
1312
- updateSession: (sessionId: string, payload: { intent?: string; }) => Promise<SessionDetail>
1882
+ updateSession: (sessionId: string, payload: { intent?: string; chat_group_id?: string | null; }) => Promise<SessionDetail>
1313
1883
  updateSessionMemory: (sessionId: string, memoryEnabled: boolean) => Promise<{ memory_enabled: boolean; }>
1884
+ updateSessionPluginConfig: (sessionId: string, name: string, update: SessionPluginConfigUpdate, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1314
1885
  updateSharing: (sessionId: string, shared: boolean) => Promise<{ shared: boolean; }>
1315
1886
  uploadFiles: (sessionId: string, dirPath: string, files: FileList | File[] | UploadFileEntry[], options?: UploadFilesOptions) => Promise<{ uploaded: string[]; failed: string[]; }>
1316
1887
  writeFile: (sessionId: string, filePath: string, content: string) => Promise<{ success: boolean; }>
@@ -1325,8 +1896,11 @@ askAnswers: Record<string, AskUserAnswerData>
1325
1896
  connection: ConnectionStatus
1326
1897
  errorMessage: string | null
1327
1898
  isStreaming: boolean
1899
+ loadingOlder: boolean
1328
1900
  messages: ChatMessage[]
1329
1901
  mode: "planning" | "executing" | null
1902
+ nextBefore: string | null
1903
+ queue: SessionQueueSnapshot
1330
1904
  replay: ReplaySnapshot | null
1331
1905
  sessionId: string
1332
1906
  status: "completed" | "failed" | "interrupted" | "running" | "created" | "waiting_for_input" | null
@@ -1342,6 +1916,44 @@ SessionStatus = type(
1342
1916
  )
1343
1917
  ```
1344
1918
 
1919
+ ## `SessionStatusEvent` (interface)
1920
+
1921
+ ```ts
1922
+ session_id: string
1923
+ status: string
1924
+ ```
1925
+
1926
+ ## `SessionTurnIndex` (interface)
1927
+
1928
+ ```ts
1929
+ items: SessionTurnIndexItem[]
1930
+ sessionId: string
1931
+ ```
1932
+
1933
+ ## `SessionTurnIndexItem` (interface)
1934
+
1935
+ ```ts
1936
+ createdAt: string | null
1937
+ entryId: string
1938
+ preview: string
1939
+ ```
1940
+
1941
+ ## `SessionTurnsPage` (interface)
1942
+
1943
+ ```ts
1944
+ currentMode: "planning" | "executing"
1945
+ nextBefore: string | null
1946
+ turns: TurnProjection[]
1947
+ ```
1948
+
1949
+ ## `SessionTurnsQuery` (interface)
1950
+
1951
+ ```ts
1952
+ before: string | undefined
1953
+ fromEntryId: string | undefined
1954
+ limit: number | undefined
1955
+ ```
1956
+
1345
1957
  ## `ShareLinkResult` (interface)
1346
1958
 
1347
1959
  ```ts
@@ -1350,13 +1962,53 @@ token: string
1350
1962
  url: string
1351
1963
  ```
1352
1964
 
1965
+ ## `shouldApplySnapshot` (function)
1966
+
1967
+ ```ts
1968
+ shouldApplySnapshot: (current: SessionQueueSnapshot | undefined, next: SessionQueueSnapshot) => boolean
1969
+ ```
1970
+
1971
+ ## `SiteVisitsResource` (class)
1972
+
1973
+ ```ts
1974
+ record: () => Promise<SiteVisitsSummary>
1975
+ summary: () => Promise<SiteVisitsSummary>
1976
+ ```
1977
+
1978
+ ## `SiteVisitsSummary` (interface)
1979
+
1980
+ ```ts
1981
+ as_of: string
1982
+ date: string
1983
+ timezone: string
1984
+ today_pv: number
1985
+ today_uv: number
1986
+ total_pv: number
1987
+ ```
1988
+
1353
1989
  ## `SkillDefinition` (interface)
1354
1990
 
1355
1991
  ```ts
1356
- files: TextFile[]
1992
+ files: SkillFile[]
1357
1993
  name: string
1358
1994
  ```
1359
1995
 
1996
+ ## `SkillEditorTemplateId` (type)
1997
+
1998
+ ```ts
1999
+ export type SkillEditorTemplateId = "skill_editor"
2000
+ ```
2001
+
2002
+ ## `SkillFile` (type)
2003
+
2004
+ ```ts
2005
+ export type SkillFile = TextFile & {
2006
+ /** 二进制内容使用 base64;省略时为 UTF-8 文本。 */
2007
+ encoding?: "utf-8" | "base64"
2008
+ executable?: boolean
2009
+ }
2010
+ ```
2011
+
1360
2012
  ## `SkillMentionAvailability` (interface)
1361
2013
 
1362
2014
  ```ts
@@ -1440,6 +2092,12 @@ export type SolutionRef = ExistingSolutionRef | PreparedSolutionAsset
1440
2092
  sortComputers: (computers: SessionComputer[]) => SessionComputer[]
1441
2093
  ```
1442
2094
 
2095
+ ## `SystemError` (interface)
2096
+
2097
+ ```ts
2098
+ message: string
2099
+ ```
2100
+
1443
2101
  ## `Task` (type)
1444
2102
 
1445
2103
  ```ts
@@ -1500,6 +2158,25 @@ action: string
1500
2158
  payload: unknown
1501
2159
  ```
1502
2160
 
2161
+ ## `ToolCallArgumentsDelta` (interface)
2162
+
2163
+ ```ts
2164
+ arguments_delta: string
2165
+ function: { name: string; }
2166
+ id: string
2167
+ index: number
2168
+ loop_name: string | undefined
2169
+ ```
2170
+
2171
+ ## `ToolCallCreated` (interface)
2172
+
2173
+ ```ts
2174
+ function: { name: string; arguments: string; }
2175
+ id: string
2176
+ index: number
2177
+ loop_name: string | undefined
2178
+ ```
2179
+
1503
2180
  ## `ToolCallInfo` (interface)
1504
2181
 
1505
2182
  ```ts
@@ -1513,6 +2190,60 @@ result: unknown
1513
2190
  status: "done" | "error" | "cancelled" | "awaiting_answer" | "pending" | undefined
1514
2191
  ```
1515
2192
 
2193
+ ## `ToolCallProjection` (interface)
2194
+
2195
+ ```ts
2196
+ arguments: string
2197
+ display_name: string
2198
+ duration_ms: number | null | undefined
2199
+ id: string
2200
+ pending_question_ref: PendingQuestionRef | null | undefined
2201
+ ran_in_parallel: boolean | undefined
2202
+ result: unknown
2203
+ started_at: string | null | undefined
2204
+ status: string
2205
+ subagent_runs: RunTiming[] | undefined
2206
+ tool_name: string
2207
+ ```
2208
+
2209
+ ## `ToolResultDelta` (interface)
2210
+
2211
+ ```ts
2212
+ content: string
2213
+ loop_name: string | undefined
2214
+ stream: "stdout" | "stderr" | undefined
2215
+ tool_call_id: string
2216
+ ```
2217
+
2218
+ ## `ToolResultDone` (interface)
2219
+
2220
+ ```ts
2221
+ content: string
2222
+ function: { name: string; }
2223
+ loop_name: string | undefined
2224
+ tool_call_id: string
2225
+ ```
2226
+
2227
+ ## `ToolUiCard` (interface)
2228
+
2229
+ ```ts
2230
+ archived: boolean | undefined
2231
+ height: number
2232
+ mcpApp: McpAppData | undefined
2233
+ resourceHTML: string | undefined
2234
+ resourceUri: string | undefined
2235
+ resourceURI: string | undefined
2236
+ sourcePath: string | undefined
2237
+ target: "inline" | "preview"
2238
+ title: string | undefined
2239
+ ```
2240
+
2241
+ ## `ToolUiCardContentType` (type)
2242
+
2243
+ ```ts
2244
+ export type ToolUiCardContentType = "resource-html" | "resource-uri" | "resource-file"
2245
+ ```
2246
+
1516
2247
  ## `toReplaySnapshot` (function)
1517
2248
 
1518
2249
  ```ts
@@ -1533,6 +2264,7 @@ archived_files: ArchivedFileInfo[] | null | undefined
1533
2264
  archived_tool_calls: ArchivedToolCallInfo[] | null | undefined
1534
2265
  blocks: ContentBlock[]
1535
2266
  client_render_id: string | null | undefined
2267
+ client_request_id: string | null | undefined
1536
2268
  compaction_id: string | null | undefined
1537
2269
  context_action: ContextAction | null | undefined
1538
2270
  context_content: unknown
@@ -1544,9 +2276,12 @@ context_revision: string | null | undefined
1544
2276
  context_window: number | undefined
1545
2277
  display_summary: string | null | undefined
1546
2278
  display_title: string | null | undefined
1547
- duration_ms: number | undefined
2279
+ duration_ms: number | null | undefined
1548
2280
  failure_reason: string | null | undefined
1549
2281
  fallback_applied: boolean | null | undefined
2282
+ first_token_delivery_ms: number | null | undefined
2283
+ first_token_ms: number | null | undefined
2284
+ has_reported_timing: boolean | undefined
1550
2285
  id: string
1551
2286
  kind: "message" | "context" | "compaction" | undefined
1552
2287
  loop_id: string
@@ -1560,6 +2295,7 @@ sequence: number
1560
2295
  sources: ContextSourceInfo[] | null | undefined
1561
2296
  started_at: string | null | undefined
1562
2297
  status: "streaming" | "completed" | "paused" | "failed" | "interrupted"
2298
+ stream_duration_ms: number | null | undefined
1563
2299
  summary_full: string | null | undefined
1564
2300
  summary_preview: string | null | undefined
1565
2301
  tokens_after: number | null | undefined