@game-forge/realtime-media 0.0.0-stage → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zopenge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export type { GameRealtimeMediaService, NpcAudioTrackListener, NpcSpeechRequest, NpcSpeechEmotion, NpcSpeechResult, NpcVoiceProfile, RealtimeAudioTrack, RealtimeVideoTrack, RoomMediaSession, TtsAudioChunk, TtsProvider, TtsSpeechRequest } from './realtime-media-types.js';
2
+ export { npcSpeechEmotions } from './realtime-media-types.js';
@@ -0,0 +1 @@
1
+ export { npcSpeechEmotions } from './realtime-media-types.js';
@@ -0,0 +1,65 @@
1
+ export interface RoomMediaSession {
2
+ readonly localPeerId: string;
3
+ readonly roomId: string;
4
+ readonly roomName: string;
5
+ }
6
+ export interface RealtimeAudioTrack {
7
+ detach(): void;
8
+ readonly element: HTMLMediaElement;
9
+ readonly id: string;
10
+ readonly kind: 'audio';
11
+ }
12
+ export interface RealtimeVideoTrack {
13
+ readonly id: string;
14
+ readonly kind: 'video';
15
+ readonly purpose: 'reserved';
16
+ }
17
+ export interface NpcSpeechRequest {
18
+ readonly emotion?: NpcSpeechEmotion | undefined;
19
+ readonly npcId: string;
20
+ readonly text: string;
21
+ }
22
+ export interface NpcSpeechResult {
23
+ readonly status: 'queued' | 'unavailable';
24
+ }
25
+ export type NpcAudioTrackListener = (track: RealtimeAudioTrack) => void;
26
+ export interface GameRealtimeMediaService {
27
+ readonly isAvailable: boolean;
28
+ readonly session?: RoomMediaSession | undefined;
29
+ onNpcAudioTrack(listener: NpcAudioTrackListener): () => void;
30
+ requestDisconnect(): void;
31
+ requestNpcSpeech(request: NpcSpeechRequest): Promise<NpcSpeechResult>;
32
+ setOutputMuted(isMuted: boolean): void;
33
+ }
34
+ export interface TtsSpeechRequest {
35
+ readonly emotion?: NpcSpeechEmotion | undefined;
36
+ readonly language?: string | undefined;
37
+ readonly modelId?: string | undefined;
38
+ readonly npcId: string;
39
+ readonly roomId: string;
40
+ readonly speed?: number | undefined;
41
+ readonly text: string;
42
+ readonly voiceId?: string | undefined;
43
+ readonly volume?: number | undefined;
44
+ }
45
+ export interface TtsAudioChunk {
46
+ readonly channels: number;
47
+ readonly data: Uint8Array;
48
+ readonly mimeType: string;
49
+ readonly sampleRate: number;
50
+ }
51
+ export interface TtsProvider {
52
+ synthesizeSpeech(request: TtsSpeechRequest): AsyncIterable<TtsAudioChunk>;
53
+ }
54
+ export declare const npcSpeechEmotions: readonly ["neutral", "angry", "excited", "content", "sad", "scared"];
55
+ export type NpcSpeechEmotion = typeof npcSpeechEmotions[number];
56
+ export interface NpcVoiceProfile {
57
+ readonly emotion: NpcSpeechEmotion;
58
+ readonly language: string;
59
+ readonly modelId: string;
60
+ readonly npcId: string;
61
+ readonly provider: 'cartesia';
62
+ readonly speed: number;
63
+ readonly voiceId: string;
64
+ readonly volume: number;
65
+ }
@@ -0,0 +1,8 @@
1
+ export const npcSpeechEmotions = [
2
+ 'neutral',
3
+ 'angry',
4
+ 'excited',
5
+ 'content',
6
+ 'sad',
7
+ 'scared'
8
+ ];
package/package.json CHANGED
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "@game-forge/realtime-media",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/zopenge/game-forge.git"
8
+ },
9
+ "publishConfig": {
10
+ "registry": "https://registry.npmjs.org",
11
+ "access": "public",
12
+ "provenance": false
13
+ },
14
+ "license": "MIT",
15
+ "main": "./dist/sdk/index.js",
16
+ "types": "./dist/sdk/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/sdk/index.d.ts",
20
+ "import": "./dist/sdk/index.js"
21
+ }
22
+ },
23
+ "dependencies": {}
24
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.