@blade-hq/agent-react 2608.0.7-beta.0 → 2608.0.7-beta.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.
- package/README.md +3 -155
- package/dist/components/AssistantTurnBlock.d.ts +1 -1
- package/dist/components/ChatView.d.ts +39 -20
- package/dist/components/FileCard.d.ts +16 -0
- package/dist/components/MarkdownContent.d.ts +6 -3
- package/dist/components/MessageList.d.ts +3 -10
- package/dist/embed/entry.d.ts +3 -5
- package/dist/index.d.ts +1 -14
- package/dist/index.js +429 -1668
- package/dist/index.js.map +1 -1
- package/dist/lib/media-tags.d.ts +24 -0
- package/dist/style.css +11 -52
- package/dist/style.full.css +12 -53
- package/package.json +2 -2
- package/public-api.md +21 -403
- package/dist/components/AgentChat.d.ts +0 -21
- package/dist/components/ChatSurface.d.ts +0 -68
- package/dist/components/LlmAdvancedSettings.d.ts +0 -40
- package/dist/components/LlmChat.d.ts +0 -29
- package/dist/components/PostChatFollowupBlock.d.ts +0 -59
- package/dist/components/ReplayBar.d.ts +0 -13
- package/dist/components/ReplayMismatchPrompt.d.ts +0 -8
- package/dist/hooks/use-llm-chat.d.ts +0 -57
- package/dist/hooks/use-replay.d.ts +0 -50
package/public-api.md
CHANGED
|
@@ -3,13 +3,7 @@
|
|
|
3
3
|
> 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
|
|
4
4
|
> 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
|
|
5
5
|
|
|
6
|
-
共
|
|
7
|
-
|
|
8
|
-
## `acceptedPostChatFollowupCompletesLatestRun` (function)
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
acceptedPostChatFollowupCompletesLatestRun: (events: RawEvent[], updates: ProjectionUpdate[]) => boolean
|
|
12
|
-
```
|
|
6
|
+
共 137 个公开声明。
|
|
13
7
|
|
|
14
8
|
## `ActiveCompactionState` (interface)
|
|
15
9
|
|
|
@@ -30,28 +24,6 @@ trigger: "auto" | "manual" | "forced_retry" | null | undefined
|
|
|
30
24
|
turn_id: string
|
|
31
25
|
```
|
|
32
26
|
|
|
33
|
-
## `AgentChat` (function)
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
AgentChat: (props: AgentChatProps) => JSX.Element
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## `AgentChatProps` (interface)
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
classNames: ChatViewClassNames | undefined
|
|
43
|
-
commands: Record<string, (data: unknown) => void> | undefined
|
|
44
|
-
createOptions: CreateSessionRequest | undefined
|
|
45
|
-
onFollowupInteraction: ((event: FollowupInteractionEvent) => void) | undefined
|
|
46
|
-
onSessionCreated: ((sessionId: string) => void) | undefined
|
|
47
|
-
onSessionReady: ((session: AgentSession) => void) | undefined
|
|
48
|
-
placeholder: string | undefined
|
|
49
|
-
renderers: ChatViewRenderers | undefined
|
|
50
|
-
sessionId: string | undefined
|
|
51
|
-
slots: ChatViewSlots | undefined
|
|
52
|
-
theme: "light" | "dark" | undefined
|
|
53
|
-
```
|
|
54
|
-
|
|
55
27
|
## `AgentLoopInfo` (interface)
|
|
56
28
|
|
|
57
29
|
```ts
|
|
@@ -70,7 +42,6 @@ compact: () => Promise<Record<string, unknown>>
|
|
|
70
42
|
countFiles: (dirPath?: string) => Promise<number>
|
|
71
43
|
dispose: () => void
|
|
72
44
|
downloadFile: (filePath: string, downloadName?: string) => Promise<void>
|
|
73
|
-
exitReplay: () => Promise<void>
|
|
74
45
|
getState: () => SessionState
|
|
75
46
|
insertText: (text: string) => void
|
|
76
47
|
isDisposed: boolean
|
|
@@ -80,7 +51,6 @@ on: <K extends keyof AgentSessionEvents>(name: K, handler: (event: AgentSessionE
|
|
|
80
51
|
onCommand: (action: string, handler: CommandHandler) => () => void
|
|
81
52
|
send: (content: MessageContent, options?: SendOptions) => Promise<boolean>
|
|
82
53
|
sessionId: string
|
|
83
|
-
setReplaySpeed: (speed: ReplaySpeed) => Promise<void>
|
|
84
54
|
stop: () => Promise<Record<string, unknown>>
|
|
85
55
|
subscribe: (listener: () => void) => () => void
|
|
86
56
|
```
|
|
@@ -177,7 +147,6 @@ getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
|
|
|
177
147
|
## `AuthResource` (class)
|
|
178
148
|
|
|
179
149
|
```ts
|
|
180
|
-
exchangeCode: (params: ExchangeCodeParams) => Promise<ExchangeCodeResult>
|
|
181
150
|
getMe: () => Promise<UserInfo>
|
|
182
151
|
getProviders: () => Promise<ProvidersResponse>
|
|
183
152
|
login: (options?: LoginOptions) => Promise<LoginResult>
|
|
@@ -268,7 +237,6 @@ baseUrl: string
|
|
|
268
237
|
fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
|
|
269
238
|
onRefreshSuccess: (() => void | Promise<void>) | undefined
|
|
270
239
|
socketToken: string | (() => string | null | undefined) | undefined
|
|
271
|
-
streamTokens: boolean | undefined
|
|
272
240
|
token: string | (() => string | null | undefined) | undefined
|
|
273
241
|
tokenStorage: TokenStorageMode | undefined
|
|
274
242
|
```
|
|
@@ -292,13 +260,6 @@ client: BladeClient
|
|
|
292
260
|
buildMessageContent: (text: string, attachments: Array<{ kind: "file"; name: string; uploadedPath?: string; textContent?: string | null; mimeType?: string; }>) => MessageContent
|
|
293
261
|
```
|
|
294
262
|
|
|
295
|
-
## `ChatCompletionTool` (interface)
|
|
296
|
-
|
|
297
|
-
```ts
|
|
298
|
-
function: { name: string; description?: string; parameters?: Record<string, unknown>; }
|
|
299
|
-
type: "function"
|
|
300
|
-
```
|
|
301
|
-
|
|
302
263
|
## `ChatMessage` (interface)
|
|
303
264
|
|
|
304
265
|
```ts
|
|
@@ -312,7 +273,6 @@ loop_name: string | undefined
|
|
|
312
273
|
memory_refs: MemoryRefInfo[] | undefined
|
|
313
274
|
parent_id: string | null | undefined
|
|
314
275
|
reasoning: string | undefined
|
|
315
|
-
render_id: string | undefined
|
|
316
276
|
role: "error" | "user" | "assistant" | "tool"
|
|
317
277
|
status: "streaming" | "completed" | "paused" | "failed" | "interrupted" | undefined
|
|
318
278
|
timestamp: string | undefined
|
|
@@ -340,10 +300,6 @@ root: string | undefined
|
|
|
340
300
|
classNames: ChatViewClassNames | undefined
|
|
341
301
|
commands: Record<string, (data: unknown) => void> | undefined
|
|
342
302
|
createOptions: CreateSessionRequest | undefined
|
|
343
|
-
llm: (LlmChatOptions & { advanced?: boolean | LlmAdvancedSettings; onOverrideChange?: (override: LlmOverride) => void; }) | undefined
|
|
344
|
-
mode: "agent" | "llm" | undefined
|
|
345
|
-
onFollowupInteraction: ((event: FollowupInteractionEvent) => void) | undefined
|
|
346
|
-
onLlmReady: ((handle: LlmChatHandle) => void) | undefined
|
|
347
303
|
onSessionCreated: ((sessionId: string) => void) | undefined
|
|
348
304
|
onSessionReady: ((session: AgentSession) => void) | undefined
|
|
349
305
|
placeholder: string | undefined
|
|
@@ -477,12 +433,6 @@ path: string | undefined
|
|
|
477
433
|
token: string | (() => string | null | undefined) | undefined
|
|
478
434
|
```
|
|
479
435
|
|
|
480
|
-
## `DEFAULT_REPLAY_SPEED` (const)
|
|
481
|
-
|
|
482
|
-
```ts
|
|
483
|
-
DEFAULT_REPLAY_SPEED: ReplaySpeed
|
|
484
|
-
```
|
|
485
|
-
|
|
486
436
|
## `EmbeddedChat` (interface)
|
|
487
437
|
|
|
488
438
|
```ts
|
|
@@ -500,20 +450,10 @@ allowedOrigins: string[]
|
|
|
500
450
|
iframe: HTMLIFrameElement | undefined
|
|
501
451
|
```
|
|
502
452
|
|
|
503
|
-
## `
|
|
504
|
-
|
|
505
|
-
```ts
|
|
506
|
-
clientOrigin: string
|
|
507
|
-
code: string
|
|
508
|
-
state: string
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
## `ExchangeCodeResult` (interface)
|
|
453
|
+
## `EMPTY_PLATFORM_ENDPOINTS` (const)
|
|
512
454
|
|
|
513
455
|
```ts
|
|
514
|
-
|
|
515
|
-
token_type: string
|
|
516
|
-
user: { id: string; username: string; display_name: string; avatar_url: string | null; }
|
|
456
|
+
EMPTY_PLATFORM_ENDPOINTS: PlatformEndpoints
|
|
517
457
|
```
|
|
518
458
|
|
|
519
459
|
## `ExistingSolutionRef` (interface)
|
|
@@ -548,59 +488,6 @@ path: string
|
|
|
548
488
|
tags: string[] | undefined
|
|
549
489
|
```
|
|
550
490
|
|
|
551
|
-
## `FinalArtifact` (interface)
|
|
552
|
-
|
|
553
|
-
```ts
|
|
554
|
-
kind: "link" | "file"
|
|
555
|
-
label: string
|
|
556
|
-
target: string
|
|
557
|
-
```
|
|
558
|
-
|
|
559
|
-
## `FollowupInteractionEvent` (type)
|
|
560
|
-
|
|
561
|
-
```ts
|
|
562
|
-
export type FollowupInteractionEvent =
|
|
563
|
-
| {
|
|
564
|
-
type: "suggestions_shown"
|
|
565
|
-
sessionId?: string
|
|
566
|
-
assistantEntryId: string
|
|
567
|
-
count: number
|
|
568
|
-
}
|
|
569
|
-
| {
|
|
570
|
-
type: "suggestion_adopted"
|
|
571
|
-
sessionId?: string
|
|
572
|
-
assistantEntryId: string
|
|
573
|
-
suggestionIndex: number
|
|
574
|
-
}
|
|
575
|
-
| {
|
|
576
|
-
type: "artifact_shown"
|
|
577
|
-
sessionId?: string
|
|
578
|
-
assistantEntryId: string
|
|
579
|
-
artifactIndex: number
|
|
580
|
-
artifactKind: FinalArtifact["kind"]
|
|
581
|
-
}
|
|
582
|
-
| {
|
|
583
|
-
type: "artifact_opened"
|
|
584
|
-
sessionId?: string
|
|
585
|
-
assistantEntryId: string
|
|
586
|
-
artifactIndex: number
|
|
587
|
-
artifactKind: FinalArtifact["kind"]
|
|
588
|
-
}
|
|
589
|
-
| {
|
|
590
|
-
type: "artifact_download_started"
|
|
591
|
-
sessionId?: string
|
|
592
|
-
assistantEntryId: string
|
|
593
|
-
artifactIndex: number
|
|
594
|
-
artifactKind: "file"
|
|
595
|
-
}
|
|
596
|
-
| {
|
|
597
|
-
type: "artifact_download_succeeded"
|
|
598
|
-
sessionId?: string
|
|
599
|
-
assistantEntryId: string
|
|
600
|
-
artifactIndex: number
|
|
601
|
-
artifactKind: "file"
|
|
602
|
-
```
|
|
603
|
-
|
|
604
491
|
## `getFileParts` (function)
|
|
605
492
|
|
|
606
493
|
```ts
|
|
@@ -619,42 +506,6 @@ getImageParts: (content: MessageContent) => ImageUrlContentPart[]
|
|
|
619
506
|
getTextContent: (content: MessageContent) => string
|
|
620
507
|
```
|
|
621
508
|
|
|
622
|
-
## `GlobalSearchConversationResult` (interface)
|
|
623
|
-
|
|
624
|
-
```ts
|
|
625
|
-
matched: "title" | "content"
|
|
626
|
-
session: SessionInfo
|
|
627
|
-
snippet: string
|
|
628
|
-
type: "conversation"
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
## `GlobalSearchFileResult` (interface)
|
|
632
|
-
|
|
633
|
-
```ts
|
|
634
|
-
matched: "name" | "path"
|
|
635
|
-
name: string
|
|
636
|
-
path: string
|
|
637
|
-
session: SessionInfo
|
|
638
|
-
snippet: string
|
|
639
|
-
type: "file"
|
|
640
|
-
```
|
|
641
|
-
|
|
642
|
-
## `GlobalSearchResult` (interface)
|
|
643
|
-
|
|
644
|
-
```ts
|
|
645
|
-
indexing: boolean
|
|
646
|
-
items: GlobalSearchResultItem[]
|
|
647
|
-
truncated: boolean
|
|
648
|
-
```
|
|
649
|
-
|
|
650
|
-
## `GlobalSearchResultItem` (type)
|
|
651
|
-
|
|
652
|
-
```ts
|
|
653
|
-
export type GlobalSearchResultItem =
|
|
654
|
-
| GlobalSearchConversationResult
|
|
655
|
-
| GlobalSearchFileResult
|
|
656
|
-
```
|
|
657
|
-
|
|
658
509
|
## `groupMessagesByLoop` (function)
|
|
659
510
|
|
|
660
511
|
```ts
|
|
@@ -715,12 +566,6 @@ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">) => boo
|
|
|
715
566
|
isInboundEnvelope: (value: unknown) => value is InboundEnvelope
|
|
716
567
|
```
|
|
717
568
|
|
|
718
|
-
## `latestPostChatFollowup` (function)
|
|
719
|
-
|
|
720
|
-
```ts
|
|
721
|
-
latestPostChatFollowup: (turns: TurnProjection[]) => PostChatFollowup | null
|
|
722
|
-
```
|
|
723
|
-
|
|
724
569
|
## `LayoutType` (enum)
|
|
725
570
|
|
|
726
571
|
```ts
|
|
@@ -737,86 +582,18 @@ export enum LayoutType {
|
|
|
737
582
|
}
|
|
738
583
|
```
|
|
739
584
|
|
|
740
|
-
## `
|
|
741
|
-
|
|
742
|
-
```ts
|
|
743
|
-
apiKey: boolean | undefined
|
|
744
|
-
baseURL: boolean | undefined
|
|
745
|
-
model: boolean | undefined
|
|
746
|
-
storage: "local" | "memory" | undefined
|
|
747
|
-
storageKey: string | undefined
|
|
748
|
-
```
|
|
749
|
-
|
|
750
|
-
## `LlmChat` (function)
|
|
751
|
-
|
|
752
|
-
```ts
|
|
753
|
-
LlmChat: ({ classNames, renderers, slots, placeholder, theme, onReady, advanced, onOverrideChange, ...options }: LlmChatProps) => JSX.Element
|
|
754
|
-
```
|
|
755
|
-
|
|
756
|
-
## `LlmChatHandle` (interface)
|
|
585
|
+
## `loadPlatformEndpoints` (function)
|
|
757
586
|
|
|
758
587
|
```ts
|
|
759
|
-
|
|
760
|
-
reset: () => void
|
|
761
|
-
send: (text: string) => Promise<boolean>
|
|
762
|
-
```
|
|
763
|
-
|
|
764
|
-
## `LlmChatOptions` (interface)
|
|
765
|
-
|
|
766
|
-
```ts
|
|
767
|
-
apiKey: string | undefined
|
|
768
|
-
baseURL: string
|
|
769
|
-
extraBody: Record<string, unknown> | undefined
|
|
770
|
-
fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
|
|
771
|
-
headers: Record<string, string> | undefined
|
|
772
|
-
historyTurns: number | undefined
|
|
773
|
-
maxToolRounds: number | undefined
|
|
774
|
-
model: string
|
|
775
|
-
onToolCall: ((call: LlmToolCall) => Promise<unknown>) | undefined
|
|
776
|
-
system: string | undefined
|
|
777
|
-
temperature: number | undefined
|
|
778
|
-
tools: ChatCompletionTool[] | undefined
|
|
588
|
+
loadPlatformEndpoints: (options?: LoadPlatformEndpointsOptions) => Promise<PlatformEndpoints>
|
|
779
589
|
```
|
|
780
590
|
|
|
781
|
-
## `
|
|
591
|
+
## `LoadPlatformEndpointsOptions` (interface)
|
|
782
592
|
|
|
783
593
|
```ts
|
|
784
|
-
|
|
785
|
-
apiKey: string | undefined
|
|
786
|
-
baseURL: string
|
|
787
|
-
classNames: ChatViewClassNames | undefined
|
|
788
|
-
extraBody: Record<string, unknown> | undefined
|
|
594
|
+
baseUrl: string | undefined
|
|
789
595
|
fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
|
|
790
|
-
|
|
791
|
-
historyTurns: number | undefined
|
|
792
|
-
maxToolRounds: number | undefined
|
|
793
|
-
model: string
|
|
794
|
-
onOverrideChange: ((override: LlmOverride) => void) | undefined
|
|
795
|
-
onReady: ((handle: LlmChatHandle) => void) | undefined
|
|
796
|
-
onToolCall: ((call: LlmToolCall) => Promise<unknown>) | undefined
|
|
797
|
-
placeholder: string | undefined
|
|
798
|
-
renderers: ChatViewRenderers | undefined
|
|
799
|
-
slots: ChatViewSlots | undefined
|
|
800
|
-
system: string | undefined
|
|
801
|
-
temperature: number | undefined
|
|
802
|
-
theme: "light" | "dark" | undefined
|
|
803
|
-
tools: ChatCompletionTool[] | undefined
|
|
804
|
-
```
|
|
805
|
-
|
|
806
|
-
## `LlmOverride` (interface)
|
|
807
|
-
|
|
808
|
-
```ts
|
|
809
|
-
apiKey: string | undefined
|
|
810
|
-
baseURL: string | undefined
|
|
811
|
-
model: string | undefined
|
|
812
|
-
```
|
|
813
|
-
|
|
814
|
-
## `LlmToolCall` (interface)
|
|
815
|
-
|
|
816
|
-
```ts
|
|
817
|
-
arguments: string
|
|
818
|
-
id: string
|
|
819
|
-
name: string
|
|
596
|
+
timeoutMs: number | undefined
|
|
820
597
|
```
|
|
821
598
|
|
|
822
599
|
## `LoginOptions` (interface)
|
|
@@ -886,9 +663,7 @@ export type ModeId = "planning" | "executing"
|
|
|
886
663
|
## `ModelCatalog` (interface)
|
|
887
664
|
|
|
888
665
|
```ts
|
|
889
|
-
baseUrl: string | undefined
|
|
890
666
|
default: string
|
|
891
|
-
defaultServiceModel: string | undefined
|
|
892
667
|
models: ModelOption[]
|
|
893
668
|
```
|
|
894
669
|
|
|
@@ -897,7 +672,6 @@ models: ModelOption[]
|
|
|
897
672
|
```ts
|
|
898
673
|
id: string
|
|
899
674
|
label: string
|
|
900
|
-
serviceModelId: string | undefined
|
|
901
675
|
```
|
|
902
676
|
|
|
903
677
|
## `ModelsResource` (class)
|
|
@@ -946,15 +720,16 @@ sequence: number
|
|
|
946
720
|
turn_id: string
|
|
947
721
|
```
|
|
948
722
|
|
|
949
|
-
## `
|
|
723
|
+
## `PlatformEndpoints` (interface)
|
|
724
|
+
|
|
725
|
+
```ts
|
|
726
|
+
services: Partial<Record<"os" | "hub" | "agent" | "oauth" | "llmGateway" | "gitea", string>>
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
## `PlatformServiceName` (type)
|
|
950
730
|
|
|
951
731
|
```ts
|
|
952
|
-
|
|
953
|
-
feedback_eligible: boolean
|
|
954
|
-
feedback_scope: "latest_result"
|
|
955
|
-
final_artifacts: FinalArtifact[] | undefined
|
|
956
|
-
recaption: string | undefined
|
|
957
|
-
suggestions: string[]
|
|
732
|
+
export type PlatformServiceName = (typeof PLATFORM_SERVICE_NAMES)[number]
|
|
958
733
|
```
|
|
959
734
|
|
|
960
735
|
## `PreparedSolution` (interface)
|
|
@@ -1018,107 +793,10 @@ payload: Record<string, unknown>
|
|
|
1018
793
|
type: string
|
|
1019
794
|
```
|
|
1020
795
|
|
|
1021
|
-
## `
|
|
1022
|
-
|
|
1023
|
-
```ts
|
|
1024
|
-
reconcileOptimisticUserTurns: (currentTurns: TurnProjection[], incomingTurns: TurnProjection[]) => TurnProjection[]
|
|
1025
|
-
```
|
|
1026
|
-
|
|
1027
|
-
## `ReplayBar` (function)
|
|
1028
|
-
|
|
1029
|
-
```ts
|
|
1030
|
-
ReplayBar: ({ isReplay, speed, onSpeedChange, onExit, canControl, className, }: ReplayBarProps) => JSX.Element | null
|
|
1031
|
-
```
|
|
1032
|
-
|
|
1033
|
-
## `ReplayBarProps` (interface)
|
|
1034
|
-
|
|
1035
|
-
```ts
|
|
1036
|
-
canControl: boolean | undefined
|
|
1037
|
-
className: string | undefined
|
|
1038
|
-
isReplay: boolean
|
|
1039
|
-
onExit: () => void
|
|
1040
|
-
onSpeedChange: (speed: ReplaySpeed) => void
|
|
1041
|
-
speed: ReplaySpeed
|
|
1042
|
-
```
|
|
1043
|
-
|
|
1044
|
-
## `ReplayMismatch` (interface)
|
|
1045
|
-
|
|
1046
|
-
```ts
|
|
1047
|
-
actualMessage: string
|
|
1048
|
-
expectedMessage: string
|
|
1049
|
-
resolve: (decision: "keep_replay" | "continue_replay") => void
|
|
1050
|
-
```
|
|
1051
|
-
|
|
1052
|
-
## `ReplayMismatchPrompt` (function)
|
|
1053
|
-
|
|
1054
|
-
```ts
|
|
1055
|
-
ReplayMismatchPrompt: ({ mismatch, className }: ReplayMismatchPromptProps) => JSX.Element | null
|
|
1056
|
-
```
|
|
1057
|
-
|
|
1058
|
-
## `ReplayMismatchPromptProps` (interface)
|
|
1059
|
-
|
|
1060
|
-
```ts
|
|
1061
|
-
className: string | undefined
|
|
1062
|
-
mismatch: ReplayMismatch | null
|
|
1063
|
-
```
|
|
1064
|
-
|
|
1065
|
-
## `ReplayPreview` (interface)
|
|
1066
|
-
|
|
1067
|
-
```ts
|
|
1068
|
-
intent: string | null | undefined
|
|
1069
|
-
reason: string | null | undefined
|
|
1070
|
-
session_id: string
|
|
1071
|
-
supported: boolean
|
|
1072
|
-
```
|
|
1073
|
-
|
|
1074
|
-
## `ReplaySnapshot` (interface)
|
|
1075
|
-
|
|
1076
|
-
```ts
|
|
1077
|
-
isReplay: boolean
|
|
1078
|
-
sourceSessionId: string | null
|
|
1079
|
-
speed: ReplaySpeed
|
|
1080
|
-
```
|
|
1081
|
-
|
|
1082
|
-
## `ReplaySpeed` (type)
|
|
1083
|
-
|
|
1084
|
-
```ts
|
|
1085
|
-
export type ReplaySpeed = 1 | 2 | 5
|
|
1086
|
-
```
|
|
1087
|
-
|
|
1088
|
-
## `ReplayState` (interface)
|
|
1089
|
-
|
|
1090
|
-
```ts
|
|
1091
|
-
autonomous_reason: string | null | undefined
|
|
1092
|
-
ended_at: string | null | undefined
|
|
1093
|
-
next_source_entry_id: string | null | undefined
|
|
1094
|
-
source_session_id: string | undefined
|
|
1095
|
-
speed: ReplaySpeed | undefined
|
|
1096
|
-
status: "replay" | "autonomous" | undefined
|
|
1097
|
-
```
|
|
1098
|
-
|
|
1099
|
-
## `ResultFeedback` (interface)
|
|
1100
|
-
|
|
1101
|
-
```ts
|
|
1102
|
-
assistant_entry_id: string
|
|
1103
|
-
created_at: string
|
|
1104
|
-
helpful: boolean
|
|
1105
|
-
project_id: string | null
|
|
1106
|
-
reason: ResultFeedbackReason | null
|
|
1107
|
-
session_id: string
|
|
1108
|
-
surface: "unknown" | "chat" | "software_factory"
|
|
1109
|
-
updated_at: string
|
|
1110
|
-
```
|
|
1111
|
-
|
|
1112
|
-
## `ResultFeedbackReason` (type)
|
|
796
|
+
## `resolveServiceUrl` (function)
|
|
1113
797
|
|
|
1114
798
|
```ts
|
|
1115
|
-
|
|
1116
|
-
| "not_solved"
|
|
1117
|
-
| "inaccurate"
|
|
1118
|
-
| "incomplete"
|
|
1119
|
-
| "needs_major_changes"
|
|
1120
|
-
| "too_slow"
|
|
1121
|
-
| "other"
|
|
799
|
+
resolveServiceUrl: (endpoints: PlatformEndpoints, name: PlatformServiceName, path?: string) => string | null
|
|
1122
800
|
```
|
|
1123
801
|
|
|
1124
802
|
## `RunOptions` (interface)
|
|
@@ -1357,7 +1035,6 @@ downloadFile: (sessionId: string, filePath: string, downloadName?: string) => Pr
|
|
|
1357
1035
|
exportSession: (sessionId: string) => Promise<void>
|
|
1358
1036
|
getBackgroundTask: (sessionId: string, taskId: string, tail?: number, init?: RequestInit) => Promise<BackgroundTask>
|
|
1359
1037
|
getDownloadDirUrl: (sessionId: string, dirPath: string) => string
|
|
1360
|
-
getReplayPreview: (sessionId: string) => Promise<ReplayPreview>
|
|
1361
1038
|
getSession: (sessionId: string, init?: RequestInit) => Promise<SessionDetail>
|
|
1362
1039
|
getSessionCheckpoints: (sessionId: string, init?: RequestInit) => Promise<{ nodes: CheckpointNode[]; leaf_id: string | null; }>
|
|
1363
1040
|
getSessionContextStats: (sessionId: string, init?: RequestInit) => Promise<SessionContextStats>
|
|
@@ -1368,26 +1045,23 @@ getSharedSession: (token: string) => Promise<TurnProjection[]>
|
|
|
1368
1045
|
importSession: (file: File, name?: string, solutionOverride?: string | null | ImportSessionOptions) => Promise<{ session_id: string; }>
|
|
1369
1046
|
listBackgroundTasks: (sessionId: string, init?: RequestInit) => Promise<BackgroundTask[]>
|
|
1370
1047
|
listDir: (sessionId: string, dirPath: string) => Promise<FileEntry[]>
|
|
1371
|
-
listResultFeedback: (sessionId: string) => Promise<ResultFeedback[]>
|
|
1372
1048
|
listSessions: (template_id_prefix?: string, solution_id?: string) => Promise<SessionInfo[]>
|
|
1373
1049
|
listSessionsPaginated: (params: { limit: number; offset: number; template_id_prefix?: string; solution_id?: string; solution_registry_id?: string; q?: string; }) => Promise<PaginatedSessionsResult>
|
|
1374
1050
|
listSessionsWithSkillData: () => Promise<SkillDevSession[]>
|
|
1375
1051
|
pinSession: (sessionId: string, pinned: boolean) => Promise<SessionInfo>
|
|
1376
1052
|
previewImport: (file: File) => Promise<ImportPreview>
|
|
1377
1053
|
probeSessionUrl: (sessionId: string, url: string) => Promise<{ reachable: boolean; requires_proxy: boolean; }>
|
|
1378
|
-
putResultFeedback: (sessionId: string, assistantEntryId: string, feedback: { helpful: boolean; reason?: ResultFeedbackReason | null; }) => Promise<ResultFeedback>
|
|
1379
1054
|
renameFile: (sessionId: string, filePath: string, newName: string) => Promise<{ path: string; }>
|
|
1380
1055
|
revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }>
|
|
1381
1056
|
rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
|
|
1382
|
-
searchOwnedContent: (params: { q: string; limit?: number; }) => Promise<GlobalSearchResult>
|
|
1383
1057
|
setSessionEnv: (sessionId: string, env: Record<string, string>) => Promise<SessionDetail>
|
|
1384
1058
|
shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
|
|
1385
|
-
startReplaySession: (sourceSessionId: string, speed?:
|
|
1059
|
+
startReplaySession: (sourceSessionId: string, speed?: 1 | 2 | 5) => Promise<{ session_id: string; }>
|
|
1386
1060
|
stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTaskStopResult>
|
|
1387
1061
|
switchBranch: (sessionId: string, checkpointId: string) => Promise<{ id: string; leaf_id: string; }>
|
|
1388
1062
|
tokenizeMessages: (messages: Array<Record<string, unknown>>, options?: { model?: string; add_generation_prompt?: boolean; enable_thinking?: boolean | null; tools?: Array<Record<string, unknown>>; }) => Promise<TokenizeResult>
|
|
1389
1063
|
tokenizePrompt: (prompt: string, model?: string) => Promise<TokenizeResult>
|
|
1390
|
-
updateReplaySession: (sessionId: string, payload: { speed?:
|
|
1064
|
+
updateReplaySession: (sessionId: string, payload: { speed?: 1 | 2 | 5; status?: "autonomous"; }) => Promise<{ replay_state: SessionInfo["replay_state"]; }>
|
|
1391
1065
|
updateSession: (sessionId: string, payload: { intent?: string; }) => Promise<SessionDetail>
|
|
1392
1066
|
updateSessionMemory: (sessionId: string, memoryEnabled: boolean) => Promise<{ memory_enabled: boolean; }>
|
|
1393
1067
|
updateSharing: (sessionId: string, shared: boolean) => Promise<{ shared: boolean; }>
|
|
@@ -1406,11 +1080,9 @@ errorMessage: string | null
|
|
|
1406
1080
|
isStreaming: boolean
|
|
1407
1081
|
messages: ChatMessage[]
|
|
1408
1082
|
mode: "planning" | "executing" | null
|
|
1409
|
-
replay: ReplaySnapshot | null
|
|
1410
1083
|
sessionId: string
|
|
1411
1084
|
status: "completed" | "failed" | "interrupted" | "running" | "created" | "waiting_for_input" | null
|
|
1412
1085
|
turns: TurnProjection[]
|
|
1413
|
-
viewerRole: "owner" | "viewer" | null
|
|
1414
1086
|
```
|
|
1415
1087
|
|
|
1416
1088
|
## `SessionStatus` (type)
|
|
@@ -1436,13 +1108,6 @@ files: TextFile[]
|
|
|
1436
1108
|
name: string
|
|
1437
1109
|
```
|
|
1438
1110
|
|
|
1439
|
-
## `SkillMentionAvailability` (interface)
|
|
1440
|
-
|
|
1441
|
-
```ts
|
|
1442
|
-
installed: boolean | undefined
|
|
1443
|
-
local: boolean | undefined
|
|
1444
|
-
```
|
|
1445
|
-
|
|
1446
1111
|
## `Solution` (interface)
|
|
1447
1112
|
|
|
1448
1113
|
```ts
|
|
@@ -1592,16 +1257,10 @@ status: "done" | "error" | "cancelled" | "awaiting_answer" | "pending" | undefin
|
|
|
1592
1257
|
export type ToolCallRenderer = (info: ToolCallInfo) => ReactNode | null
|
|
1593
1258
|
```
|
|
1594
1259
|
|
|
1595
|
-
## `toReplaySnapshot` (function)
|
|
1596
|
-
|
|
1597
|
-
```ts
|
|
1598
|
-
toReplaySnapshot: (raw: ReplayState | null | undefined) => ReplaySnapshot | null
|
|
1599
|
-
```
|
|
1600
|
-
|
|
1601
1260
|
## `transformSlashCommand` (function)
|
|
1602
1261
|
|
|
1603
1262
|
```ts
|
|
1604
|
-
transformSlashCommand: (skillName: string, rawInput: string
|
|
1263
|
+
transformSlashCommand: (skillName: string, rawInput: string) => string
|
|
1605
1264
|
```
|
|
1606
1265
|
|
|
1607
1266
|
## `TurnProjection` (interface)
|
|
@@ -1611,7 +1270,6 @@ archived_count: number | null | undefined
|
|
|
1611
1270
|
archived_files: ArchivedFileInfo[] | null | undefined
|
|
1612
1271
|
archived_tool_calls: ArchivedToolCallInfo[] | null | undefined
|
|
1613
1272
|
blocks: ContentBlock[]
|
|
1614
|
-
client_render_id: string | null | undefined
|
|
1615
1273
|
compaction_id: string | null | undefined
|
|
1616
1274
|
context_window: number | undefined
|
|
1617
1275
|
duration_ms: number | undefined
|
|
@@ -1623,7 +1281,6 @@ loop_id: string
|
|
|
1623
1281
|
memory_refs: MemoryRef[] | null | undefined
|
|
1624
1282
|
model: string | null | undefined
|
|
1625
1283
|
parent_fork_tool_call_id: string | null | undefined
|
|
1626
|
-
post_chat_followup: PostChatFollowup | null | undefined
|
|
1627
1284
|
role: "user" | "assistant" | "system"
|
|
1628
1285
|
saved_ratio: number | null | undefined
|
|
1629
1286
|
sequence: number
|
|
@@ -1692,45 +1349,6 @@ state: SessionState | null
|
|
|
1692
1349
|
useBladeClient: () => BladeClient
|
|
1693
1350
|
```
|
|
1694
1351
|
|
|
1695
|
-
## `useLlmChat` (function)
|
|
1696
|
-
|
|
1697
|
-
```ts
|
|
1698
|
-
useLlmChat: (options: LlmChatOptions) => UseLlmChatResult
|
|
1699
|
-
```
|
|
1700
|
-
|
|
1701
|
-
## `UseLlmChatResult` (interface)
|
|
1702
|
-
|
|
1703
|
-
```ts
|
|
1704
|
-
error: string | null
|
|
1705
|
-
isStreaming: boolean
|
|
1706
|
-
messages: ChatMessage[]
|
|
1707
|
-
reset: () => void
|
|
1708
|
-
send: (text: string) => Promise<boolean>
|
|
1709
|
-
stop: () => void
|
|
1710
|
-
```
|
|
1711
|
-
|
|
1712
|
-
## `useReplay` (function)
|
|
1713
|
-
|
|
1714
|
-
```ts
|
|
1715
|
-
useReplay: (session: AgentSession | null) => UseReplayResult
|
|
1716
|
-
```
|
|
1717
|
-
|
|
1718
|
-
## `UseReplayResult` (interface)
|
|
1719
|
-
|
|
1720
|
-
```ts
|
|
1721
|
-
canControl: boolean
|
|
1722
|
-
canReplay: boolean
|
|
1723
|
-
error: Error | null
|
|
1724
|
-
exitToAutonomous: () => Promise<void>
|
|
1725
|
-
isReplay: boolean
|
|
1726
|
-
isStarting: boolean
|
|
1727
|
-
mismatch: ReplayMismatch | null
|
|
1728
|
-
setSpeed: (speed: ReplaySpeed) => Promise<void>
|
|
1729
|
-
speed: ReplaySpeed
|
|
1730
|
-
startReplay: (speed?: ReplaySpeed) => Promise<string>
|
|
1731
|
-
unsupportedReason: string | null
|
|
1732
|
-
```
|
|
1733
|
-
|
|
1734
1352
|
## `UserInfo` (interface)
|
|
1735
1353
|
|
|
1736
1354
|
```ts
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { AgentSession, CreateSessionRequest } from "@blade-hq/agent-client";
|
|
2
|
-
import { type ChatPresentationProps } from "./ChatSurface";
|
|
3
|
-
import type { FollowupInteractionEvent } from "./PostChatFollowupBlock";
|
|
4
|
-
export interface AgentChatProps extends ChatPresentationProps {
|
|
5
|
-
/** follow-up、成果和评分交互;SDK 不绑定任何分析厂商。 */
|
|
6
|
-
onFollowupInteraction?: (event: FollowupInteractionEvent) => void;
|
|
7
|
-
/** 连接既有会话;不传则按 createOptions 自动新建。 */
|
|
8
|
-
sessionId?: string;
|
|
9
|
-
createOptions?: CreateSessionRequest;
|
|
10
|
-
/** 自动创建出的 sessionId 通过此回调交还调用方持有。 */
|
|
11
|
-
onSessionCreated?: (sessionId: string) => void;
|
|
12
|
-
/** 会话连接完成后回调(页面协作场景拿 AgentSession 实例用)。 */
|
|
13
|
-
onSessionReady?: (session: AgentSession) => void;
|
|
14
|
-
/** 智能体下发给宿主页面的指令处理器(action → handler)。 */
|
|
15
|
-
commands?: Record<string, (data: unknown) => void>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* 智能体模式的聊天界面:连接(或新建)一个 Blade 会话,渲染消息流与输入框。
|
|
19
|
-
* 状态全部来自 useAgentSession,不依赖任何全局 store。
|
|
20
|
-
*/
|
|
21
|
-
export declare function AgentChat(props: AgentChatProps): import("react/jsx-runtime").JSX.Element;
|