@gendive/chatllm 0.6.12 → 0.8.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.
- package/dist/react/index.d.mts +107 -2
- package/dist/react/index.d.ts +107 -2
- package/dist/react/index.js +894 -119
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +894 -119
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.d.mts
CHANGED
|
@@ -68,6 +68,75 @@ interface MarkdownRendererProps {
|
|
|
68
68
|
}
|
|
69
69
|
declare const MarkdownRenderer: React$1.FC<MarkdownRendererProps>;
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* @description 메모리 시스템 타입 정의
|
|
73
|
+
* @license MIT
|
|
74
|
+
*/
|
|
75
|
+
/** @description 메모리 저장소 타입 */
|
|
76
|
+
type MemoryStorageType = 'localStorage' | 'postgresql' | 'memory';
|
|
77
|
+
/** @description 메모리 엔트리 기본 타입 */
|
|
78
|
+
interface MemoryEntry {
|
|
79
|
+
key: string;
|
|
80
|
+
value: unknown;
|
|
81
|
+
createdAt: number;
|
|
82
|
+
updatedAt: number;
|
|
83
|
+
}
|
|
84
|
+
/** @description 확장된 메모리 엔트리 (자동 추출 시 사용) */
|
|
85
|
+
interface ExtendedMemoryEntry extends MemoryEntry {
|
|
86
|
+
category?: MemoryCategory;
|
|
87
|
+
confidence?: number;
|
|
88
|
+
source?: string;
|
|
89
|
+
}
|
|
90
|
+
/** @description 메모리 카테고리 */
|
|
91
|
+
type MemoryCategory = 'basic' | 'professional' | 'preferences' | 'context';
|
|
92
|
+
/** @description 글로벌 메모리 설정 */
|
|
93
|
+
interface GlobalMemoryConfig {
|
|
94
|
+
storageType: MemoryStorageType;
|
|
95
|
+
/** localStorage 설정 */
|
|
96
|
+
localStorage?: {
|
|
97
|
+
key: string;
|
|
98
|
+
};
|
|
99
|
+
/** PostgreSQL 설정 */
|
|
100
|
+
postgresql?: {
|
|
101
|
+
apiEndpoint: string;
|
|
102
|
+
userId: string;
|
|
103
|
+
authToken?: string;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** @description 압축 상태 */
|
|
107
|
+
interface CompressionState {
|
|
108
|
+
contextSummary?: string;
|
|
109
|
+
summaryAfterIndex?: number;
|
|
110
|
+
compressionCount: number;
|
|
111
|
+
lastCompressionAt?: number;
|
|
112
|
+
}
|
|
113
|
+
/** @description 정보 추출 설정 */
|
|
114
|
+
interface InfoExtractionConfig {
|
|
115
|
+
/** 자동 추출 활성화 여부 */
|
|
116
|
+
enabled: boolean;
|
|
117
|
+
/** 추출에 사용할 모델 (저렴한 모델 권장) */
|
|
118
|
+
model?: string;
|
|
119
|
+
/** 최소 confidence 임계값 (기본: 0.8) */
|
|
120
|
+
minConfidence: number;
|
|
121
|
+
}
|
|
122
|
+
/** @description useGlobalMemory 훅 상태 */
|
|
123
|
+
interface GlobalMemoryState {
|
|
124
|
+
entries: Map<string, ExtendedMemoryEntry>;
|
|
125
|
+
isLoading: boolean;
|
|
126
|
+
error: Error | null;
|
|
127
|
+
}
|
|
128
|
+
/** @description useGlobalMemory 훅 반환 타입 */
|
|
129
|
+
interface UseGlobalMemoryReturn {
|
|
130
|
+
state: GlobalMemoryState;
|
|
131
|
+
set: (key: string, value: unknown, meta?: Partial<ExtendedMemoryEntry>) => Promise<void>;
|
|
132
|
+
get: <T>(key: string) => T | undefined;
|
|
133
|
+
remove: (key: string) => Promise<void>;
|
|
134
|
+
has: (key: string) => boolean;
|
|
135
|
+
clear: () => Promise<void>;
|
|
136
|
+
toPromptContext: () => string;
|
|
137
|
+
refresh: () => Promise<void>;
|
|
138
|
+
}
|
|
139
|
+
|
|
71
140
|
/**
|
|
72
141
|
* @description React UI 컴포넌트 타입 정의
|
|
73
142
|
*/
|
|
@@ -102,8 +171,12 @@ interface ChatSession {
|
|
|
102
171
|
model: string;
|
|
103
172
|
createdAt: number;
|
|
104
173
|
updatedAt: number;
|
|
174
|
+
/** @deprecated Use compressionState.contextSummary instead */
|
|
105
175
|
contextSummary?: string;
|
|
176
|
+
/** @deprecated Use compressionState.summaryAfterIndex instead */
|
|
106
177
|
summaryAfterIndex?: number;
|
|
178
|
+
/** 압축 상태 (점진적 압축용) */
|
|
179
|
+
compressionState?: CompressionState;
|
|
107
180
|
}
|
|
108
181
|
interface ActionItem {
|
|
109
182
|
id: string;
|
|
@@ -159,9 +232,9 @@ interface ChatUIProps {
|
|
|
159
232
|
showModelSelector?: boolean;
|
|
160
233
|
/** 초기 시스템 프롬프트 */
|
|
161
234
|
systemPrompt?: string;
|
|
162
|
-
/** 컨텍스트 압축 임계값 */
|
|
235
|
+
/** 컨텍스트 압축 임계값 (기본: 20) */
|
|
163
236
|
contextCompressionThreshold?: number;
|
|
164
|
-
/** 압축 후 유지할 메시지 수 */
|
|
237
|
+
/** 압축 후 유지할 메시지 수 (기본: 6) */
|
|
165
238
|
keepRecentMessages?: number;
|
|
166
239
|
/** 스토리지 키 (로컬 저장용) */
|
|
167
240
|
storageKey?: string;
|
|
@@ -173,6 +246,20 @@ interface ChatUIProps {
|
|
|
173
246
|
onSessionChange?: (session: ChatSession | null) => void;
|
|
174
247
|
/** 에러 핸들러 */
|
|
175
248
|
onError?: (error: Error) => void;
|
|
249
|
+
/** @Todo vibecode - 세션 제목 변경 핸들러 */
|
|
250
|
+
onTitleChange?: (sessionId: string, newTitle: string) => void;
|
|
251
|
+
/** 재압축 임계값 - 새 메시지 수 (기본: 10) */
|
|
252
|
+
recompressionThreshold?: number;
|
|
253
|
+
/** 토큰 한도 (기본: 8000) */
|
|
254
|
+
tokenLimit?: number;
|
|
255
|
+
/** 글로벌 메모리 사용 여부 (기본: true) */
|
|
256
|
+
useGlobalMemory?: boolean;
|
|
257
|
+
/** 글로벌 메모리 설정 */
|
|
258
|
+
globalMemoryConfig?: GlobalMemoryConfig;
|
|
259
|
+
/** 자동 정보 추출 활성화 (기본: true) */
|
|
260
|
+
enableAutoExtraction?: boolean;
|
|
261
|
+
/** 정보 추출 설정 */
|
|
262
|
+
infoExtractionConfig?: Partial<InfoExtractionConfig>;
|
|
176
263
|
}
|
|
177
264
|
interface SendMessageParams {
|
|
178
265
|
messages: {
|
|
@@ -215,6 +302,8 @@ interface SidebarProps {
|
|
|
215
302
|
onSelectSession: (id: string) => void;
|
|
216
303
|
onNewSession: () => void;
|
|
217
304
|
onDeleteSession: (id: string) => void;
|
|
305
|
+
/** @Todo vibecode - 세션 제목 변경 핸들러 */
|
|
306
|
+
onRenameSession?: (id: string, newTitle: string) => void;
|
|
218
307
|
isOpen: boolean;
|
|
219
308
|
onToggle: () => void;
|
|
220
309
|
}
|
|
@@ -319,6 +408,8 @@ interface UseChatUIReturn {
|
|
|
319
408
|
newSession: () => void;
|
|
320
409
|
selectSession: (id: string) => void;
|
|
321
410
|
deleteSession: (id: string) => void;
|
|
411
|
+
/** @Todo vibecode - 세션 제목 변경 함수 */
|
|
412
|
+
renameSession: (id: string, newTitle: string) => void;
|
|
322
413
|
setModel: (model: string) => void;
|
|
323
414
|
toggleSidebar: () => void;
|
|
324
415
|
openSettings: () => void;
|
|
@@ -335,6 +426,12 @@ interface UseChatUIReturn {
|
|
|
335
426
|
getActiveAlternative: (assistantMessageId: string) => number;
|
|
336
427
|
updatePersonalization: (config: Partial<PersonalizationConfig>) => void;
|
|
337
428
|
models: ModelConfig[];
|
|
429
|
+
/** 글로벌 메모리 상태 */
|
|
430
|
+
globalMemory: UseGlobalMemoryReturn | null;
|
|
431
|
+
/** 현재 세션의 압축 상태 */
|
|
432
|
+
compressionState: CompressionState | null;
|
|
433
|
+
/** 수동으로 정보 추출 트리거 */
|
|
434
|
+
extractUserInfo: () => Promise<void>;
|
|
338
435
|
}
|
|
339
436
|
|
|
340
437
|
/**
|
|
@@ -374,6 +471,14 @@ interface UseChatUIOptions {
|
|
|
374
471
|
onSessionChange?: (session: ChatSession | null) => void;
|
|
375
472
|
/** 에러 핸들러 */
|
|
376
473
|
onError?: (error: Error) => void;
|
|
474
|
+
/** @Todo vibecode - 세션 제목 변경 핸들러 */
|
|
475
|
+
onTitleChange?: (sessionId: string, newTitle: string) => void;
|
|
476
|
+
/** 글로벌 메모리 사용 여부 (기본: true) */
|
|
477
|
+
useGlobalMemoryEnabled?: boolean;
|
|
478
|
+
/** 글로벌 메모리 설정 */
|
|
479
|
+
globalMemoryConfig?: GlobalMemoryConfig;
|
|
480
|
+
/** 자동 정보 추출 활성화 (기본: true) */
|
|
481
|
+
enableAutoExtraction?: boolean;
|
|
377
482
|
}
|
|
378
483
|
declare const useChatUI: (options: UseChatUIOptions) => UseChatUIReturn;
|
|
379
484
|
|
package/dist/react/index.d.ts
CHANGED
|
@@ -68,6 +68,75 @@ interface MarkdownRendererProps {
|
|
|
68
68
|
}
|
|
69
69
|
declare const MarkdownRenderer: React$1.FC<MarkdownRendererProps>;
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* @description 메모리 시스템 타입 정의
|
|
73
|
+
* @license MIT
|
|
74
|
+
*/
|
|
75
|
+
/** @description 메모리 저장소 타입 */
|
|
76
|
+
type MemoryStorageType = 'localStorage' | 'postgresql' | 'memory';
|
|
77
|
+
/** @description 메모리 엔트리 기본 타입 */
|
|
78
|
+
interface MemoryEntry {
|
|
79
|
+
key: string;
|
|
80
|
+
value: unknown;
|
|
81
|
+
createdAt: number;
|
|
82
|
+
updatedAt: number;
|
|
83
|
+
}
|
|
84
|
+
/** @description 확장된 메모리 엔트리 (자동 추출 시 사용) */
|
|
85
|
+
interface ExtendedMemoryEntry extends MemoryEntry {
|
|
86
|
+
category?: MemoryCategory;
|
|
87
|
+
confidence?: number;
|
|
88
|
+
source?: string;
|
|
89
|
+
}
|
|
90
|
+
/** @description 메모리 카테고리 */
|
|
91
|
+
type MemoryCategory = 'basic' | 'professional' | 'preferences' | 'context';
|
|
92
|
+
/** @description 글로벌 메모리 설정 */
|
|
93
|
+
interface GlobalMemoryConfig {
|
|
94
|
+
storageType: MemoryStorageType;
|
|
95
|
+
/** localStorage 설정 */
|
|
96
|
+
localStorage?: {
|
|
97
|
+
key: string;
|
|
98
|
+
};
|
|
99
|
+
/** PostgreSQL 설정 */
|
|
100
|
+
postgresql?: {
|
|
101
|
+
apiEndpoint: string;
|
|
102
|
+
userId: string;
|
|
103
|
+
authToken?: string;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** @description 압축 상태 */
|
|
107
|
+
interface CompressionState {
|
|
108
|
+
contextSummary?: string;
|
|
109
|
+
summaryAfterIndex?: number;
|
|
110
|
+
compressionCount: number;
|
|
111
|
+
lastCompressionAt?: number;
|
|
112
|
+
}
|
|
113
|
+
/** @description 정보 추출 설정 */
|
|
114
|
+
interface InfoExtractionConfig {
|
|
115
|
+
/** 자동 추출 활성화 여부 */
|
|
116
|
+
enabled: boolean;
|
|
117
|
+
/** 추출에 사용할 모델 (저렴한 모델 권장) */
|
|
118
|
+
model?: string;
|
|
119
|
+
/** 최소 confidence 임계값 (기본: 0.8) */
|
|
120
|
+
minConfidence: number;
|
|
121
|
+
}
|
|
122
|
+
/** @description useGlobalMemory 훅 상태 */
|
|
123
|
+
interface GlobalMemoryState {
|
|
124
|
+
entries: Map<string, ExtendedMemoryEntry>;
|
|
125
|
+
isLoading: boolean;
|
|
126
|
+
error: Error | null;
|
|
127
|
+
}
|
|
128
|
+
/** @description useGlobalMemory 훅 반환 타입 */
|
|
129
|
+
interface UseGlobalMemoryReturn {
|
|
130
|
+
state: GlobalMemoryState;
|
|
131
|
+
set: (key: string, value: unknown, meta?: Partial<ExtendedMemoryEntry>) => Promise<void>;
|
|
132
|
+
get: <T>(key: string) => T | undefined;
|
|
133
|
+
remove: (key: string) => Promise<void>;
|
|
134
|
+
has: (key: string) => boolean;
|
|
135
|
+
clear: () => Promise<void>;
|
|
136
|
+
toPromptContext: () => string;
|
|
137
|
+
refresh: () => Promise<void>;
|
|
138
|
+
}
|
|
139
|
+
|
|
71
140
|
/**
|
|
72
141
|
* @description React UI 컴포넌트 타입 정의
|
|
73
142
|
*/
|
|
@@ -102,8 +171,12 @@ interface ChatSession {
|
|
|
102
171
|
model: string;
|
|
103
172
|
createdAt: number;
|
|
104
173
|
updatedAt: number;
|
|
174
|
+
/** @deprecated Use compressionState.contextSummary instead */
|
|
105
175
|
contextSummary?: string;
|
|
176
|
+
/** @deprecated Use compressionState.summaryAfterIndex instead */
|
|
106
177
|
summaryAfterIndex?: number;
|
|
178
|
+
/** 압축 상태 (점진적 압축용) */
|
|
179
|
+
compressionState?: CompressionState;
|
|
107
180
|
}
|
|
108
181
|
interface ActionItem {
|
|
109
182
|
id: string;
|
|
@@ -159,9 +232,9 @@ interface ChatUIProps {
|
|
|
159
232
|
showModelSelector?: boolean;
|
|
160
233
|
/** 초기 시스템 프롬프트 */
|
|
161
234
|
systemPrompt?: string;
|
|
162
|
-
/** 컨텍스트 압축 임계값 */
|
|
235
|
+
/** 컨텍스트 압축 임계값 (기본: 20) */
|
|
163
236
|
contextCompressionThreshold?: number;
|
|
164
|
-
/** 압축 후 유지할 메시지 수 */
|
|
237
|
+
/** 압축 후 유지할 메시지 수 (기본: 6) */
|
|
165
238
|
keepRecentMessages?: number;
|
|
166
239
|
/** 스토리지 키 (로컬 저장용) */
|
|
167
240
|
storageKey?: string;
|
|
@@ -173,6 +246,20 @@ interface ChatUIProps {
|
|
|
173
246
|
onSessionChange?: (session: ChatSession | null) => void;
|
|
174
247
|
/** 에러 핸들러 */
|
|
175
248
|
onError?: (error: Error) => void;
|
|
249
|
+
/** @Todo vibecode - 세션 제목 변경 핸들러 */
|
|
250
|
+
onTitleChange?: (sessionId: string, newTitle: string) => void;
|
|
251
|
+
/** 재압축 임계값 - 새 메시지 수 (기본: 10) */
|
|
252
|
+
recompressionThreshold?: number;
|
|
253
|
+
/** 토큰 한도 (기본: 8000) */
|
|
254
|
+
tokenLimit?: number;
|
|
255
|
+
/** 글로벌 메모리 사용 여부 (기본: true) */
|
|
256
|
+
useGlobalMemory?: boolean;
|
|
257
|
+
/** 글로벌 메모리 설정 */
|
|
258
|
+
globalMemoryConfig?: GlobalMemoryConfig;
|
|
259
|
+
/** 자동 정보 추출 활성화 (기본: true) */
|
|
260
|
+
enableAutoExtraction?: boolean;
|
|
261
|
+
/** 정보 추출 설정 */
|
|
262
|
+
infoExtractionConfig?: Partial<InfoExtractionConfig>;
|
|
176
263
|
}
|
|
177
264
|
interface SendMessageParams {
|
|
178
265
|
messages: {
|
|
@@ -215,6 +302,8 @@ interface SidebarProps {
|
|
|
215
302
|
onSelectSession: (id: string) => void;
|
|
216
303
|
onNewSession: () => void;
|
|
217
304
|
onDeleteSession: (id: string) => void;
|
|
305
|
+
/** @Todo vibecode - 세션 제목 변경 핸들러 */
|
|
306
|
+
onRenameSession?: (id: string, newTitle: string) => void;
|
|
218
307
|
isOpen: boolean;
|
|
219
308
|
onToggle: () => void;
|
|
220
309
|
}
|
|
@@ -319,6 +408,8 @@ interface UseChatUIReturn {
|
|
|
319
408
|
newSession: () => void;
|
|
320
409
|
selectSession: (id: string) => void;
|
|
321
410
|
deleteSession: (id: string) => void;
|
|
411
|
+
/** @Todo vibecode - 세션 제목 변경 함수 */
|
|
412
|
+
renameSession: (id: string, newTitle: string) => void;
|
|
322
413
|
setModel: (model: string) => void;
|
|
323
414
|
toggleSidebar: () => void;
|
|
324
415
|
openSettings: () => void;
|
|
@@ -335,6 +426,12 @@ interface UseChatUIReturn {
|
|
|
335
426
|
getActiveAlternative: (assistantMessageId: string) => number;
|
|
336
427
|
updatePersonalization: (config: Partial<PersonalizationConfig>) => void;
|
|
337
428
|
models: ModelConfig[];
|
|
429
|
+
/** 글로벌 메모리 상태 */
|
|
430
|
+
globalMemory: UseGlobalMemoryReturn | null;
|
|
431
|
+
/** 현재 세션의 압축 상태 */
|
|
432
|
+
compressionState: CompressionState | null;
|
|
433
|
+
/** 수동으로 정보 추출 트리거 */
|
|
434
|
+
extractUserInfo: () => Promise<void>;
|
|
338
435
|
}
|
|
339
436
|
|
|
340
437
|
/**
|
|
@@ -374,6 +471,14 @@ interface UseChatUIOptions {
|
|
|
374
471
|
onSessionChange?: (session: ChatSession | null) => void;
|
|
375
472
|
/** 에러 핸들러 */
|
|
376
473
|
onError?: (error: Error) => void;
|
|
474
|
+
/** @Todo vibecode - 세션 제목 변경 핸들러 */
|
|
475
|
+
onTitleChange?: (sessionId: string, newTitle: string) => void;
|
|
476
|
+
/** 글로벌 메모리 사용 여부 (기본: true) */
|
|
477
|
+
useGlobalMemoryEnabled?: boolean;
|
|
478
|
+
/** 글로벌 메모리 설정 */
|
|
479
|
+
globalMemoryConfig?: GlobalMemoryConfig;
|
|
480
|
+
/** 자동 정보 추출 활성화 (기본: true) */
|
|
481
|
+
enableAutoExtraction?: boolean;
|
|
377
482
|
}
|
|
378
483
|
declare const useChatUI: (options: UseChatUIOptions) => UseChatUIReturn;
|
|
379
484
|
|