super-agent-sdk 1.0.20 → 1.0.21

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 CHANGED
@@ -482,6 +482,15 @@ export interface MountOptions {
482
482
  attachmentUploader?: (file: File) => Promise<ChatAttachment>;
483
483
  /** 内置 NOS 直传(推荐):配置即用,📎 按钮 + chip 进度 + 断点续传全内置 */
484
484
  nosUpload?: { baseURL: string; headers?: Record<string, string>; trunkSize?: number };
485
+ /**
486
+ * 折叠内容(思维链/工具调用)DeepSeek 式展示:流式期间自动展开、结束自动收起,
487
+ * 思维链收起条显示「已深度思考 · 用时 Ns」(仅 live 轮有耗时,历史回显无数据)。
488
+ * 对象出现(含 {})即整体开启;子项/子字段仅覆盖缺省(全 true)。结构可扩展。
489
+ */
490
+ collapse?: {
491
+ thinking?: { expandWhileStreaming?: boolean; showDuration?: boolean };
492
+ toolCall?: { expandWhileStreaming?: boolean };
493
+ };
485
494
  }
486
495
 
487
496
  export interface CapabilityItem {
@@ -1634,6 +1643,8 @@ mount("#chat", { sdk }).open();
1634
1643
  ```
1635
1644
 
1636
1645
  > interrupt 帧是流的**暂停点**(后端不发 `done`),`respondInterrupt()` 后的续事件在同一 SSE 流上返回;续流结束(或嵌套 interrupt 再次暂停)后,输入框均可正常继续发送——挂起/续流状态由 Widget 自动管理。
1646
+ >
1647
+ > pending interrupt 期间在输入框直接发文本(不点卡片)也是"作答":Widget 自动路由到 `POST /chat/interrupt/{interruptId}/respond`(`action=submit` + 原文),而非新开 `/chat` 轮;答案回填到中断卡片,不另插用户气泡(与历史加载口径一致)。
1637
1648
 
1638
1649
  也可通过插槽自定义中断卡片:
1639
1650
 
package/dist/index.d.ts CHANGED
@@ -134,6 +134,7 @@ export declare type MessagePart = {
134
134
  } | {
135
135
  type: "thinking";
136
136
  content: string;
137
+ durationMs?: number;
137
138
  } | {
138
139
  type: "tool_call";
139
140
  toolName: string;