@urun-sh/openai 0.6.45 → 0.6.46
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/dist/{chunk-5JTIJPFV.js → chunk-2AFSBZLN.js} +1 -1
- package/dist/{chunk-3QZYIRAL.js → chunk-CUO2JOW4.js} +5 -5
- package/dist/{chunk-GCQR62TJ.js → chunk-MJGUEL2U.js} +1 -1
- package/dist/{chunk-ZXQXOEVN.js → chunk-NCKEKCTI.js} +2 -2
- package/dist/{chunk-LNQW3VFC.js → chunk-U6TUJPC3.js} +21 -21
- package/dist/{chunk-NUPHEB3L.js → chunk-UOQP3DBT.js} +6 -6
- package/dist/{chunk-BMSZZYSZ.js → chunk-WWFK27D2.js} +1 -1
- package/dist/{composite-BXbbnmL2.d.ts → composite-D0ivH65M.d.ts} +7 -2
- package/dist/{composite-n3axzdCh.d.cts → composite-QilJ-Faj.d.cts} +25 -2
- package/dist/hosted/bin.cjs +41 -41
- package/dist/hosted/bin.js +1 -1
- package/dist/hosted/index.cjs +36 -36
- package/dist/hosted/index.d.cts +1 -1
- package/dist/hosted/index.d.ts +1 -1
- package/dist/hosted/index.js +1 -1
- package/dist/pi-extension/index.js +1 -1
- package/dist/pooler/bin.cjs +5 -5
- package/dist/pooler/bin.js +1 -1
- package/dist/proxy/cli.cjs +36 -36
- package/dist/proxy/cli.js +1 -1
- package/dist/proxy/index.cjs +19 -19
- package/dist/proxy/index.d.cts +21 -3
- package/dist/proxy/index.d.ts +5 -3
- package/dist/proxy/index.js +1 -1
- package/package.json +2 -2
package/dist/proxy/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server, IncomingMessage } from 'node:http';
|
|
2
|
-
import { h as ProxyHandlerOptions, P as ProxyClients, l as RealtimeCompanionsFor, k as RealtimeBinding, R as RealtimeAdmissionNotifier } from '../composite-
|
|
3
|
-
export { D as DialObserver, a as DialReport, O as OPENAI_REALTIME_PATH, f as OpenAIRealtimeOptions, g as OpenAIRealtimeResolver, i as ProxyIdentity, j as ProxyVideoOutLane, S as SessionGoneError, U as UnknownModelError, o as attachOpenAIRealtime } from '../composite-
|
|
2
|
+
import { h as ProxyHandlerOptions, P as ProxyClients, l as RealtimeCompanionsFor, k as RealtimeBinding, R as RealtimeAdmissionNotifier } from '../composite-QilJ-Faj.cjs';
|
|
3
|
+
export { D as DialObserver, a as DialReport, O as OPENAI_REALTIME_PATH, f as OpenAIRealtimeOptions, g as OpenAIRealtimeResolver, i as ProxyIdentity, j as ProxyVideoOutLane, S as SessionGoneError, U as UnknownModelError, o as attachOpenAIRealtime } from '../composite-QilJ-Faj.cjs';
|
|
4
4
|
export { h as GEMINI_LIVE_PATH, V as VIDEO_OUT_SETUP_KEY } from '../translator-C6MpaZS-.cjs';
|
|
5
5
|
import { WebSocket } from 'ws';
|
|
6
6
|
import '../models-D7F0bLJ3.cjs';
|
|
@@ -593,6 +593,19 @@ declare class OpenAIRealtimeConnection<S = unknown> {
|
|
|
593
593
|
* the turn is never retried on another session behind the bridge's back —
|
|
594
594
|
* the only honest moves are to say why and close.
|
|
595
595
|
*/
|
|
596
|
+
/**
|
|
597
|
+
* THE CREDITS CUTOFF TERMINAL CLOSE (2026-11): ONE `error` event naming
|
|
598
|
+
* `insufficient_credits` with the authored caller line, then the 1011
|
|
599
|
+
* close carrying the SAME code as its reason — the wire contract
|
|
600
|
+
* (error-event + close + teardown, the established session-gone shape).
|
|
601
|
+
* The sense SDKs treat this code as TERMINAL: no reconnect, no re-dial —
|
|
602
|
+
* the org is drained, and the redial storm against a drained org (the
|
|
603
|
+
* generic `session_gone` death the DB cut used to surface) is the defect
|
|
604
|
+
* this replaces. No reacquire happens on this connection: the binding's
|
|
605
|
+
* pinned session IS the one that was parked, and nothing re-picks a lane
|
|
606
|
+
* behind the bridge's back.
|
|
607
|
+
*/
|
|
608
|
+
private failInsufficientCredits;
|
|
596
609
|
private failSessionGone;
|
|
597
610
|
/**
|
|
598
611
|
* Classify ONE upstream turn failure (the dial throwing, or the stream
|
|
@@ -604,6 +617,11 @@ declare class OpenAIRealtimeConnection<S = unknown> {
|
|
|
604
617
|
* LOUDLY, pre- or post-content alike — and post-CANCEL alike: the
|
|
605
618
|
* bridge is orphaned either way, and a cancelled turn must never mute
|
|
606
619
|
* a dead pinned session (round-1 review, CodeRabbit + Greptile);
|
|
620
|
+
* the ONE special case is the CREDITS CAUSE (the structured park
|
|
621
|
+
* reason `credits_exhausted`, threaded from core Session.onPhase —
|
|
622
|
+
* the platform's own word): the terminal {@link failInsufficientCredits}
|
|
623
|
+
* close, so the client never sees a generic death it would redial
|
|
624
|
+
* into;
|
|
607
625
|
* - a CANCELLED turn suppresses every OTHER late fault (round-1 review):
|
|
608
626
|
* `response.cancel` does not abort a pending dial, and the dial's
|
|
609
627
|
* rejection settles AFTER `cancelled` was set — the lane's pre-#511
|
|
@@ -740,7 +758,7 @@ declare function realtimeModelOf(req: IncomingMessage): string | undefined;
|
|
|
740
758
|
* and the bridge opens — a refused upgrade admits nothing. On an stt row
|
|
741
759
|
* the intent is recorded on the binding (a transcription session).
|
|
742
760
|
*/
|
|
743
|
-
declare function realtimeBindingFor(clients: Pick<ProxyClients, 'sessionHandle' | 'createResponseOn'> & Partial<Pick<ProxyClients, 'supportsAudio' | 'openAudioOn' | 'openVideoOn' | 'supportsTranscription' | 'openTurnsOn' | 'transcriptStreamFor' | 'realtimeCompanionsFor' | 'releaseSessionHandle' | 'dedicatedSessionHandle' | 'endDedicatedSession' | 'realtimeBillingIdentityFor'>>, model: string | undefined, signal?: AbortSignal, intent?: string, onAdmission?: RealtimeAdmissionNotifier): Promise<RealtimeBinding<ProxyClients>>;
|
|
761
|
+
declare function realtimeBindingFor(clients: Pick<ProxyClients, 'sessionHandle' | 'createResponseOn'> & Partial<Pick<ProxyClients, 'supportsAudio' | 'openAudioOn' | 'openVideoOn' | 'supportsTranscription' | 'openTurnsOn' | 'transcriptStreamFor' | 'realtimeCompanionsFor' | 'releaseSessionHandle' | 'dedicatedSessionHandle' | 'endDedicatedSession' | 'onSessionEnd' | 'realtimeBillingIdentityFor'>>, model: string | undefined, signal?: AbortSignal, intent?: string, onAdmission?: RealtimeAdmissionNotifier): Promise<RealtimeBinding<ProxyClients>>;
|
|
744
762
|
/**
|
|
745
763
|
* The LOCAL lane resolver: fixed pooled clients, optional fixed apiKey (the
|
|
746
764
|
* same shared-secret rule the local Gemini Live lane applies — a mismatched
|
package/dist/proxy/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server, IncomingMessage } from 'node:http';
|
|
2
|
-
import { h as ProxyHandlerOptions, P as ProxyClients, l as RealtimeCompanionsFor, k as RealtimeBinding, R as RealtimeAdmissionNotifier } from '../composite-
|
|
3
|
-
export { D as DialObserver, a as DialReport, O as OPENAI_REALTIME_PATH, f as OpenAIRealtimeOptions, g as OpenAIRealtimeResolver, i as ProxyIdentity, j as ProxyVideoOutLane, S as SessionGoneError, U as UnknownModelError, o as attachOpenAIRealtime } from '../composite-
|
|
2
|
+
import { h as ProxyHandlerOptions, P as ProxyClients, l as RealtimeCompanionsFor, k as RealtimeBinding, R as RealtimeAdmissionNotifier } from '../composite-D0ivH65M.js';
|
|
3
|
+
export { D as DialObserver, a as DialReport, O as OPENAI_REALTIME_PATH, f as OpenAIRealtimeOptions, g as OpenAIRealtimeResolver, i as ProxyIdentity, j as ProxyVideoOutLane, S as SessionGoneError, U as UnknownModelError, o as attachOpenAIRealtime } from '../composite-D0ivH65M.js';
|
|
4
4
|
export { h as GEMINI_LIVE_PATH, V as VIDEO_OUT_SETUP_KEY } from '../translator-CaOqL-V8.js';
|
|
5
5
|
import { WebSocket } from 'ws';
|
|
6
6
|
import '../models-D7F0bLJ3.js';
|
|
@@ -177,6 +177,8 @@ declare class OpenAIRealtimeConnection<S = unknown> {
|
|
|
177
177
|
private doneResponse;
|
|
178
178
|
private upstreamErrorBody;
|
|
179
179
|
|
|
180
|
+
|
|
181
|
+
private failInsufficientCredits;
|
|
180
182
|
private failSessionGone;
|
|
181
183
|
|
|
182
184
|
private upstreamTurnFault;
|
|
@@ -197,7 +199,7 @@ declare class OpenAIRealtimeConnection<S = unknown> {
|
|
|
197
199
|
|
|
198
200
|
declare function realtimeModelOf(req: IncomingMessage): string | undefined;
|
|
199
201
|
|
|
200
|
-
declare function realtimeBindingFor(clients: Pick<ProxyClients, 'sessionHandle' | 'createResponseOn'> & Partial<Pick<ProxyClients, 'supportsAudio' | 'openAudioOn' | 'openVideoOn' | 'supportsTranscription' | 'openTurnsOn' | 'transcriptStreamFor' | 'realtimeCompanionsFor' | 'releaseSessionHandle' | 'dedicatedSessionHandle' | 'endDedicatedSession' | 'realtimeBillingIdentityFor'>>, model: string | undefined, signal?: AbortSignal, intent?: string, onAdmission?: RealtimeAdmissionNotifier): Promise<RealtimeBinding<ProxyClients>>;
|
|
202
|
+
declare function realtimeBindingFor(clients: Pick<ProxyClients, 'sessionHandle' | 'createResponseOn'> & Partial<Pick<ProxyClients, 'supportsAudio' | 'openAudioOn' | 'openVideoOn' | 'supportsTranscription' | 'openTurnsOn' | 'transcriptStreamFor' | 'realtimeCompanionsFor' | 'releaseSessionHandle' | 'dedicatedSessionHandle' | 'endDedicatedSession' | 'onSessionEnd' | 'realtimeBillingIdentityFor'>>, model: string | undefined, signal?: AbortSignal, intent?: string, onAdmission?: RealtimeAdmissionNotifier): Promise<RealtimeBinding<ProxyClients>>;
|
|
201
203
|
|
|
202
204
|
declare function fixedClientsResolver(clients: ProxyClients, apiKey?: string, realtimeCompanions?: RealtimeCompanionsFor): {
|
|
203
205
|
resolve(req: IncomingMessage, signal?: AbortSignal, onAdmission?: RealtimeAdmissionNotifier): Promise<RealtimeBinding<ProxyClients>>;
|
package/dist/proxy/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as I,a as n,b as p,c as m,k as l,l as a,m as x,o as s,r as O,s as f}from"../chunk-
|
|
1
|
+
import{F as I,a as n,b as p,c as m,k as l,l as a,m as x,o as s,r as O,s as f}from"../chunk-U6TUJPC3.js";import{a as o,h as t}from"../chunk-X5BLQXHK.js";import"../chunk-64VO62LW.js";import"../chunk-2AFSBZLN.js";import{i as r,j as i}from"../chunk-CUO2JOW4.js";import{c as e}from"../chunk-YSFSRI3D.js";e();export{o as GEMINI_LIVE_PATH,a as OPENAI_REALTIME_PATH,l as OpenAIRealtimeConnection,n as ResumptionRegistry,i as SessionGoneError,r as UnknownModelError,t as VIDEO_OUT_SETUP_KEY,p as attachGeminiLive,x as attachOpenAIRealtime,I as createOpenAIProxy,f as fixedClientsResolver,O as realtimeBindingFor,s as realtimeModelOf,m as serveGeminiLiveSocket};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urun-sh/openai",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.46",
|
|
4
4
|
"description": "OpenAI-compatible Realtime + Responses SDK over uRun session primitives (not websockets).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"build:bin": "bun build --compile --external @roamhq/wrtc src/proxy/bin.ts --outfile dist/bin/urun-openai && node scripts/assert-bin-transport.mjs"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@urun-sh/core": "^0.6.
|
|
73
|
+
"@urun-sh/core": "^0.6.46"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@prometheus-io/client": "^0.16.1",
|