@prestyj/voice 4.3.191

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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +79 -0
  3. package/dist/bridges/ezboss.cjs +96 -0
  4. package/dist/bridges/ezboss.cjs.map +1 -0
  5. package/dist/bridges/ezboss.d.cts +13 -0
  6. package/dist/bridges/ezboss.d.ts +13 -0
  7. package/dist/bridges/ezboss.js +70 -0
  8. package/dist/bridges/ezboss.js.map +1 -0
  9. package/dist/bridges/ezcoder-rpc.cjs +128 -0
  10. package/dist/bridges/ezcoder-rpc.cjs.map +1 -0
  11. package/dist/bridges/ezcoder-rpc.d.cts +18 -0
  12. package/dist/bridges/ezcoder-rpc.d.ts +18 -0
  13. package/dist/bridges/ezcoder-rpc.js +101 -0
  14. package/dist/bridges/ezcoder-rpc.js.map +1 -0
  15. package/dist/chunk-VJ6MPV2Z.js +225 -0
  16. package/dist/chunk-VJ6MPV2Z.js.map +1 -0
  17. package/dist/chunk-YLNKQ7CC.js +234 -0
  18. package/dist/chunk-YLNKQ7CC.js.map +1 -0
  19. package/dist/index.cjs +357 -0
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.d.cts +90 -0
  22. package/dist/index.d.ts +90 -0
  23. package/dist/index.js +109 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/providers/openai-codex-realtime.cjs +362 -0
  26. package/dist/providers/openai-codex-realtime.cjs.map +1 -0
  27. package/dist/providers/openai-codex-realtime.d.cts +15 -0
  28. package/dist/providers/openai-codex-realtime.d.ts +15 -0
  29. package/dist/providers/openai-codex-realtime.js +31 -0
  30. package/dist/providers/openai-codex-realtime.js.map +1 -0
  31. package/dist/providers/openai-realtime.cjs +342 -0
  32. package/dist/providers/openai-realtime.cjs.map +1 -0
  33. package/dist/providers/openai-realtime.d.cts +34 -0
  34. package/dist/providers/openai-realtime.d.ts +34 -0
  35. package/dist/providers/openai-realtime.js +12 -0
  36. package/dist/providers/openai-realtime.js.map +1 -0
  37. package/dist/types-Dc4Q3Z6X.d.cts +257 -0
  38. package/dist/types-Dc4Q3Z6X.d.ts +257 -0
  39. package/package.json +63 -0
@@ -0,0 +1,257 @@
1
+ type JsonObject = Record<string, unknown>;
2
+ type VoiceConnectionState = "idle" | "connecting" | "connected" | "closing" | "closed";
3
+ interface VoiceSessionMetadata {
4
+ readonly sessionId?: string;
5
+ readonly conversationId?: string;
6
+ readonly provider?: string;
7
+ readonly model?: string;
8
+ readonly createdAt?: string;
9
+ }
10
+ interface VoiceAuthConfig {
11
+ readonly apiKey?: string;
12
+ readonly ephemeralKey?: string;
13
+ readonly accessToken?: string;
14
+ readonly baseUrl?: string;
15
+ readonly headers?: Readonly<Record<string, string>>;
16
+ }
17
+ interface VoiceSessionConfig {
18
+ readonly model: string;
19
+ readonly instructions?: string;
20
+ readonly voice?: string;
21
+ readonly modalities?: readonly ("audio" | "text")[];
22
+ readonly inputAudioFormat?: string;
23
+ readonly outputAudioFormat?: string;
24
+ readonly turnDetection?: JsonObject | null;
25
+ readonly tools?: readonly VoiceTool[];
26
+ readonly metadata?: Readonly<Record<string, string>>;
27
+ }
28
+ interface VoiceProviderConnectOptions {
29
+ readonly auth?: VoiceAuthConfig;
30
+ readonly session: VoiceSessionConfig;
31
+ readonly transport?: VoiceTransport;
32
+ readonly signal?: AbortSignal;
33
+ }
34
+ interface VoiceProvider {
35
+ readonly name: string;
36
+ connect(options: VoiceProviderConnectOptions): Promise<VoiceSession>;
37
+ }
38
+ interface VoiceSession {
39
+ readonly id: string;
40
+ readonly provider: string;
41
+ readonly state: VoiceConnectionState;
42
+ readonly metadata: VoiceSessionMetadata;
43
+ onEvent(handler: VoiceEventHandler): () => void;
44
+ sendAudio(chunk: AudioInputChunk, signal?: AbortSignal): Promise<void>;
45
+ sendText(text: string, signal?: AbortSignal): Promise<void>;
46
+ sendToolResult(result: VoiceToolResult, signal?: AbortSignal): Promise<void>;
47
+ updateConfig(config: Partial<VoiceSessionConfig>, signal?: AbortSignal): Promise<void>;
48
+ close(reason?: string): Promise<void>;
49
+ }
50
+ type VoiceEventHandler = (event: VoiceEvent) => void;
51
+ interface AudioInputChunk {
52
+ readonly data: ArrayBuffer | Uint8Array | string;
53
+ readonly format?: string;
54
+ readonly sampleRate?: number;
55
+ readonly channels?: number;
56
+ readonly timestampMs?: number;
57
+ }
58
+ interface AudioOutputChunk {
59
+ readonly data: ArrayBuffer | Uint8Array | string;
60
+ readonly format?: string;
61
+ readonly sampleRate?: number;
62
+ readonly channels?: number;
63
+ readonly timestampMs?: number;
64
+ }
65
+ interface VoiceSessionStartedEvent {
66
+ readonly type: "session_started";
67
+ readonly session: VoiceSessionMetadata;
68
+ }
69
+ interface VoiceInputTranscriptDeltaEvent {
70
+ readonly type: "input_transcript_delta";
71
+ readonly delta: string;
72
+ readonly itemId?: string;
73
+ }
74
+ interface VoiceInputTranscriptDoneEvent {
75
+ readonly type: "input_transcript_done";
76
+ readonly text: string;
77
+ readonly itemId?: string;
78
+ }
79
+ interface VoiceOutputTextDeltaEvent {
80
+ readonly type: "output_text_delta";
81
+ readonly delta: string;
82
+ readonly itemId?: string;
83
+ }
84
+ interface VoiceOutputTextDoneEvent {
85
+ readonly type: "output_text_done";
86
+ readonly text: string;
87
+ readonly itemId?: string;
88
+ }
89
+ interface VoiceOutputAudioStartedEvent {
90
+ readonly type: "output_audio_started";
91
+ readonly itemId?: string;
92
+ }
93
+ interface VoiceOutputAudioDeltaEvent {
94
+ readonly type: "output_audio_delta";
95
+ readonly chunk: AudioOutputChunk;
96
+ readonly itemId?: string;
97
+ }
98
+ interface VoiceOutputAudioDoneEvent {
99
+ readonly type: "output_audio_done";
100
+ readonly itemId?: string;
101
+ }
102
+ interface VoiceToolCallEvent {
103
+ readonly type: "tool_call";
104
+ readonly call: VoiceToolCall;
105
+ }
106
+ interface VoiceToolResultSentEvent {
107
+ readonly type: "tool_result_sent";
108
+ readonly result: VoiceToolResult;
109
+ }
110
+ interface VoiceErrorEvent {
111
+ readonly type: "error";
112
+ readonly error: Error;
113
+ readonly recoverable: boolean;
114
+ }
115
+ interface VoiceClosedEvent {
116
+ readonly type: "closed";
117
+ readonly reason?: string;
118
+ }
119
+ type VoiceEvent = VoiceSessionStartedEvent | VoiceInputTranscriptDeltaEvent | VoiceInputTranscriptDoneEvent | VoiceOutputTextDeltaEvent | VoiceOutputTextDoneEvent | VoiceOutputAudioStartedEvent | VoiceOutputAudioDeltaEvent | VoiceOutputAudioDoneEvent | VoiceToolCallEvent | VoiceToolResultSentEvent | VoiceErrorEvent | VoiceClosedEvent;
120
+ interface RealtimeFunctionToolDefinition {
121
+ readonly type: "function";
122
+ readonly name: string;
123
+ readonly description: string;
124
+ readonly parameters: JsonObject;
125
+ }
126
+ type ToolConfirmationPolicy = "never" | "always" | "destructive" | ((request: ToolConfirmationRequest) => ToolConfirmationDecision | Promise<ToolConfirmationDecision>);
127
+ interface ToolConfirmationRequest {
128
+ readonly call: VoiceToolCall;
129
+ readonly tool: VoiceTool;
130
+ }
131
+ type ToolConfirmationDecision = {
132
+ readonly approved: true;
133
+ } | {
134
+ readonly approved: false;
135
+ readonly reason: string;
136
+ };
137
+ type ToolConfirmationResolver = (request: ToolConfirmationRequest) => ToolConfirmationDecision | Promise<ToolConfirmationDecision>;
138
+ interface VoiceToolContext {
139
+ readonly signal: AbortSignal;
140
+ readonly toolCallId: string;
141
+ readonly confirmation?: ToolConfirmationResolver;
142
+ readonly onUpdate?: (update: unknown) => void;
143
+ }
144
+ interface VoiceTool {
145
+ readonly name: string;
146
+ readonly description: string;
147
+ readonly parameters: JsonObject;
148
+ readonly confirmation?: ToolConfirmationPolicy;
149
+ readonly destructive?: boolean;
150
+ execute?(args: JsonObject, context: VoiceToolContext): VoiceToolExecutionResult | Promise<VoiceToolExecutionResult>;
151
+ }
152
+ interface VoiceToolCall {
153
+ readonly id: string;
154
+ readonly name: string;
155
+ readonly args: JsonObject;
156
+ readonly providerCallId?: string;
157
+ readonly raw?: unknown;
158
+ }
159
+ type VoiceToolExecutionResult = string | JsonObject | readonly JsonObject[];
160
+ interface VoiceToolResult {
161
+ readonly toolCallId: string;
162
+ readonly name: string;
163
+ readonly content: VoiceToolExecutionResult;
164
+ readonly isError?: boolean;
165
+ }
166
+ interface VoiceToolExecutionError {
167
+ readonly type: "tool_not_found" | "tool_confirmation_denied" | "tool_execution_failed";
168
+ readonly message: string;
169
+ readonly cause?: unknown;
170
+ }
171
+ interface VoiceTransportConnectOptions {
172
+ readonly auth?: VoiceAuthConfig;
173
+ readonly session: VoiceSessionConfig;
174
+ readonly signal?: AbortSignal;
175
+ }
176
+ interface VoiceTransport {
177
+ readonly kind: "webrtc" | "websocket" | "custom";
178
+ connect(options: VoiceTransportConnectOptions): Promise<void>;
179
+ onEvent(handler: VoiceTransportEventHandler): () => void;
180
+ send(event: VoiceTransportSendEvent, signal?: AbortSignal): Promise<void>;
181
+ close(reason?: string): Promise<void>;
182
+ }
183
+ type VoiceTransportEventHandler = (event: VoiceTransportEvent) => void;
184
+ type VoiceTransportSendEvent = {
185
+ readonly type: "audio";
186
+ readonly chunk: AudioInputChunk;
187
+ } | {
188
+ readonly type: "text";
189
+ readonly text: string;
190
+ } | {
191
+ readonly type: "tool_result";
192
+ readonly result: VoiceToolResult;
193
+ } | {
194
+ readonly type: "config";
195
+ readonly config: Partial<VoiceSessionConfig>;
196
+ };
197
+ type VoiceTransportEvent = VoiceEvent | {
198
+ readonly type: "raw";
199
+ readonly data: unknown;
200
+ };
201
+ type VoiceBridgeCommand = {
202
+ readonly type: "prompt";
203
+ readonly text: string;
204
+ readonly sessionId?: string;
205
+ readonly project?: string;
206
+ } | {
207
+ readonly type: "cancel";
208
+ readonly sessionId?: string;
209
+ } | {
210
+ readonly type: "status";
211
+ readonly sessionId?: string;
212
+ } | {
213
+ readonly type: "new_session";
214
+ readonly project?: string;
215
+ } | {
216
+ readonly type: "switch_project";
217
+ readonly project: string;
218
+ } | {
219
+ readonly type: "switch_model";
220
+ readonly provider: string;
221
+ readonly model: string;
222
+ } | {
223
+ readonly type: "list_projects";
224
+ };
225
+ type VoiceBridgeEvent = {
226
+ readonly type: "text_delta";
227
+ readonly text: string;
228
+ readonly sessionId?: string;
229
+ } | {
230
+ readonly type: "tool_start";
231
+ readonly name: string;
232
+ readonly id?: string;
233
+ readonly sessionId?: string;
234
+ } | {
235
+ readonly type: "tool_end";
236
+ readonly name: string;
237
+ readonly id?: string;
238
+ readonly isError?: boolean;
239
+ readonly sessionId?: string;
240
+ } | {
241
+ readonly type: "task_dispatch";
242
+ readonly workerId?: string;
243
+ readonly text: string;
244
+ } | {
245
+ readonly type: "completion";
246
+ readonly sessionId?: string;
247
+ } | {
248
+ readonly type: "status";
249
+ readonly status: JsonObject;
250
+ readonly sessionId?: string;
251
+ } | {
252
+ readonly type: "error";
253
+ readonly error: string;
254
+ readonly sessionId?: string;
255
+ };
256
+
257
+ export type { AudioInputChunk as A, JsonObject as J, RealtimeFunctionToolDefinition as R, ToolConfirmationDecision as T, VoiceTransport as V, VoiceSessionMetadata as a, VoiceToolResult as b, VoiceSessionConfig as c, VoiceSession as d, VoiceTool as e, VoiceToolCall as f, VoiceToolContext as g, VoiceProvider as h, VoiceEvent as i, VoiceProviderConnectOptions as j, AudioOutputChunk as k, ToolConfirmationPolicy as l, ToolConfirmationRequest as m, ToolConfirmationResolver as n, VoiceAuthConfig as o, VoiceBridgeCommand as p, VoiceBridgeEvent as q, VoiceConnectionState as r, VoiceEventHandler as s, VoiceToolExecutionError as t, VoiceToolExecutionResult as u, VoiceTransportConnectOptions as v, VoiceTransportEvent as w, VoiceTransportEventHandler as x, VoiceTransportSendEvent as y };
@@ -0,0 +1,257 @@
1
+ type JsonObject = Record<string, unknown>;
2
+ type VoiceConnectionState = "idle" | "connecting" | "connected" | "closing" | "closed";
3
+ interface VoiceSessionMetadata {
4
+ readonly sessionId?: string;
5
+ readonly conversationId?: string;
6
+ readonly provider?: string;
7
+ readonly model?: string;
8
+ readonly createdAt?: string;
9
+ }
10
+ interface VoiceAuthConfig {
11
+ readonly apiKey?: string;
12
+ readonly ephemeralKey?: string;
13
+ readonly accessToken?: string;
14
+ readonly baseUrl?: string;
15
+ readonly headers?: Readonly<Record<string, string>>;
16
+ }
17
+ interface VoiceSessionConfig {
18
+ readonly model: string;
19
+ readonly instructions?: string;
20
+ readonly voice?: string;
21
+ readonly modalities?: readonly ("audio" | "text")[];
22
+ readonly inputAudioFormat?: string;
23
+ readonly outputAudioFormat?: string;
24
+ readonly turnDetection?: JsonObject | null;
25
+ readonly tools?: readonly VoiceTool[];
26
+ readonly metadata?: Readonly<Record<string, string>>;
27
+ }
28
+ interface VoiceProviderConnectOptions {
29
+ readonly auth?: VoiceAuthConfig;
30
+ readonly session: VoiceSessionConfig;
31
+ readonly transport?: VoiceTransport;
32
+ readonly signal?: AbortSignal;
33
+ }
34
+ interface VoiceProvider {
35
+ readonly name: string;
36
+ connect(options: VoiceProviderConnectOptions): Promise<VoiceSession>;
37
+ }
38
+ interface VoiceSession {
39
+ readonly id: string;
40
+ readonly provider: string;
41
+ readonly state: VoiceConnectionState;
42
+ readonly metadata: VoiceSessionMetadata;
43
+ onEvent(handler: VoiceEventHandler): () => void;
44
+ sendAudio(chunk: AudioInputChunk, signal?: AbortSignal): Promise<void>;
45
+ sendText(text: string, signal?: AbortSignal): Promise<void>;
46
+ sendToolResult(result: VoiceToolResult, signal?: AbortSignal): Promise<void>;
47
+ updateConfig(config: Partial<VoiceSessionConfig>, signal?: AbortSignal): Promise<void>;
48
+ close(reason?: string): Promise<void>;
49
+ }
50
+ type VoiceEventHandler = (event: VoiceEvent) => void;
51
+ interface AudioInputChunk {
52
+ readonly data: ArrayBuffer | Uint8Array | string;
53
+ readonly format?: string;
54
+ readonly sampleRate?: number;
55
+ readonly channels?: number;
56
+ readonly timestampMs?: number;
57
+ }
58
+ interface AudioOutputChunk {
59
+ readonly data: ArrayBuffer | Uint8Array | string;
60
+ readonly format?: string;
61
+ readonly sampleRate?: number;
62
+ readonly channels?: number;
63
+ readonly timestampMs?: number;
64
+ }
65
+ interface VoiceSessionStartedEvent {
66
+ readonly type: "session_started";
67
+ readonly session: VoiceSessionMetadata;
68
+ }
69
+ interface VoiceInputTranscriptDeltaEvent {
70
+ readonly type: "input_transcript_delta";
71
+ readonly delta: string;
72
+ readonly itemId?: string;
73
+ }
74
+ interface VoiceInputTranscriptDoneEvent {
75
+ readonly type: "input_transcript_done";
76
+ readonly text: string;
77
+ readonly itemId?: string;
78
+ }
79
+ interface VoiceOutputTextDeltaEvent {
80
+ readonly type: "output_text_delta";
81
+ readonly delta: string;
82
+ readonly itemId?: string;
83
+ }
84
+ interface VoiceOutputTextDoneEvent {
85
+ readonly type: "output_text_done";
86
+ readonly text: string;
87
+ readonly itemId?: string;
88
+ }
89
+ interface VoiceOutputAudioStartedEvent {
90
+ readonly type: "output_audio_started";
91
+ readonly itemId?: string;
92
+ }
93
+ interface VoiceOutputAudioDeltaEvent {
94
+ readonly type: "output_audio_delta";
95
+ readonly chunk: AudioOutputChunk;
96
+ readonly itemId?: string;
97
+ }
98
+ interface VoiceOutputAudioDoneEvent {
99
+ readonly type: "output_audio_done";
100
+ readonly itemId?: string;
101
+ }
102
+ interface VoiceToolCallEvent {
103
+ readonly type: "tool_call";
104
+ readonly call: VoiceToolCall;
105
+ }
106
+ interface VoiceToolResultSentEvent {
107
+ readonly type: "tool_result_sent";
108
+ readonly result: VoiceToolResult;
109
+ }
110
+ interface VoiceErrorEvent {
111
+ readonly type: "error";
112
+ readonly error: Error;
113
+ readonly recoverable: boolean;
114
+ }
115
+ interface VoiceClosedEvent {
116
+ readonly type: "closed";
117
+ readonly reason?: string;
118
+ }
119
+ type VoiceEvent = VoiceSessionStartedEvent | VoiceInputTranscriptDeltaEvent | VoiceInputTranscriptDoneEvent | VoiceOutputTextDeltaEvent | VoiceOutputTextDoneEvent | VoiceOutputAudioStartedEvent | VoiceOutputAudioDeltaEvent | VoiceOutputAudioDoneEvent | VoiceToolCallEvent | VoiceToolResultSentEvent | VoiceErrorEvent | VoiceClosedEvent;
120
+ interface RealtimeFunctionToolDefinition {
121
+ readonly type: "function";
122
+ readonly name: string;
123
+ readonly description: string;
124
+ readonly parameters: JsonObject;
125
+ }
126
+ type ToolConfirmationPolicy = "never" | "always" | "destructive" | ((request: ToolConfirmationRequest) => ToolConfirmationDecision | Promise<ToolConfirmationDecision>);
127
+ interface ToolConfirmationRequest {
128
+ readonly call: VoiceToolCall;
129
+ readonly tool: VoiceTool;
130
+ }
131
+ type ToolConfirmationDecision = {
132
+ readonly approved: true;
133
+ } | {
134
+ readonly approved: false;
135
+ readonly reason: string;
136
+ };
137
+ type ToolConfirmationResolver = (request: ToolConfirmationRequest) => ToolConfirmationDecision | Promise<ToolConfirmationDecision>;
138
+ interface VoiceToolContext {
139
+ readonly signal: AbortSignal;
140
+ readonly toolCallId: string;
141
+ readonly confirmation?: ToolConfirmationResolver;
142
+ readonly onUpdate?: (update: unknown) => void;
143
+ }
144
+ interface VoiceTool {
145
+ readonly name: string;
146
+ readonly description: string;
147
+ readonly parameters: JsonObject;
148
+ readonly confirmation?: ToolConfirmationPolicy;
149
+ readonly destructive?: boolean;
150
+ execute?(args: JsonObject, context: VoiceToolContext): VoiceToolExecutionResult | Promise<VoiceToolExecutionResult>;
151
+ }
152
+ interface VoiceToolCall {
153
+ readonly id: string;
154
+ readonly name: string;
155
+ readonly args: JsonObject;
156
+ readonly providerCallId?: string;
157
+ readonly raw?: unknown;
158
+ }
159
+ type VoiceToolExecutionResult = string | JsonObject | readonly JsonObject[];
160
+ interface VoiceToolResult {
161
+ readonly toolCallId: string;
162
+ readonly name: string;
163
+ readonly content: VoiceToolExecutionResult;
164
+ readonly isError?: boolean;
165
+ }
166
+ interface VoiceToolExecutionError {
167
+ readonly type: "tool_not_found" | "tool_confirmation_denied" | "tool_execution_failed";
168
+ readonly message: string;
169
+ readonly cause?: unknown;
170
+ }
171
+ interface VoiceTransportConnectOptions {
172
+ readonly auth?: VoiceAuthConfig;
173
+ readonly session: VoiceSessionConfig;
174
+ readonly signal?: AbortSignal;
175
+ }
176
+ interface VoiceTransport {
177
+ readonly kind: "webrtc" | "websocket" | "custom";
178
+ connect(options: VoiceTransportConnectOptions): Promise<void>;
179
+ onEvent(handler: VoiceTransportEventHandler): () => void;
180
+ send(event: VoiceTransportSendEvent, signal?: AbortSignal): Promise<void>;
181
+ close(reason?: string): Promise<void>;
182
+ }
183
+ type VoiceTransportEventHandler = (event: VoiceTransportEvent) => void;
184
+ type VoiceTransportSendEvent = {
185
+ readonly type: "audio";
186
+ readonly chunk: AudioInputChunk;
187
+ } | {
188
+ readonly type: "text";
189
+ readonly text: string;
190
+ } | {
191
+ readonly type: "tool_result";
192
+ readonly result: VoiceToolResult;
193
+ } | {
194
+ readonly type: "config";
195
+ readonly config: Partial<VoiceSessionConfig>;
196
+ };
197
+ type VoiceTransportEvent = VoiceEvent | {
198
+ readonly type: "raw";
199
+ readonly data: unknown;
200
+ };
201
+ type VoiceBridgeCommand = {
202
+ readonly type: "prompt";
203
+ readonly text: string;
204
+ readonly sessionId?: string;
205
+ readonly project?: string;
206
+ } | {
207
+ readonly type: "cancel";
208
+ readonly sessionId?: string;
209
+ } | {
210
+ readonly type: "status";
211
+ readonly sessionId?: string;
212
+ } | {
213
+ readonly type: "new_session";
214
+ readonly project?: string;
215
+ } | {
216
+ readonly type: "switch_project";
217
+ readonly project: string;
218
+ } | {
219
+ readonly type: "switch_model";
220
+ readonly provider: string;
221
+ readonly model: string;
222
+ } | {
223
+ readonly type: "list_projects";
224
+ };
225
+ type VoiceBridgeEvent = {
226
+ readonly type: "text_delta";
227
+ readonly text: string;
228
+ readonly sessionId?: string;
229
+ } | {
230
+ readonly type: "tool_start";
231
+ readonly name: string;
232
+ readonly id?: string;
233
+ readonly sessionId?: string;
234
+ } | {
235
+ readonly type: "tool_end";
236
+ readonly name: string;
237
+ readonly id?: string;
238
+ readonly isError?: boolean;
239
+ readonly sessionId?: string;
240
+ } | {
241
+ readonly type: "task_dispatch";
242
+ readonly workerId?: string;
243
+ readonly text: string;
244
+ } | {
245
+ readonly type: "completion";
246
+ readonly sessionId?: string;
247
+ } | {
248
+ readonly type: "status";
249
+ readonly status: JsonObject;
250
+ readonly sessionId?: string;
251
+ } | {
252
+ readonly type: "error";
253
+ readonly error: string;
254
+ readonly sessionId?: string;
255
+ };
256
+
257
+ export type { AudioInputChunk as A, JsonObject as J, RealtimeFunctionToolDefinition as R, ToolConfirmationDecision as T, VoiceTransport as V, VoiceSessionMetadata as a, VoiceToolResult as b, VoiceSessionConfig as c, VoiceSession as d, VoiceTool as e, VoiceToolCall as f, VoiceToolContext as g, VoiceProvider as h, VoiceEvent as i, VoiceProviderConnectOptions as j, AudioOutputChunk as k, ToolConfirmationPolicy as l, ToolConfirmationRequest as m, ToolConfirmationResolver as n, VoiceAuthConfig as o, VoiceBridgeCommand as p, VoiceBridgeEvent as q, VoiceConnectionState as r, VoiceEventHandler as s, VoiceToolExecutionError as t, VoiceToolExecutionResult as u, VoiceTransportConnectOptions as v, VoiceTransportEvent as w, VoiceTransportEventHandler as x, VoiceTransportSendEvent as y };
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@prestyj/voice",
3
+ "version": "4.3.191",
4
+ "type": "module",
5
+ "description": "Provider-agnostic realtime voice orchestration for EZ tools and agents",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Gahroot/ezcoder.git",
10
+ "directory": "packages/voice"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs"
17
+ },
18
+ "./providers/openai-realtime": {
19
+ "types": "./dist/providers/openai-realtime.d.ts",
20
+ "import": "./dist/providers/openai-realtime.js",
21
+ "require": "./dist/providers/openai-realtime.cjs"
22
+ },
23
+ "./providers/openai-codex-realtime": {
24
+ "types": "./dist/providers/openai-codex-realtime.d.ts",
25
+ "import": "./dist/providers/openai-codex-realtime.js",
26
+ "require": "./dist/providers/openai-codex-realtime.cjs"
27
+ },
28
+ "./bridges/ezcoder-rpc": {
29
+ "types": "./dist/bridges/ezcoder-rpc.d.ts",
30
+ "import": "./dist/bridges/ezcoder-rpc.js",
31
+ "require": "./dist/bridges/ezcoder-rpc.cjs"
32
+ },
33
+ "./bridges/ezboss": {
34
+ "types": "./dist/bridges/ezboss.d.ts",
35
+ "import": "./dist/bridges/ezboss.js",
36
+ "require": "./dist/bridges/ezboss.cjs"
37
+ }
38
+ },
39
+ "main": "./dist/index.cjs",
40
+ "module": "./dist/index.js",
41
+ "types": "./dist/index.d.ts",
42
+ "files": [
43
+ "dist",
44
+ "README.md"
45
+ ],
46
+ "dependencies": {
47
+ "zod": "^4.4.3",
48
+ "@prestyj/agent": "4.3.207",
49
+ "@prestyj/ai": "4.3.207"
50
+ },
51
+ "devDependencies": {
52
+ "typescript": "^6.0.3",
53
+ "vitest": "^4.1.4"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "scripts": {
59
+ "build": "tsup",
60
+ "check": "tsc --noEmit",
61
+ "test": "vitest run"
62
+ }
63
+ }