@blade-hq/agent-client 2610.0.0-beta.9 → 2610.0.0-beta.90

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 (43) hide show
  1. package/README.md +266 -11
  2. package/dist/auth.d.ts +0 -1
  3. package/dist/blade-client.d.ts +24 -3
  4. package/dist/index.d.ts +37 -7
  5. package/dist/index.js +2395 -295
  6. package/dist/index.js.map +1 -1
  7. package/dist/platform-endpoints.d.ts +14 -0
  8. package/dist/polling-backoff.d.ts +11 -0
  9. package/dist/resources/chat-groups.d.ts +31 -0
  10. package/dist/resources/computers.d.ts +115 -0
  11. package/dist/resources/models.d.ts +2 -0
  12. package/dist/resources/plugins.d.ts +43 -0
  13. package/dist/resources/sessions.d.ts +193 -2
  14. package/dist/resources/site-visits.d.ts +32 -0
  15. package/dist/rest.d.ts +8 -0
  16. package/dist/schemas/context.d.ts +49 -0
  17. package/dist/schemas/event.d.ts +9 -0
  18. package/dist/schemas/mcp-app.d.ts +30 -0
  19. package/dist/schemas/message-utils.d.ts +15 -1
  20. package/dist/schemas/message.d.ts +6 -0
  21. package/dist/schemas/projection.d.ts +37 -2
  22. package/dist/schemas/session.d.ts +10 -1
  23. package/dist/session/agent-session.d.ts +159 -17
  24. package/dist/session/definition.d.ts +6 -1
  25. package/dist/session/errors.d.ts +11 -0
  26. package/dist/session/events.d.ts +16 -2
  27. package/dist/session/history-page.d.ts +9 -0
  28. package/dist/session/hub.d.ts +9 -1
  29. package/dist/session/queue.d.ts +104 -0
  30. package/dist/session/state.d.ts +18 -2
  31. package/dist/shared/auth-busy.d.ts +9 -0
  32. package/dist/shared/projection/builder.d.ts +12 -0
  33. package/dist/shared/projection/context.d.ts +3 -0
  34. package/dist/shared/projection/helpers.d.ts +2 -2
  35. package/dist/shared/projection/history.d.ts +1 -0
  36. package/dist/shared/projection/index.d.ts +2 -1
  37. package/dist/shared/projection/state.d.ts +7 -0
  38. package/dist/shared/tool-ui-card.d.ts +60 -0
  39. package/dist/shared/type-guards.d.ts +2 -0
  40. package/dist/socket.d.ts +2 -0
  41. package/dist/types/socket-events.d.ts +199 -6
  42. package/package.json +1 -1
  43. package/public-api.md +960 -17
package/public-api.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
4
4
  > 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
5
5
 
6
- 共 137 个公开声明。
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,11 +135,11 @@ 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; }
92
- toolResult: { toolCall: ToolCallInfo; turn: TurnProjection; }
141
+ toolPreview: { sourcePath?: string; toolCallId: string; type: "resource-html" | "resource-uri" | "resource-file"; content: string; title: string; mcpApp?: McpAppData; }
142
+ toolResult: { toolCall: ToolCallInfo; turn: TurnProjection; source: "live" | "bootstrap_replay" | "reconnect_replay"; }
93
143
  workspaceChanged: { filePath?: string; }
94
144
  ```
95
145
 
@@ -133,6 +183,7 @@ tool_name: string | null | undefined
133
183
 
134
184
  ```ts
135
185
  custom: Record<number, string>
186
+ note: string | undefined
136
187
  selections: Record<number, number[]>
137
188
  ```
138
189
 
@@ -152,6 +203,20 @@ cli: AppCliDefinition | undefined
152
203
  getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
153
204
  ```
154
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
+
155
220
  ## `AuthResource` (class)
156
221
 
157
222
  ```ts
@@ -217,6 +282,8 @@ statusText: string
217
282
  auth: AuthResource
218
283
  blob: (method: HttpMethod, path: string) => Promise<Blob>
219
284
  buildAuthedUrl: (path: string) => string
285
+ chatGroups: ChatGroupsResource
286
+ computers: ComputersResource
220
287
  fetch: (method: HttpMethod, path: string, init?: BladeFetchInit, isRetry?: boolean) => Promise<Response>
221
288
  formData: (method: HttpMethod, path: string, form: FormData, options?: { expectOk?: boolean; onUploadProgress?: (progress: UploadProgress) => void; }) => Promise<Response>
222
289
  hasToken: () => boolean
@@ -229,10 +296,13 @@ logoutToken: () => void
229
296
  models: ModelsResource
230
297
  onSocketReplaced: (listener: () => void) => () => void
231
298
  options: BladeClientOptions
299
+ plugins: PluginsResource
300
+ requestCommand: (event: string, payload: Record<string, unknown>, timeoutMs: number) => Promise<Record<string, unknown>>
232
301
  responseFromInit: (path: string, init?: RequestInit) => Promise<Response>
233
302
  sessions: SessionsResource
234
303
  setBaseUrl: (baseUrl: string) => void
235
304
  setToken: (token: string | null) => void
305
+ siteVisits: SiteVisitsResource
236
306
  socket: () => TypedSocket
237
307
  text: (method: HttpMethod, path: string) => Promise<string>
238
308
  textFromInit: (path: string, init?: RequestInit) => Promise<string>
@@ -243,10 +313,10 @@ token: string | null
243
313
 
244
314
  ```ts
245
315
  baseUrl: string
316
+ commandTransport: ((event: string, payload: Record<string, unknown>, send: () => Promise<Record<string, unknown>>) => Promise<Record<string, unknown>>) | undefined
246
317
  fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
247
318
  onRefreshSuccess: (() => void | Promise<void>) | undefined
248
319
  socketToken: string | (() => string | null | undefined) | undefined
249
- streamTokens: boolean | undefined
250
320
  token: string | (() => string | null | undefined) | undefined
251
321
  tokenStorage: TokenStorageMode | undefined
252
322
  ```
@@ -257,12 +327,78 @@ tokenStorage: TokenStorageMode | undefined
257
327
  buildMessageContent: (text: string, attachments: Array<{ kind: "file"; name: string; uploadedPath?: string; textContent?: string | null; mimeType?: string; }>) => MessageContent
258
328
  ```
259
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
+
354
+ ## `canToggleComputer` (function)
355
+
356
+ ```ts
357
+ canToggleComputer: (computer: SessionComputer) => boolean
358
+ ```
359
+
360
+ ## `ChatEnd` (interface)
361
+
362
+ ```ts
363
+ duration_ms: number
364
+ status: string
365
+ ```
366
+
367
+ ## `chatErrorForDisplay` (function)
368
+
369
+ ```ts
370
+ chatErrorForDisplay: (message: string, developer?: boolean) => string
371
+ ```
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
+
260
395
  ## `ChatMessage` (interface)
261
396
 
262
397
  ```ts
263
398
  blocks: ContentBlock[] | undefined
264
399
  compaction: CompactionInfo | undefined
265
400
  content: MessageContent
401
+ context: ContextProjectionData | undefined
266
402
  duration_ms: number | undefined
267
403
  entry_id: string | undefined
268
404
  kind: string | undefined
@@ -286,6 +422,18 @@ reset: () => void
286
422
  seedSequence: (maxSeq: number) => void
287
423
  ```
288
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
+
289
437
  ## `CommandEnvelope` (interface)
290
438
 
291
439
  ```ts
@@ -318,6 +466,50 @@ tokens_before: number | null | undefined
318
466
  trigger: "auto" | "manual" | "forced_retry" | null | undefined
319
467
  ```
320
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
+
493
+ ## `ComputersResource` (class)
494
+
495
+ ```ts
496
+ list: (sessionId: string) => Promise<SessionComputerList>
497
+ listAccount: () => Promise<AccountComputerList>
498
+ setEnabled: (sessionId: string, computer: string, enabled: boolean) => Promise<SessionComputer>
499
+ ```
500
+
501
+ ## `computerState` (function)
502
+
503
+ ```ts
504
+ computerState: (computer: SessionComputer) => ComputerState
505
+ ```
506
+
507
+ ## `ComputerState` (type)
508
+
509
+ ```ts
510
+ export type ComputerState = "primary" | "enabled" | "offline" | "idle"
511
+ ```
512
+
321
513
  ## `connectEmbedded` (function)
322
514
 
323
515
  ```ts
@@ -334,18 +526,89 @@ export type ConnectionStatus = "connecting" | "connected" | "reconnecting" | "di
334
526
 
335
527
  ```ts
336
528
  content: unknown
529
+ delivery_id: string | null | undefined
337
530
  display_name: string | null | undefined
338
531
  tool_call_id: string | null | undefined
339
532
  tool_name: string | null | undefined
340
533
  type: "text" | "thinking" | "tool_use" | "tool_result" | "tool_ui" | "tool_bridge" | "system_notification" | "mode_change" | "plan_status" | "ask_user_answer"
341
534
  ```
342
535
 
536
+ ## `ContentDelta` (interface)
537
+
538
+ ```ts
539
+ content: string
540
+ loop_name: string | undefined
541
+ ```
542
+
343
543
  ## `contentPreview` (function)
344
544
 
345
545
  ```ts
346
546
  contentPreview: (content: MessageContent, maxLen?: number) => string
347
547
  ```
348
548
 
549
+ ## `ContextAction` (type)
550
+
551
+ ```ts
552
+ export type ContextAction = "published" | "retained" | "removed"
553
+ ```
554
+
555
+ ## `ContextDisplayState` (interface)
556
+
557
+ ```ts
558
+ detail: string
559
+ isRemoved: boolean
560
+ summary: string
561
+ title: string
562
+ ```
563
+
564
+ ## `ContextGroupDisplayState` (interface)
565
+
566
+ ```ts
567
+ count: number
568
+ summary: string
569
+ title: string
570
+ ```
571
+
572
+ ## `contextProjectionData` (function)
573
+
574
+ ```ts
575
+ contextProjectionData: (fields: ContextProjectionFields) => ContextProjectionData | null
576
+ ```
577
+
578
+ ## `ContextProjectionData` (interface)
579
+
580
+ ```ts
581
+ context_action: ContextAction
582
+ context_key: string
583
+ context_kind: string
584
+ context_name: string
585
+ context_order: number
586
+ context_revision: string
587
+ display_summary: string | null | undefined
588
+ display_title: string | null | undefined
589
+ sources: ContextSourceInfo[]
590
+ ```
591
+
592
+ ## `ContextProjectionFields` (interface)
593
+
594
+ ```ts
595
+ context_action: ContextAction | null | undefined
596
+ context_key: string | null | undefined
597
+ context_kind: string | null | undefined
598
+ context_name: string | null | undefined
599
+ context_order: number | null | undefined
600
+ context_revision: string | null | undefined
601
+ display_summary: string | null | undefined
602
+ display_title: string | null | undefined
603
+ sources: ContextSourceInfo[] | null | undefined
604
+ ```
605
+
606
+ ## `ContextSourceInfo` (type)
607
+
608
+ ```ts
609
+ export type ContextSourceInfo = Record<string, unknown>
610
+ ```
611
+
349
612
  ## `createInitialSessionState` (function)
350
613
 
351
614
  ```ts
@@ -355,7 +618,9 @@ createInitialSessionState: (sessionId: string) => SessionState
355
618
  ## `CreateSessionRequest` (interface)
356
619
 
357
620
  ```ts
621
+ agent_runtime_id: string | null | undefined
358
622
  biz_role_id: string | null | undefined
623
+ chat_group_id: string | null | undefined
359
624
  compaction_ratio: number | null | undefined
360
625
  daemon_id: string | null | undefined
361
626
  disable_tools: string[] | null | undefined
@@ -365,7 +630,7 @@ intent: string | undefined
365
630
  memory_enabled: boolean | null | undefined
366
631
  model: string | null | undefined
367
632
  primary_skill_id: string | null | undefined
368
- runtime_type: "sandbox" | "daemon" | null | undefined
633
+ runtime_type: "sandbox" | "daemon" | "native" | null | undefined
369
634
  session_solution_asset_id: string | null | undefined
370
635
  solution_id: string | undefined
371
636
  solution_ref: PublishedSolutionRef | undefined
@@ -385,6 +650,7 @@ createSocket: (options: CreateSocketOptions) => TypedSocket
385
650
  baseUrl: string
386
651
  path: string | undefined
387
652
  token: string | (() => string | null | undefined) | undefined
653
+ transports: ("polling" | "websocket")[] | undefined
388
654
  ```
389
655
 
390
656
  ## `DEFAULT_REPLAY_SPEED` (const)
@@ -410,6 +676,18 @@ allowedOrigins: string[]
410
676
  iframe: HTMLIFrameElement | undefined
411
677
  ```
412
678
 
679
+ ## `EMPTY_PLATFORM_ENDPOINTS` (const)
680
+
681
+ ```ts
682
+ EMPTY_PLATFORM_ENDPOINTS: PlatformEndpoints
683
+ ```
684
+
685
+ ## `EMPTY_SESSION_QUEUE` (const)
686
+
687
+ ```ts
688
+ EMPTY_SESSION_QUEUE: SessionQueueSnapshot
689
+ ```
690
+
413
691
  ## `ExchangeCodeParams` (interface)
414
692
 
415
693
  ```ts
@@ -466,6 +744,18 @@ label: string
466
744
  target: string
467
745
  ```
468
746
 
747
+ ## `getContextDisplayState` (function)
748
+
749
+ ```ts
750
+ getContextDisplayState: (context: ContextProjectionData) => ContextDisplayState
751
+ ```
752
+
753
+ ## `getContextGroupDisplayState` (function)
754
+
755
+ ```ts
756
+ getContextGroupDisplayState: (contexts: readonly ContextProjectionData[]) => ContextGroupDisplayState
757
+ ```
758
+
469
759
  ## `getFileParts` (function)
470
760
 
471
761
  ```ts
@@ -520,12 +810,24 @@ export type GlobalSearchResultItem =
520
810
  | GlobalSearchFileResult
521
811
  ```
522
812
 
813
+ ## `groupAdjacentContextRuns` (function)
814
+
815
+ ```ts
816
+ groupAdjacentContextRuns: (kinds: readonly (string | null)[]) => readonly (readonly number[])[]
817
+ ```
818
+
523
819
  ## `groupMessagesByLoop` (function)
524
820
 
525
821
  ```ts
526
822
  groupMessagesByLoop: (messages: ChatMessage[]) => MessageGroup[]
527
823
  ```
528
824
 
825
+ ## `hasChatRunEvent` (function)
826
+
827
+ ```ts
828
+ hasChatRunEvent: (events: RawEvent[]) => boolean
829
+ ```
830
+
529
831
  ## `HeadlessResource` (class)
530
832
 
531
833
  ```ts
@@ -534,10 +836,19 @@ runInSession: { <T = unknown>(sessionId: string, prompt: string, options: Headle
534
836
  runWithSession: { <T = unknown>(prompt: string, options: HeadlessRunOptions & { schema: JsonSchemaObject; }): Promise<HeadlessRunInSessionResult<T>>; (prompt: string, options?: HeadlessRunOptions): Promise<HeadlessRunInSessionResult<string>>; }
535
837
  ```
536
838
 
839
+ ## `HistoricalCommand` (interface)
840
+
841
+ ```ts
842
+ action: string
843
+ deliveryId: string
844
+ payload: unknown
845
+ toolCallId: string | undefined
846
+ ```
847
+
537
848
  ## `ImageUrlContentPart` (interface)
538
849
 
539
850
  ```ts
540
- image_url: { url: string; }
851
+ image_url: { url: string; source_path?: string; width?: number; height?: number; }
541
852
  type: "image_url"
542
853
  ```
543
854
 
@@ -562,16 +873,48 @@ direction: "host-to-agent"
562
873
  payload: unknown
563
874
  ```
564
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
+
565
902
  ## `isCommandEnvelope` (function)
566
903
 
567
904
  ```ts
568
905
  isCommandEnvelope: (value: unknown) => value is CommandEnvelope
569
906
  ```
570
907
 
908
+ ## `isEntryGoneError` (function)
909
+
910
+ ```ts
911
+ isEntryGoneError: (error: unknown) => boolean
912
+ ```
913
+
571
914
  ## `isHiddenInternalMessage` (function)
572
915
 
573
916
  ```ts
574
- isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">) => boolean
917
+ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">, options?: { includeLegacyForkContext?: boolean; }) => boolean
575
918
  ```
576
919
 
577
920
  ## `isInboundEnvelope` (function)
@@ -580,6 +923,30 @@ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">) => boo
580
923
  isInboundEnvelope: (value: unknown) => value is InboundEnvelope
581
924
  ```
582
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
+
583
950
  ## `latestPostChatFollowup` (function)
584
951
 
585
952
  ```ts
@@ -602,6 +969,37 @@ export enum LayoutType {
602
969
  }
603
970
  ```
604
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
+
989
+ ## `loadPlatformEndpoints` (function)
990
+
991
+ ```ts
992
+ loadPlatformEndpoints: (options?: LoadPlatformEndpointsOptions) => Promise<PlatformEndpoints>
993
+ ```
994
+
995
+ ## `LoadPlatformEndpointsOptions` (interface)
996
+
997
+ ```ts
998
+ baseUrl: string | undefined
999
+ fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
1000
+ timeoutMs: number | undefined
1001
+ ```
1002
+
605
1003
  ## `LoginOptions` (interface)
606
1004
 
607
1005
  ```ts
@@ -617,6 +1015,49 @@ token: string
617
1015
  user: { id?: string; username?: string; display_name?: string; } | undefined
618
1016
  ```
619
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
+
620
1061
  ## `MemoryRef` (interface)
621
1062
 
622
1063
  ```ts
@@ -658,6 +1099,8 @@ baseUrl: string | undefined
658
1099
  default: string
659
1100
  defaultServiceModel: string | undefined
660
1101
  models: ModelOption[]
1102
+ unavailableModelIds: string[] | undefined
1103
+ unavailableProviderIds: string[] | undefined
661
1104
  ```
662
1105
 
663
1106
  ## `ModelOption` (interface)
@@ -704,6 +1147,12 @@ content: string
704
1147
  label: string
705
1148
  ```
706
1149
 
1150
+ ## `parseQueueAck` (function)
1151
+
1152
+ ```ts
1153
+ parseQueueAck: (response: unknown, fallbackSessionId: string) => QueueOperationResult
1154
+ ```
1155
+
707
1156
  ## `PatchEnvelope` (interface)
708
1157
 
709
1158
  ```ts
@@ -714,6 +1163,51 @@ sequence: number
714
1163
  turn_id: string
715
1164
  ```
716
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
+
1174
+ ## `PlatformEndpoints` (interface)
1175
+
1176
+ ```ts
1177
+ services: Partial<Record<"os" | "hub" | "agent" | "oauth" | "llmGateway" | "gitea" | "tile", string>>
1178
+ ```
1179
+
1180
+ ## `PlatformServiceName` (type)
1181
+
1182
+ ```ts
1183
+ export type PlatformServiceName = (typeof PLATFORM_SERVICE_NAMES)[number]
1184
+ ```
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
+
717
1211
  ## `PostChatFollowup` (interface)
718
1212
 
719
1213
  ```ts
@@ -744,6 +1238,21 @@ bizRoleId: string | undefined
744
1238
  kind: "prepared"
745
1239
  ```
746
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
+
747
1256
  ## `PrimarySkillParallelMode` (interface)
748
1257
 
749
1258
  ```ts
@@ -764,6 +1273,21 @@ title: string
764
1273
  version: number
765
1274
  ```
766
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
+
767
1291
  ## `ProvidersResponse` (interface)
768
1292
 
769
1293
  ```ts
@@ -779,6 +1303,61 @@ export type PublishedSolutionRef =
779
1303
  | { source: "hub"; org: string; name: string }
780
1304
  ```
781
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
+
782
1361
  ## `RawEvent` (interface)
783
1362
 
784
1363
  ```ts
@@ -786,12 +1365,24 @@ payload: Record<string, unknown>
786
1365
  type: string
787
1366
  ```
788
1367
 
1368
+ ## `reconcileHistoricalUserTurns` (function)
1369
+
1370
+ ```ts
1371
+ reconcileHistoricalUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
1372
+ ```
1373
+
789
1374
  ## `reconcileOptimisticUserTurns` (function)
790
1375
 
791
1376
  ```ts
792
1377
  reconcileOptimisticUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
793
1378
  ```
794
1379
 
1380
+ ## `replaceWindow` (function)
1381
+
1382
+ ```ts
1383
+ replaceWindow: (current: TurnProjection[], page: TurnProjection[], liveRevisionAtStart: number, liveRevisions: LiveRevisionState) => TurnProjection[]
1384
+ ```
1385
+
795
1386
  ## `ReplayPreview` (interface)
796
1387
 
797
1388
  ```ts
@@ -826,6 +1417,18 @@ speed: ReplaySpeed | undefined
826
1417
  status: "replay" | "autonomous" | undefined
827
1418
  ```
828
1419
 
1420
+ ## `resolveServiceUrl` (function)
1421
+
1422
+ ```ts
1423
+ resolveServiceUrl: (endpoints: PlatformEndpoints, name: PlatformServiceName, path?: string) => string | null
1424
+ ```
1425
+
1426
+ ## `resolveToolUiCardContent` (function)
1427
+
1428
+ ```ts
1429
+ resolveToolUiCardContent: (card: ToolUiCard) => { type: ToolUiCardContentType; content: string; } | null
1430
+ ```
1431
+
829
1432
  ## `ResultFeedback` (interface)
830
1433
 
831
1434
  ```ts
@@ -872,6 +1475,17 @@ result: unknown
872
1475
  sessionId: string
873
1476
  ```
874
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
+
875
1489
  ## `RunTrace` (interface)
876
1490
 
877
1491
  ```ts
@@ -897,13 +1511,42 @@ SDK_VERSION: string
897
1511
 
898
1512
  ```ts
899
1513
  askUserAnswer: Record<string, unknown> | undefined
1514
+ kbIds: number[] | undefined
900
1515
  mode: string | undefined
901
1516
  model: string | undefined
1517
+ queueWhenRunning: boolean | undefined
902
1518
  replayDecision: "keep_replay" | "continue_replay" | undefined
903
1519
  thinkingOverride: boolean | undefined
904
1520
  whatif: { from_step: number; quotes: Array<Record<string, unknown>>; deprecate_entry_ids: string[]; } | undefined
905
1521
  ```
906
1522
 
1523
+ ## `SessionComputer` (interface)
1524
+
1525
+ ```ts
1526
+ agent_runtimes: unknown[] | undefined
1527
+ allowed_paths: string[] | undefined
1528
+ arch: string | null | undefined
1529
+ blade_home: string | null | undefined
1530
+ created_at: string
1531
+ daemon_version: string | null | undefined
1532
+ enabled: boolean
1533
+ home: string | null | undefined
1534
+ hostname: string | null | undefined
1535
+ id: string
1536
+ is_primary: boolean
1537
+ label: string
1538
+ last_seen_at: string | null | undefined
1539
+ online: boolean
1540
+ os: string | null | undefined
1541
+ workspace: string | null | undefined
1542
+ ```
1543
+
1544
+ ## `SessionComputerList` (interface)
1545
+
1546
+ ```ts
1547
+ computers: SessionComputer[]
1548
+ ```
1549
+
907
1550
  ## `SessionConfig` (interface)
908
1551
 
909
1552
  ```ts
@@ -915,6 +1558,12 @@ memoryEnabled: boolean | undefined
915
1558
  model: string | undefined
916
1559
  ```
917
1560
 
1561
+ ## `SessionConnectOptions` (interface)
1562
+
1563
+ ```ts
1564
+ setup: ((session: AgentSession) => void) | undefined
1565
+ ```
1566
+
918
1567
  ## `SessionContextStats` (interface)
919
1568
 
920
1569
  ```ts
@@ -935,14 +1584,18 @@ solution: SolutionDefinition | undefined
935
1584
  ## `SessionDetail` (interface)
936
1585
 
937
1586
  ```ts
1587
+ agent_runtime_id: string | null | undefined
1588
+ ba_version: string | null | undefined
938
1589
  biz_role_id: string | null | undefined
939
1590
  bound_skill_id: string | null | undefined
1591
+ chat_group_id: string | null | undefined
940
1592
  created_at: string
941
1593
  daemon_id: string | null | undefined
942
1594
  disable_tools: (string[] & string[]) | undefined
943
1595
  enable_thinking: boolean | null | undefined
944
1596
  env: Record<string, string> | undefined
945
1597
  id: string
1598
+ initiator: "unknown" | "ui" | "sdk" | null | undefined
946
1599
  intent: string
947
1600
  is_example: boolean | undefined
948
1601
  is_headless: boolean | undefined
@@ -959,6 +1612,7 @@ primary_skill_id: string | null | undefined
959
1612
  primary_skill_snapshot: PrimarySkillSnapshot | null | undefined
960
1613
  replay_state: ReplayState | null | undefined
961
1614
  runtime_type: string | null | undefined
1615
+ sandbox_version: string | null | undefined
962
1616
  shared: boolean | undefined
963
1617
  solution: Solution | null | undefined
964
1618
  solution_id: string | null | undefined
@@ -984,7 +1638,7 @@ tools_tokens: number | null | undefined
984
1638
  ## `SessionHub` (class)
985
1639
 
986
1640
  ```ts
987
- connect: (sessionId: string) => Promise<AgentSession>
1641
+ connect: (sessionId: string, options?: SessionConnectOptions) => Promise<AgentSession>
988
1642
  disconnect: () => void
989
1643
  disposeAll: () => void
990
1644
  getConnection: () => ConnectionStatus
@@ -1005,6 +1659,7 @@ SessionInfo = type({
1005
1659
  "shared?": "boolean",
1006
1660
  "memory_enabled?": "boolean",
1007
1661
  "is_persistent?": "boolean",
1662
+ "initiator?": "'ui' | 'sdk' | 'unknown' | null",
1008
1663
  "is_headless?": "boolean",
1009
1664
  "viewer_role?": "'owner' | 'viewer'",
1010
1665
  "template_id?": "string | null",
@@ -1027,11 +1682,84 @@ SessionInfo = type({
1027
1682
  "disable_tools?": "string[]",
1028
1683
  "runtime_type?": "string | null",
1029
1684
  "daemon_id?": "string | null",
1685
+ "agent_runtime_id?": "string | null",
1030
1686
  "workspace_path?": "string | null",
1687
+ "ba_version?": "string | null",
1688
+ "sandbox_version?": "string | null",
1689
+ "chat_group_id?": "string | null",
1031
1690
  "match?": "unknown",
1032
1691
  })
1033
1692
  ```
1034
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
+
1035
1763
  ## `SessionPortMapping` (interface)
1036
1764
 
1037
1765
  ```ts
@@ -1051,6 +1779,23 @@ model: string | undefined
1051
1779
  solution: SolutionRef | undefined
1052
1780
  ```
1053
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
+
1054
1799
  ## `SessionSetupError` (class)
1055
1800
 
1056
1801
  ```ts
@@ -1072,6 +1817,7 @@ export type SessionSetupStage = "solution" | "session" | "skill" | "connection"
1072
1817
 
1073
1818
  ```ts
1074
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; }>
1075
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; }>
1076
1822
  connect: (sessionId: string) => Promise<AgentSession>
1077
1823
  copyFile: (sessionId: string, filePath: string) => Promise<{ path: string; }>
@@ -1085,24 +1831,36 @@ deleteFile: (sessionId: string, filePath: string) => Promise<void>
1085
1831
  deleteSession: (sessionId: string, options?: { deleteWorkspace?: boolean; }) => Promise<{ deleted: boolean; workspace_deleted?: boolean; }>
1086
1832
  downloadFile: (sessionId: string, filePath: string, downloadName?: string) => Promise<void>
1087
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>
1088
1837
  getBackgroundTask: (sessionId: string, taskId: string, tail?: number, init?: RequestInit) => Promise<BackgroundTask>
1089
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>
1090
1841
  getReplayPreview: (sessionId: string) => Promise<ReplayPreview>
1091
1842
  getSession: (sessionId: string, init?: RequestInit) => Promise<SessionDetail>
1092
1843
  getSessionCheckpoints: (sessionId: string, init?: RequestInit) => Promise<{ nodes: CheckpointNode[]; leaf_id: string | null; }>
1093
1844
  getSessionContextStats: (sessionId: string, init?: RequestInit) => Promise<SessionContextStats>
1094
1845
  getSessionHistory: (sessionId: string, init?: RequestInit) => Promise<SessionHistory>
1846
+ getSessionPluginConfig: (sessionId: string, name: string, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1095
1847
  getSessionTasks: (sessionId: string) => Promise<Task[]>
1848
+ getSessionTurnCommands: (sessionId: string) => Promise<HistoricalCommand[]>
1849
+ getSessionTurnIndex: (sessionId: string) => Promise<SessionTurnIndex>
1096
1850
  getSessionTurns: (sessionId: string) => Promise<TurnProjection[]>
1851
+ getSessionTurnsPage: (sessionId: string, options?: SessionTurnsQuery, init?: RequestInit) => Promise<SessionTurnsPage>
1097
1852
  getSharedSession: (token: string) => Promise<TurnProjection[]>
1098
1853
  importSession: (file: File, name?: string, solutionOverride?: string | null | ImportSessionOptions) => Promise<{ session_id: string; }>
1099
1854
  listBackgroundTasks: (sessionId: string, init?: RequestInit) => Promise<BackgroundTask[]>
1100
- listDir: (sessionId: string, dirPath: string) => Promise<FileEntry[]>
1855
+ listDir: (sessionId: string, dirPath: string, showHidden?: boolean) => Promise<FileEntry[]>
1101
1856
  listResultFeedback: (sessionId: string) => Promise<ResultFeedback[]>
1857
+ listSessionPlugins: (sessionId: string, init?: RequestInit) => Promise<{ plugins: SessionPlugin[]; sync_version: number; sync_pending: boolean; }>
1102
1858
  listSessions: (template_id_prefix?: string, solution_id?: string) => Promise<SessionInfo[]>
1103
- 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>
1104
1860
  listSessionsWithSkillData: () => Promise<SkillDevSession[]>
1861
+ onMcpAppChanged: (sessionId: string, sourceId: string, listener: () => void) => () => void
1105
1862
  pinSession: (sessionId: string, pinned: boolean) => Promise<SessionInfo>
1863
+ prepareSessionPluginConfig: (sessionId: string, name: string, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1106
1864
  previewImport: (file: File) => Promise<ImportPreview>
1107
1865
  probeSessionUrl: (sessionId: string, url: string) => Promise<{ reachable: boolean; requires_proxy: boolean; }>
1108
1866
  putResultFeedback: (sessionId: string, assistantEntryId: string, feedback: { helpful: boolean; reason?: ResultFeedbackReason | null; }) => Promise<ResultFeedback>
@@ -1110,16 +1868,20 @@ renameFile: (sessionId: string, filePath: string, newName: string) => Promise<{
1110
1868
  revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }>
1111
1869
  rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
1112
1870
  searchOwnedContent: (params: { q: string; limit?: number; }) => Promise<GlobalSearchResult>
1871
+ sessionPluginIconUrl: (sessionId: string, name: string) => string
1113
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; }>
1114
1874
  shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
1115
1875
  startReplaySession: (sourceSessionId: string, speed?: ReplaySpeed) => Promise<{ session_id: string; }>
1116
1876
  stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTaskStopResult>
1117
1877
  switchBranch: (sessionId: string, checkpointId: string) => Promise<{ id: string; leaf_id: string; }>
1118
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>
1119
1879
  tokenizePrompt: (prompt: string, model?: string) => Promise<TokenizeResult>
1880
+ updateMcpAppContext: (sessionId: string, sourceId: string, body: McpAppContextUpdate, init?: RequestInit) => Promise<{ status: "accepted"; revision: string; }>
1120
1881
  updateReplaySession: (sessionId: string, payload: { speed?: ReplaySpeed; status?: "autonomous"; }) => Promise<{ replay_state: SessionInfo["replay_state"]; }>
1121
- updateSession: (sessionId: string, payload: { intent?: string; }) => Promise<SessionDetail>
1882
+ updateSession: (sessionId: string, payload: { intent?: string; chat_group_id?: string | null; }) => Promise<SessionDetail>
1122
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; }>
1123
1885
  updateSharing: (sessionId: string, shared: boolean) => Promise<{ shared: boolean; }>
1124
1886
  uploadFiles: (sessionId: string, dirPath: string, files: FileList | File[] | UploadFileEntry[], options?: UploadFilesOptions) => Promise<{ uploaded: string[]; failed: string[]; }>
1125
1887
  writeFile: (sessionId: string, filePath: string, content: string) => Promise<{ success: boolean; }>
@@ -1134,8 +1896,11 @@ askAnswers: Record<string, AskUserAnswerData>
1134
1896
  connection: ConnectionStatus
1135
1897
  errorMessage: string | null
1136
1898
  isStreaming: boolean
1899
+ loadingOlder: boolean
1137
1900
  messages: ChatMessage[]
1138
1901
  mode: "planning" | "executing" | null
1902
+ nextBefore: string | null
1903
+ queue: SessionQueueSnapshot
1139
1904
  replay: ReplaySnapshot | null
1140
1905
  sessionId: string
1141
1906
  status: "completed" | "failed" | "interrupted" | "running" | "created" | "waiting_for_input" | null
@@ -1151,6 +1916,44 @@ SessionStatus = type(
1151
1916
  )
1152
1917
  ```
1153
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
+
1154
1957
  ## `ShareLinkResult` (interface)
1155
1958
 
1156
1959
  ```ts
@@ -1159,13 +1962,53 @@ token: string
1159
1962
  url: string
1160
1963
  ```
1161
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
+
1162
1989
  ## `SkillDefinition` (interface)
1163
1990
 
1164
1991
  ```ts
1165
- files: TextFile[]
1992
+ files: SkillFile[]
1166
1993
  name: string
1167
1994
  ```
1168
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
+
1169
2012
  ## `SkillMentionAvailability` (interface)
1170
2013
 
1171
2014
  ```ts
@@ -1243,6 +2086,18 @@ export type SolutionDefinition =
1243
2086
  export type SolutionRef = ExistingSolutionRef | PreparedSolutionAsset
1244
2087
  ```
1245
2088
 
2089
+ ## `sortComputers` (function)
2090
+
2091
+ ```ts
2092
+ sortComputers: (computers: SessionComputer[]) => SessionComputer[]
2093
+ ```
2094
+
2095
+ ## `SystemError` (interface)
2096
+
2097
+ ```ts
2098
+ message: string
2099
+ ```
2100
+
1246
2101
  ## `Task` (type)
1247
2102
 
1248
2103
  ```ts
@@ -1303,6 +2158,25 @@ action: string
1303
2158
  payload: unknown
1304
2159
  ```
1305
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
+
1306
2180
  ## `ToolCallInfo` (interface)
1307
2181
 
1308
2182
  ```ts
@@ -1316,6 +2190,60 @@ result: unknown
1316
2190
  status: "done" | "error" | "cancelled" | "awaiting_answer" | "pending" | undefined
1317
2191
  ```
1318
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
+
1319
2247
  ## `toReplaySnapshot` (function)
1320
2248
 
1321
2249
  ```ts
@@ -1336,13 +2264,26 @@ archived_files: ArchivedFileInfo[] | null | undefined
1336
2264
  archived_tool_calls: ArchivedToolCallInfo[] | null | undefined
1337
2265
  blocks: ContentBlock[]
1338
2266
  client_render_id: string | null | undefined
2267
+ client_request_id: string | null | undefined
1339
2268
  compaction_id: string | null | undefined
2269
+ context_action: ContextAction | null | undefined
2270
+ context_content: unknown
2271
+ context_key: string | null | undefined
2272
+ context_kind: string | null | undefined
2273
+ context_name: string | null | undefined
2274
+ context_order: number | null | undefined
2275
+ context_revision: string | null | undefined
1340
2276
  context_window: number | undefined
1341
- duration_ms: number | undefined
2277
+ display_summary: string | null | undefined
2278
+ display_title: string | null | undefined
2279
+ duration_ms: number | null | undefined
1342
2280
  failure_reason: string | null | undefined
1343
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
1344
2285
  id: string
1345
- kind: "message" | "compaction" | undefined
2286
+ kind: "message" | "context" | "compaction" | undefined
1346
2287
  loop_id: string
1347
2288
  memory_refs: MemoryRef[] | null | undefined
1348
2289
  model: string | null | undefined
@@ -1351,8 +2292,10 @@ post_chat_followup: PostChatFollowup | null | undefined
1351
2292
  role: "user" | "assistant" | "system"
1352
2293
  saved_ratio: number | null | undefined
1353
2294
  sequence: number
2295
+ sources: ContextSourceInfo[] | null | undefined
1354
2296
  started_at: string | null | undefined
1355
2297
  status: "streaming" | "completed" | "paused" | "failed" | "interrupted"
2298
+ stream_duration_ms: number | null | undefined
1356
2299
  summary_full: string | null | undefined
1357
2300
  summary_preview: string | null | undefined
1358
2301
  tokens_after: number | null | undefined