@code-inspector/core 2.0.0-beta.2 → 2.0.0-beta.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/client.iife.js +1 -1
- package/dist/client.umd.js +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +18465 -18477
- package/package.json +1 -1
- package/types/client/ai-persist.d.ts +32 -0
- package/types/client/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI 对话状态持久化 - 使用 sessionStorage 在页面刷新后恢复弹窗
|
|
3
|
+
*/
|
|
4
|
+
import type { ChatMessage, ChatContext } from './ai';
|
|
5
|
+
/**
|
|
6
|
+
* 持久化的 AI 状态
|
|
7
|
+
*/
|
|
8
|
+
export interface PersistedAIState {
|
|
9
|
+
showChatModal: boolean;
|
|
10
|
+
chatMessages: ChatMessage[];
|
|
11
|
+
chatContext: ChatContext | null;
|
|
12
|
+
chatSessionId: string | null;
|
|
13
|
+
chatTheme: 'light' | 'dark';
|
|
14
|
+
chatModel: string;
|
|
15
|
+
modalPosition: {
|
|
16
|
+
left: string;
|
|
17
|
+
top: string;
|
|
18
|
+
} | null;
|
|
19
|
+
turnStatus: 'idle' | 'running' | 'done' | 'interrupt';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 保存 AI 状态到 sessionStorage
|
|
23
|
+
*/
|
|
24
|
+
export declare function saveAIState(state: PersistedAIState): void;
|
|
25
|
+
/**
|
|
26
|
+
* 从 sessionStorage 恢复 AI 状态
|
|
27
|
+
*/
|
|
28
|
+
export declare function loadAIState(): PersistedAIState | null;
|
|
29
|
+
/**
|
|
30
|
+
* 清除 sessionStorage 中的 AI 状态
|
|
31
|
+
*/
|
|
32
|
+
export declare function clearAIState(): void;
|
package/types/client/index.d.ts
CHANGED
|
@@ -216,6 +216,7 @@ export declare class CodeInspectorComponent extends LitElement {
|
|
|
216
216
|
toggleCopy: () => void;
|
|
217
217
|
toggleTarget: () => void;
|
|
218
218
|
toggleAICode: () => void;
|
|
219
|
+
private persistAIState;
|
|
219
220
|
openChatModal: () => void;
|
|
220
221
|
closeChatModal: () => void;
|
|
221
222
|
clearChatMessages: () => void;
|
|
@@ -232,6 +233,7 @@ export declare class CodeInspectorComponent extends LitElement {
|
|
|
232
233
|
handleChatDragEnd: () => void;
|
|
233
234
|
handleOverlayClick: () => void;
|
|
234
235
|
sendChatMessage: () => Promise<void>;
|
|
236
|
+
private resumeAITask;
|
|
235
237
|
/**
|
|
236
238
|
* Attach all event listeners
|
|
237
239
|
*/
|