@aituber-onair/core 0.1.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/README.md +723 -0
- package/dist/constants/api.d.ts +4 -0
- package/dist/constants/api.js +13 -0
- package/dist/constants/api.js.map +1 -0
- package/dist/constants/index.d.ts +23 -0
- package/dist/constants/index.js +25 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/openaiApi.d.ts +15 -0
- package/dist/constants/openaiApi.js +15 -0
- package/dist/constants/openaiApi.js.map +1 -0
- package/dist/constants/prompts.d.ts +2 -0
- package/dist/constants/prompts.js +13 -0
- package/dist/constants/prompts.js.map +1 -0
- package/dist/core/AITuberOnAirCore.d.ts +142 -0
- package/dist/core/AITuberOnAirCore.js +316 -0
- package/dist/core/AITuberOnAirCore.js.map +1 -0
- package/dist/core/ChatProcessor.d.ts +86 -0
- package/dist/core/ChatProcessor.js +246 -0
- package/dist/core/ChatProcessor.js.map +1 -0
- package/dist/core/EventEmitter.d.ts +35 -0
- package/dist/core/EventEmitter.js +72 -0
- package/dist/core/EventEmitter.js.map +1 -0
- package/dist/core/MemoryManager.d.ts +98 -0
- package/dist/core/MemoryManager.js +208 -0
- package/dist/core/MemoryManager.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/services/chat/ChatService.d.ts +21 -0
- package/dist/services/chat/ChatService.js +2 -0
- package/dist/services/chat/ChatService.js.map +1 -0
- package/dist/services/chat/ChatServiceFactory.d.ts +38 -0
- package/dist/services/chat/ChatServiceFactory.js +55 -0
- package/dist/services/chat/ChatServiceFactory.js.map +1 -0
- package/dist/services/chat/OpenAIChatService.d.ts +38 -0
- package/dist/services/chat/OpenAIChatService.js +166 -0
- package/dist/services/chat/OpenAIChatService.js.map +1 -0
- package/dist/services/chat/OpenAISummarizer.d.ts +25 -0
- package/dist/services/chat/OpenAISummarizer.js +70 -0
- package/dist/services/chat/OpenAISummarizer.js.map +1 -0
- package/dist/services/chat/providers/ChatServiceProvider.d.ts +44 -0
- package/dist/services/chat/providers/ChatServiceProvider.js +2 -0
- package/dist/services/chat/providers/ChatServiceProvider.js.map +1 -0
- package/dist/services/chat/providers/OpenAIChatServiceProvider.d.ts +33 -0
- package/dist/services/chat/providers/OpenAIChatServiceProvider.js +44 -0
- package/dist/services/chat/providers/OpenAIChatServiceProvider.js.map +1 -0
- package/dist/services/voice/VoiceEngineAdapter.d.ts +46 -0
- package/dist/services/voice/VoiceEngineAdapter.js +173 -0
- package/dist/services/voice/VoiceEngineAdapter.js.map +1 -0
- package/dist/services/voice/VoiceService.d.ts +55 -0
- package/dist/services/voice/VoiceService.js +2 -0
- package/dist/services/voice/VoiceService.js.map +1 -0
- package/dist/services/voice/engines/AivisSpeechEngine.d.ts +10 -0
- package/dist/services/voice/engines/AivisSpeechEngine.js +70 -0
- package/dist/services/voice/engines/AivisSpeechEngine.js.map +1 -0
- package/dist/services/voice/engines/NijiVoiceEngine.d.ts +12 -0
- package/dist/services/voice/engines/NijiVoiceEngine.js +105 -0
- package/dist/services/voice/engines/NijiVoiceEngine.js.map +1 -0
- package/dist/services/voice/engines/OpenAiEngine.d.ts +9 -0
- package/dist/services/voice/engines/OpenAiEngine.js +34 -0
- package/dist/services/voice/engines/OpenAiEngine.js.map +1 -0
- package/dist/services/voice/engines/VoiceEngine.d.ts +21 -0
- package/dist/services/voice/engines/VoiceEngine.js +2 -0
- package/dist/services/voice/engines/VoiceEngine.js.map +1 -0
- package/dist/services/voice/engines/VoiceEngineFactory.d.ts +14 -0
- package/dist/services/voice/engines/VoiceEngineFactory.js +34 -0
- package/dist/services/voice/engines/VoiceEngineFactory.js.map +1 -0
- package/dist/services/voice/engines/VoicePeakEngine.d.ts +13 -0
- package/dist/services/voice/engines/VoicePeakEngine.js +46 -0
- package/dist/services/voice/engines/VoicePeakEngine.js.map +1 -0
- package/dist/services/voice/engines/VoiceVoxEngine.d.ts +13 -0
- package/dist/services/voice/engines/VoiceVoxEngine.js +67 -0
- package/dist/services/voice/engines/VoiceVoxEngine.js.map +1 -0
- package/dist/services/voice/engines/index.d.ts +7 -0
- package/dist/services/voice/engines/index.js +7 -0
- package/dist/services/voice/engines/index.js.map +1 -0
- package/dist/services/voice/messages.d.ts +38 -0
- package/dist/services/voice/messages.js +49 -0
- package/dist/services/voice/messages.js.map +1 -0
- package/dist/services/youtube/YouTubeDataApiService.d.ts +69 -0
- package/dist/services/youtube/YouTubeDataApiService.js +255 -0
- package/dist/services/youtube/YouTubeDataApiService.js.map +1 -0
- package/dist/services/youtube/YouTubeService.d.ts +63 -0
- package/dist/services/youtube/YouTubeService.js +2 -0
- package/dist/services/youtube/YouTubeService.js.map +1 -0
- package/dist/types/index.d.ts +82 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/nijiVoice.d.ts +27 -0
- package/dist/types/nijiVoice.js +2 -0
- package/dist/types/nijiVoice.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/screenplay.d.ts +19 -0
- package/dist/utils/screenplay.js +42 -0
- package/dist/utils/screenplay.js.map +1 -0
- package/dist/utils/screenshot.d.ts +19 -0
- package/dist/utils/screenshot.js +44 -0
- package/dist/utils/screenshot.js.map +1 -0
- package/dist/utils/storage.d.ts +44 -0
- package/dist/utils/storage.js +103 -0
- package/dist/utils/storage.js.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ChatService } from '../services/chat/ChatService';
|
|
2
|
+
import { MemoryManager } from './MemoryManager';
|
|
3
|
+
import { Message, ChatType } from '../types';
|
|
4
|
+
import { EventEmitter } from './EventEmitter';
|
|
5
|
+
/**
|
|
6
|
+
* ChatProcessor options
|
|
7
|
+
*/
|
|
8
|
+
export interface ChatProcessorOptions {
|
|
9
|
+
/** System prompt */
|
|
10
|
+
systemPrompt: string;
|
|
11
|
+
/** System prompt for vision mode */
|
|
12
|
+
visionSystemPrompt?: string;
|
|
13
|
+
/** Vision prompt for describing the image */
|
|
14
|
+
visionPrompt?: string;
|
|
15
|
+
/** Whether to summarize memory during processing */
|
|
16
|
+
useMemory: boolean;
|
|
17
|
+
/** Memory note (instructions for AI) */
|
|
18
|
+
memoryNote?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Core logic for chat processing
|
|
22
|
+
* Combines ChatService and MemoryManager to execute
|
|
23
|
+
* AITuber's main processing (text chat, vision chat)
|
|
24
|
+
*/
|
|
25
|
+
export declare class ChatProcessor extends EventEmitter {
|
|
26
|
+
private chatService;
|
|
27
|
+
private memoryManager?;
|
|
28
|
+
private options;
|
|
29
|
+
private chatLog;
|
|
30
|
+
private chatStartTime;
|
|
31
|
+
private processingChat;
|
|
32
|
+
/**
|
|
33
|
+
* Constructor
|
|
34
|
+
* @param chatService Chat service
|
|
35
|
+
* @param options Configuration options
|
|
36
|
+
* @param memoryManager Memory manager (optional)
|
|
37
|
+
*/
|
|
38
|
+
constructor(chatService: ChatService, options: ChatProcessorOptions, memoryManager?: MemoryManager);
|
|
39
|
+
/**
|
|
40
|
+
* Add message to chat log
|
|
41
|
+
* @param message Message to add
|
|
42
|
+
*/
|
|
43
|
+
addToChatLog(message: Message): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get chat log
|
|
46
|
+
*/
|
|
47
|
+
getChatLog(): Message[];
|
|
48
|
+
/**
|
|
49
|
+
* Clear chat log
|
|
50
|
+
*/
|
|
51
|
+
clearChatLog(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Set chat start time
|
|
54
|
+
* @param time Timestamp
|
|
55
|
+
*/
|
|
56
|
+
setChatStartTime(time: number): void;
|
|
57
|
+
/**
|
|
58
|
+
* Get chat start time
|
|
59
|
+
*/
|
|
60
|
+
getChatStartTime(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Get processing status
|
|
63
|
+
*/
|
|
64
|
+
isProcessing(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Update options
|
|
67
|
+
* @param newOptions New options to merge with existing ones
|
|
68
|
+
*/
|
|
69
|
+
updateOptions(newOptions: Partial<ChatProcessorOptions>): void;
|
|
70
|
+
/**
|
|
71
|
+
* Process text chat
|
|
72
|
+
* @param text User input text
|
|
73
|
+
* @param chatType Chat type
|
|
74
|
+
*/
|
|
75
|
+
processTextChat(text: string, chatType?: ChatType): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Process vision chat
|
|
78
|
+
* @param imageDataUrl Image data URL
|
|
79
|
+
*/
|
|
80
|
+
processVisionChat(imageDataUrl: string): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Prepare messages to send to AI
|
|
83
|
+
* Create an array of messages with system prompt and memory
|
|
84
|
+
*/
|
|
85
|
+
private prepareMessagesForAI;
|
|
86
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { EventEmitter } from './EventEmitter';
|
|
2
|
+
import { textsToScreenplay } from '../utils/screenplay';
|
|
3
|
+
import { DEFAULT_VISION_PROMPT } from '../constants/prompts';
|
|
4
|
+
/**
|
|
5
|
+
* Core logic for chat processing
|
|
6
|
+
* Combines ChatService and MemoryManager to execute
|
|
7
|
+
* AITuber's main processing (text chat, vision chat)
|
|
8
|
+
*/
|
|
9
|
+
export class ChatProcessor extends EventEmitter {
|
|
10
|
+
/**
|
|
11
|
+
* Constructor
|
|
12
|
+
* @param chatService Chat service
|
|
13
|
+
* @param options Configuration options
|
|
14
|
+
* @param memoryManager Memory manager (optional)
|
|
15
|
+
*/
|
|
16
|
+
constructor(chatService, options, memoryManager) {
|
|
17
|
+
super();
|
|
18
|
+
this.chatLog = [];
|
|
19
|
+
this.chatStartTime = 0;
|
|
20
|
+
this.processingChat = false;
|
|
21
|
+
this.chatService = chatService;
|
|
22
|
+
this.options = options;
|
|
23
|
+
this.memoryManager = memoryManager;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Add message to chat log
|
|
27
|
+
* @param message Message to add
|
|
28
|
+
*/
|
|
29
|
+
addToChatLog(message) {
|
|
30
|
+
this.chatLog.push(message);
|
|
31
|
+
this.emit('chatLogUpdated', this.chatLog);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get chat log
|
|
35
|
+
*/
|
|
36
|
+
getChatLog() {
|
|
37
|
+
return [...this.chatLog];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Clear chat log
|
|
41
|
+
*/
|
|
42
|
+
clearChatLog() {
|
|
43
|
+
this.chatLog = [];
|
|
44
|
+
this.emit('chatLogUpdated', this.chatLog);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Set chat start time
|
|
48
|
+
* @param time Timestamp
|
|
49
|
+
*/
|
|
50
|
+
setChatStartTime(time) {
|
|
51
|
+
this.chatStartTime = time;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get chat start time
|
|
55
|
+
*/
|
|
56
|
+
getChatStartTime() {
|
|
57
|
+
return this.chatStartTime;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get processing status
|
|
61
|
+
*/
|
|
62
|
+
isProcessing() {
|
|
63
|
+
return this.processingChat;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Update options
|
|
67
|
+
* @param newOptions New options to merge with existing ones
|
|
68
|
+
*/
|
|
69
|
+
updateOptions(newOptions) {
|
|
70
|
+
this.options = { ...this.options, ...newOptions };
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Process text chat
|
|
74
|
+
* @param text User input text
|
|
75
|
+
* @param chatType Chat type
|
|
76
|
+
*/
|
|
77
|
+
async processTextChat(text, chatType = 'chatForm') {
|
|
78
|
+
if (this.processingChat) {
|
|
79
|
+
console.warn('Another chat processing is in progress');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
this.processingChat = true;
|
|
84
|
+
this.emit('processingStart', { type: chatType, text });
|
|
85
|
+
// Set chat start time (if first message)
|
|
86
|
+
if (this.chatStartTime === 0) {
|
|
87
|
+
this.chatStartTime = Date.now();
|
|
88
|
+
}
|
|
89
|
+
// Create user message
|
|
90
|
+
const userMessage = {
|
|
91
|
+
role: 'user',
|
|
92
|
+
content: text,
|
|
93
|
+
timestamp: Date.now(),
|
|
94
|
+
};
|
|
95
|
+
// Add to chat log
|
|
96
|
+
this.addToChatLog(userMessage);
|
|
97
|
+
// Create memory (if needed)
|
|
98
|
+
if (this.options.useMemory && this.memoryManager) {
|
|
99
|
+
await this.memoryManager.createMemoryIfNeeded(this.chatLog, this.chatStartTime);
|
|
100
|
+
}
|
|
101
|
+
// Prepare messages to send to AI
|
|
102
|
+
const messages = await this.prepareMessagesForAI();
|
|
103
|
+
// Process with ChatService
|
|
104
|
+
await this.chatService.processChat(messages, (sentence) => {
|
|
105
|
+
// Process streaming response
|
|
106
|
+
this.emit('assistantPartialResponse', sentence);
|
|
107
|
+
}, async (fullText) => {
|
|
108
|
+
// Process after response
|
|
109
|
+
const assistantMessage = {
|
|
110
|
+
role: 'assistant',
|
|
111
|
+
content: fullText,
|
|
112
|
+
timestamp: Date.now(),
|
|
113
|
+
};
|
|
114
|
+
this.addToChatLog(assistantMessage);
|
|
115
|
+
// Convert to screenplay
|
|
116
|
+
const screenplay = textsToScreenplay([fullText])[0];
|
|
117
|
+
this.emit('assistantResponse', {
|
|
118
|
+
message: assistantMessage,
|
|
119
|
+
screenplay: screenplay,
|
|
120
|
+
});
|
|
121
|
+
// Clean up memory
|
|
122
|
+
if (this.memoryManager) {
|
|
123
|
+
this.memoryManager.cleanupOldMemories();
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
console.error('Error in text chat processing:', error);
|
|
129
|
+
this.emit('error', error);
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
this.processingChat = false;
|
|
133
|
+
this.emit('processingEnd');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Process vision chat
|
|
138
|
+
* @param imageDataUrl Image data URL
|
|
139
|
+
*/
|
|
140
|
+
async processVisionChat(imageDataUrl) {
|
|
141
|
+
if (this.processingChat) {
|
|
142
|
+
console.warn('Another chat processing is in progress');
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
this.processingChat = true;
|
|
147
|
+
this.emit('processingStart', { type: 'vision', imageUrl: imageDataUrl });
|
|
148
|
+
// Set chat start time (if first message)
|
|
149
|
+
if (this.chatStartTime === 0) {
|
|
150
|
+
this.chatStartTime = Date.now();
|
|
151
|
+
}
|
|
152
|
+
// Create memory (if needed)
|
|
153
|
+
if (this.options.useMemory && this.memoryManager) {
|
|
154
|
+
await this.memoryManager.createMemoryIfNeeded(this.chatLog, this.chatStartTime);
|
|
155
|
+
}
|
|
156
|
+
// Prepare messages to send to AI
|
|
157
|
+
const baseMessages = await this.prepareMessagesForAI();
|
|
158
|
+
// Add vision system prompt
|
|
159
|
+
if (this.options.visionSystemPrompt) {
|
|
160
|
+
baseMessages.push({
|
|
161
|
+
role: 'system',
|
|
162
|
+
content: this.options.visionSystemPrompt,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
// Create vision message
|
|
166
|
+
const visionMessage = {
|
|
167
|
+
role: 'user',
|
|
168
|
+
content: [
|
|
169
|
+
{
|
|
170
|
+
type: 'text',
|
|
171
|
+
text: this.options.visionPrompt || DEFAULT_VISION_PROMPT,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'image_url',
|
|
175
|
+
image_url: {
|
|
176
|
+
url: imageDataUrl,
|
|
177
|
+
detail: 'low', // For token saving
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
};
|
|
182
|
+
// Process with ChatService
|
|
183
|
+
await this.chatService.processVisionChat([...baseMessages, visionMessage], (sentence) => {
|
|
184
|
+
// Process streaming response
|
|
185
|
+
this.emit('assistantPartialResponse', sentence);
|
|
186
|
+
}, async (fullText) => {
|
|
187
|
+
// Process after response
|
|
188
|
+
const assistantMessage = {
|
|
189
|
+
role: 'assistant',
|
|
190
|
+
content: fullText,
|
|
191
|
+
timestamp: Date.now(),
|
|
192
|
+
};
|
|
193
|
+
this.addToChatLog(assistantMessage);
|
|
194
|
+
// Convert to screenplay
|
|
195
|
+
const screenplay = textsToScreenplay([fullText])[0];
|
|
196
|
+
this.emit('assistantResponse', {
|
|
197
|
+
message: assistantMessage,
|
|
198
|
+
screenplay: screenplay,
|
|
199
|
+
visionSource: imageDataUrl,
|
|
200
|
+
});
|
|
201
|
+
// Clean up memory
|
|
202
|
+
if (this.memoryManager) {
|
|
203
|
+
this.memoryManager.cleanupOldMemories();
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
console.error('Error in vision chat processing:', error);
|
|
209
|
+
this.emit('error', error);
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
this.processingChat = false;
|
|
213
|
+
this.emit('processingEnd');
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Prepare messages to send to AI
|
|
218
|
+
* Create an array of messages with system prompt and memory
|
|
219
|
+
*/
|
|
220
|
+
async prepareMessagesForAI() {
|
|
221
|
+
const messages = [];
|
|
222
|
+
// Add system prompt
|
|
223
|
+
if (this.options.systemPrompt) {
|
|
224
|
+
messages.push({
|
|
225
|
+
role: 'system',
|
|
226
|
+
content: this.options.systemPrompt,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
// Add memory
|
|
230
|
+
if (this.options.useMemory && this.memoryManager) {
|
|
231
|
+
const memoryText = this.memoryManager.getMemoryForPrompt();
|
|
232
|
+
if (memoryText) {
|
|
233
|
+
const memoryContent = memoryText +
|
|
234
|
+
(this.options.memoryNote ? `\n\n${this.options.memoryNote}` : '');
|
|
235
|
+
messages.push({
|
|
236
|
+
role: 'system',
|
|
237
|
+
content: memoryContent,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// Add chat log
|
|
242
|
+
messages.push(...this.chatLog);
|
|
243
|
+
return messages;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=ChatProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatProcessor.js","sourceRoot":"","sources":["../../src/core/ChatProcessor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAkB7D;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IAQ7C;;;;;OAKG;IACH,YACE,WAAwB,EACxB,OAA6B,EAC7B,aAA6B;QAE7B,KAAK,EAAE,CAAC;QAfF,YAAO,GAAc,EAAE,CAAC;QACxB,kBAAa,GAAW,CAAC,CAAC;QAC1B,mBAAc,GAAY,KAAK,CAAC;QActC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,OAAgB;QAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,YAAY;QACV,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAA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,CAAC,cAAc,GAAG,KAAK,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,oBAAoB;QAChC,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,oBAAoB;QACpB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY;aACnC,CAAC,CAAC;QACL,CAAC;QAED,aAAa;QACb,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACjD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE,CAAC;YAC3D,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,aAAa,GACjB,UAAU;oBACV,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBAEpE,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,aAAa;iBACvB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,eAAe;QACf,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QAE/B,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Manager
|
|
3
|
+
* For state notification of asynchronous processing
|
|
4
|
+
*/
|
|
5
|
+
export declare class EventEmitter {
|
|
6
|
+
private events;
|
|
7
|
+
/**
|
|
8
|
+
* Register event listener
|
|
9
|
+
* @param event Event name
|
|
10
|
+
* @param listener Callback function
|
|
11
|
+
*/
|
|
12
|
+
on(event: string, listener: (...args: any[]) => void): void;
|
|
13
|
+
/**
|
|
14
|
+
* Register event listener that will only be executed once
|
|
15
|
+
* @param event Event name
|
|
16
|
+
* @param listener Callback function
|
|
17
|
+
*/
|
|
18
|
+
once(event: string, listener: (...args: any[]) => void): void;
|
|
19
|
+
/**
|
|
20
|
+
* Remove event listener
|
|
21
|
+
* @param event Event name
|
|
22
|
+
* @param listener Listener to remove (if omitted, all listeners will be removed)
|
|
23
|
+
*/
|
|
24
|
+
off(event: string, listener?: (...args: any[]) => void): void;
|
|
25
|
+
/**
|
|
26
|
+
* Emit event
|
|
27
|
+
* @param event Event name
|
|
28
|
+
* @param args Arguments to pass to the event
|
|
29
|
+
*/
|
|
30
|
+
emit(event: string, ...args: any[]): void;
|
|
31
|
+
/**
|
|
32
|
+
* Clear all event listeners
|
|
33
|
+
*/
|
|
34
|
+
removeAllListeners(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Manager
|
|
3
|
+
* For state notification of asynchronous processing
|
|
4
|
+
*/
|
|
5
|
+
export class EventEmitter {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.events = {};
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Register event listener
|
|
11
|
+
* @param event Event name
|
|
12
|
+
* @param listener Callback function
|
|
13
|
+
*/
|
|
14
|
+
on(event, listener) {
|
|
15
|
+
if (!this.events[event]) {
|
|
16
|
+
this.events[event] = [];
|
|
17
|
+
}
|
|
18
|
+
this.events[event].push(listener);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Register event listener that will only be executed once
|
|
22
|
+
* @param event Event name
|
|
23
|
+
* @param listener Callback function
|
|
24
|
+
*/
|
|
25
|
+
once(event, listener) {
|
|
26
|
+
const onceWrapper = (...args) => {
|
|
27
|
+
listener(...args);
|
|
28
|
+
this.off(event, onceWrapper);
|
|
29
|
+
};
|
|
30
|
+
this.on(event, onceWrapper);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Remove event listener
|
|
34
|
+
* @param event Event name
|
|
35
|
+
* @param listener Listener to remove (if omitted, all listeners will be removed)
|
|
36
|
+
*/
|
|
37
|
+
off(event, listener) {
|
|
38
|
+
if (!this.events[event]) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (!listener) {
|
|
42
|
+
delete this.events[event];
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.events[event] = this.events[event].filter((l) => l !== listener);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Emit event
|
|
49
|
+
* @param event Event name
|
|
50
|
+
* @param args Arguments to pass to the event
|
|
51
|
+
*/
|
|
52
|
+
emit(event, ...args) {
|
|
53
|
+
if (!this.events[event]) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.events[event].forEach((listener) => {
|
|
57
|
+
try {
|
|
58
|
+
listener(...args);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error(`Error in event listener for "${event}":`, error);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Clear all event listeners
|
|
67
|
+
*/
|
|
68
|
+
removeAllListeners() {
|
|
69
|
+
this.events = {};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=EventEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitter.js","sourceRoot":"","sources":["../../src/core/EventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,YAAY;IAAzB;QACU,WAAM,GAAoD,EAAE,CAAC;IAsEvE,CAAC;IApEC;;;;OAIG;IACH,EAAE,CAAC,KAAa,EAAE,QAAkC;QAClD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,MAA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CAAgC,KAAK,IAAI,EAAE,KAAK,CAAC,CAAC;YAClE,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Message, MemoryRecord, MemoryType, MemoryStorage } from '../types';
|
|
2
|
+
import { EventEmitter } from './EventEmitter';
|
|
3
|
+
/**
|
|
4
|
+
* Memory manager settings
|
|
5
|
+
*/
|
|
6
|
+
export interface MemoryOptions {
|
|
7
|
+
/** Enable summarization */
|
|
8
|
+
enableSummarization: boolean;
|
|
9
|
+
/** Short-term memory duration (milliseconds) */
|
|
10
|
+
shortTermDuration: number;
|
|
11
|
+
/** Mid-term memory duration (milliseconds) */
|
|
12
|
+
midTermDuration: number;
|
|
13
|
+
/** Long-term memory duration (milliseconds) */
|
|
14
|
+
longTermDuration: number;
|
|
15
|
+
/** Threshold for the number of messages before summarization */
|
|
16
|
+
maxMessagesBeforeSummarization: number;
|
|
17
|
+
/** Maximum number of characters in summary */
|
|
18
|
+
maxSummaryLength?: number;
|
|
19
|
+
/** Memory retention period (milliseconds) */
|
|
20
|
+
memoryRetentionPeriod?: number;
|
|
21
|
+
/** Custom summary prompt template */
|
|
22
|
+
summaryPromptTemplate?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Summarizer interface
|
|
26
|
+
*/
|
|
27
|
+
export interface Summarizer {
|
|
28
|
+
/**
|
|
29
|
+
* Summarize message array
|
|
30
|
+
* @param messages Array of messages to summarize
|
|
31
|
+
* @param maxLength Maximum number of characters
|
|
32
|
+
* @param customPrompt Custom prompt template for summarization (optional)
|
|
33
|
+
*/
|
|
34
|
+
summarize(messages: Message[], maxLength?: number, customPrompt?: string): Promise<string>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Manager for managing chat history and summarization
|
|
38
|
+
*/
|
|
39
|
+
export declare class MemoryManager extends EventEmitter {
|
|
40
|
+
private options;
|
|
41
|
+
private summarizer?;
|
|
42
|
+
private memories;
|
|
43
|
+
private storage?;
|
|
44
|
+
/**
|
|
45
|
+
* Constructor
|
|
46
|
+
* @param options Settings options
|
|
47
|
+
* @param summarizer Summarizer implementation (if omitted, summarization is disabled)
|
|
48
|
+
* @param storage Storage implementation for persistence (optional)
|
|
49
|
+
*/
|
|
50
|
+
constructor(options: MemoryOptions, summarizer?: Summarizer, storage?: MemoryStorage);
|
|
51
|
+
/**
|
|
52
|
+
* Load memories from storage
|
|
53
|
+
*/
|
|
54
|
+
private loadFromStorage;
|
|
55
|
+
/**
|
|
56
|
+
* Save memories to storage
|
|
57
|
+
*/
|
|
58
|
+
private saveToStorage;
|
|
59
|
+
/**
|
|
60
|
+
* Import memory records (used for restoring from external storage)
|
|
61
|
+
* @param records Memory records to import
|
|
62
|
+
*/
|
|
63
|
+
importMemoryRecords(records: MemoryRecord[]): void;
|
|
64
|
+
/**
|
|
65
|
+
* Summarize chat log and save as memory
|
|
66
|
+
* @param chatLog Chat log
|
|
67
|
+
* @param chatStartTime Chat start time
|
|
68
|
+
*/
|
|
69
|
+
createMemoryIfNeeded(chatLog: Message[], chatStartTime: number): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Create memory of specified type
|
|
72
|
+
* @param type Memory type
|
|
73
|
+
* @param chatLog Chat log
|
|
74
|
+
* @param timestamp Timestamp
|
|
75
|
+
*/
|
|
76
|
+
private createMemory;
|
|
77
|
+
/**
|
|
78
|
+
* Get all memories
|
|
79
|
+
*/
|
|
80
|
+
getAllMemories(): MemoryRecord[];
|
|
81
|
+
/**
|
|
82
|
+
* Get memory of specified type
|
|
83
|
+
* @param type Memory type
|
|
84
|
+
*/
|
|
85
|
+
getMemoryByType(type: MemoryType): MemoryRecord | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Generate memory text for AI prompt
|
|
88
|
+
*/
|
|
89
|
+
getMemoryForPrompt(): string;
|
|
90
|
+
/**
|
|
91
|
+
* Clean up old memories
|
|
92
|
+
*/
|
|
93
|
+
cleanupOldMemories(): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Clear all memories
|
|
96
|
+
*/
|
|
97
|
+
clearAllMemories(): Promise<void>;
|
|
98
|
+
}
|