@huyooo/ai-chat-frontend-react 0.2.41 → 0.2.42

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/dist/index.css CHANGED
@@ -3212,6 +3212,25 @@ body {
3212
3212
  }
3213
3213
  }
3214
3214
 
3215
+ /* src/components/message/parts/CompactPart.css */
3216
+ .compact-detail {
3217
+ display: flex;
3218
+ flex-direction: column;
3219
+ gap: 4px;
3220
+ font-size: 12px;
3221
+ color: var(--chat-text-muted, #999);
3222
+ }
3223
+ .compact-row {
3224
+ display: flex;
3225
+ justify-content: space-between;
3226
+ }
3227
+ .compact-label {
3228
+ opacity: 0.7;
3229
+ }
3230
+ .compact-value {
3231
+ font-variant-numeric: tabular-nums;
3232
+ }
3233
+
3215
3234
  /* src/components/message/PartsRenderer.css */
3216
3235
  .parts-renderer {
3217
3236
  display: flex;
package/dist/index.d.ts CHANGED
@@ -136,6 +136,23 @@ interface PlanPart {
136
136
  steps: PlanStepItem[];
137
137
  status: 'running' | 'done';
138
138
  }
139
+ /** 上下文压缩 Part(AI 总结对话历史) */
140
+ interface CompactPart {
141
+ type: 'compact';
142
+ status: 'running' | 'done' | 'failed';
143
+ /** 压缩前估算 token 数 */
144
+ estimatedTokens?: number;
145
+ /** 可用 prompt token 预算 */
146
+ budget?: number;
147
+ /** 压缩后估算 token 数 */
148
+ compressedTokens?: number;
149
+ /** 压缩前消息数 */
150
+ originalMessageCount?: number;
151
+ /** 压缩后消息数 */
152
+ compressedMessageCount?: number;
153
+ /** 耗时(秒) */
154
+ duration?: number;
155
+ }
139
156
  /** 天气 Part(由 get_weather 工具生成)*/
140
157
  interface WeatherPart {
141
158
  type: 'weather';
@@ -153,7 +170,7 @@ interface CustomPart {
153
170
  [key: string]: unknown;
154
171
  }
155
172
  /** 内置 Part 联合类型 */
156
- type BuiltinPart = TextPart$1 | CodePart | ThinkingPart$1 | SearchPart$1 | ToolCallPart$1 | ImagePart$1 | ErrorPart$1 | PlanPart;
173
+ type BuiltinPart = TextPart$1 | CodePart | ThinkingPart$1 | SearchPart$1 | ToolCallPart$1 | ImagePart$1 | ErrorPart$1 | PlanPart | CompactPart;
157
174
  /** 内容 Part 联合类型(包含内置和扩展类型)*/
158
175
  type ContentPart = BuiltinPart | WeatherPart | CustomPart;
159
176
  /** 内容 Part 类型字符串 */