@aituber-onair/core 0.1.2 → 0.3.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 +118 -8
- package/dist/constants/chat.d.ts +13 -0
- package/dist/constants/chat.js +14 -0
- package/dist/constants/chat.js.map +1 -0
- package/dist/constants/gemini.d.ts +7 -0
- package/dist/constants/gemini.js +17 -0
- package/dist/constants/gemini.js.map +1 -0
- package/dist/constants/index.d.ts +6 -20
- package/dist/constants/index.js +6 -21
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/openai.d.ts +8 -0
- package/dist/constants/openai.js +17 -0
- package/dist/constants/openai.js.map +1 -0
- package/dist/constants/voiceEngine.d.ts +5 -0
- package/dist/constants/voiceEngine.js +6 -0
- package/dist/constants/voiceEngine.js.map +1 -0
- package/dist/constants/youtube.d.ts +1 -0
- package/dist/constants/youtube.js +2 -0
- package/dist/constants/youtube.js.map +1 -0
- package/dist/core/AITuberOnAirCore.js +10 -3
- package/dist/core/AITuberOnAirCore.js.map +1 -1
- package/dist/core/ChatProcessor.js +1 -1
- package/dist/core/ChatProcessor.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/services/chat/ChatService.d.ts +10 -0
- package/dist/services/chat/ChatServiceFactory.js +5 -2
- package/dist/services/chat/ChatServiceFactory.js.map +1 -1
- package/dist/services/chat/ClaudeChatService.d.ts +64 -0
- package/dist/services/chat/ClaudeChatService.js +237 -0
- package/dist/services/chat/ClaudeChatService.js.map +1 -0
- package/dist/services/chat/GeminiChatService.d.ts +63 -0
- package/dist/services/chat/GeminiChatService.js +314 -0
- package/dist/services/chat/GeminiChatService.js.map +1 -0
- package/dist/services/chat/OpenAIChatService.d.ts +1 -0
- package/dist/services/chat/OpenAIChatService.js +6 -1
- package/dist/services/chat/OpenAIChatService.js.map +1 -1
- package/dist/services/chat/providers/ChatServiceProvider.d.ts +2 -0
- package/dist/services/chat/providers/ClaudeChatServiceProvider.d.ts +39 -0
- package/dist/services/chat/providers/ClaudeChatServiceProvider.js +57 -0
- package/dist/services/chat/providers/ClaudeChatServiceProvider.js.map +1 -0
- package/dist/services/chat/providers/GeminiChatServiceProvider.d.ts +39 -0
- package/dist/services/chat/providers/GeminiChatServiceProvider.js +57 -0
- package/dist/services/chat/providers/GeminiChatServiceProvider.js.map +1 -0
- package/dist/services/chat/providers/OpenAIChatServiceProvider.d.ts +6 -0
- package/dist/services/chat/providers/OpenAIChatServiceProvider.js +16 -3
- package/dist/services/chat/providers/OpenAIChatServiceProvider.js.map +1 -1
- package/dist/services/chat/providers/gemini/GeminiChatService.d.ts +68 -0
- package/dist/services/chat/providers/gemini/GeminiChatService.js +325 -0
- package/dist/services/chat/providers/gemini/GeminiChatService.js.map +1 -0
- package/dist/services/chat/providers/gemini/GeminiChatServiceProvider.d.ts +39 -0
- package/dist/services/chat/providers/gemini/GeminiChatServiceProvider.js +61 -0
- package/dist/services/chat/providers/gemini/GeminiChatServiceProvider.js.map +1 -0
- package/dist/services/chat/providers/gemini/GeminiSummarizer.d.ts +25 -0
- package/dist/services/chat/providers/gemini/GeminiSummarizer.js +86 -0
- package/dist/services/chat/providers/gemini/GeminiSummarizer.js.map +1 -0
- package/dist/services/chat/providers/openai/OpenAIChatService.d.ts +44 -0
- package/dist/services/chat/providers/openai/OpenAIChatService.js +182 -0
- package/dist/services/chat/providers/openai/OpenAIChatService.js.map +1 -0
- package/dist/services/chat/providers/openai/OpenAIChatServiceProvider.d.ts +39 -0
- package/dist/services/chat/providers/openai/OpenAIChatServiceProvider.js +57 -0
- package/dist/services/chat/providers/openai/OpenAIChatServiceProvider.js.map +1 -0
- package/dist/services/chat/providers/openai/OpenAISummarizer.d.ts +25 -0
- package/dist/services/chat/providers/openai/OpenAISummarizer.js +70 -0
- package/dist/services/chat/providers/openai/OpenAISummarizer.js.map +1 -0
- package/dist/services/voice/VoiceEngineAdapter.d.ts +2 -2
- package/dist/services/voice/VoiceEngineAdapter.js +21 -0
- package/dist/services/voice/VoiceEngineAdapter.js.map +1 -1
- package/dist/services/voice/VoiceService.d.ts +9 -3
- package/dist/services/voice/engines/AivisSpeechEngine.d.ts +7 -1
- package/dist/services/voice/engines/AivisSpeechEngine.js +12 -2
- package/dist/services/voice/engines/AivisSpeechEngine.js.map +1 -1
- package/dist/services/voice/engines/NijiVoiceEngine.d.ts +1 -2
- package/dist/services/voice/engines/NijiVoiceEngine.js.map +1 -1
- package/dist/services/voice/engines/OpenAiEngine.d.ts +1 -1
- package/dist/services/voice/engines/OpenAiEngine.js +2 -1
- package/dist/services/voice/engines/OpenAiEngine.js.map +1 -1
- package/dist/services/voice/engines/VoiceEngine.d.ts +6 -2
- package/dist/services/voice/engines/VoiceEngineFactory.d.ts +2 -1
- package/dist/services/voice/engines/VoiceEngineFactory.js.map +1 -1
- package/dist/services/voice/engines/VoicePeakEngine.d.ts +7 -1
- package/dist/services/voice/engines/VoicePeakEngine.js +12 -2
- package/dist/services/voice/engines/VoicePeakEngine.js.map +1 -1
- package/dist/services/voice/engines/VoiceVoxEngine.d.ts +7 -1
- package/dist/services/voice/engines/VoiceVoxEngine.js +12 -2
- package/dist/services/voice/engines/VoiceVoxEngine.js.map +1 -1
- package/dist/services/voice/messages.d.ts +2 -37
- package/dist/services/voice/messages.js +1 -9
- package/dist/services/voice/messages.js.map +1 -1
- package/dist/types/chat.d.ts +54 -0
- package/dist/types/chat.js +5 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/types/index.d.ts +10 -80
- package/dist/types/index.js +9 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/memory.d.ts +34 -0
- package/dist/types/memory.js +2 -0
- package/dist/types/memory.js.map +1 -0
- package/dist/types/voice.d.ts +35 -0
- package/dist/types/voice.js +19 -0
- package/dist/types/voice.js.map +1 -0
- package/dist/types/voiceEngine.d.ts +1 -0
- package/dist/types/voiceEngine.js +2 -0
- package/dist/types/voiceEngine.js.map +1 -0
- package/dist/utils/screenplay.d.ts +4 -4
- package/dist/utils/screenplay.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Talk } from '
|
|
2
|
-
import { VoiceActor } from '../../../types/nijiVoice';
|
|
1
|
+
import { VoiceActor, Talk } from '../../../types';
|
|
3
2
|
/**
|
|
4
3
|
* Common interface for voice engines
|
|
5
4
|
*/
|
|
@@ -18,4 +17,9 @@ export interface VoiceEngine {
|
|
|
18
17
|
* @returns test message
|
|
19
18
|
*/
|
|
20
19
|
getTestMessage(textVoiceText?: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Set custom API endpoint URL
|
|
22
|
+
* @param apiUrl custom API endpoint URL
|
|
23
|
+
*/
|
|
24
|
+
setApiEndpoint?(apiUrl: string): void;
|
|
21
25
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VoiceEngine } from './VoiceEngine';
|
|
2
|
+
import { voiceEngineType } from '../../../types';
|
|
2
3
|
/**
|
|
3
4
|
* Voice engine factory
|
|
4
5
|
* Generate appropriate voice engine instances based on voice engine type
|
|
@@ -10,5 +11,5 @@ export declare class VoiceEngineFactory {
|
|
|
10
11
|
* @returns voice engine instance
|
|
11
12
|
* @throws error if engine type is unknown
|
|
12
13
|
*/
|
|
13
|
-
static getEngine(engineType:
|
|
14
|
+
static getEngine(engineType: voiceEngineType): VoiceEngine;
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceEngineFactory.js","sourceRoot":"","sources":["../../../../src/services/voice/engines/VoiceEngineFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAC7B;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"VoiceEngineFactory.js","sourceRoot":"","sources":["../../../../src/services/voice/engines/VoiceEngineFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAC7B;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,UAA2B;QAC1C,QAAQ,UAAU,EAAE,CAAC;YACnB,KAAK,UAAU;gBACb,OAAO,IAAI,cAAc,EAAE,CAAC;YAC9B,KAAK,WAAW;gBACd,OAAO,IAAI,eAAe,EAAE,CAAC;YAC/B,KAAK,aAAa;gBAChB,OAAO,IAAI,iBAAiB,EAAE,CAAC;YACjC,KAAK,QAAQ;gBACX,OAAO,IAAI,YAAY,EAAE,CAAC;YAC5B,KAAK,WAAW;gBACd,OAAO,IAAI,eAAe,EAAE,CAAC;YAC/B;gBACE,MAAM,IAAI,KAAK,CAAC,kCAAkC,UAAU,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { Talk } from '
|
|
1
|
+
import { Talk } from '../../../types';
|
|
2
2
|
import { VoiceEngine } from './VoiceEngine';
|
|
3
3
|
/**
|
|
4
4
|
* VoicePeak voice synthesis engine
|
|
5
5
|
*/
|
|
6
6
|
export declare class VoicePeakEngine implements VoiceEngine {
|
|
7
|
+
private apiEndpoint;
|
|
7
8
|
fetchAudio(input: Talk, speaker: string): Promise<ArrayBuffer>;
|
|
8
9
|
/**
|
|
9
10
|
* Map emotion style to VoicePeak's emotion parameters
|
|
10
11
|
*/
|
|
11
12
|
private mapEmotionStyle;
|
|
12
13
|
getTestMessage(textVoiceText?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Set custom API endpoint URL
|
|
16
|
+
* @param apiUrl custom API endpoint URL
|
|
17
|
+
*/
|
|
18
|
+
setApiEndpoint(apiUrl: string): void;
|
|
13
19
|
}
|
|
@@ -3,16 +3,19 @@ import { VOICEPEAK_API_URL } from '../../../constants';
|
|
|
3
3
|
* VoicePeak voice synthesis engine
|
|
4
4
|
*/
|
|
5
5
|
export class VoicePeakEngine {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.apiEndpoint = VOICEPEAK_API_URL;
|
|
8
|
+
}
|
|
6
9
|
async fetchAudio(input, speaker) {
|
|
7
10
|
const talk = input;
|
|
8
|
-
const ttsQueryResponse = await fetch(`${
|
|
11
|
+
const ttsQueryResponse = await fetch(`${this.apiEndpoint}/audio_query?speaker=${speaker}&text=${encodeURIComponent(talk.message)}`, { method: 'POST' });
|
|
9
12
|
if (!ttsQueryResponse.ok) {
|
|
10
13
|
throw new Error('Failed to fetch TTS query.');
|
|
11
14
|
}
|
|
12
15
|
const ttsQueryJson = await ttsQueryResponse.json();
|
|
13
16
|
// set emotion from talk.style
|
|
14
17
|
ttsQueryJson['emotion'] = this.mapEmotionStyle(talk.style || 'neutral');
|
|
15
|
-
const synthesisResponse = await fetch(`${
|
|
18
|
+
const synthesisResponse = await fetch(`${this.apiEndpoint}/synthesis?speaker=${speaker}`, {
|
|
16
19
|
method: 'POST',
|
|
17
20
|
headers: { 'Content-Type': 'application/json' },
|
|
18
21
|
body: JSON.stringify(ttsQueryJson),
|
|
@@ -42,5 +45,12 @@ export class VoicePeakEngine {
|
|
|
42
45
|
getTestMessage(textVoiceText) {
|
|
43
46
|
return textVoiceText || 'ボイスピークを使用します';
|
|
44
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Set custom API endpoint URL
|
|
50
|
+
* @param apiUrl custom API endpoint URL
|
|
51
|
+
*/
|
|
52
|
+
setApiEndpoint(apiUrl) {
|
|
53
|
+
this.apiEndpoint = apiUrl;
|
|
54
|
+
}
|
|
45
55
|
}
|
|
46
56
|
//# sourceMappingURL=VoicePeakEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoicePeakEngine.js","sourceRoot":"","sources":["../../../../src/services/voice/engines/VoicePeakEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;GAEG;AACH,MAAM,OAAO,eAAe;
|
|
1
|
+
{"version":3,"file":"VoicePeakEngine.js","sourceRoot":"","sources":["../../../../src/services/voice/engines/VoicePeakEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;GAEG;AACH,MAAM,OAAO,eAAe;IAA5B;QACU,gBAAW,GAAW,iBAAiB,CAAC;IAgElD,CAAC;IA9DC,KAAK,CAAC,UAAU,CAAC,KAAW,EAAE,OAAe;QAC3C,MAAM,IAAI,GAAG,KAAa,CAAC;QAE3B,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAClC,GAAG,IAAI,CAAC,WAAW,wBAAwB,OAAO,SAAS,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAC7F,EAAE,MAAM,EAAE,MAAM,EAAE,CACnB,CAAC;QAEF,IAAI,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAC;QAEnD,8BAA8B;QAC9B,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;QAExE,MAAM,iBAAiB,GAAG,MAAM,KAAK,CACnC,GAAG,IAAI,CAAC,WAAW,sBAAsB,OAAO,EAAE,EAClD;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;SACnC,CACF,CAAC;QAEF,IAAI,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC5C,OAAO,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,KAAa;QACnC,QAAQ,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YAC5B,KAAK,OAAO,CAAC;YACb,KAAK,KAAK;gBACR,OAAO,OAAO,CAAC;YACjB,KAAK,OAAO;gBACV,OAAO,OAAO,CAAC;YACjB,KAAK,KAAK;gBACR,OAAO,KAAK,CAAC;YACf;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAED,cAAc,CAAC,aAAsB;QACnC,OAAO,aAAa,IAAI,cAAc,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,MAAc;QAC3B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { Talk } from '
|
|
1
|
+
import { Talk } from '../../../types';
|
|
2
2
|
import { VoiceEngine } from './VoiceEngine';
|
|
3
3
|
/**
|
|
4
4
|
* VoiceVox voice synthesis engine
|
|
5
5
|
*/
|
|
6
6
|
export declare class VoiceVoxEngine implements VoiceEngine {
|
|
7
|
+
private apiEndpoint;
|
|
7
8
|
fetchAudio(input: Talk, speaker: string): Promise<ArrayBuffer>;
|
|
8
9
|
/**
|
|
9
10
|
* Adjust parameters according to emotion
|
|
10
11
|
*/
|
|
11
12
|
private adjustEmotionParameters;
|
|
12
13
|
getTestMessage(textVoiceText?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Set custom API endpoint URL
|
|
16
|
+
* @param apiUrl custom API endpoint URL
|
|
17
|
+
*/
|
|
18
|
+
setApiEndpoint(apiUrl: string): void;
|
|
13
19
|
}
|
|
@@ -3,18 +3,21 @@ import { VOICE_VOX_API_URL } from '../../../constants';
|
|
|
3
3
|
* VoiceVox voice synthesis engine
|
|
4
4
|
*/
|
|
5
5
|
export class VoiceVoxEngine {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.apiEndpoint = VOICE_VOX_API_URL;
|
|
8
|
+
}
|
|
6
9
|
async fetchAudio(input, speaker) {
|
|
7
10
|
const talk = input;
|
|
8
11
|
// get emotion from talk.style
|
|
9
12
|
const emotion = talk.style || 'neutral';
|
|
10
|
-
const ttsQueryResponse = await fetch(`${
|
|
13
|
+
const ttsQueryResponse = await fetch(`${this.apiEndpoint}/audio_query?speaker=${speaker}&text=${encodeURIComponent(talk.message)}`, { method: 'POST' });
|
|
11
14
|
if (!ttsQueryResponse.ok) {
|
|
12
15
|
throw new Error('Failed to fetch TTS query.');
|
|
13
16
|
}
|
|
14
17
|
const ttsQueryJson = await ttsQueryResponse.json();
|
|
15
18
|
// adjust parameters according to emotion
|
|
16
19
|
this.adjustEmotionParameters(ttsQueryJson, emotion);
|
|
17
|
-
const synthesisResponse = await fetch(`${
|
|
20
|
+
const synthesisResponse = await fetch(`${this.apiEndpoint}/synthesis?speaker=${speaker}`, {
|
|
18
21
|
method: 'POST',
|
|
19
22
|
headers: {
|
|
20
23
|
'Content-Type': 'application/json',
|
|
@@ -63,5 +66,12 @@ export class VoiceVoxEngine {
|
|
|
63
66
|
getTestMessage(textVoiceText) {
|
|
64
67
|
return textVoiceText || 'ボイスボックスを使用します';
|
|
65
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Set custom API endpoint URL
|
|
71
|
+
* @param apiUrl custom API endpoint URL
|
|
72
|
+
*/
|
|
73
|
+
setApiEndpoint(apiUrl) {
|
|
74
|
+
this.apiEndpoint = apiUrl;
|
|
75
|
+
}
|
|
66
76
|
}
|
|
67
77
|
//# sourceMappingURL=VoiceVoxEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceVoxEngine.js","sourceRoot":"","sources":["../../../../src/services/voice/engines/VoiceVoxEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;GAEG;AACH,MAAM,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"VoiceVoxEngine.js","sourceRoot":"","sources":["../../../../src/services/voice/engines/VoiceVoxEngine.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type Message = {
|
|
3
|
-
role: 'assistant' | 'system' | 'user';
|
|
4
|
-
content: string;
|
|
5
|
-
timestamp?: number;
|
|
6
|
-
};
|
|
7
|
-
type VisionBlock = {
|
|
8
|
-
type: 'text';
|
|
9
|
-
text: string;
|
|
10
|
-
} | {
|
|
11
|
-
type: 'image_url';
|
|
12
|
-
image_url: {
|
|
13
|
-
url: string;
|
|
14
|
-
detail?: 'low' | 'high' | 'auto';
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type MessageWithVision = {
|
|
18
|
-
role: 'assistant' | 'system' | 'user';
|
|
19
|
-
content: string | VisionBlock[];
|
|
20
|
-
};
|
|
21
|
-
declare const talkStyles: readonly ["talk", "happy", "sad", "angry", "fear", "surprised"];
|
|
22
|
-
export type TalkStyle = (typeof talkStyles)[number];
|
|
23
|
-
export type Talk = {
|
|
24
|
-
style: TalkStyle;
|
|
25
|
-
message: string;
|
|
26
|
-
};
|
|
27
|
-
declare const emotions: readonly ["neutral", "happy", "angry", "sad", "relaxed"];
|
|
28
|
-
export type EmotionType = (typeof emotions)[number] & VRMExpressionPresetName;
|
|
29
|
-
/**
|
|
30
|
-
* Set of talk text and emotion, and model's emotion expression
|
|
31
|
-
*/
|
|
32
|
-
export type Screenplay = {
|
|
33
|
-
expression: EmotionType;
|
|
34
|
-
talk: Talk;
|
|
35
|
-
};
|
|
1
|
+
import { VoiceScreenplay } from '../../types';
|
|
36
2
|
export declare const splitSentence: (text: string) => string[];
|
|
37
|
-
export declare const textsToScreenplay: (texts: string[]) =>
|
|
38
|
-
export {};
|
|
3
|
+
export declare const textsToScreenplay: (texts: string[]) => VoiceScreenplay[];
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
'talk',
|
|
3
|
-
'happy',
|
|
4
|
-
'sad',
|
|
5
|
-
'angry',
|
|
6
|
-
'fear',
|
|
7
|
-
'surprised',
|
|
8
|
-
];
|
|
9
|
-
const emotions = ['neutral', 'happy', 'angry', 'sad', 'relaxed'];
|
|
1
|
+
import { emotions } from '../../types';
|
|
10
2
|
export const splitSentence = (text) => {
|
|
11
3
|
const splitMessages = text.split(/(?<=[。.!?\n])/g);
|
|
12
4
|
return splitMessages.filter((msg) => msg !== '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/services/voice/messages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/services/voice/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEhF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAY,EAAE;IACtD,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACnD,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAqB,EAAE;IACtE,MAAM,WAAW,GAAsB,EAAE,CAAC;IAC1C,IAAI,cAAc,GAAG,SAAS,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAEtC,MAAM,GAAG,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC;QAElD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAE/C,IAAI,UAAU,GAAG,cAAc,CAAC;QAChC,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAU,CAAC,EAAE,CAAC;YAClC,UAAU,GAAG,GAAG,CAAC;YACjB,cAAc,GAAG,GAAG,CAAC;QACvB,CAAC;QAED,WAAW,CAAC,IAAI,CAAC;YACf,UAAU,EAAE,UAAyB;YACrC,IAAI,EAAE;gBACJ,KAAK,EAAE,kBAAkB,CAAC,UAAyB,CAAC;gBACpD,OAAO,EAAE,OAAO;aACjB;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,OAAoB,EAAa,EAAE;IAC7D,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,KAAK,CAAC;QACf;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AITuber OnAir Core type definitions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Chat message basic type
|
|
6
|
+
*/
|
|
7
|
+
export interface Message {
|
|
8
|
+
role: 'system' | 'user' | 'assistant';
|
|
9
|
+
content: string;
|
|
10
|
+
timestamp?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Vision block type for image content
|
|
14
|
+
*/
|
|
15
|
+
export type VisionBlock = {
|
|
16
|
+
type: 'text';
|
|
17
|
+
text: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'image_url';
|
|
20
|
+
image_url: {
|
|
21
|
+
url: string;
|
|
22
|
+
detail?: 'low' | 'high' | 'auto';
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Message type corresponding to vision (image)
|
|
27
|
+
*/
|
|
28
|
+
export interface MessageWithVision {
|
|
29
|
+
role: 'system' | 'user' | 'assistant';
|
|
30
|
+
content: string | VisionBlock[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Chat type
|
|
34
|
+
* - chatForm: Chat from text input
|
|
35
|
+
* - youtube: Chat from YouTube comments
|
|
36
|
+
* - vision: Chat from vision (image)
|
|
37
|
+
*/
|
|
38
|
+
export type ChatType = 'chatForm' | 'youtube' | 'vision';
|
|
39
|
+
/**
|
|
40
|
+
* screenplay (text with emotion)
|
|
41
|
+
*/
|
|
42
|
+
export interface Screenplay {
|
|
43
|
+
text: string;
|
|
44
|
+
emotion?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Speech synthesis options
|
|
48
|
+
*/
|
|
49
|
+
export interface SpeakOptions {
|
|
50
|
+
speed?: number;
|
|
51
|
+
pitch?: number;
|
|
52
|
+
intonation?: number;
|
|
53
|
+
volumeScale?: number;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,82 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AITuber OnAir Core type definitions
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
* Message type corresponding to vision (image)
|
|
14
|
-
*/
|
|
15
|
-
export interface MessageWithVision {
|
|
16
|
-
role: 'system' | 'user' | 'assistant';
|
|
17
|
-
content: string | Array<{
|
|
18
|
-
type: 'text' | 'image_url';
|
|
19
|
-
text?: string;
|
|
20
|
-
image_url?: {
|
|
21
|
-
url: string;
|
|
22
|
-
detail: 'low' | 'high';
|
|
23
|
-
};
|
|
24
|
-
}>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Chat type
|
|
28
|
-
* - chatForm: Chat from text input
|
|
29
|
-
* - youtube: Chat from YouTube comments
|
|
30
|
-
* - vision: Chat from vision (image)
|
|
31
|
-
*/
|
|
32
|
-
export type ChatType = 'chatForm' | 'youtube' | 'vision';
|
|
33
|
-
/**
|
|
34
|
-
* Memory storage interface for persistence
|
|
35
|
-
* Implementations can use various storage mechanisms (LocalStorage, IndexedDB, files, etc.)
|
|
36
|
-
*/
|
|
37
|
-
export interface MemoryStorage {
|
|
38
|
-
/**
|
|
39
|
-
* Load memory records from storage
|
|
40
|
-
* @returns Promise resolving to array of memory records
|
|
41
|
-
*/
|
|
42
|
-
load(): Promise<MemoryRecord[]>;
|
|
43
|
-
/**
|
|
44
|
-
* Save memory records to storage
|
|
45
|
-
* @param records Memory records to save
|
|
46
|
-
* @returns Promise resolving when save is complete
|
|
47
|
-
*/
|
|
48
|
-
save(records: MemoryRecord[]): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Clear all stored memory records
|
|
51
|
-
* @returns Promise resolving when clear is complete
|
|
52
|
-
*/
|
|
53
|
-
clear(): Promise<void>;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Memory record type
|
|
57
|
-
*/
|
|
58
|
-
export type MemoryType = 'short' | 'mid' | 'long';
|
|
59
|
-
/**
|
|
60
|
-
* Memory record type
|
|
61
|
-
*/
|
|
62
|
-
export interface MemoryRecord {
|
|
63
|
-
type: MemoryType;
|
|
64
|
-
summary: string;
|
|
65
|
-
timestamp: number;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Screenplay (text with emotion)
|
|
69
|
-
*/
|
|
70
|
-
export interface Screenplay {
|
|
71
|
-
text: string;
|
|
72
|
-
emotion?: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Speech synthesis options
|
|
76
|
-
*/
|
|
77
|
-
export interface SpeakOptions {
|
|
78
|
-
speed?: number;
|
|
79
|
-
pitch?: number;
|
|
80
|
-
intonation?: number;
|
|
81
|
-
volumeScale?: number;
|
|
82
|
-
}
|
|
3
|
+
* Index file: Export all type definitions from here
|
|
4
|
+
*/
|
|
5
|
+
export * from './memory';
|
|
6
|
+
export * from './voiceEngine';
|
|
7
|
+
export * from './nijiVoice';
|
|
8
|
+
export { Message, MessageWithVision, VisionBlock, ChatType, SpeakOptions, } from './chat';
|
|
9
|
+
export { talkStyles, TalkStyle, Talk, emotions, EmotionType, EmotionTypeForVoicepeak, } from './voice';
|
|
10
|
+
import { Screenplay as VoiceScreenplay } from './voice';
|
|
11
|
+
import { Screenplay as ChatScreenplay } from './chat';
|
|
12
|
+
export { VoiceScreenplay, ChatScreenplay };
|
package/dist/types/index.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AITuber OnAir Core type definitions
|
|
3
|
+
* Index file: Export all type definitions from here
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
+
// Memory related type definitions
|
|
6
|
+
export * from './memory';
|
|
7
|
+
// Voice engine related type definitions
|
|
8
|
+
export * from './voiceEngine';
|
|
9
|
+
// NijiVoice related type definitions
|
|
10
|
+
export * from './nijiVoice';
|
|
11
|
+
// Voice related type definitions (excluding Screenplay type)
|
|
12
|
+
export { talkStyles, emotions, } from './voice';
|
|
5
13
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kCAAkC;AAClC,cAAc,UAAU,CAAC;AAEzB,wCAAwC;AACxC,cAAc,eAAe,CAAC;AAE9B,qCAAqC;AACrC,cAAc,aAAa,CAAC;AAW5B,6DAA6D;AAC7D,OAAO,EACL,UAAU,EAGV,QAAQ,GAGT,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory storage interface for persistence
|
|
3
|
+
* Implementations can use various storage mechanisms (LocalStorage, IndexedDB, files, etc.)
|
|
4
|
+
*/
|
|
5
|
+
export interface MemoryStorage {
|
|
6
|
+
/**
|
|
7
|
+
* Load memory records from storage
|
|
8
|
+
* @returns Promise resolving to array of memory records
|
|
9
|
+
*/
|
|
10
|
+
load(): Promise<MemoryRecord[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Save memory records to storage
|
|
13
|
+
* @param records Memory records to save
|
|
14
|
+
* @returns Promise resolving when save is complete
|
|
15
|
+
*/
|
|
16
|
+
save(records: MemoryRecord[]): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Clear all stored memory records
|
|
19
|
+
* @returns Promise resolving when clear is complete
|
|
20
|
+
*/
|
|
21
|
+
clear(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Memory record type
|
|
25
|
+
*/
|
|
26
|
+
export type MemoryType = 'short' | 'mid' | 'long';
|
|
27
|
+
/**
|
|
28
|
+
* Memory record type
|
|
29
|
+
*/
|
|
30
|
+
export interface MemoryRecord {
|
|
31
|
+
type: MemoryType;
|
|
32
|
+
summary: string;
|
|
33
|
+
timestamp: number;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/types/memory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice related type definitions
|
|
3
|
+
*/
|
|
4
|
+
import { VRMExpressionPresetName } from '@pixiv/three-vrm';
|
|
5
|
+
export declare const talkStyles: readonly ["talk", "happy", "sad", "angry", "fear", "surprised"];
|
|
6
|
+
/**
|
|
7
|
+
* TalkStyle - Style of speech for voice synthesis
|
|
8
|
+
*/
|
|
9
|
+
export type TalkStyle = (typeof talkStyles)[number];
|
|
10
|
+
/**
|
|
11
|
+
* Talk - Set of message and talk style
|
|
12
|
+
*/
|
|
13
|
+
export type Talk = {
|
|
14
|
+
style: TalkStyle;
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Types of emotional expressions
|
|
19
|
+
*/
|
|
20
|
+
export declare const emotions: readonly ["neutral", "happy", "angry", "sad", "relaxed"];
|
|
21
|
+
export type EmotionType = (typeof emotions)[number] & VRMExpressionPresetName;
|
|
22
|
+
/**
|
|
23
|
+
* Emotion types for VoicePeak
|
|
24
|
+
*/
|
|
25
|
+
export type EmotionTypeForVoicepeak = 'happy' | 'fun' | 'angry' | 'sad' | 'neutral';
|
|
26
|
+
/**
|
|
27
|
+
* Screenplay - Text with emotion expression
|
|
28
|
+
* This has a different structure from the Screenplay type in chat.ts.
|
|
29
|
+
* Be careful of name conflicts when importing both types.
|
|
30
|
+
* Example: import { Screenplay as VoiceScreenplay } from '../types/voice';
|
|
31
|
+
*/
|
|
32
|
+
export type Screenplay = {
|
|
33
|
+
expression: EmotionType;
|
|
34
|
+
talk: Talk;
|
|
35
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const talkStyles = [
|
|
2
|
+
'talk',
|
|
3
|
+
'happy',
|
|
4
|
+
'sad',
|
|
5
|
+
'angry',
|
|
6
|
+
'fear',
|
|
7
|
+
'surprised',
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Types of emotional expressions
|
|
11
|
+
*/
|
|
12
|
+
export const emotions = [
|
|
13
|
+
'neutral',
|
|
14
|
+
'happy',
|
|
15
|
+
'angry',
|
|
16
|
+
'sad',
|
|
17
|
+
'relaxed',
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=voice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice.js","sourceRoot":"","sources":["../../src/types/voice.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM;IACN,OAAO;IACP,KAAK;IACL,OAAO;IACP,MAAM;IACN,WAAW;CACH,CAAC;AAeX;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,SAAS;IACT,OAAO;IACP,OAAO;IACP,KAAK;IACL,SAAS;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type voiceEngineType = 'voicevox' | 'voicepeak' | 'openai' | 'nijivoice' | 'aivisSpeech';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceEngine.js","sourceRoot":"","sources":["../../src/types/voiceEngine.ts"],"names":[],"mappings":""}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChatScreenplay } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Convert text to screenplay (text with emotion)
|
|
4
4
|
* @param text Original text (may contain emotion expressions like [happy])
|
|
5
5
|
* @returns Screenplay object with emotion and text separated
|
|
6
6
|
*/
|
|
7
|
-
export declare function textToScreenplay(text: string):
|
|
7
|
+
export declare function textToScreenplay(text: string): ChatScreenplay;
|
|
8
8
|
/**
|
|
9
9
|
* Convert multiple texts to screenplay array
|
|
10
10
|
* @param texts Text array
|
|
11
11
|
* @returns Array of screenplay objects
|
|
12
12
|
*/
|
|
13
|
-
export declare function textsToScreenplay(texts: string[]):
|
|
13
|
+
export declare function textsToScreenplay(texts: string[]): ChatScreenplay[];
|
|
14
14
|
/**
|
|
15
15
|
* Convert screenplay to text with emotion
|
|
16
16
|
* @param screenplay Screenplay object
|
|
17
17
|
* @returns Text with emotion (e.g. [happy] Hello)
|
|
18
18
|
*/
|
|
19
|
-
export declare function screenplayToText(screenplay:
|
|
19
|
+
export declare function screenplayToText(screenplay: ChatScreenplay): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenplay.js","sourceRoot":"","sources":["../../src/utils/screenplay.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAExC,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACvC,4DAA4D;QAC5D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACjE,OAAO;YACL,OAAO;YACP,IAAI,EAAE,SAAS;SAChB,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAe;IAC/C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"screenplay.js","sourceRoot":"","sources":["../../src/utils/screenplay.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAExC,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACvC,4DAA4D;QAC5D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACjE,OAAO;YACL,OAAO;YACP,IAAI,EAAE,SAAS;SAChB,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAe;IAC/C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAA0B;IACzD,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;QACvB,OAAO,IAAI,UAAU,CAAC,OAAO,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;IACtD,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aituber-onair/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Core library for AITuber OnAir providing voice synthesis and chat processing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"typecheck": "tsc --project tsconfig.dev.json",
|
|
12
12
|
"test": "npm run typecheck && vitest run",
|
|
13
13
|
"test:watch": "vitest",
|
|
14
|
-
"test:coverage": "vitest run --coverage"
|
|
14
|
+
"test:coverage": "vitest run --coverage",
|
|
15
|
+
"fmt": "biome format . --write"
|
|
15
16
|
},
|
|
16
17
|
"keywords": ["aituber", "vtuber", "ai", "voice", "streaming"],
|
|
17
18
|
"author": "shinshin86 (https://github.com/shinshin86)",
|
|
18
19
|
"license": "MIT",
|
|
19
|
-
"dependencies": {},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"openai": "^3.2.1",
|
|
22
21
|
"@pixiv/three-vrm": "^1.0.9"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|
|
24
|
+
"@biomejs/biome": "1.9.4",
|
|
25
25
|
"@types/node": "^18.15.0",
|
|
26
26
|
"@vitest/coverage-v8": "^1.3.1",
|
|
27
27
|
"typescript": "^5.0.0",
|