@blade-hq/agent-react 2610.0.0-beta.50 → 2610.0.0-beta.51

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.
package/public-api.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
4
4
  > 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
5
5
 
6
- 247 个公开声明。
6
+ 281 个公开声明。
7
7
 
8
8
  ## `acceptedPostChatFollowupCompletesLatestRun` (function)
9
9
 
@@ -128,7 +128,7 @@ sandboxOom: { toolCallId: string; }
128
128
  sessionUpdated: { intent?: string; status?: SessionStatus; model?: string | null; boundSkillId?: string | null; replayState?: Record<string, unknown> | null; }
129
129
  taskListUpdated: { tasks: unknown[]; }
130
130
  toolCall: { toolCall: ToolCallInfo; turn: TurnProjection; }
131
- toolPreview: { toolCallId: string; type: "resource-html" | "resource-uri"; content: string; title: string; }
131
+ toolPreview: { toolCallId: string; type: "resource-html" | "resource-uri"; content: string; title: string; mcpApp?: McpAppData; }
132
132
  toolResult: { toolCall: ToolCallInfo; turn: TurnProjection; source: "live" | "bootstrap_replay" | "reconnect_replay"; }
133
133
  workspaceChanged: { filePath?: string; }
134
134
  ```
@@ -326,6 +326,12 @@ client: BladeClient
326
326
  buildMessageContent: (text: string, attachments: Array<{ kind: "file"; name: string; uploadedPath?: string; textContent?: string | null; mimeType?: string; }>) => MessageContent
327
327
  ```
328
328
 
329
+ ## `buildToolUiCardKey` (function)
330
+
331
+ ```ts
332
+ buildToolUiCardKey: (toolCallId: string, type: ToolUiCardContentType, content: string) => string
333
+ ```
334
+
329
335
  ## `canToggleComputer` (function)
330
336
 
331
337
  ```ts
@@ -450,12 +456,24 @@ reset: () => void
450
456
  seedSequence: (maxSeq: number) => void
451
457
  ```
452
458
 
459
+ ## `collectInlineToolUiCards` (function)
460
+
461
+ ```ts
462
+ collectInlineToolUiCards: (messages: ChatMessage[]) => InlineToolUiCardEntry[]
463
+ ```
464
+
453
465
  ## `collectMemoryRefs` (function)
454
466
 
455
467
  ```ts
456
468
  collectMemoryRefs: (messages: ChatMessage[]) => MemoryRefInfo[]
457
469
  ```
458
470
 
471
+ ## `collectPreviewToolUiCards` (function)
472
+
473
+ ```ts
474
+ collectPreviewToolUiCards: (messages: ChatMessage[]) => PreviewToolUiCardEntry[]
475
+ ```
476
+
459
477
  ## `CommandEnvelope` (interface)
460
478
 
461
479
  ```ts
@@ -963,6 +981,14 @@ direction: "host-to-agent"
963
981
  payload: unknown
964
982
  ```
965
983
 
984
+ ## `InlineToolUiCardEntry` (interface)
985
+
986
+ ```ts
987
+ card: ToolUiCard
988
+ key: string
989
+ toolCallId: string
990
+ ```
991
+
966
992
  ## `isAgentComputerCommand` (function)
967
993
 
968
994
  ```ts
@@ -975,6 +1001,12 @@ isAgentComputerCommand: (command: string) => boolean
975
1001
  isAgentComputerToolCall: (argumentsJson: string | null | undefined) => boolean
976
1002
  ```
977
1003
 
1004
+ ## `isAppDevToolUiCard` (function)
1005
+
1006
+ ```ts
1007
+ isAppDevToolUiCard: (card: ToolUiCard, isAppDev: boolean) => boolean
1008
+ ```
1009
+
978
1010
  ## `isCommandEnvelope` (function)
979
1011
 
980
1012
  ```ts
@@ -993,12 +1025,30 @@ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">, option
993
1025
  isInboundEnvelope: (value: unknown) => value is InboundEnvelope
994
1026
  ```
995
1027
 
1028
+ ## `isInternalStatusToolUiCard` (function)
1029
+
1030
+ ```ts
1031
+ isInternalStatusToolUiCard: (card: { title?: string | null; } | null) => boolean
1032
+ ```
1033
+
1034
+ ## `isMcpAppData` (function)
1035
+
1036
+ ```ts
1037
+ isMcpAppData: (value: unknown) => value is McpAppData
1038
+ ```
1039
+
996
1040
  ## `isPlanUpdateTool` (function)
997
1041
 
998
1042
  ```ts
999
1043
  isPlanUpdateTool: (toolCall: Pick<ToolCallInfo, "name">) => boolean
1000
1044
  ```
1001
1045
 
1046
+ ## `isToolUiCard` (function)
1047
+
1048
+ ```ts
1049
+ isToolUiCard: (value: unknown) => value is ToolUiCard
1050
+ ```
1051
+
1002
1052
  ## `latestPostChatFollowup` (function)
1003
1053
 
1004
1054
  ```ts
@@ -1154,6 +1204,64 @@ mode: "streaming" | "static" | undefined
1154
1204
  sessionId: string | undefined
1155
1205
  ```
1156
1206
 
1207
+ ## `McpAppArchive` (interface)
1208
+
1209
+ ```ts
1210
+ html: string
1211
+ mimeType: string
1212
+ plugin: string
1213
+ previousToolInput: Record<string, unknown> | undefined
1214
+ previousToolResult: Record<string, unknown> | undefined
1215
+ resourceMeta: Record<string, unknown>
1216
+ resourceUri: string
1217
+ sourceId: string
1218
+ toolInput: Record<string, unknown>
1219
+ toolResult: Record<string, unknown>
1220
+ ```
1221
+
1222
+ ## `McpAppCard` (function)
1223
+
1224
+ ```ts
1225
+ McpAppCard: ({ sessionId, sourceId, client: suppliedClient, onMessage: suppliedOnMessage }: { sessionId: string; sourceId: string; client?: BladeClient; onMessage?: (message: McpAppMessage) => void; }) => JSX.Element
1226
+ ```
1227
+
1228
+ ## `McpAppContextState` (interface)
1229
+
1230
+ ```ts
1231
+ content: string
1232
+ plugin: string | null
1233
+ revision: string
1234
+ server_alias: string | null
1235
+ ```
1236
+
1237
+ ## `McpAppContextUpdate` (interface)
1238
+
1239
+ ```ts
1240
+ content: string
1241
+ expected_revision: string | null
1242
+ request_id: string
1243
+ ```
1244
+
1245
+ ## `McpAppData` (interface)
1246
+
1247
+ ```ts
1248
+ mimeType: string
1249
+ resourceMeta: Record<string, unknown>
1250
+ resourceUri: string
1251
+ sourceId: string
1252
+ toolInput: Record<string, unknown>
1253
+ toolResult: Record<string, unknown>
1254
+ ```
1255
+
1256
+ ## `McpAppMessage` (interface)
1257
+
1258
+ ```ts
1259
+ content: string
1260
+ label: string
1261
+ sessionId: string
1262
+ sourceId: string
1263
+ ```
1264
+
1157
1265
  ## `MemoryRef` (interface)
1158
1266
 
1159
1267
  ```ts
@@ -1378,6 +1486,15 @@ kind: "prepared"
1378
1486
  prependOlder: (current: TurnProjection[], page: TurnProjection[]) => TurnProjection[]
1379
1487
  ```
1380
1488
 
1489
+ ## `PreviewToolUiCardEntry` (interface)
1490
+
1491
+ ```ts
1492
+ blocks: ContentBlock[]
1493
+ card: ToolUiCard
1494
+ key: string
1495
+ toolCall: ToolCallInfo
1496
+ ```
1497
+
1381
1498
  ## `PrimarySkillParallelMode` (interface)
1382
1499
 
1383
1500
  ```ts
@@ -1516,6 +1633,12 @@ status: "replay" | "autonomous" | undefined
1516
1633
  resolveServiceUrl: (endpoints: PlatformEndpoints, name: PlatformServiceName, path?: string) => string | null
1517
1634
  ```
1518
1635
 
1636
+ ## `resolveToolUiCardContent` (function)
1637
+
1638
+ ```ts
1639
+ resolveToolUiCardContent: (card: ToolUiCard) => { type: ToolUiCardContentType; content: string; } | null
1640
+ ```
1641
+
1519
1642
  ## `ResultFeedback` (interface)
1520
1643
 
1521
1644
  ```ts
@@ -1789,6 +1912,9 @@ sessionId: string
1789
1912
 
1790
1913
  ```ts
1791
1914
  active: boolean
1915
+ config: SessionPluginConfigSummary | undefined
1916
+ display_name: string | null | undefined
1917
+ icon: string | null | undefined
1792
1918
  installed: boolean | null
1793
1919
  name: string
1794
1920
  projected: boolean
@@ -1803,6 +1929,121 @@ status: string
1803
1929
  export type SessionPluginActivation = Pick<SessionPlugin, "name" | "active" | "status" | "reason">
1804
1930
  ```
1805
1931
 
1932
+ ## `SessionPluginConfigDialog` (function)
1933
+
1934
+ ```ts
1935
+ SessionPluginConfigDialog: ({ client, sessionId, plugin, ...props }: SessionPluginConfigDialogProps) => JSX.Element
1936
+ ```
1937
+
1938
+ ## `SessionPluginConfigDialogProps` (interface)
1939
+
1940
+ ```ts
1941
+ client: BladeClient
1942
+ onClose: () => void
1943
+ onSaved: ((state: SessionPluginConfigState) => void) | undefined
1944
+ plugin: Pick<SessionPlugin, "name" | "display_name" | "icon">
1945
+ sessionId: string
1946
+ ```
1947
+
1948
+ ## `SessionPluginConfigDraft` (interface)
1949
+
1950
+ ```ts
1951
+ remove: string[]
1952
+ set: SessionPluginConfigSet[]
1953
+ ```
1954
+
1955
+ ## `SessionPluginConfigError` (interface)
1956
+
1957
+ ```ts
1958
+ message: string
1959
+ path: string
1960
+ ```
1961
+
1962
+ ## `SessionPluginConfigForm` (function)
1963
+
1964
+ ```ts
1965
+ SessionPluginConfigForm: ({ config, submitting, errors, failure, onSubmit, onCancel, }: SessionPluginConfigFormProps) => JSX.Element
1966
+ ```
1967
+
1968
+ ## `SessionPluginConfigFormProps` (interface)
1969
+
1970
+ ```ts
1971
+ config: SessionPluginConfigState
1972
+ errors: SessionPluginConfigError[]
1973
+ failure: string | null
1974
+ onCancel: () => void
1975
+ onSubmit: (draft: SessionPluginConfigDraft) => void
1976
+ submitting: boolean
1977
+ ```
1978
+
1979
+ ## `SessionPluginConfigSet` (interface)
1980
+
1981
+ ```ts
1982
+ path: string
1983
+ value: unknown
1984
+ ```
1985
+
1986
+ ## `SessionPluginConfigState` (interface)
1987
+
1988
+ ```ts
1989
+ errors: SessionPluginConfigError[]
1990
+ reason: string | null
1991
+ revision: string | null
1992
+ schema: Record<string, unknown> | null
1993
+ state: SessionPluginConfigStateName
1994
+ values: Record<string, unknown>
1995
+ write_only: string[]
1996
+ ```
1997
+
1998
+ ## `SessionPluginConfigStateName` (type)
1999
+
2000
+ ```ts
2001
+ export type SessionPluginConfigStateName = "not_required" | "required" | "configured" | "error"
2002
+ ```
2003
+
2004
+ ## `SessionPluginConfigSummary` (type)
2005
+
2006
+ ```ts
2007
+ export type SessionPluginConfigSummary =
2008
+ | SessionPluginConfigStateName
2009
+ | "unchecked"
2010
+ ```
2011
+
2012
+ ## `SessionPluginConfigUpdate` (interface)
2013
+
2014
+ ```ts
2015
+ expected_revision: string | null | undefined
2016
+ remove: string[] | undefined
2017
+ set: SessionPluginConfigSet[] | undefined
2018
+ ```
2019
+
2020
+ ## `SessionPluginIcon` (function)
2021
+
2022
+ ```ts
2023
+ SessionPluginIcon: ({ client, sessionId, plugin, className }: SessionPluginIconProps) => JSX.Element
2024
+ ```
2025
+
2026
+ ## `SessionPluginIconProps` (interface)
2027
+
2028
+ ```ts
2029
+ className: string | undefined
2030
+ client: BladeClient
2031
+ plugin: Pick<SessionPlugin, "name" | "icon">
2032
+ sessionId: string
2033
+ ```
2034
+
2035
+ ## `sessionPluginLabel` (function)
2036
+
2037
+ ```ts
2038
+ sessionPluginLabel: (plugin: Pick<SessionPlugin, "name" | "display_name">) => string
2039
+ ```
2040
+
2041
+ ## `SessionPluginLabelProps` (interface)
2042
+
2043
+ ```ts
2044
+ plugin: Pick<SessionPlugin, "name" | "display_name">
2045
+ ```
2046
+
1806
2047
  ## `SessionPluginSelector` (function)
1807
2048
 
1808
2049
  ```ts
@@ -1859,6 +2100,7 @@ export type SessionSetupStage = "solution" | "session" | "skill" | "connection"
1859
2100
 
1860
2101
  ```ts
1861
2102
  attachAppCli: (sessionId: string, definition: AppCliDefinition) => Promise<AppCliAttachment>
2103
+ callMcpApp: (sessionId: string, sourceId: string, request: { request_id: string; name: string; arguments: Record<string, unknown>; }, init?: RequestInit) => Promise<{ response: Record<string, unknown>; replayed: boolean; }>
1862
2104
  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; }>
1863
2105
  connect: (sessionId: string) => Promise<AgentSession>
1864
2106
  copyFile: (sessionId: string, filePath: string) => Promise<{ path: string; }>
@@ -1872,13 +2114,17 @@ deleteFile: (sessionId: string, filePath: string) => Promise<void>
1872
2114
  deleteSession: (sessionId: string, options?: { deleteWorkspace?: boolean; }) => Promise<{ deleted: boolean; workspace_deleted?: boolean; }>
1873
2115
  downloadFile: (sessionId: string, filePath: string, downloadName?: string) => Promise<void>
1874
2116
  exportSession: (sessionId: string) => Promise<void>
2117
+ fetchSessionPluginIcon: (sessionId: string, name: string) => Promise<Blob>
1875
2118
  getBackgroundTask: (sessionId: string, taskId: string, tail?: number, init?: RequestInit) => Promise<BackgroundTask>
1876
2119
  getDownloadDirUrl: (sessionId: string, dirPath: string) => string
2120
+ getMcpApp: (sessionId: string, sourceId: string, init?: RequestInit) => Promise<McpAppArchive>
2121
+ getMcpAppContext: (sessionId: string, sourceId: string, init?: RequestInit) => Promise<McpAppContextState>
1877
2122
  getReplayPreview: (sessionId: string) => Promise<ReplayPreview>
1878
2123
  getSession: (sessionId: string, init?: RequestInit) => Promise<SessionDetail>
1879
2124
  getSessionCheckpoints: (sessionId: string, init?: RequestInit) => Promise<{ nodes: CheckpointNode[]; leaf_id: string | null; }>
1880
2125
  getSessionContextStats: (sessionId: string, init?: RequestInit) => Promise<SessionContextStats>
1881
2126
  getSessionHistory: (sessionId: string, init?: RequestInit) => Promise<SessionHistory>
2127
+ getSessionPluginConfig: (sessionId: string, name: string, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1882
2128
  getSessionTasks: (sessionId: string) => Promise<Task[]>
1883
2129
  getSessionTurnCommands: (sessionId: string) => Promise<HistoricalCommand[]>
1884
2130
  getSessionTurns: (sessionId: string) => Promise<TurnProjection[]>
@@ -1892,6 +2138,7 @@ listSessionPlugins: (sessionId: string, init?: RequestInit) => Promise<{ plugins
1892
2138
  listSessions: (template_id_prefix?: string, solution_id?: string) => Promise<SessionInfo[]>
1893
2139
  listSessionsPaginated: (params: { limit: number; offset: number; template_id_prefix?: string; solution_id?: string; solution_registry_id?: string; q?: string; chat_project_id?: string; }) => Promise<PaginatedSessionsResult>
1894
2140
  listSessionsWithSkillData: () => Promise<SkillDevSession[]>
2141
+ onMcpAppChanged: (sessionId: string, sourceId: string, listener: () => void) => () => void
1895
2142
  pinSession: (sessionId: string, pinned: boolean) => Promise<SessionInfo>
1896
2143
  previewImport: (file: File) => Promise<ImportPreview>
1897
2144
  probeSessionUrl: (sessionId: string, url: string) => Promise<{ reachable: boolean; requires_proxy: boolean; }>
@@ -1900,6 +2147,7 @@ renameFile: (sessionId: string, filePath: string, newName: string) => Promise<{
1900
2147
  revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }>
1901
2148
  rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
1902
2149
  searchOwnedContent: (params: { q: string; limit?: number; }) => Promise<GlobalSearchResult>
2150
+ sessionPluginIconUrl: (sessionId: string, name: string) => string
1903
2151
  setSessionEnv: (sessionId: string, env: Record<string, string>) => Promise<SessionDetail>
1904
2152
  setSessionPluginActivation: (sessionId: string, name: string, active: boolean, init?: RequestInit) => Promise<{ plugin: SessionPluginActivation; sync_version: number; }>
1905
2153
  shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
@@ -1908,9 +2156,11 @@ stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTas
1908
2156
  switchBranch: (sessionId: string, checkpointId: string) => Promise<{ id: string; leaf_id: string; }>
1909
2157
  tokenizeMessages: (messages: Array<Record<string, unknown>>, options?: { model?: string; add_generation_prompt?: boolean; enable_thinking?: boolean | null; tools?: Array<Record<string, unknown>>; }) => Promise<TokenizeResult>
1910
2158
  tokenizePrompt: (prompt: string, model?: string) => Promise<TokenizeResult>
2159
+ updateMcpAppContext: (sessionId: string, sourceId: string, body: McpAppContextUpdate, init?: RequestInit) => Promise<{ status: "accepted"; revision: string; }>
1911
2160
  updateReplaySession: (sessionId: string, payload: { speed?: ReplaySpeed; status?: "autonomous"; }) => Promise<{ replay_state: SessionInfo["replay_state"]; }>
1912
2161
  updateSession: (sessionId: string, payload: { intent?: string; chat_project_id?: string | null; }) => Promise<SessionDetail>
1913
2162
  updateSessionMemory: (sessionId: string, memoryEnabled: boolean) => Promise<{ memory_enabled: boolean; }>
2163
+ updateSessionPluginConfig: (sessionId: string, name: string, update: SessionPluginConfigUpdate, init?: RequestInit) => Promise<{ plugin: string; config: SessionPluginConfigState; }>
1914
2164
  updateSharing: (sessionId: string, shared: boolean) => Promise<{ shared: boolean; }>
1915
2165
  uploadFiles: (sessionId: string, dirPath: string, files: FileList | File[] | UploadFileEntry[], options?: UploadFilesOptions) => Promise<{ uploaded: string[]; failed: string[]; }>
1916
2166
  writeFile: (sessionId: string, filePath: string, content: string) => Promise<{ success: boolean; }>
@@ -2129,6 +2379,31 @@ status: "done" | "error" | "cancelled" | "awaiting_answer" | "pending" | undefin
2129
2379
  export type ToolCallRenderer = (info: ToolCallInfo) => ReactNode | null
2130
2380
  ```
2131
2381
 
2382
+ ## `ToolUiCard` (interface)
2383
+
2384
+ ```ts
2385
+ archived: boolean | undefined
2386
+ height: number
2387
+ mcpApp: McpAppData | undefined
2388
+ resourceHTML: string | undefined
2389
+ resourceUri: string | undefined
2390
+ resourceURI: string | undefined
2391
+ target: "inline" | "preview"
2392
+ title: string | undefined
2393
+ ```
2394
+
2395
+ ## `ToolUiCardContentType` (type)
2396
+
2397
+ ```ts
2398
+ export type ToolUiCardContentType = "resource-html" | "resource-uri"
2399
+ ```
2400
+
2401
+ ## `ToolUiCardView` (function)
2402
+
2403
+ ```ts
2404
+ ToolUiCardView: ({ card, sessionId }: { card: ToolUiCard; sessionId?: string; }) => JSX.Element | null
2405
+ ```
2406
+
2132
2407
  ## `toReplaySnapshot` (function)
2133
2408
 
2134
2409
  ```ts
@@ -1,8 +0,0 @@
1
- "use client";
2
- import {
3
- Nt
4
- } from "./chunk-ZXXLY4RM.js";
5
- export {
6
- Nt as Mermaid
7
- };
8
- //# sourceMappingURL=mermaid-3ZIDBTTL-N7YKJ3SM.js.map