@yushaw/sanqian-chat 0.1.1 → 0.2.0

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.
@@ -1,5 +1,75 @@
1
1
  import { HitlResponse } from '@yushaw/sanqian-sdk';
2
2
 
3
+ /**
4
+ * @yushaw/sanqian-chat Core Types
5
+ *
6
+ * Re-exports SDK types + chat-specific types
7
+ */
8
+
9
+ type Locale = 'en' | 'zh';
10
+ interface ChatUiStrings {
11
+ inputPlaceholder: string;
12
+ inputSend: string;
13
+ inputStop: string;
14
+ chat: string;
15
+ recentChats: string;
16
+ newChat: string;
17
+ selectConversation: string;
18
+ noHistory: string;
19
+ loadMore: string;
20
+ today: string;
21
+ yesterday: string;
22
+ delete: string;
23
+ dismiss: string;
24
+ close: string;
25
+ pin: string;
26
+ unpin: string;
27
+ conversationUntitled: string;
28
+ conversationDeleteConfirm: string;
29
+ messageThinking: string;
30
+ messageError: string;
31
+ messageLoading: string;
32
+ connectionConnecting: string;
33
+ connectionConnected: string;
34
+ connectionDisconnected: string;
35
+ connectionReconnecting: string;
36
+ connectionError: string;
37
+ steps: string;
38
+ executing: string;
39
+ thinking: string;
40
+ thinkingStreaming: string;
41
+ thinkingPaused: string;
42
+ hitlApprove: string;
43
+ hitlReject: string;
44
+ hitlSubmit: string;
45
+ hitlCancel: string;
46
+ hitlRememberChoice: string;
47
+ hitlRequiredField: string;
48
+ hitlTimeoutIn: string;
49
+ hitlSeconds: string;
50
+ hitlExecuteTool: string;
51
+ hitlToolLabel: string;
52
+ hitlArgsLabel: string;
53
+ hitlDefaultPrefix: string;
54
+ hitlEnterResponse: string;
55
+ hitlApprovalRequest: string;
56
+ hitlInputRequest: string;
57
+ hitlApprovalRequired: string;
58
+ hitlInputRequired: string;
59
+ }
60
+ type ChatThemeMode = 'light' | 'dark' | 'auto';
61
+ type ChatFontSize = 'small' | 'normal' | 'large' | 'extra-large';
62
+ interface ChatUiConfigSerializable {
63
+ logo?: string;
64
+ theme?: ChatThemeMode;
65
+ /** Font size scale: small (13px), normal (14px), large (16px), extra-large (18px) */
66
+ fontSize?: ChatFontSize;
67
+ accentColor?: string;
68
+ locale?: Locale;
69
+ strings?: Partial<ChatUiStrings>;
70
+ alwaysOnTop?: boolean;
71
+ }
72
+
3
73
  /**
4
74
  * @yushaw/sanqian-chat Preload
5
75
  *
@@ -19,6 +89,7 @@ interface SanqianChatAPI {
19
89
  content: string;
20
90
  }>;
21
91
  conversationId?: string;
92
+ agentId?: string | null;
22
93
  }): Promise<void>;
23
94
  cancelStream(params: {
24
95
  streamId: string;
@@ -57,10 +128,27 @@ interface SanqianChatAPI {
57
128
  hide(): Promise<{
58
129
  success: boolean;
59
130
  }>;
131
+ setAlwaysOnTop(params: {
132
+ alwaysOnTop: boolean;
133
+ }): Promise<{
134
+ success: boolean;
135
+ error?: string;
136
+ }>;
137
+ getAlwaysOnTop(): Promise<{
138
+ success: boolean;
139
+ data?: boolean;
140
+ error?: string;
141
+ }>;
142
+ getUiConfig(): Promise<{
143
+ success: boolean;
144
+ data?: ChatUiConfigSerializable | null;
145
+ error?: string;
146
+ }>;
60
147
  }
61
148
  declare global {
62
149
  interface Window {
63
150
  sanqianChat: SanqianChatAPI;
151
+ __SANQIAN_CHAT_STYLE_MODE__?: 'safe' | 'full' | false;
64
152
  }
65
153
  }
66
154
 
@@ -33,6 +33,10 @@ var api = {
33
33
  listConversations: (params) => import_electron.ipcRenderer.invoke("sanqian-chat:listConversations", params),
34
34
  getConversation: (params) => import_electron.ipcRenderer.invoke("sanqian-chat:getConversation", params),
35
35
  deleteConversation: (params) => import_electron.ipcRenderer.invoke("sanqian-chat:deleteConversation", params),
36
- hide: () => import_electron.ipcRenderer.invoke("sanqian-chat:hide")
36
+ hide: () => import_electron.ipcRenderer.invoke("sanqian-chat:hide"),
37
+ setAlwaysOnTop: (params) => import_electron.ipcRenderer.invoke("sanqian-chat:setAlwaysOnTop", params),
38
+ getAlwaysOnTop: () => import_electron.ipcRenderer.invoke("sanqian-chat:getAlwaysOnTop"),
39
+ getUiConfig: () => import_electron.ipcRenderer.invoke("sanqian-chat:getUiConfig")
37
40
  };
38
41
  import_electron.contextBridge.exposeInMainWorld("sanqianChat", api);
42
+ import_electron.contextBridge.exposeInMainWorld("__SANQIAN_CHAT_STYLE_MODE__", "full");