@shaxpir/duiduidui-models 1.25.4 → 1.25.5
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/models/Chat.d.ts +3 -2
- package/dist/models/Chat.js +1 -1
- package/package.json +1 -1
package/dist/models/Chat.d.ts
CHANGED
|
@@ -31,8 +31,9 @@ export interface ThinkingBlock {
|
|
|
31
31
|
thinking: string;
|
|
32
32
|
}
|
|
33
33
|
export type ContentBlock = TextBlock | ImageBlock | ToolUseBlock | ToolResultBlock | ThinkingBlock;
|
|
34
|
+
export type CacheTTL = 'ephemeral_5m' | 'ephemeral_1h';
|
|
34
35
|
export interface CacheBreakpoint {
|
|
35
|
-
ttl:
|
|
36
|
+
ttl: CacheTTL;
|
|
36
37
|
created_at: CompactDateTime;
|
|
37
38
|
expires_at: CompactDateTime;
|
|
38
39
|
}
|
|
@@ -123,7 +124,7 @@ export declare class Chat extends SharedContent {
|
|
|
123
124
|
hasUnread(userId: ContentId): boolean;
|
|
124
125
|
toStub(): ChatStub;
|
|
125
126
|
appendMessage(message: ChatMessage): void;
|
|
126
|
-
setBreakpoint(messageIndex: number, ttl:
|
|
127
|
+
setBreakpoint(messageIndex: number, ttl: CacheTTL): void;
|
|
127
128
|
removeBreakpoint(messageIndex: number): void;
|
|
128
129
|
clearExpiredBreakpoints(): void;
|
|
129
130
|
}
|
package/dist/models/Chat.js
CHANGED
|
@@ -197,7 +197,7 @@ class Chat extends SharedContent_1.SharedContent {
|
|
|
197
197
|
if (messageIndex < 0 || messageIndex >= this._messagesView.length)
|
|
198
198
|
return;
|
|
199
199
|
const now = shaxpir_common_1.ClockService.getClock().utc();
|
|
200
|
-
const durationMinutes = ttl === '
|
|
200
|
+
const durationMinutes = ttl === 'ephemeral_5m' ? 5 : 60;
|
|
201
201
|
const expiresAt = shaxpir_common_1.Time.plus(now, durationMinutes, 'minutes');
|
|
202
202
|
const breakpoint = {
|
|
203
203
|
ttl,
|