@blade-hq/agent-react 2608.0.6 → 2608.0.7-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -3
- package/dist/components/AgentChat.d.ts +21 -0
- package/dist/components/AssistantTurnBlock.d.ts +1 -1
- package/dist/components/ChatSurface.d.ts +68 -0
- package/dist/components/ChatView.d.ts +20 -39
- package/dist/components/LlmAdvancedSettings.d.ts +40 -0
- package/dist/components/LlmChat.d.ts +29 -0
- package/dist/components/MarkdownContent.d.ts +3 -6
- package/dist/components/MessageList.d.ts +10 -3
- package/dist/components/PostChatFollowupBlock.d.ts +59 -0
- package/dist/components/ReplayBar.d.ts +13 -0
- package/dist/components/ReplayMismatchPrompt.d.ts +8 -0
- package/dist/embed/entry.d.ts +5 -0
- package/dist/hooks/use-llm-chat.d.ts +57 -0
- package/dist/hooks/use-replay.d.ts +50 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +1673 -434
- package/dist/index.js.map +1 -1
- package/dist/style.css +52 -11
- package/dist/style.full.css +53 -12
- package/package.json +2 -2
- package/public-api.md +424 -4
- package/dist/components/FileCard.d.ts +0 -16
- package/dist/lib/media-tags.d.ts +0 -24
package/public-api.md
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
> 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
|
|
4
4
|
> 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
|
|
5
5
|
|
|
6
|
-
共
|
|
6
|
+
共 171 个公开声明。
|
|
7
|
+
|
|
8
|
+
## `acceptedPostChatFollowupCompletesLatestRun` (function)
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
acceptedPostChatFollowupCompletesLatestRun: (events: RawEvent[], updates: ProjectionUpdate[]) => boolean
|
|
12
|
+
```
|
|
7
13
|
|
|
8
14
|
## `ActiveCompactionState` (interface)
|
|
9
15
|
|
|
@@ -24,6 +30,28 @@ trigger: "auto" | "manual" | "forced_retry" | null | undefined
|
|
|
24
30
|
turn_id: string
|
|
25
31
|
```
|
|
26
32
|
|
|
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
|
+
|
|
27
55
|
## `AgentLoopInfo` (interface)
|
|
28
56
|
|
|
29
57
|
```ts
|
|
@@ -42,6 +70,7 @@ compact: () => Promise<Record<string, unknown>>
|
|
|
42
70
|
countFiles: (dirPath?: string) => Promise<number>
|
|
43
71
|
dispose: () => void
|
|
44
72
|
downloadFile: (filePath: string, downloadName?: string) => Promise<void>
|
|
73
|
+
exitReplay: () => Promise<void>
|
|
45
74
|
getState: () => SessionState
|
|
46
75
|
insertText: (text: string) => void
|
|
47
76
|
isDisposed: boolean
|
|
@@ -51,6 +80,7 @@ on: <K extends keyof AgentSessionEvents>(name: K, handler: (event: AgentSessionE
|
|
|
51
80
|
onCommand: (action: string, handler: CommandHandler) => () => void
|
|
52
81
|
send: (content: MessageContent, options?: SendOptions) => Promise<boolean>
|
|
53
82
|
sessionId: string
|
|
83
|
+
setReplaySpeed: (speed: ReplaySpeed) => Promise<void>
|
|
54
84
|
stop: () => Promise<Record<string, unknown>>
|
|
55
85
|
subscribe: (listener: () => void) => () => void
|
|
56
86
|
```
|
|
@@ -147,6 +177,7 @@ getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
|
|
|
147
177
|
## `AuthResource` (class)
|
|
148
178
|
|
|
149
179
|
```ts
|
|
180
|
+
exchangeCode: (params: ExchangeCodeParams) => Promise<ExchangeCodeResult>
|
|
150
181
|
getMe: () => Promise<UserInfo>
|
|
151
182
|
getProviders: () => Promise<ProvidersResponse>
|
|
152
183
|
login: (options?: LoginOptions) => Promise<LoginResult>
|
|
@@ -237,6 +268,7 @@ baseUrl: string
|
|
|
237
268
|
fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
|
|
238
269
|
onRefreshSuccess: (() => void | Promise<void>) | undefined
|
|
239
270
|
socketToken: string | (() => string | null | undefined) | undefined
|
|
271
|
+
streamTokens: boolean | undefined
|
|
240
272
|
token: string | (() => string | null | undefined) | undefined
|
|
241
273
|
tokenStorage: TokenStorageMode | undefined
|
|
242
274
|
```
|
|
@@ -260,6 +292,13 @@ client: BladeClient
|
|
|
260
292
|
buildMessageContent: (text: string, attachments: Array<{ kind: "file"; name: string; uploadedPath?: string; textContent?: string | null; mimeType?: string; }>) => MessageContent
|
|
261
293
|
```
|
|
262
294
|
|
|
295
|
+
## `ChatCompletionTool` (interface)
|
|
296
|
+
|
|
297
|
+
```ts
|
|
298
|
+
function: { name: string; description?: string; parameters?: Record<string, unknown>; }
|
|
299
|
+
type: "function"
|
|
300
|
+
```
|
|
301
|
+
|
|
263
302
|
## `ChatMessage` (interface)
|
|
264
303
|
|
|
265
304
|
```ts
|
|
@@ -273,6 +312,7 @@ loop_name: string | undefined
|
|
|
273
312
|
memory_refs: MemoryRefInfo[] | undefined
|
|
274
313
|
parent_id: string | null | undefined
|
|
275
314
|
reasoning: string | undefined
|
|
315
|
+
render_id: string | undefined
|
|
276
316
|
role: "error" | "user" | "assistant" | "tool"
|
|
277
317
|
status: "streaming" | "completed" | "paused" | "failed" | "interrupted" | undefined
|
|
278
318
|
timestamp: string | undefined
|
|
@@ -300,6 +340,10 @@ root: string | undefined
|
|
|
300
340
|
classNames: ChatViewClassNames | undefined
|
|
301
341
|
commands: Record<string, (data: unknown) => void> | undefined
|
|
302
342
|
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
|
|
303
347
|
onSessionCreated: ((sessionId: string) => void) | undefined
|
|
304
348
|
onSessionReady: ((session: AgentSession) => void) | undefined
|
|
305
349
|
placeholder: string | undefined
|
|
@@ -433,6 +477,12 @@ path: string | undefined
|
|
|
433
477
|
token: string | (() => string | null | undefined) | undefined
|
|
434
478
|
```
|
|
435
479
|
|
|
480
|
+
## `DEFAULT_REPLAY_SPEED` (const)
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
DEFAULT_REPLAY_SPEED: ReplaySpeed
|
|
484
|
+
```
|
|
485
|
+
|
|
436
486
|
## `EmbeddedChat` (interface)
|
|
437
487
|
|
|
438
488
|
```ts
|
|
@@ -450,6 +500,22 @@ allowedOrigins: string[]
|
|
|
450
500
|
iframe: HTMLIFrameElement | undefined
|
|
451
501
|
```
|
|
452
502
|
|
|
503
|
+
## `ExchangeCodeParams` (interface)
|
|
504
|
+
|
|
505
|
+
```ts
|
|
506
|
+
clientOrigin: string
|
|
507
|
+
code: string
|
|
508
|
+
state: string
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## `ExchangeCodeResult` (interface)
|
|
512
|
+
|
|
513
|
+
```ts
|
|
514
|
+
access_token: string
|
|
515
|
+
token_type: string
|
|
516
|
+
user: { id: string; username: string; display_name: string; avatar_url: string | null; }
|
|
517
|
+
```
|
|
518
|
+
|
|
453
519
|
## `ExistingSolutionRef` (interface)
|
|
454
520
|
|
|
455
521
|
```ts
|
|
@@ -482,6 +548,59 @@ path: string
|
|
|
482
548
|
tags: string[] | undefined
|
|
483
549
|
```
|
|
484
550
|
|
|
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
|
+
|
|
485
604
|
## `getFileParts` (function)
|
|
486
605
|
|
|
487
606
|
```ts
|
|
@@ -500,6 +619,42 @@ getImageParts: (content: MessageContent) => ImageUrlContentPart[]
|
|
|
500
619
|
getTextContent: (content: MessageContent) => string
|
|
501
620
|
```
|
|
502
621
|
|
|
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
|
+
|
|
503
658
|
## `groupMessagesByLoop` (function)
|
|
504
659
|
|
|
505
660
|
```ts
|
|
@@ -560,6 +715,12 @@ isHiddenInternalMessage: (message: Pick<ChatMessage, "role" | "content">) => boo
|
|
|
560
715
|
isInboundEnvelope: (value: unknown) => value is InboundEnvelope
|
|
561
716
|
```
|
|
562
717
|
|
|
718
|
+
## `latestPostChatFollowup` (function)
|
|
719
|
+
|
|
720
|
+
```ts
|
|
721
|
+
latestPostChatFollowup: (turns: TurnProjection[]) => PostChatFollowup | null
|
|
722
|
+
```
|
|
723
|
+
|
|
563
724
|
## `LayoutType` (enum)
|
|
564
725
|
|
|
565
726
|
```ts
|
|
@@ -576,6 +737,88 @@ export enum LayoutType {
|
|
|
576
737
|
}
|
|
577
738
|
```
|
|
578
739
|
|
|
740
|
+
## `LlmAdvancedSettings` (interface)
|
|
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)
|
|
757
|
+
|
|
758
|
+
```ts
|
|
759
|
+
insertText: (text: string) => void
|
|
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
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
## `LlmChatProps` (interface)
|
|
782
|
+
|
|
783
|
+
```ts
|
|
784
|
+
advanced: boolean | LlmAdvancedSettings | undefined
|
|
785
|
+
apiKey: string | undefined
|
|
786
|
+
baseURL: string
|
|
787
|
+
classNames: ChatViewClassNames | undefined
|
|
788
|
+
extraBody: Record<string, unknown> | undefined
|
|
789
|
+
fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
|
|
790
|
+
headers: Record<string, string> | undefined
|
|
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
|
|
820
|
+
```
|
|
821
|
+
|
|
579
822
|
## `LoginOptions` (interface)
|
|
580
823
|
|
|
581
824
|
```ts
|
|
@@ -643,7 +886,9 @@ export type ModeId = "planning" | "executing"
|
|
|
643
886
|
## `ModelCatalog` (interface)
|
|
644
887
|
|
|
645
888
|
```ts
|
|
889
|
+
baseUrl: string | undefined
|
|
646
890
|
default: string
|
|
891
|
+
defaultServiceModel: string | undefined
|
|
647
892
|
models: ModelOption[]
|
|
648
893
|
```
|
|
649
894
|
|
|
@@ -652,6 +897,7 @@ models: ModelOption[]
|
|
|
652
897
|
```ts
|
|
653
898
|
id: string
|
|
654
899
|
label: string
|
|
900
|
+
serviceModelId: string | undefined
|
|
655
901
|
```
|
|
656
902
|
|
|
657
903
|
## `ModelsResource` (class)
|
|
@@ -700,6 +946,17 @@ sequence: number
|
|
|
700
946
|
turn_id: string
|
|
701
947
|
```
|
|
702
948
|
|
|
949
|
+
## `PostChatFollowup` (interface)
|
|
950
|
+
|
|
951
|
+
```ts
|
|
952
|
+
assistant_entry_id: string
|
|
953
|
+
feedback_eligible: boolean
|
|
954
|
+
feedback_scope: "latest_result"
|
|
955
|
+
final_artifacts: FinalArtifact[] | undefined
|
|
956
|
+
recaption: string | undefined
|
|
957
|
+
suggestions: string[]
|
|
958
|
+
```
|
|
959
|
+
|
|
703
960
|
## `PreparedSolution` (interface)
|
|
704
961
|
|
|
705
962
|
```ts
|
|
@@ -761,6 +1018,109 @@ payload: Record<string, unknown>
|
|
|
761
1018
|
type: string
|
|
762
1019
|
```
|
|
763
1020
|
|
|
1021
|
+
## `reconcileOptimisticUserTurns` (function)
|
|
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)
|
|
1113
|
+
|
|
1114
|
+
```ts
|
|
1115
|
+
export type ResultFeedbackReason =
|
|
1116
|
+
| "not_solved"
|
|
1117
|
+
| "inaccurate"
|
|
1118
|
+
| "incomplete"
|
|
1119
|
+
| "needs_major_changes"
|
|
1120
|
+
| "too_slow"
|
|
1121
|
+
| "other"
|
|
1122
|
+
```
|
|
1123
|
+
|
|
764
1124
|
## `RunOptions` (interface)
|
|
765
1125
|
|
|
766
1126
|
```ts
|
|
@@ -997,6 +1357,7 @@ downloadFile: (sessionId: string, filePath: string, downloadName?: string) => Pr
|
|
|
997
1357
|
exportSession: (sessionId: string) => Promise<void>
|
|
998
1358
|
getBackgroundTask: (sessionId: string, taskId: string, tail?: number, init?: RequestInit) => Promise<BackgroundTask>
|
|
999
1359
|
getDownloadDirUrl: (sessionId: string, dirPath: string) => string
|
|
1360
|
+
getReplayPreview: (sessionId: string) => Promise<ReplayPreview>
|
|
1000
1361
|
getSession: (sessionId: string, init?: RequestInit) => Promise<SessionDetail>
|
|
1001
1362
|
getSessionCheckpoints: (sessionId: string, init?: RequestInit) => Promise<{ nodes: CheckpointNode[]; leaf_id: string | null; }>
|
|
1002
1363
|
getSessionContextStats: (sessionId: string, init?: RequestInit) => Promise<SessionContextStats>
|
|
@@ -1007,23 +1368,26 @@ getSharedSession: (token: string) => Promise<TurnProjection[]>
|
|
|
1007
1368
|
importSession: (file: File, name?: string, solutionOverride?: string | null | ImportSessionOptions) => Promise<{ session_id: string; }>
|
|
1008
1369
|
listBackgroundTasks: (sessionId: string, init?: RequestInit) => Promise<BackgroundTask[]>
|
|
1009
1370
|
listDir: (sessionId: string, dirPath: string) => Promise<FileEntry[]>
|
|
1371
|
+
listResultFeedback: (sessionId: string) => Promise<ResultFeedback[]>
|
|
1010
1372
|
listSessions: (template_id_prefix?: string, solution_id?: string) => Promise<SessionInfo[]>
|
|
1011
1373
|
listSessionsPaginated: (params: { limit: number; offset: number; template_id_prefix?: string; solution_id?: string; solution_registry_id?: string; q?: string; }) => Promise<PaginatedSessionsResult>
|
|
1012
1374
|
listSessionsWithSkillData: () => Promise<SkillDevSession[]>
|
|
1013
1375
|
pinSession: (sessionId: string, pinned: boolean) => Promise<SessionInfo>
|
|
1014
1376
|
previewImport: (file: File) => Promise<ImportPreview>
|
|
1015
1377
|
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>
|
|
1016
1379
|
renameFile: (sessionId: string, filePath: string, newName: string) => Promise<{ path: string; }>
|
|
1017
1380
|
revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }>
|
|
1018
1381
|
rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
|
|
1382
|
+
searchOwnedContent: (params: { q: string; limit?: number; }) => Promise<GlobalSearchResult>
|
|
1019
1383
|
setSessionEnv: (sessionId: string, env: Record<string, string>) => Promise<SessionDetail>
|
|
1020
1384
|
shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
|
|
1021
|
-
startReplaySession: (sourceSessionId: string, speed?:
|
|
1385
|
+
startReplaySession: (sourceSessionId: string, speed?: ReplaySpeed) => Promise<{ session_id: string; }>
|
|
1022
1386
|
stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTaskStopResult>
|
|
1023
1387
|
switchBranch: (sessionId: string, checkpointId: string) => Promise<{ id: string; leaf_id: string; }>
|
|
1024
1388
|
tokenizeMessages: (messages: Array<Record<string, unknown>>, options?: { model?: string; add_generation_prompt?: boolean; enable_thinking?: boolean | null; tools?: Array<Record<string, unknown>>; }) => Promise<TokenizeResult>
|
|
1025
1389
|
tokenizePrompt: (prompt: string, model?: string) => Promise<TokenizeResult>
|
|
1026
|
-
updateReplaySession: (sessionId: string, payload: { speed?:
|
|
1390
|
+
updateReplaySession: (sessionId: string, payload: { speed?: ReplaySpeed; status?: "autonomous"; }) => Promise<{ replay_state: SessionInfo["replay_state"]; }>
|
|
1027
1391
|
updateSession: (sessionId: string, payload: { intent?: string; }) => Promise<SessionDetail>
|
|
1028
1392
|
updateSessionMemory: (sessionId: string, memoryEnabled: boolean) => Promise<{ memory_enabled: boolean; }>
|
|
1029
1393
|
updateSharing: (sessionId: string, shared: boolean) => Promise<{ shared: boolean; }>
|
|
@@ -1042,9 +1406,11 @@ errorMessage: string | null
|
|
|
1042
1406
|
isStreaming: boolean
|
|
1043
1407
|
messages: ChatMessage[]
|
|
1044
1408
|
mode: "planning" | "executing" | null
|
|
1409
|
+
replay: ReplaySnapshot | null
|
|
1045
1410
|
sessionId: string
|
|
1046
1411
|
status: "completed" | "failed" | "interrupted" | "running" | "created" | "waiting_for_input" | null
|
|
1047
1412
|
turns: TurnProjection[]
|
|
1413
|
+
viewerRole: "owner" | "viewer" | null
|
|
1048
1414
|
```
|
|
1049
1415
|
|
|
1050
1416
|
## `SessionStatus` (type)
|
|
@@ -1070,6 +1436,13 @@ files: TextFile[]
|
|
|
1070
1436
|
name: string
|
|
1071
1437
|
```
|
|
1072
1438
|
|
|
1439
|
+
## `SkillMentionAvailability` (interface)
|
|
1440
|
+
|
|
1441
|
+
```ts
|
|
1442
|
+
installed: boolean | undefined
|
|
1443
|
+
local: boolean | undefined
|
|
1444
|
+
```
|
|
1445
|
+
|
|
1073
1446
|
## `Solution` (interface)
|
|
1074
1447
|
|
|
1075
1448
|
```ts
|
|
@@ -1219,10 +1592,16 @@ status: "done" | "error" | "cancelled" | "awaiting_answer" | "pending" | undefin
|
|
|
1219
1592
|
export type ToolCallRenderer = (info: ToolCallInfo) => ReactNode | null
|
|
1220
1593
|
```
|
|
1221
1594
|
|
|
1595
|
+
## `toReplaySnapshot` (function)
|
|
1596
|
+
|
|
1597
|
+
```ts
|
|
1598
|
+
toReplaySnapshot: (raw: ReplayState | null | undefined) => ReplaySnapshot | null
|
|
1599
|
+
```
|
|
1600
|
+
|
|
1222
1601
|
## `transformSlashCommand` (function)
|
|
1223
1602
|
|
|
1224
1603
|
```ts
|
|
1225
|
-
transformSlashCommand: (skillName: string, rawInput: string) => string
|
|
1604
|
+
transformSlashCommand: (skillName: string, rawInput: string, { local, installed }?: SkillMentionAvailability) => string
|
|
1226
1605
|
```
|
|
1227
1606
|
|
|
1228
1607
|
## `TurnProjection` (interface)
|
|
@@ -1232,6 +1611,7 @@ archived_count: number | null | undefined
|
|
|
1232
1611
|
archived_files: ArchivedFileInfo[] | null | undefined
|
|
1233
1612
|
archived_tool_calls: ArchivedToolCallInfo[] | null | undefined
|
|
1234
1613
|
blocks: ContentBlock[]
|
|
1614
|
+
client_render_id: string | null | undefined
|
|
1235
1615
|
compaction_id: string | null | undefined
|
|
1236
1616
|
context_window: number | undefined
|
|
1237
1617
|
duration_ms: number | undefined
|
|
@@ -1243,6 +1623,7 @@ loop_id: string
|
|
|
1243
1623
|
memory_refs: MemoryRef[] | null | undefined
|
|
1244
1624
|
model: string | null | undefined
|
|
1245
1625
|
parent_fork_tool_call_id: string | null | undefined
|
|
1626
|
+
post_chat_followup: PostChatFollowup | null | undefined
|
|
1246
1627
|
role: "user" | "assistant" | "system"
|
|
1247
1628
|
saved_ratio: number | null | undefined
|
|
1248
1629
|
sequence: number
|
|
@@ -1311,6 +1692,45 @@ state: SessionState | null
|
|
|
1311
1692
|
useBladeClient: () => BladeClient
|
|
1312
1693
|
```
|
|
1313
1694
|
|
|
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
|
+
|
|
1314
1734
|
## `UserInfo` (interface)
|
|
1315
1735
|
|
|
1316
1736
|
```ts
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef } from "react";
|
|
2
|
-
import type { ExtraProps } from "streamdown";
|
|
3
|
-
export type FileCardProps = ComponentPropsWithRef<"span"> & ExtraProps & {
|
|
4
|
-
"data-path"?: string;
|
|
5
|
-
"data-name"?: string;
|
|
6
|
-
dataPath?: string;
|
|
7
|
-
dataName?: string;
|
|
8
|
-
sessionId?: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* 智能体产出文件的下载链接(由 MEDIA 行折叠而来)。
|
|
12
|
-
*
|
|
13
|
-
* href 让 Vue/纯 HTML 宿主看到标准的「文件名→URL」语义;普通点击仍交给
|
|
14
|
-
* downloadFile,避免跨域时 download 属性被忽略,也确保使用点击时的最新 token。
|
|
15
|
-
*/
|
|
16
|
-
export declare function FileCard({ node, "data-path": pathAttribute, "data-name": nameAttribute, dataPath, dataName, sessionId, children, className, ...props }: FileCardProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/lib/media-tags.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MEDIA 行处理。后端提示词要求智能体产出文件时单独写一行 `MEDIA:<绝对路径>`
|
|
3
|
-
* (见 host/src/blade_agent/host/orchestrator/prompt.py),界面必须把它折叠成文件下载链接——
|
|
4
|
-
* 这是内部标记,直接摆给用户看就是 bug。
|
|
5
|
-
*/
|
|
6
|
-
export declare const FILE_CARD_TAG = "blade-file-card";
|
|
7
|
-
/**
|
|
8
|
-
* 能不能拿这个路径去下载。绝对路径原样交给服务端解析(它会把工作区路径映射进沙盒、
|
|
9
|
-
* 并拒绝越界),所以这里只挡明显不该放过的:空路径和 `..`。
|
|
10
|
-
*/
|
|
11
|
-
export declare function isSafeMediaPath(path: string): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 把 MEDIA 行折叠成文件下载链接标签。
|
|
14
|
-
*
|
|
15
|
-
* `streaming` 时最后一行要特殊对待:MEDIA_LINE_RE 用 `$` 匹配行尾,而流式过程中最后一行
|
|
16
|
-
* 随时都是「行尾」,逐 token 折叠会依次闪出 `MEDIA:`、半截路径的链接、再变成正确链接。
|
|
17
|
-
* 所以正在写的那一行整行先不渲染,等它以换行结束、或消息转为 static 之后再折叠。
|
|
18
|
-
*
|
|
19
|
-
* 判据只能是 `streaming`,不能是「有没有尾随换行」:AssistantTurnBlock 传进来的文本是
|
|
20
|
-
* trim 过的,静态消息永远没有尾随换行,那样判断会导致 MEDIA 行永远不折叠。
|
|
21
|
-
*/
|
|
22
|
-
export declare function collapseMediaTags(text: string, options?: {
|
|
23
|
-
streaming?: boolean;
|
|
24
|
-
}): string;
|