@shogo-ai/voice 1.10.0 → 2.4.1
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 +89 -0
- package/dist/{chunk-S3S2RNO6.js → chunk-BI6SL35K.js} +1 -184
- package/dist/chunk-CLF25CZC.js +987 -0
- package/dist/chunk-KMSL5PWK.js +540 -0
- package/dist/chunk-ME3SIZZU.js +581 -0
- package/dist/chunk-TQOBJMEK.js +17 -0
- package/dist/{chunk-T3T4EBWY.js → chunk-UH75UVM2.js} +6 -2
- package/dist/chunk-UW7VQ3S6.js +148 -0
- package/dist/chunk-XE4LLC7Z.js +1067 -0
- package/dist/chunk-ZAW6F3YT.js +172 -0
- package/dist/index.cjs +735 -25
- package/dist/index.d.cts +373 -3
- package/dist/index.d.ts +373 -3
- package/dist/index.js +59 -3
- package/dist/live/client.cjs +173 -0
- package/dist/live/client.d.cts +132 -0
- package/dist/live/client.d.ts +132 -0
- package/dist/live/client.js +9 -0
- package/dist/native/index.d.cts +5 -2
- package/dist/native/index.d.ts +5 -2
- package/dist/native/index.js +15 -11
- package/dist/{organicParticlesShaders-DIva0vBO.d.ts → organicParticlesShaders-seZq7jYX.d.cts} +1 -421
- package/dist/{organicParticlesShaders-DIva0vBO.d.cts → organicParticlesShaders-seZq7jYX.d.ts} +1 -421
- package/dist/particlesConfig-0YbdPOdY.d.cts +223 -0
- package/dist/particlesConfig-0YbdPOdY.d.ts +223 -0
- package/dist/react/conversation.cjs +789 -0
- package/dist/react/conversation.d.cts +134 -0
- package/dist/react/conversation.d.ts +134 -0
- package/dist/react/conversation.js +13 -0
- package/dist/react/index.cjs +374 -36
- package/dist/react/index.d.cts +10 -141
- package/dist/react/index.d.ts +10 -141
- package/dist/react/index.js +23 -770
- package/dist/react/visuals.cjs +1048 -0
- package/dist/react/visuals.d.cts +70 -0
- package/dist/react/visuals.d.ts +70 -0
- package/dist/react/visuals.js +10 -0
- package/dist/route/agent.cjs +1038 -85
- package/dist/route/agent.js +3 -3
- package/dist/route/audio-tags.cjs +1038 -85
- package/dist/route/audio-tags.js +3 -3
- package/dist/route/index.cjs +1042 -85
- package/dist/route/index.d.cts +19 -3
- package/dist/route/index.d.ts +19 -3
- package/dist/route/index.js +3 -3
- package/dist/route/music.cjs +1038 -85
- package/dist/route/music.js +3 -3
- package/dist/route/op.cjs +2118 -0
- package/dist/route/op.d.cts +43 -0
- package/dist/route/op.d.ts +43 -0
- package/dist/route/op.js +27 -0
- package/dist/route/signed-url.cjs +1038 -85
- package/dist/route/signed-url.js +3 -3
- package/dist/route/tts-preview.cjs +1038 -85
- package/dist/route/tts-preview.d.cts +6 -4
- package/dist/route/tts-preview.d.ts +6 -4
- package/dist/route/tts-preview.js +3 -3
- package/dist/server.cjs +1038 -85
- package/dist/server.d.cts +40 -8
- package/dist/server.d.ts +40 -8
- package/dist/server.js +2 -2
- package/dist/types-Bfhu-aQH.d.cts +199 -0
- package/dist/types-Bfhu-aQH.d.ts +199 -0
- package/dist/{types-W9y6eMj3.d.ts → types-CadjTXNH.d.cts} +193 -12
- package/dist/{types-W9y6eMj3.d.cts → types-CadjTXNH.d.ts} +193 -12
- package/package.json +21 -1
- package/dist/chunk-B4JC3DK2.js +0 -529
- package/dist/chunk-O362EJQR.js +0 -524
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
interface LiveAudioConfig {
|
|
2
|
+
format?: {
|
|
3
|
+
type: 'audio/pcm' | 'audio/pcmu' | 'audio/pcma';
|
|
4
|
+
rate: number;
|
|
5
|
+
};
|
|
6
|
+
output?: {
|
|
7
|
+
voice?: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface LiveResponsesDelegation {
|
|
13
|
+
model: string;
|
|
14
|
+
instructions?: string;
|
|
15
|
+
tools?: unknown[];
|
|
16
|
+
tool_choice?: unknown;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
interface LiveSessionConfig {
|
|
20
|
+
model: string;
|
|
21
|
+
instructions?: string;
|
|
22
|
+
audio?: LiveAudioConfig;
|
|
23
|
+
input?: unknown;
|
|
24
|
+
store?: boolean;
|
|
25
|
+
delegation?: {
|
|
26
|
+
type: 'responses' | 'client';
|
|
27
|
+
responses?: LiveResponsesDelegation;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
interface LiveSessionStartedEvent {
|
|
33
|
+
type: 'session.started';
|
|
34
|
+
session: {
|
|
35
|
+
id: string;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
interface LiveSessionUsageUpdatedEvent {
|
|
41
|
+
type: 'session.usage.updated';
|
|
42
|
+
usage: {
|
|
43
|
+
seconds: number;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
interface LiveSessionClosedEvent {
|
|
49
|
+
type: 'session.closed';
|
|
50
|
+
usage?: {
|
|
51
|
+
seconds?: number;
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
interface LiveErrorEvent {
|
|
57
|
+
type: 'error';
|
|
58
|
+
error?: {
|
|
59
|
+
message?: string;
|
|
60
|
+
code?: string;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
type LiveSessionEvent = LiveSessionStartedEvent | LiveSessionUsageUpdatedEvent | LiveSessionClosedEvent | LiveErrorEvent | {
|
|
66
|
+
type: 'session.output_audio.delta' | 'session.input_transcript.delta' | 'session.output_transcript.delta';
|
|
67
|
+
delta?: string;
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'response.event';
|
|
71
|
+
event?: Record<string, unknown>;
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
} | Record<string, unknown>;
|
|
74
|
+
interface LiveWebRtcSession {
|
|
75
|
+
session: {
|
|
76
|
+
id: string;
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
};
|
|
79
|
+
transport: {
|
|
80
|
+
type?: string;
|
|
81
|
+
sdp: string;
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
};
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface ShogoLiveClientOptions {
|
|
88
|
+
apiUrl: string;
|
|
89
|
+
apiKey?: string;
|
|
90
|
+
runtimeToken?: string;
|
|
91
|
+
fetch?: typeof fetch;
|
|
92
|
+
WebSocket?: new (url: string, protocols?: string | string[]) => WebSocket;
|
|
93
|
+
}
|
|
94
|
+
interface LiveSessionHandlers {
|
|
95
|
+
[eventType: string]: (event: LiveSessionEvent) => void;
|
|
96
|
+
}
|
|
97
|
+
declare class LiveSession {
|
|
98
|
+
private readonly socket;
|
|
99
|
+
private readonly initialSession?;
|
|
100
|
+
private readonly handlers;
|
|
101
|
+
private readonly startedPromise;
|
|
102
|
+
private resolveStarted;
|
|
103
|
+
private rejectStarted;
|
|
104
|
+
private closedPromise;
|
|
105
|
+
private resolveClosed;
|
|
106
|
+
private closed;
|
|
107
|
+
readonly started: Promise<LiveSessionStartedEvent>;
|
|
108
|
+
latestUsageSeconds: number;
|
|
109
|
+
constructor(socket: WebSocket, initialSession?: LiveSessionConfig | undefined);
|
|
110
|
+
on(eventType: string, handler: (event: LiveSessionEvent) => void): () => void;
|
|
111
|
+
send(event: Record<string, unknown>): void;
|
|
112
|
+
appendAudio(audio: Uint8Array | string): void;
|
|
113
|
+
close(timeoutMs?: number): Promise<LiveSessionClosedEvent | void>;
|
|
114
|
+
}
|
|
115
|
+
declare class ShogoLiveClient {
|
|
116
|
+
private readonly apiUrl;
|
|
117
|
+
private readonly token;
|
|
118
|
+
private readonly fetchImpl;
|
|
119
|
+
private readonly WebSocketImpl;
|
|
120
|
+
constructor(options: ShogoLiveClientOptions);
|
|
121
|
+
private httpUrl;
|
|
122
|
+
private wsUrl;
|
|
123
|
+
private protocols;
|
|
124
|
+
connect(session: LiveSessionConfig): LiveSession;
|
|
125
|
+
attach(sessionId: string): LiveSession;
|
|
126
|
+
createWebRtcSession(input: {
|
|
127
|
+
session: LiveSessionConfig;
|
|
128
|
+
sdp: string;
|
|
129
|
+
}): Promise<LiveWebRtcSession>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { type LiveAudioConfig, type LiveErrorEvent, type LiveResponsesDelegation, LiveSession, type LiveSessionClosedEvent, type LiveSessionConfig, type LiveSessionEvent, type LiveSessionHandlers, type LiveSessionStartedEvent, type LiveSessionUsageUpdatedEvent, type LiveWebRtcSession, ShogoLiveClient, type ShogoLiveClientOptions };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
interface LiveAudioConfig {
|
|
2
|
+
format?: {
|
|
3
|
+
type: 'audio/pcm' | 'audio/pcmu' | 'audio/pcma';
|
|
4
|
+
rate: number;
|
|
5
|
+
};
|
|
6
|
+
output?: {
|
|
7
|
+
voice?: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface LiveResponsesDelegation {
|
|
13
|
+
model: string;
|
|
14
|
+
instructions?: string;
|
|
15
|
+
tools?: unknown[];
|
|
16
|
+
tool_choice?: unknown;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
interface LiveSessionConfig {
|
|
20
|
+
model: string;
|
|
21
|
+
instructions?: string;
|
|
22
|
+
audio?: LiveAudioConfig;
|
|
23
|
+
input?: unknown;
|
|
24
|
+
store?: boolean;
|
|
25
|
+
delegation?: {
|
|
26
|
+
type: 'responses' | 'client';
|
|
27
|
+
responses?: LiveResponsesDelegation;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
interface LiveSessionStartedEvent {
|
|
33
|
+
type: 'session.started';
|
|
34
|
+
session: {
|
|
35
|
+
id: string;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
interface LiveSessionUsageUpdatedEvent {
|
|
41
|
+
type: 'session.usage.updated';
|
|
42
|
+
usage: {
|
|
43
|
+
seconds: number;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
interface LiveSessionClosedEvent {
|
|
49
|
+
type: 'session.closed';
|
|
50
|
+
usage?: {
|
|
51
|
+
seconds?: number;
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
interface LiveErrorEvent {
|
|
57
|
+
type: 'error';
|
|
58
|
+
error?: {
|
|
59
|
+
message?: string;
|
|
60
|
+
code?: string;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
type LiveSessionEvent = LiveSessionStartedEvent | LiveSessionUsageUpdatedEvent | LiveSessionClosedEvent | LiveErrorEvent | {
|
|
66
|
+
type: 'session.output_audio.delta' | 'session.input_transcript.delta' | 'session.output_transcript.delta';
|
|
67
|
+
delta?: string;
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'response.event';
|
|
71
|
+
event?: Record<string, unknown>;
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
} | Record<string, unknown>;
|
|
74
|
+
interface LiveWebRtcSession {
|
|
75
|
+
session: {
|
|
76
|
+
id: string;
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
};
|
|
79
|
+
transport: {
|
|
80
|
+
type?: string;
|
|
81
|
+
sdp: string;
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
};
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface ShogoLiveClientOptions {
|
|
88
|
+
apiUrl: string;
|
|
89
|
+
apiKey?: string;
|
|
90
|
+
runtimeToken?: string;
|
|
91
|
+
fetch?: typeof fetch;
|
|
92
|
+
WebSocket?: new (url: string, protocols?: string | string[]) => WebSocket;
|
|
93
|
+
}
|
|
94
|
+
interface LiveSessionHandlers {
|
|
95
|
+
[eventType: string]: (event: LiveSessionEvent) => void;
|
|
96
|
+
}
|
|
97
|
+
declare class LiveSession {
|
|
98
|
+
private readonly socket;
|
|
99
|
+
private readonly initialSession?;
|
|
100
|
+
private readonly handlers;
|
|
101
|
+
private readonly startedPromise;
|
|
102
|
+
private resolveStarted;
|
|
103
|
+
private rejectStarted;
|
|
104
|
+
private closedPromise;
|
|
105
|
+
private resolveClosed;
|
|
106
|
+
private closed;
|
|
107
|
+
readonly started: Promise<LiveSessionStartedEvent>;
|
|
108
|
+
latestUsageSeconds: number;
|
|
109
|
+
constructor(socket: WebSocket, initialSession?: LiveSessionConfig | undefined);
|
|
110
|
+
on(eventType: string, handler: (event: LiveSessionEvent) => void): () => void;
|
|
111
|
+
send(event: Record<string, unknown>): void;
|
|
112
|
+
appendAudio(audio: Uint8Array | string): void;
|
|
113
|
+
close(timeoutMs?: number): Promise<LiveSessionClosedEvent | void>;
|
|
114
|
+
}
|
|
115
|
+
declare class ShogoLiveClient {
|
|
116
|
+
private readonly apiUrl;
|
|
117
|
+
private readonly token;
|
|
118
|
+
private readonly fetchImpl;
|
|
119
|
+
private readonly WebSocketImpl;
|
|
120
|
+
constructor(options: ShogoLiveClientOptions);
|
|
121
|
+
private httpUrl;
|
|
122
|
+
private wsUrl;
|
|
123
|
+
private protocols;
|
|
124
|
+
connect(session: LiveSessionConfig): LiveSession;
|
|
125
|
+
attach(sessionId: string): LiveSession;
|
|
126
|
+
createWebRtcSession(input: {
|
|
127
|
+
session: LiveSessionConfig;
|
|
128
|
+
sdp: string;
|
|
129
|
+
}): Promise<LiveWebRtcSession>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { type LiveAudioConfig, type LiveErrorEvent, type LiveResponsesDelegation, LiveSession, type LiveSessionClosedEvent, type LiveSessionConfig, type LiveSessionEvent, type LiveSessionHandlers, type LiveSessionStartedEvent, type LiveSessionUsageUpdatedEvent, type LiveWebRtcSession, ShogoLiveClient, type ShogoLiveClientOptions };
|
package/dist/native/index.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { B as BaseVoiceConversationOptions, a as BaseVoiceConversationResult
|
|
3
|
-
|
|
2
|
+
import { B as BaseVoiceConversationOptions, a as BaseVoiceConversationResult } from '../types-Bfhu-aQH.cjs';
|
|
3
|
+
import { B as BaseChatConversationOptions, a as BaseChatConversationResult } from '../organicParticlesShaders-seZq7jYX.cjs';
|
|
4
|
+
export { C as ChatClientToolFn, b as ChatConversationStatus, c as ChatToolDescriptor, O as ORGANIC_PARTICLES_FRAGMENT_SHADER, d as ORGANIC_PARTICLES_VERTEX_SHADER, e as ORGANIC_SPHERE_FRAGMENT_SHADER, f as ORGANIC_SPHERE_VERTEX_SHADER, P as PERLIN_4D } from '../organicParticlesShaders-seZq7jYX.cjs';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
6
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
7
|
+
import { b as OrganicSphereConfig, O as OrganicParticlesConfig } from '../particlesConfig-0YbdPOdY.cjs';
|
|
8
|
+
export { B as BandReactivity, D as DEFAULT_ORGANIC_PARTICLES_CONFIG, a as DEFAULT_ORGANIC_SPHERE_CONFIG, r as resolveOrganicParticlesConfig, c as resolveOrganicSphereConfig } from '../particlesConfig-0YbdPOdY.cjs';
|
|
6
9
|
import 'ai';
|
|
7
10
|
|
|
8
11
|
/**
|
package/dist/native/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { B as BaseVoiceConversationOptions, a as BaseVoiceConversationResult
|
|
3
|
-
|
|
2
|
+
import { B as BaseVoiceConversationOptions, a as BaseVoiceConversationResult } from '../types-Bfhu-aQH.js';
|
|
3
|
+
import { B as BaseChatConversationOptions, a as BaseChatConversationResult } from '../organicParticlesShaders-seZq7jYX.js';
|
|
4
|
+
export { C as ChatClientToolFn, b as ChatConversationStatus, c as ChatToolDescriptor, O as ORGANIC_PARTICLES_FRAGMENT_SHADER, d as ORGANIC_PARTICLES_VERTEX_SHADER, e as ORGANIC_SPHERE_FRAGMENT_SHADER, f as ORGANIC_SPHERE_VERTEX_SHADER, P as PERLIN_4D } from '../organicParticlesShaders-seZq7jYX.js';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
6
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
7
|
+
import { b as OrganicSphereConfig, O as OrganicParticlesConfig } from '../particlesConfig-0YbdPOdY.js';
|
|
8
|
+
export { B as BandReactivity, D as DEFAULT_ORGANIC_PARTICLES_CONFIG, a as DEFAULT_ORGANIC_SPHERE_CONFIG, r as resolveOrganicParticlesConfig, c as resolveOrganicSphereConfig } from '../particlesConfig-0YbdPOdY.js';
|
|
6
9
|
import 'ai';
|
|
7
10
|
|
|
8
11
|
/**
|
package/dist/native/index.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ORGANIC_PARTICLES_VERTEX_SHADER,
|
|
6
|
-
ORGANIC_SPHERE_FRAGMENT_SHADER,
|
|
7
|
-
ORGANIC_SPHERE_VERTEX_SHADER,
|
|
8
|
-
PERLIN_4D,
|
|
9
|
-
appendChatQuery,
|
|
2
|
+
appendChatQuery
|
|
3
|
+
} from "../chunk-TQOBJMEK.js";
|
|
4
|
+
import {
|
|
10
5
|
appendTranscriptLine,
|
|
11
6
|
buildSessionPayload,
|
|
12
7
|
createMemoryAddTool,
|
|
@@ -14,10 +9,19 @@ import {
|
|
|
14
9
|
createPostJson,
|
|
15
10
|
createTranscriptDisconnectHandler,
|
|
16
11
|
fetchSignedUrl,
|
|
17
|
-
resolveOrganicParticlesConfig,
|
|
18
|
-
resolveOrganicSphereConfig,
|
|
19
12
|
withProjectQuery
|
|
20
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-ZAW6F3YT.js";
|
|
14
|
+
import {
|
|
15
|
+
DEFAULT_ORGANIC_PARTICLES_CONFIG,
|
|
16
|
+
DEFAULT_ORGANIC_SPHERE_CONFIG,
|
|
17
|
+
ORGANIC_PARTICLES_FRAGMENT_SHADER,
|
|
18
|
+
ORGANIC_PARTICLES_VERTEX_SHADER,
|
|
19
|
+
ORGANIC_SPHERE_FRAGMENT_SHADER,
|
|
20
|
+
ORGANIC_SPHERE_VERTEX_SHADER,
|
|
21
|
+
PERLIN_4D,
|
|
22
|
+
resolveOrganicParticlesConfig,
|
|
23
|
+
resolveOrganicSphereConfig
|
|
24
|
+
} from "../chunk-BI6SL35K.js";
|
|
21
25
|
import "../chunk-Q3TJAJ54.js";
|
|
22
26
|
|
|
23
27
|
// src/native/ShogoVoiceProvider.tsx
|