@code-inspector/core 2.0.0-beta.1 → 2.0.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-inspector/core",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "types/index.d.ts",
@@ -0,0 +1,31 @@
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
+ }
20
+ /**
21
+ * 保存 AI 状态到 sessionStorage
22
+ */
23
+ export declare function saveAIState(state: PersistedAIState): void;
24
+ /**
25
+ * 从 sessionStorage 恢复 AI 状态
26
+ */
27
+ export declare function loadAIState(): PersistedAIState | null;
28
+ /**
29
+ * 清除 sessionStorage 中的 AI 状态
30
+ */
31
+ export declare function clearAIState(): void;
@@ -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;