@blade-hq/agent-client 2610.0.1-alpha.1 → 2610.0.1

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 (44) hide show
  1. package/README.md +281 -11
  2. package/dist/auth.d.ts +0 -1
  3. package/dist/blade-client.d.ts +24 -1
  4. package/dist/index.d.ts +38 -7
  5. package/dist/index.js +2520 -283
  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 +238 -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 +8 -0
  21. package/dist/schemas/projection-utils.d.ts +3 -0
  22. package/dist/schemas/projection.d.ts +53 -2
  23. package/dist/schemas/session.d.ts +10 -1
  24. package/dist/session/agent-session.d.ts +160 -16
  25. package/dist/session/definition.d.ts +6 -1
  26. package/dist/session/errors.d.ts +11 -0
  27. package/dist/session/events.d.ts +16 -2
  28. package/dist/session/history-page.d.ts +9 -0
  29. package/dist/session/hub.d.ts +9 -1
  30. package/dist/session/queue.d.ts +104 -0
  31. package/dist/session/state.d.ts +19 -2
  32. package/dist/shared/auth-busy.d.ts +9 -0
  33. package/dist/shared/projection/builder.d.ts +17 -0
  34. package/dist/shared/projection/context.d.ts +3 -0
  35. package/dist/shared/projection/helpers.d.ts +4 -2
  36. package/dist/shared/projection/history.d.ts +1 -0
  37. package/dist/shared/projection/index.d.ts +2 -1
  38. package/dist/shared/projection/state.d.ts +7 -0
  39. package/dist/shared/tool-ui-card.d.ts +60 -0
  40. package/dist/shared/type-guards.d.ts +2 -0
  41. package/dist/socket.d.ts +2 -0
  42. package/dist/types/socket-events.d.ts +201 -2
  43. package/package.json +4 -2
  44. package/public-api.md +1071 -23
package/public-api.md CHANGED
@@ -3,7 +3,41 @@
3
3
  > 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
4
4
  > 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
5
5
 
6
- 共 126 个公开声明。
6
+ 共 247 个公开声明。
7
+
8
+ ## `acceptedPostChatFollowupCompletesLatestRun` (function)
9
+
10
+ ```ts
11
+ acceptedPostChatFollowupCompletesLatestRun: (events: RawEvent[], updates: ProjectionUpdate[]) => boolean
12
+ ```
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
+ ```
7
41
 
8
42
  ## `ActiveCompactionState` (interface)
9
43
 
@@ -35,26 +69,48 @@ toolCallId: string
35
69
  ## `AgentSession` (class)
36
70
 
37
71
  ```ts
38
- append: (text: string) => void
39
72
  attach: (label: string, data: unknown) => void
40
73
  attachApp: (options: AttachAppOptions) => Promise<AppCliAttachment | null>
74
+ cancelPendingLocate: () => void
75
+ cancelQueuedMessage: (itemId: string, expectedVersion?: number) => Promise<QueueOperationResult>
41
76
  compact: () => Promise<Record<string, unknown>>
42
77
  countFiles: (dirPath?: string) => Promise<number>
78
+ deliverQueuedMessage: (itemId: string, expectedVersion: number) => Promise<QueueOperationResult>
43
79
  dispose: () => void
44
80
  downloadFile: (filePath: string, downloadName?: string) => Promise<void>
45
81
  exitReplay: () => Promise<void>
46
82
  getState: () => SessionState
83
+ hasOlderHistory: boolean
47
84
  insertText: (text: string) => void
48
85
  isDisposed: boolean
86
+ isStatic: boolean
49
87
  listDir: (dirPath?: string) => Promise<FileEntry[]>
88
+ loadOlderHistory: (options?: { beforeCommit?: () => void; }) => Promise<void>
89
+ loadTurnIndex: () => Promise<SessionTurnIndexItem[]>
90
+ locateEntry: (entryId: string) => Promise<boolean>
50
91
  off: <K extends keyof AgentSessionEvents>(name: K, handler: (event: AgentSessionEvents[K]) => void) => void
51
92
  on: <K extends keyof AgentSessionEvents>(name: K, handler: (event: AgentSessionEvents[K]) => void) => () => void
52
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>
53
98
  send: (content: MessageContent, options?: SendOptions) => Promise<boolean>
54
99
  sessionId: string
55
100
  setReplaySpeed: (speed: ReplaySpeed) => Promise<void>
56
101
  stop: () => Promise<Record<string, unknown>>
57
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
58
114
  ```
59
115
 
60
116
  ## `AgentSessionEventName` (type)
@@ -71,7 +127,7 @@ attachRequested: { label: string; content: string; }
71
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; }
72
128
  chatEnd: { status: string; }
73
129
  command: { action: string; payload: unknown; toolCallId?: string; }
74
- error: { message: string; }
130
+ error: { message: string; code?: string; }
75
131
  insertTextRequested: { text: string; }
76
132
  message: { message: ChatMessage; turn: TurnProjection; }
77
133
  modeChange: { mode: "planning" | "executing"; }
@@ -79,11 +135,11 @@ notification: { type: string; title: string; detail?: string; status: "info" | "
79
135
  replayMismatch: { actualMessage?: string; expectedMessage?: string; respond: (decision: "keep_replay" | "continue_replay") => void; }
80
136
  rewind: { checkpointId: string; }
81
137
  sandboxOom: { toolCallId: string; }
82
- 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; }
83
139
  taskListUpdated: { tasks: unknown[]; }
84
140
  toolCall: { toolCall: ToolCallInfo; turn: TurnProjection; }
85
- toolPreview: { toolCallId: string; type: "resource-html" | "resource-uri"; content: string; title: string; }
86
- 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"; }
87
143
  workspaceChanged: { filePath?: string; }
88
144
  ```
89
145
 
@@ -127,6 +183,7 @@ tool_name: string | null | undefined
127
183
 
128
184
  ```ts
129
185
  custom: Record<number, string>
186
+ note: string | undefined
130
187
  selections: Record<number, number[]>
131
188
  ```
132
189
 
@@ -146,6 +203,20 @@ cli: AppCliDefinition | undefined
146
203
  getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
147
204
  ```
148
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
+
149
220
  ## `AuthResource` (class)
150
221
 
151
222
  ```ts
@@ -211,6 +282,8 @@ statusText: string
211
282
  auth: AuthResource
212
283
  blob: (method: HttpMethod, path: string) => Promise<Blob>
213
284
  buildAuthedUrl: (path: string) => string
285
+ chatGroups: ChatGroupsResource
286
+ computers: ComputersResource
214
287
  fetch: (method: HttpMethod, path: string, init?: BladeFetchInit, isRetry?: boolean) => Promise<Response>
215
288
  formData: (method: HttpMethod, path: string, form: FormData, options?: { expectOk?: boolean; onUploadProgress?: (progress: UploadProgress) => void; }) => Promise<Response>
216
289
  hasToken: () => boolean
@@ -223,10 +296,13 @@ logoutToken: () => void
223
296
  models: ModelsResource
224
297
  onSocketReplaced: (listener: () => void) => () => void
225
298
  options: BladeClientOptions
299
+ plugins: PluginsResource
300
+ requestCommand: (event: string, payload: Record<string, unknown>, timeoutMs: number) => Promise<Record<string, unknown>>
226
301
  responseFromInit: (path: string, init?: RequestInit) => Promise<Response>
227
302
  sessions: SessionsResource
228
303
  setBaseUrl: (baseUrl: string) => void
229
304
  setToken: (token: string | null) => void
305
+ siteVisits: SiteVisitsResource
230
306
  socket: () => TypedSocket
231
307
  text: (method: HttpMethod, path: string) => Promise<string>
232
308
  textFromInit: (path: string, init?: RequestInit) => Promise<string>
@@ -237,6 +313,7 @@ token: string | null
237
313
 
238
314
  ```ts
239
315
  baseUrl: string
316
+ commandTransport: ((event: string, payload: Record<string, unknown>, send: () => Promise<Record<string, unknown>>) => Promise<Record<string, unknown>>) | undefined
240
317
  fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
241
318
  onRefreshSuccess: (() => void | Promise<void>) | undefined
242
319
  socketToken: string | (() => string | null | undefined) | undefined
@@ -250,12 +327,78 @@ tokenStorage: TokenStorageMode | undefined
250
327
  buildMessageContent: (text: string, attachments: Array<{ kind: "file"; name: string; uploadedPath?: string; textContent?: string | null; mimeType?: string; }>) => MessageContent
251
328
  ```
252
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
+
253
395
  ## `ChatMessage` (interface)
254
396
 
255
397
  ```ts
256
398
  blocks: ContentBlock[] | undefined
257
399
  compaction: CompactionInfo | undefined
258
400
  content: MessageContent
401
+ context: ContextProjectionData | undefined
259
402
  duration_ms: number | undefined
260
403
  entry_id: string | undefined
261
404
  kind: string | undefined
@@ -263,6 +406,7 @@ loop_name: string | undefined
263
406
  memory_refs: MemoryRefInfo[] | undefined
264
407
  parent_id: string | null | undefined
265
408
  reasoning: string | undefined
409
+ render_id: string | undefined
266
410
  role: "error" | "user" | "assistant" | "tool"
267
411
  status: "streaming" | "completed" | "paused" | "failed" | "interrupted" | undefined
268
412
  timestamp: string | undefined
@@ -278,6 +422,18 @@ reset: () => void
278
422
  seedSequence: (maxSeq: number) => void
279
423
  ```
280
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
+
281
437
  ## `CommandEnvelope` (interface)
282
438
 
283
439
  ```ts
@@ -310,6 +466,50 @@ tokens_before: number | null | undefined
310
466
  trigger: "auto" | "manual" | "forced_retry" | null | undefined
311
467
  ```
312
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
+
313
513
  ## `connectEmbedded` (function)
314
514
 
315
515
  ```ts
@@ -326,18 +526,89 @@ export type ConnectionStatus = "connecting" | "connected" | "reconnecting" | "di
326
526
 
327
527
  ```ts
328
528
  content: unknown
529
+ delivery_id: string | null | undefined
329
530
  display_name: string | null | undefined
330
531
  tool_call_id: string | null | undefined
331
532
  tool_name: string | null | undefined
332
533
  type: "text" | "thinking" | "tool_use" | "tool_result" | "tool_ui" | "tool_bridge" | "system_notification" | "mode_change" | "plan_status" | "ask_user_answer"
333
534
  ```
334
535
 
536
+ ## `ContentDelta` (interface)
537
+
538
+ ```ts
539
+ content: string
540
+ loop_name: string | undefined
541
+ ```
542
+
335
543
  ## `contentPreview` (function)
336
544
 
337
545
  ```ts
338
546
  contentPreview: (content: MessageContent, maxLen?: number) => string
339
547
  ```
340
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
+
341
612
  ## `createInitialSessionState` (function)
342
613
 
343
614
  ```ts
@@ -347,7 +618,9 @@ createInitialSessionState: (sessionId: string) => SessionState
347
618
  ## `CreateSessionRequest` (interface)
348
619
 
349
620
  ```ts
621
+ agent_runtime_id: string | null | undefined
350
622
  biz_role_id: string | null | undefined
623
+ chat_group_id: string | null | undefined
351
624
  compaction_ratio: number | null | undefined
352
625
  daemon_id: string | null | undefined
353
626
  disable_tools: string[] | null | undefined
@@ -357,7 +630,7 @@ intent: string | undefined
357
630
  memory_enabled: boolean | null | undefined
358
631
  model: string | null | undefined
359
632
  primary_skill_id: string | null | undefined
360
- runtime_type: "sandbox" | "daemon" | null | undefined
633
+ runtime_type: "sandbox" | "daemon" | "native" | null | undefined
361
634
  session_solution_asset_id: string | null | undefined
362
635
  solution_id: string | undefined
363
636
  solution_ref: PublishedSolutionRef | undefined
@@ -377,6 +650,7 @@ createSocket: (options: CreateSocketOptions) => TypedSocket
377
650
  baseUrl: string
378
651
  path: string | undefined
379
652
  token: string | (() => string | null | undefined) | undefined
653
+ transports: ("polling" | "websocket")[] | undefined
380
654
  ```
381
655
 
382
656
  ## `DEFAULT_REPLAY_SPEED` (const)
@@ -402,6 +676,18 @@ allowedOrigins: string[]
402
676
  iframe: HTMLIFrameElement | undefined
403
677
  ```
404
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
+
405
691
  ## `ExchangeCodeParams` (interface)
406
692
 
407
693
  ```ts
@@ -450,6 +736,26 @@ path: string
450
736
  tags: string[] | undefined
451
737
  ```
452
738
 
739
+ ## `FinalArtifact` (interface)
740
+
741
+ ```ts
742
+ kind: "link" | "file"
743
+ label: string
744
+ target: string
745
+ ```
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
+
453
759
  ## `getFileParts` (function)
454
760
 
455
761
  ```ts
@@ -468,12 +774,60 @@ getImageParts: (content: MessageContent) => ImageUrlContentPart[]
468
774
  getTextContent: (content: MessageContent) => string
469
775
  ```
470
776
 
777
+ ## `GlobalSearchConversationResult` (interface)
778
+
779
+ ```ts
780
+ matched: "title" | "content"
781
+ session: SessionInfo
782
+ snippet: string
783
+ type: "conversation"
784
+ ```
785
+
786
+ ## `GlobalSearchFileResult` (interface)
787
+
788
+ ```ts
789
+ matched: "name" | "path"
790
+ name: string
791
+ path: string
792
+ session: SessionInfo
793
+ snippet: string
794
+ type: "file"
795
+ ```
796
+
797
+ ## `GlobalSearchResult` (interface)
798
+
799
+ ```ts
800
+ indexing: boolean
801
+ items: GlobalSearchResultItem[]
802
+ truncated: boolean
803
+ ```
804
+
805
+ ## `GlobalSearchResultItem` (type)
806
+
807
+ ```ts
808
+ export type GlobalSearchResultItem =
809
+ | GlobalSearchConversationResult
810
+ | GlobalSearchFileResult
811
+ ```
812
+
813
+ ## `groupAdjacentContextRuns` (function)
814
+
815
+ ```ts
816
+ groupAdjacentContextRuns: (kinds: readonly (string | null)[]) => readonly (readonly number[])[]
817
+ ```
818
+
471
819
  ## `groupMessagesByLoop` (function)
472
820
 
473
821
  ```ts
474
822
  groupMessagesByLoop: (messages: ChatMessage[]) => MessageGroup[]
475
823
  ```
476
824
 
825
+ ## `hasChatRunEvent` (function)
826
+
827
+ ```ts
828
+ hasChatRunEvent: (events: RawEvent[]) => boolean
829
+ ```
830
+
477
831
  ## `HeadlessResource` (class)
478
832
 
479
833
  ```ts
@@ -482,10 +836,19 @@ runInSession: { <T = unknown>(sessionId: string, prompt: string, options: Headle
482
836
  runWithSession: { <T = unknown>(prompt: string, options: HeadlessRunOptions & { schema: JsonSchemaObject; }): Promise<HeadlessRunInSessionResult<T>>; (prompt: string, options?: HeadlessRunOptions): Promise<HeadlessRunInSessionResult<string>>; }
483
837
  ```
484
838
 
839
+ ## `HistoricalCommand` (interface)
840
+
841
+ ```ts
842
+ action: string
843
+ deliveryId: string
844
+ payload: unknown
845
+ toolCallId: string | undefined
846
+ ```
847
+
485
848
  ## `ImageUrlContentPart` (interface)
486
849
 
487
850
  ```ts
488
- image_url: { url: string; }
851
+ image_url: { url: string; source_path?: string; width?: number; height?: number; }
489
852
  type: "image_url"
490
853
  ```
491
854
 
@@ -510,16 +873,48 @@ direction: "host-to-agent"
510
873
  payload: unknown
511
874
  ```
512
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
+
513
902
  ## `isCommandEnvelope` (function)
514
903
 
515
904
  ```ts
516
905
  isCommandEnvelope: (value: unknown) => value is CommandEnvelope
517
906
  ```
518
907
 
908
+ ## `isEntryGoneError` (function)
909
+
910
+ ```ts
911
+ isEntryGoneError: (error: unknown) => boolean
912
+ ```
913
+
519
914
  ## `isHiddenInternalMessage` (function)
520
915
 
521
916
  ```ts
522
- isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">) => boolean
917
+ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">, options?: { includeLegacyForkContext?: boolean; }) => boolean
523
918
  ```
524
919
 
525
920
  ## `isInboundEnvelope` (function)
@@ -528,6 +923,36 @@ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">) => boo
528
923
  isInboundEnvelope: (value: unknown) => value is InboundEnvelope
529
924
  ```
530
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
+
950
+ ## `latestPostChatFollowup` (function)
951
+
952
+ ```ts
953
+ latestPostChatFollowup: (turns: TurnProjection[]) => PostChatFollowup | null
954
+ ```
955
+
531
956
  ## `LayoutType` (enum)
532
957
 
533
958
  ```ts
@@ -544,6 +969,37 @@ export enum LayoutType {
544
969
  }
545
970
  ```
546
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
+
547
1003
  ## `LoginOptions` (interface)
548
1004
 
549
1005
  ```ts
@@ -559,6 +1015,49 @@ token: string
559
1015
  user: { id?: string; username?: string; display_name?: string; } | undefined
560
1016
  ```
561
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
+
562
1061
  ## `MemoryRef` (interface)
563
1062
 
564
1063
  ```ts
@@ -600,6 +1099,8 @@ baseUrl: string | undefined
600
1099
  default: string
601
1100
  defaultServiceModel: string | undefined
602
1101
  models: ModelOption[]
1102
+ unavailableModelIds: string[] | undefined
1103
+ unavailableProviderIds: string[] | undefined
603
1104
  ```
604
1105
 
605
1106
  ## `ModelOption` (interface)
@@ -646,14 +1147,76 @@ content: string
646
1147
  label: string
647
1148
  ```
648
1149
 
649
- ## `PatchEnvelope` (interface)
1150
+ ## `parseQueueAck` (function)
1151
+
1152
+ ```ts
1153
+ parseQueueAck: (response: unknown, fallbackSessionId: string) => QueueOperationResult
1154
+ ```
1155
+
1156
+ ## `PatchEnvelope` (interface)
1157
+
1158
+ ```ts
1159
+ data: { turn?: TurnProjection; workspace_changed?: { tool_call_id?: string; tool_name?: string; workspace_path?: string; }; }
1160
+ loop_id: string
1161
+ patch_type: string
1162
+ sequence: number
1163
+ turn_id: string
1164
+ ```
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
+
1211
+ ## `PostChatFollowup` (interface)
650
1212
 
651
1213
  ```ts
652
- data: { turn?: TurnProjection; workspace_changed?: { tool_call_id?: string; tool_name?: string; workspace_path?: string; }; }
653
- loop_id: string
654
- patch_type: string
655
- sequence: number
656
- turn_id: string
1214
+ assistant_entry_id: string
1215
+ feedback_eligible: boolean
1216
+ feedback_scope: "latest_result"
1217
+ final_artifacts: FinalArtifact[] | undefined
1218
+ recaption: string | undefined
1219
+ suggestions: string[]
657
1220
  ```
658
1221
 
659
1222
  ## `PreparedSolution` (interface)
@@ -675,6 +1238,21 @@ bizRoleId: string | undefined
675
1238
  kind: "prepared"
676
1239
  ```
677
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
+
678
1256
  ## `PrimarySkillParallelMode` (interface)
679
1257
 
680
1258
  ```ts
@@ -695,6 +1273,21 @@ title: string
695
1273
  version: number
696
1274
  ```
697
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
+
698
1291
  ## `ProvidersResponse` (interface)
699
1292
 
700
1293
  ```ts
@@ -710,6 +1303,61 @@ export type PublishedSolutionRef =
710
1303
  | { source: "hub"; org: string; name: string }
711
1304
  ```
712
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
+
713
1361
  ## `RawEvent` (interface)
714
1362
 
715
1363
  ```ts
@@ -717,6 +1365,24 @@ payload: Record<string, unknown>
717
1365
  type: string
718
1366
  ```
719
1367
 
1368
+ ## `reconcileHistoricalUserTurns` (function)
1369
+
1370
+ ```ts
1371
+ reconcileHistoricalUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
1372
+ ```
1373
+
1374
+ ## `reconcileOptimisticUserTurns` (function)
1375
+
1376
+ ```ts
1377
+ reconcileOptimisticUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
1378
+ ```
1379
+
1380
+ ## `replaceWindow` (function)
1381
+
1382
+ ```ts
1383
+ replaceWindow: (current: TurnProjection[], page: TurnProjection[], liveRevisionAtStart: number, liveRevisions: LiveRevisionState) => TurnProjection[]
1384
+ ```
1385
+
720
1386
  ## `ReplayPreview` (interface)
721
1387
 
722
1388
  ```ts
@@ -751,6 +1417,43 @@ speed: ReplaySpeed | undefined
751
1417
  status: "replay" | "autonomous" | undefined
752
1418
  ```
753
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
+
1432
+ ## `ResultFeedback` (interface)
1433
+
1434
+ ```ts
1435
+ assistant_entry_id: string
1436
+ created_at: string
1437
+ helpful: boolean
1438
+ project_id: string | null
1439
+ reason: ResultFeedbackReason | null
1440
+ session_id: string
1441
+ surface: "unknown" | "chat" | "software_factory"
1442
+ updated_at: string
1443
+ ```
1444
+
1445
+ ## `ResultFeedbackReason` (type)
1446
+
1447
+ ```ts
1448
+ export type ResultFeedbackReason =
1449
+ | "not_solved"
1450
+ | "inaccurate"
1451
+ | "incomplete"
1452
+ | "needs_major_changes"
1453
+ | "too_slow"
1454
+ | "other"
1455
+ ```
1456
+
754
1457
  ## `RunOptions` (interface)
755
1458
 
756
1459
  ```ts
@@ -772,6 +1475,17 @@ result: unknown
772
1475
  sessionId: string
773
1476
  ```
774
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
+
775
1489
  ## `RunTrace` (interface)
776
1490
 
777
1491
  ```ts
@@ -797,13 +1511,42 @@ SDK_VERSION: string
797
1511
 
798
1512
  ```ts
799
1513
  askUserAnswer: Record<string, unknown> | undefined
1514
+ kbIds: number[] | undefined
800
1515
  mode: string | undefined
801
1516
  model: string | undefined
1517
+ queueWhenRunning: boolean | undefined
802
1518
  replayDecision: "keep_replay" | "continue_replay" | undefined
803
1519
  thinkingOverride: boolean | undefined
804
1520
  whatif: { from_step: number; quotes: Array<Record<string, unknown>>; deprecate_entry_ids: string[]; } | undefined
805
1521
  ```
806
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
+
807
1550
  ## `SessionConfig` (interface)
808
1551
 
809
1552
  ```ts
@@ -815,6 +1558,12 @@ memoryEnabled: boolean | undefined
815
1558
  model: string | undefined
816
1559
  ```
817
1560
 
1561
+ ## `SessionConnectOptions` (interface)
1562
+
1563
+ ```ts
1564
+ setup: ((session: AgentSession) => void) | undefined
1565
+ ```
1566
+
818
1567
  ## `SessionContextStats` (interface)
819
1568
 
820
1569
  ```ts
@@ -835,14 +1584,18 @@ solution: SolutionDefinition | undefined
835
1584
  ## `SessionDetail` (interface)
836
1585
 
837
1586
  ```ts
1587
+ agent_runtime_id: string | null | undefined
1588
+ ba_version: string | null | undefined
838
1589
  biz_role_id: string | null | undefined
839
1590
  bound_skill_id: string | null | undefined
1591
+ chat_group_id: string | null | undefined
840
1592
  created_at: string
841
1593
  daemon_id: string | null | undefined
842
1594
  disable_tools: (string[] & string[]) | undefined
843
1595
  enable_thinking: boolean | null | undefined
844
1596
  env: Record<string, string> | undefined
845
1597
  id: string
1598
+ initiator: "unknown" | "ui" | "sdk" | null | undefined
846
1599
  intent: string
847
1600
  is_example: boolean | undefined
848
1601
  is_headless: boolean | undefined
@@ -859,6 +1612,7 @@ primary_skill_id: string | null | undefined
859
1612
  primary_skill_snapshot: PrimarySkillSnapshot | null | undefined
860
1613
  replay_state: ReplayState | null | undefined
861
1614
  runtime_type: string | null | undefined
1615
+ sandbox_version: string | null | undefined
862
1616
  shared: boolean | undefined
863
1617
  solution: Solution | null | undefined
864
1618
  solution_id: string | null | undefined
@@ -884,7 +1638,7 @@ tools_tokens: number | null | undefined
884
1638
  ## `SessionHub` (class)
885
1639
 
886
1640
  ```ts
887
- connect: (sessionId: string) => Promise<AgentSession>
1641
+ connect: (sessionId: string, options?: SessionConnectOptions) => Promise<AgentSession>
888
1642
  disconnect: () => void
889
1643
  disposeAll: () => void
890
1644
  getConnection: () => ConnectionStatus
@@ -905,6 +1659,7 @@ SessionInfo = type({
905
1659
  "shared?": "boolean",
906
1660
  "memory_enabled?": "boolean",
907
1661
  "is_persistent?": "boolean",
1662
+ "initiator?": "'ui' | 'sdk' | 'unknown' | null",
908
1663
  "is_headless?": "boolean",
909
1664
  "viewer_role?": "'owner' | 'viewer'",
910
1665
  "template_id?": "string | null",
@@ -927,11 +1682,84 @@ SessionInfo = type({
927
1682
  "disable_tools?": "string[]",
928
1683
  "runtime_type?": "string | null",
929
1684
  "daemon_id?": "string | null",
1685
+ "agent_runtime_id?": "string | null",
930
1686
  "workspace_path?": "string | null",
1687
+ "ba_version?": "string | null",
1688
+ "sandbox_version?": "string | null",
1689
+ "chat_group_id?": "string | null",
931
1690
  "match?": "unknown",
932
1691
  })
933
1692
  ```
934
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
+
935
1763
  ## `SessionPortMapping` (interface)
936
1764
 
937
1765
  ```ts
@@ -951,6 +1779,23 @@ model: string | undefined
951
1779
  solution: SolutionRef | undefined
952
1780
  ```
953
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
+
954
1799
  ## `SessionSetupError` (class)
955
1800
 
956
1801
  ```ts
@@ -972,6 +1817,7 @@ export type SessionSetupStage = "solution" | "session" | "skill" | "connection"
972
1817
 
973
1818
  ```ts
974
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; }>
975
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; }>
976
1822
  connect: (sessionId: string) => Promise<AgentSession>
977
1823
  copyFile: (sessionId: string, filePath: string) => Promise<{ path: string; }>
@@ -985,40 +1831,59 @@ deleteFile: (sessionId: string, filePath: string) => Promise<void>
985
1831
  deleteSession: (sessionId: string, options?: { deleteWorkspace?: boolean; }) => Promise<{ deleted: boolean; workspace_deleted?: boolean; }>
986
1832
  downloadFile: (sessionId: string, filePath: string, downloadName?: string) => Promise<void>
987
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>
988
1837
  getBackgroundTask: (sessionId: string, taskId: string, tail?: number, init?: RequestInit) => Promise<BackgroundTask>
989
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>
990
1841
  getReplayPreview: (sessionId: string) => Promise<ReplayPreview>
991
1842
  getSession: (sessionId: string, init?: RequestInit) => Promise<SessionDetail>
992
1843
  getSessionCheckpoints: (sessionId: string, init?: RequestInit) => Promise<{ nodes: CheckpointNode[]; leaf_id: string | null; }>
993
1844
  getSessionContextStats: (sessionId: string, init?: RequestInit) => Promise<SessionContextStats>
994
1845
  getSessionHistory: (sessionId: string, init?: RequestInit) => Promise<SessionHistory>
1846
+ getSessionPluginConfig: (sessionId: string, name: string, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
995
1847
  getSessionTasks: (sessionId: string) => Promise<Task[]>
1848
+ getSessionTurnCommands: (sessionId: string) => Promise<HistoricalCommand[]>
1849
+ getSessionTurnIndex: (sessionId: string) => Promise<SessionTurnIndex>
996
1850
  getSessionTurns: (sessionId: string) => Promise<TurnProjection[]>
1851
+ getSessionTurnsPage: (sessionId: string, options?: SessionTurnsQuery, init?: RequestInit) => Promise<SessionTurnsPage>
997
1852
  getSharedSession: (token: string) => Promise<TurnProjection[]>
998
1853
  importSession: (file: File, name?: string, solutionOverride?: string | null | ImportSessionOptions) => Promise<{ session_id: string; }>
999
1854
  listBackgroundTasks: (sessionId: string, init?: RequestInit) => Promise<BackgroundTask[]>
1000
- listDir: (sessionId: string, dirPath: string) => Promise<FileEntry[]>
1855
+ listDir: (sessionId: string, dirPath: string, showHidden?: boolean) => Promise<FileEntry[]>
1856
+ listResultFeedback: (sessionId: string) => Promise<ResultFeedback[]>
1857
+ listSessionPlugins: (sessionId: string, init?: RequestInit) => Promise<{ plugins: SessionPlugin[]; sync_version: number; sync_pending: boolean; }>
1001
1858
  listSessions: (template_id_prefix?: string, solution_id?: string) => Promise<SessionInfo[]>
1002
- 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>
1003
1860
  listSessionsWithSkillData: () => Promise<SkillDevSession[]>
1861
+ onMcpAppChanged: (sessionId: string, sourceId: string, listener: () => void) => () => void
1004
1862
  pinSession: (sessionId: string, pinned: boolean) => Promise<SessionInfo>
1863
+ prepareSessionPluginConfig: (sessionId: string, name: string, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1005
1864
  previewImport: (file: File) => Promise<ImportPreview>
1006
1865
  probeSessionUrl: (sessionId: string, url: string) => Promise<{ reachable: boolean; requires_proxy: boolean; }>
1866
+ putResultFeedback: (sessionId: string, assistantEntryId: string, feedback: { helpful: boolean; reason?: ResultFeedbackReason | null; }) => Promise<ResultFeedback>
1007
1867
  renameFile: (sessionId: string, filePath: string, newName: string) => Promise<{ path: string; }>
1008
1868
  revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }>
1009
1869
  rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
1870
+ searchOwnedContent: (params: { q: string; limit?: number; }) => Promise<GlobalSearchResult>
1871
+ sessionPluginIconUrl: (sessionId: string, name: string) => string
1010
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; }>
1011
1874
  shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
1012
1875
  startReplaySession: (sourceSessionId: string, speed?: ReplaySpeed) => Promise<{ session_id: string; }>
1013
1876
  stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTaskStopResult>
1014
1877
  switchBranch: (sessionId: string, checkpointId: string) => Promise<{ id: string; leaf_id: string; }>
1015
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>
1016
1879
  tokenizePrompt: (prompt: string, model?: string) => Promise<TokenizeResult>
1880
+ updateMcpAppContext: (sessionId: string, sourceId: string, body: McpAppContextUpdate, init?: RequestInit) => Promise<{ status: "accepted"; revision: string; }>
1017
1881
  updateReplaySession: (sessionId: string, payload: { speed?: ReplaySpeed; status?: "autonomous"; }) => Promise<{ replay_state: SessionInfo["replay_state"]; }>
1018
- updateSession: (sessionId: string, payload: { intent?: string; }) => Promise<SessionDetail>
1882
+ updateSession: (sessionId: string, payload: { intent?: string; chat_group_id?: string | null; }) => Promise<SessionDetail>
1019
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; }>
1020
1885
  updateSharing: (sessionId: string, shared: boolean) => Promise<{ shared: boolean; }>
1021
- uploadFiles: (sessionId: string, dirPath: string, files: FileList | File[] | UploadFileEntry[], options?: UploadFilesOptions) => Promise<{ uploaded: string[]; failed: string[]; }>
1886
+ uploadFiles: (sessionId: string, dirPath: string, files: FileList | File[] | UploadFileEntry[], options?: UploadFilesOptions) => Promise<{ uploaded: string[]; failed: string[]; results: Array<{ index: number; path?: string; error?: string; }>; }>
1022
1887
  writeFile: (sessionId: string, filePath: string, content: string) => Promise<{ success: boolean; }>
1023
1888
  ```
1024
1889
 
@@ -1031,8 +1896,11 @@ askAnswers: Record<string, AskUserAnswerData>
1031
1896
  connection: ConnectionStatus
1032
1897
  errorMessage: string | null
1033
1898
  isStreaming: boolean
1899
+ loadingOlder: boolean
1034
1900
  messages: ChatMessage[]
1035
1901
  mode: "planning" | "executing" | null
1902
+ nextBefore: string | null
1903
+ queue: SessionQueueSnapshot
1036
1904
  replay: ReplaySnapshot | null
1037
1905
  sessionId: string
1038
1906
  status: "completed" | "failed" | "interrupted" | "running" | "created" | "waiting_for_input" | null
@@ -1048,6 +1916,44 @@ SessionStatus = type(
1048
1916
  )
1049
1917
  ```
1050
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
+
1051
1957
  ## `ShareLinkResult` (interface)
1052
1958
 
1053
1959
  ```ts
@@ -1056,13 +1962,53 @@ token: string
1056
1962
  url: string
1057
1963
  ```
1058
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
+
1059
1989
  ## `SkillDefinition` (interface)
1060
1990
 
1061
1991
  ```ts
1062
- files: TextFile[]
1992
+ files: SkillFile[]
1063
1993
  name: string
1064
1994
  ```
1065
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
+
1066
2012
  ## `SkillMentionAvailability` (interface)
1067
2013
 
1068
2014
  ```ts
@@ -1140,6 +2086,18 @@ export type SolutionDefinition =
1140
2086
  export type SolutionRef = ExistingSolutionRef | PreparedSolutionAsset
1141
2087
  ```
1142
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
+
1143
2101
  ## `Task` (type)
1144
2102
 
1145
2103
  ```ts
@@ -1200,6 +2158,25 @@ action: string
1200
2158
  payload: unknown
1201
2159
  ```
1202
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
+
1203
2180
  ## `ToolCallInfo` (interface)
1204
2181
 
1205
2182
  ```ts
@@ -1213,6 +2190,60 @@ result: unknown
1213
2190
  status: "done" | "error" | "cancelled" | "awaiting_answer" | "pending" | undefined
1214
2191
  ```
1215
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
+
1216
2247
  ## `toReplaySnapshot` (function)
1217
2248
 
1218
2249
  ```ts
@@ -1232,22 +2263,39 @@ archived_count: number | null | undefined
1232
2263
  archived_files: ArchivedFileInfo[] | null | undefined
1233
2264
  archived_tool_calls: ArchivedToolCallInfo[] | null | undefined
1234
2265
  blocks: ContentBlock[]
2266
+ client_render_id: string | null | undefined
2267
+ client_request_id: string | null | undefined
1235
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
1236
2276
  context_window: number | undefined
1237
- duration_ms: number | undefined
2277
+ display_summary: string | null | undefined
2278
+ display_title: string | null | undefined
2279
+ duration_ms: number | null | undefined
1238
2280
  failure_reason: string | null | undefined
1239
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
1240
2285
  id: string
1241
- kind: "message" | "compaction" | undefined
2286
+ kind: "message" | "context" | "compaction" | undefined
1242
2287
  loop_id: string
1243
2288
  memory_refs: MemoryRef[] | null | undefined
1244
2289
  model: string | null | undefined
1245
2290
  parent_fork_tool_call_id: string | null | undefined
2291
+ post_chat_followup: PostChatFollowup | null | undefined
1246
2292
  role: "user" | "assistant" | "system"
1247
2293
  saved_ratio: number | null | undefined
1248
2294
  sequence: number
2295
+ sources: ContextSourceInfo[] | null | undefined
1249
2296
  started_at: string | null | undefined
1250
2297
  status: "streaming" | "completed" | "paused" | "failed" | "interrupted"
2298
+ stream_duration_ms: number | null | undefined
1251
2299
  summary_full: string | null | undefined
1252
2300
  summary_preview: string | null | undefined
1253
2301
  tokens_after: number | null | undefined