super-agent-sdk 1.0.22 → 1.0.23
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 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +13 -0
- package/dist/index.mjs +27 -24
- package/dist/widget.cjs +61 -61
- package/dist/widget.d.ts +18 -3
- package/dist/widget.mjs +4978 -4968
- package/package.json +1 -1
package/dist/widget.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ declare interface ChatEvent {
|
|
|
103
103
|
renderMode?: string;
|
|
104
104
|
html?: string;
|
|
105
105
|
markdown?: string;
|
|
106
|
+
defaultExpanded?: boolean;
|
|
106
107
|
roundId?: string;
|
|
107
108
|
event?: string;
|
|
108
109
|
id?: string;
|
|
@@ -257,7 +258,7 @@ export declare const defaultTheme: Required<ThemeConfig>;
|
|
|
257
258
|
/**
|
|
258
259
|
* SVG symbol 雪碧图加载。
|
|
259
260
|
*
|
|
260
|
-
* `Icon` 用 `<use href="#icon-xxx">` 引用 symbol,symbol 由阿里 iconfont 的 symbol js
|
|
261
|
+
* `Icon` 用 `<use href="#icon-agent-xxx">` 引用 symbol,symbol 由阿里 iconfont 的 symbol js
|
|
261
262
|
* 注入到 `<body>` 下的雪碧图。此前要求宿主页自行 `<script src>`,漏引图标即全空;
|
|
262
263
|
* 现由 SDK 自己动态建 script 加载,宿主页零配置。
|
|
263
264
|
*/
|
|
@@ -334,7 +335,7 @@ export declare interface HeaderProps {
|
|
|
334
335
|
panelTitle?: string;
|
|
335
336
|
}
|
|
336
337
|
|
|
337
|
-
export declare function Icon({ name, size, color, className, style }: IconProps): JSX_2.Element;
|
|
338
|
+
export declare function Icon({ name, size, color, className, style, }: IconProps): JSX_2.Element;
|
|
338
339
|
|
|
339
340
|
declare interface IconProps {
|
|
340
341
|
name: string;
|
|
@@ -425,6 +426,14 @@ declare interface ListConversationsResult {
|
|
|
425
426
|
|
|
426
427
|
export declare function Message({ message, isStreaming, isLast, slots, avatar, artifactPreview, showTimestamp, collapse, }: InternalMessageProps): JSX_2.Element;
|
|
427
428
|
|
|
429
|
+
/** 消息反馈(赞/踩)。type 为 like/dislike;reason/remark 仅 dislike 有值。
|
|
430
|
+
* 历史加载时由消息列表的 feedback 字段还原,供赞/踩按钮回显已选态。 */
|
|
431
|
+
declare interface MessageFeedback {
|
|
432
|
+
type: "like" | "dislike";
|
|
433
|
+
reason?: number | null;
|
|
434
|
+
remark?: string | null;
|
|
435
|
+
}
|
|
436
|
+
|
|
428
437
|
declare type MessagePart = {
|
|
429
438
|
type: "text";
|
|
430
439
|
content: string;
|
|
@@ -446,6 +455,7 @@ declare type MessagePart = {
|
|
|
446
455
|
renderMode?: string;
|
|
447
456
|
html?: string;
|
|
448
457
|
markdown?: string;
|
|
458
|
+
defaultExpanded?: boolean;
|
|
449
459
|
} | {
|
|
450
460
|
type: "error";
|
|
451
461
|
content: string;
|
|
@@ -727,7 +737,7 @@ export declare interface ToolCallPartProps {
|
|
|
727
737
|
expandWhileStreaming?: boolean;
|
|
728
738
|
}
|
|
729
739
|
|
|
730
|
-
export declare function ToolResultPart({ toolName, content, renderMode, html }: ToolResultPartProps): default_2.JSX.Element;
|
|
740
|
+
export declare function ToolResultPart({ toolName, content, renderMode, html, defaultExpanded }: ToolResultPartProps): default_2.JSX.Element;
|
|
731
741
|
|
|
732
742
|
export declare interface ToolResultPartProps {
|
|
733
743
|
toolName: string;
|
|
@@ -736,6 +746,8 @@ export declare interface ToolResultPartProps {
|
|
|
736
746
|
artifacts?: Artifact[];
|
|
737
747
|
renderMode?: string;
|
|
738
748
|
html?: string;
|
|
749
|
+
/** 后端 config.default_expanded=true 或 render_mode=html:结果块默认展开(缺省收起) */
|
|
750
|
+
defaultExpanded?: boolean;
|
|
739
751
|
artifactPreview?: boolean;
|
|
740
752
|
}
|
|
741
753
|
|
|
@@ -764,6 +776,9 @@ declare interface UIMessage {
|
|
|
764
776
|
* feedback / cancelFeedback 按它定位消息(不是表主键 id)。来源二选一:
|
|
765
777
|
* 历史加载取消息列表的 messageId;流式消息取 done/stop 帧的 messageId。 */
|
|
766
778
|
messageId?: string;
|
|
779
|
+
/** 该消息已有的反馈(历史加载还原,无则 null/undefined):赞/踩按钮据此显示已选态。
|
|
780
|
+
* 流式消息不携带(新回复尚无反馈)。 */
|
|
781
|
+
feedback?: MessageFeedback | null;
|
|
767
782
|
roundId?: string;
|
|
768
783
|
artifacts?: Artifact[];
|
|
769
784
|
/** 用户消息原文(含技能 "/code" 前缀;parts 文本展示 "/技能名" 版本时两者不同)。
|