@urun-sh/openai 0.6.31 → 0.6.33

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 (49) hide show
  1. package/dist/chunk-7D2HMQFC.js +2 -0
  2. package/dist/chunk-CAR4AEQJ.js +1 -0
  3. package/dist/{chunk-76BZLCGT.js → chunk-GL7EWL3V.js} +1 -1
  4. package/dist/chunk-GR3UAW6P.js +60 -0
  5. package/dist/chunk-L6HTHDVV.js +1 -0
  6. package/dist/chunk-LM4E5YM2.js +19 -0
  7. package/dist/chunk-NL3UBLXV.js +6 -0
  8. package/dist/chunk-NN6TQQUG.js +1 -0
  9. package/dist/chunk-OOCRI7ZM.js +6 -0
  10. package/dist/chunk-PAYCMH5F.js +1 -0
  11. package/dist/chunk-PBKCUSTI.js +17 -0
  12. package/dist/{responses-turn-DXrwiPJh.d.cts → composite-CwfOOT0b.d.cts} +548 -309
  13. package/dist/{responses-turn-BGb_XPOa.d.ts → composite-D9VDruCV.d.ts} +127 -83
  14. package/dist/gemini-live.cjs +2 -2
  15. package/dist/gemini-live.d.cts +85 -105
  16. package/dist/gemini-live.d.ts +48 -48
  17. package/dist/gemini-live.js +1 -1
  18. package/dist/hosted/bin.cjs +56 -42
  19. package/dist/hosted/bin.js +4 -22
  20. package/dist/hosted/index.cjs +52 -38
  21. package/dist/hosted/index.d.cts +243 -19
  22. package/dist/hosted/index.d.ts +120 -4
  23. package/dist/hosted/index.js +1 -1
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.d.cts +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/{models-DUdx_Y6X.d.cts → models-D7F0bLJ3.d.cts} +14 -0
  29. package/dist/{models-DUdx_Y6X.d.ts → models-D7F0bLJ3.d.ts} +6 -0
  30. package/dist/pi-extension/index.cjs +6 -6
  31. package/dist/pi-extension/index.js +1 -1
  32. package/dist/pi-extension/standalone.cjs +33 -33
  33. package/dist/pooler/bin.cjs +335 -0
  34. package/dist/pooler/bin.js +316 -0
  35. package/dist/proxy/cli.cjs +58 -53
  36. package/dist/proxy/cli.js +1 -1
  37. package/dist/proxy/conformance-probe.cjs +1 -0
  38. package/dist/proxy/conformance-probe.js +1 -0
  39. package/dist/proxy/index.cjs +31 -28
  40. package/dist/proxy/index.d.cts +315 -167
  41. package/dist/proxy/index.d.ts +85 -53
  42. package/dist/proxy/index.js +1 -1
  43. package/package.json +14 -4
  44. package/dist/chunk-4MI2TNQS.js +0 -62
  45. package/dist/chunk-7SAW4IL4.js +0 -2
  46. package/dist/chunk-7V2JKPIG.js +0 -1
  47. package/dist/chunk-CUDFHFNX.js +0 -4
  48. package/dist/chunk-HZC2SKKI.js +0 -8
  49. package/dist/chunk-K23AZPI4.js +0 -1
@@ -3,111 +3,6 @@ import { b as UrunSessionLike } from './types-CHPtJx6d.cjs';
3
3
  export { L as LaneMessage, a as LaneToolCallDelta, U as UrunDocLike, c as UrunStreamLike } from './types-CHPtJx6d.cjs';
4
4
  export { A as AudioBackend, a as AudioBridge, b as AudioSink, c as AudioSource, N as NATIVE_AUDIO_SAMPLE_RATE, R as RT_VIDEO_IN_STREAM, d as RT_VIDEO_OUT_STREAM, V as VIDEO_FRAME_MESSAGE_BUDGET, e as VIDEO_OUT_DEFAULT_CODEC, f as VIDEO_OUT_FRAMING, g as VIDEO_OUT_WS_FRAMING, h as VideoFrameLane, i as VideoOutEndpoint, j as VideoOutLane, k as VideoOutRecord, l as VideoOutRecordHeader, m as VideoOutTransportSink, n as VideoOutWtConnect, o as VideoOutWtSession, p as consumeVideoOut, q as decodeVideoOutRecord, r as enableSessionAudio, s as enableSessionVideo, t as encodeVideoOutRecord, u as negotiateSessionVideoOutQuic, v as nodeAudioBackend, w as openSessionVideoOutLane, x as weriftAudioBackend } from './video-out-BsuLqlID.cjs';
5
5
 
6
- declare class SdkTransport {
7
- private readonly session;
8
- /** Test seam for the gate deadline; never an env knob or config surface. */
9
- private readonly docSyncTimeoutMs;
10
- /**
11
- * Session-affinity tag (urun-python #1556): every envelope this transport
12
- * writes carries the SAME stable tag, so the serve engine adapter can
13
- * continue the session's retained sequence state instead of re-prefilling
14
- * the whole conversation each turn. The uRun session id when the SDK
15
- * exposes it; otherwise minted ONCE here — one transport wraps exactly one
16
- * persistent session, so a per-transport tag identifies the session too.
17
- */
18
- private readonly sessionTag;
19
- /** The shipped gate deadline — the only production value (test seam overrides it). */
20
- private static readonly DEFAULT_DOC_SYNC_GATE_TIMEOUT_MS;
21
- constructor(session: UrunSessionLike,
22
- /** Test seam for the gate deadline; never an env knob or config surface. */
23
- docSyncTimeoutMs?: number);
24
- get consumerId(): string;
25
- /**
26
- * THE FIRST-WRITE-LOST GATE (resumed-attach, prod-usw2 2026-09-23): a turn's
27
- * request envelope is the llm doc's FIRST write after a cold (re-)attach, and
28
- * the dial's `whenLive` gate resolves off the SIGNALING status frame — which
29
- * routinely lands while the yjs doc provider is still dialing its room. A
30
- * local write applied while the provider has no socket is relayed ONLY through
31
- * the initial-sync diff exchange, and on a resumed session that exchange races
32
- * the session-server's S3 hydration barrier. Observed live (local proxy against
33
- * prod, dial resumed the long-parked shared-org session): the 396-byte envelope
34
- * applied at `wsconnected=false synced=false` NEVER reached the room — the
35
- * serve runtime drained the doc for the caller's whole timeout budget and
36
- * never saw the request (`drain: 2 in doc, 0 pending`, no change events), while
37
- * the client's provider reported `synced`. The write is silently stranded.
38
- *
39
- * So every request-envelope write first holds for the doc plane's OWN
40
- * readiness — `synced`, the provider's level-triggered initial-sync bar.
41
- * Post-sync writes ride the connected socket directly and are delivered.
42
- * Bounded and loud on deadline: the caller (rehome's one re-dial, then the
43
- * lane's loud 502) owns the verdict — never a silent loss. A session double
44
- * that exposes no `onSynced` surface cannot be gated and is skipped honestly
45
- * (same structural-seam contract as `onConnectionState`).
46
- */
47
- /** Hold until the llm doc plane has completed its first sync (bounded, loud). */
48
- private ensureDocSynced;
49
- private write;
50
- sendResponses(params: {
51
- model?: string;
52
- input: unknown;
53
- stream?: boolean;
54
- /** Per-request system instructions — forwarded verbatim to the serve envelope. */
55
- instructions?: string;
56
- tools?: unknown;
57
- tool_choice?: unknown;
58
- temperature?: number;
59
- top_p?: number;
60
- stop?: string[];
61
- max_output_tokens?: number;
62
- reasoning_effort?: string;
63
- chat_template_kwargs?: Record<string, unknown>;
64
- /** ENG-310 structured output: forwarded verbatim; the serve runtime validates. */
65
- response_format?: unknown;
66
- /**
67
- * ENG-331 speech lane: the per-request TTS voice, forwarded verbatim
68
- * on the serve envelope (encode.ts `ServeEnvelope.voice`); absent →
69
- * key absent — the engine's catalog-configured default voice applies.
70
- */
71
- voice?: string;
72
- }, requestId: string): Promise<AsyncIterable<unknown>>;
73
- sendResponseCreate(ev: {
74
- type: 'response.create';
75
- response?: Record<string, unknown>;
76
- }, conversation: Array<{
77
- role: string;
78
- content: unknown;
79
- }>, requestId: string): Promise<AsyncIterable<unknown>>;
80
- /**
81
- * Run the turn's write + lane subscribe behind {@link ensureDocSynced}. The
82
- * gate is per-turn: the doc plane may have re-dialed since the last turn
83
- * (resume / pod move), so every turn re-checks — `synced` is true the moment
84
- * the provider is warm, so the steady-state turn pays only a property read.
85
- */
86
- private writeGated;
87
- }
88
-
89
- /**
90
- * Read the addressed lane and yield OpenAI Responses server-events.
91
- *
92
- * Delta messages decode field-by-field (a single lane message may carry
93
- * several):
94
- * - `delta` → `response.output_text.delta` (visible text, unchanged)
95
- * - `reasoning` → `response.reasoning_text.delta` (OpenAI Responses
96
- * reasoning-stream vocabulary)
97
- * - `tool_calls` → `response.function_call_arguments.delta`, ENRICHED with
98
- * `tool_index` / `call_id` / `name` (latched per index —
99
- * chunk-style fragments carry id/name only on the first
100
- * fragment). The full output_item lifecycle around these is
101
- * synthesized by each consumer leg (proxy/pi), NOT here:
102
- * emitting `response.output_item.added` from the decoder
103
- * would flip the proxy's upstream-speaks-envelope
104
- * passthrough while the text item still needs synthesis.
105
- *
106
- * Unknown fields on a delta message are ignored (a NEWER server against this
107
- * decoder must degrade to whatever fields we know, never throw).
108
- */
109
- declare function decodeResponsesLane(session: UrunSessionLike, requestId: string): AsyncIterable<unknown>;
110
-
111
6
  interface ServeEnvelope {
112
7
  request_id: string;
113
8
  consumer_id: string;
@@ -206,4 +101,89 @@ declare function responsesCreateToEnvelope(params: {
206
101
  instructions?: string;
207
102
  }, requestId: string, consumerId: string): ServeEnvelope;
208
103
 
104
+ declare class SdkTransport {
105
+ private readonly session;
106
+ /** Test seam for the gate deadline; never an env knob or config surface. */
107
+ private readonly docSyncTimeoutMs;
108
+ /**
109
+ * Session-affinity tag (urun-python #1556): every envelope this transport
110
+ * writes carries the SAME stable tag, so the serve engine adapter can
111
+ * continue the session's retained sequence state instead of re-prefilling
112
+ * the whole conversation each turn. The uRun session id when the SDK
113
+ * exposes it; otherwise minted ONCE here — one transport wraps exactly one
114
+ * persistent session, so a per-transport tag identifies the session too.
115
+ */
116
+ private readonly sessionTag;
117
+ /** The shipped gate deadline — the only production value (test seam overrides it). */
118
+ private static readonly DEFAULT_DOC_SYNC_GATE_TIMEOUT_MS;
119
+ constructor(session: UrunSessionLike,
120
+ /** Test seam for the gate deadline; never an env knob or config surface. */
121
+ docSyncTimeoutMs?: number);
122
+ get consumerId(): string;
123
+ /**
124
+ * THE FIRST-WRITE-LOST GATE (resumed-attach, prod-usw2 2026-09-23): a turn's
125
+ * request envelope is the llm doc's FIRST write after a cold (re-)attach, and
126
+ * the dial's `whenLive` gate resolves off the SIGNALING status frame — which
127
+ * routinely lands while the yjs doc provider is still dialing its room. A
128
+ * local write applied while the provider has no socket is relayed ONLY through
129
+ * the initial-sync diff exchange, and on a resumed session that exchange races
130
+ * the session-server's S3 hydration barrier. Observed live (local proxy against
131
+ * prod, dial resumed the long-parked shared-org session): the 396-byte envelope
132
+ * applied at `wsconnected=false synced=false` NEVER reached the room — the
133
+ * serve runtime drained the doc for the caller's whole timeout budget and
134
+ * never saw the request (`drain: 2 in doc, 0 pending`, no change events), while
135
+ * the client's provider reported `synced`. The write is silently stranded.
136
+ *
137
+ * So every request-envelope write first holds for the doc plane's OWN
138
+ * readiness — `synced`, the provider's level-triggered initial-sync bar.
139
+ * Post-sync writes ride the connected socket directly and are delivered.
140
+ * Bounded and loud on deadline: the caller (rehome's one re-dial, then the
141
+ * lane's loud 502) owns the verdict — never a silent loss. A session double
142
+ * that exposes no `onSynced` surface cannot be gated and is skipped honestly
143
+ * (same structural-seam contract as `onConnectionState`).
144
+ */
145
+ /** Hold until the llm doc plane has completed its first sync (bounded, loud). */
146
+ private ensureDocSynced;
147
+ private write;
148
+ sendResponses(params: {
149
+ model?: string;
150
+ input: unknown;
151
+ stream?: boolean;
152
+ /** Per-request system instructions — forwarded verbatim to the serve envelope. */
153
+ instructions?: string;
154
+ tools?: unknown;
155
+ tool_choice?: unknown;
156
+ temperature?: number;
157
+ top_p?: number;
158
+ stop?: string[];
159
+ max_output_tokens?: number;
160
+ reasoning_effort?: string;
161
+ chat_template_kwargs?: Record<string, unknown>;
162
+ /** ENG-310 structured output: forwarded verbatim; the serve runtime validates. */
163
+ response_format?: unknown;
164
+ /**
165
+ * ENG-331 speech lane: the per-request TTS voice, forwarded verbatim
166
+ * on the serve envelope (encode.ts `ServeEnvelope.voice`); absent →
167
+ * key absent — the engine's catalog-configured default voice applies.
168
+ */
169
+ voice?: string;
170
+ }, requestId: string): Promise<AsyncIterable<unknown>>;
171
+ sendResponseCreate(ev: {
172
+ type: 'response.create';
173
+ response?: Record<string, unknown>;
174
+ }, conversation: Array<{
175
+ role: string;
176
+ content: unknown;
177
+ }>, requestId: string): Promise<AsyncIterable<unknown>>;
178
+ /**
179
+ * Run the turn's write + lane subscribe behind {@link ensureDocSynced}. The
180
+ * gate is per-turn: the doc plane may have re-dialed since the last turn
181
+ * (resume / pod move), so every turn re-checks — `synced` is true the moment
182
+ * the provider is warm, so the steady-state turn pays only a property read.
183
+ */
184
+ private writeGated;
185
+ }
186
+
187
+ declare function decodeResponsesLane(session: UrunSessionLike, requestId: string): AsyncIterable<unknown>;
188
+
209
189
  export { SdkTransport, type ServeEnvelope, UrunSessionLike, decodeResponsesLane, responseCreateToEnvelope, responsesCreateToEnvelope };
@@ -3,54 +3,6 @@ import { b as UrunSessionLike } from './types-CHPtJx6d.js';
3
3
  export { L as LaneMessage, a as LaneToolCallDelta, U as UrunDocLike, c as UrunStreamLike } from './types-CHPtJx6d.js';
4
4
  export { A as AudioBackend, a as AudioBridge, b as AudioSink, c as AudioSource, N as NATIVE_AUDIO_SAMPLE_RATE, R as RT_VIDEO_IN_STREAM, d as RT_VIDEO_OUT_STREAM, V as VIDEO_FRAME_MESSAGE_BUDGET, e as VIDEO_OUT_DEFAULT_CODEC, f as VIDEO_OUT_FRAMING, g as VIDEO_OUT_WS_FRAMING, h as VideoFrameLane, i as VideoOutEndpoint, j as VideoOutLane, k as VideoOutRecord, l as VideoOutRecordHeader, m as VideoOutTransportSink, n as VideoOutWtConnect, o as VideoOutWtSession, p as consumeVideoOut, q as decodeVideoOutRecord, r as enableSessionAudio, s as enableSessionVideo, t as encodeVideoOutRecord, u as negotiateSessionVideoOutQuic, v as nodeAudioBackend, w as openSessionVideoOutLane, x as weriftAudioBackend } from './video-out-Cawtm7SF.js';
5
5
 
6
- declare class SdkTransport {
7
- private readonly session;
8
-
9
- private readonly docSyncTimeoutMs;
10
-
11
- private readonly sessionTag;
12
-
13
- private static readonly DEFAULT_DOC_SYNC_GATE_TIMEOUT_MS;
14
- constructor(session: UrunSessionLike,
15
-
16
- docSyncTimeoutMs?: number);
17
- get consumerId(): string;
18
-
19
-
20
- private ensureDocSynced;
21
- private write;
22
- sendResponses(params: {
23
- model?: string;
24
- input: unknown;
25
- stream?: boolean;
26
-
27
- instructions?: string;
28
- tools?: unknown;
29
- tool_choice?: unknown;
30
- temperature?: number;
31
- top_p?: number;
32
- stop?: string[];
33
- max_output_tokens?: number;
34
- reasoning_effort?: string;
35
- chat_template_kwargs?: Record<string, unknown>;
36
-
37
- response_format?: unknown;
38
-
39
- voice?: string;
40
- }, requestId: string): Promise<AsyncIterable<unknown>>;
41
- sendResponseCreate(ev: {
42
- type: 'response.create';
43
- response?: Record<string, unknown>;
44
- }, conversation: Array<{
45
- role: string;
46
- content: unknown;
47
- }>, requestId: string): Promise<AsyncIterable<unknown>>;
48
-
49
- private writeGated;
50
- }
51
-
52
- declare function decodeResponsesLane(session: UrunSessionLike, requestId: string): AsyncIterable<unknown>;
53
-
54
6
  interface ServeEnvelope {
55
7
  request_id: string;
56
8
  consumer_id: string;
@@ -110,4 +62,52 @@ declare function responsesCreateToEnvelope(params: {
110
62
  instructions?: string;
111
63
  }, requestId: string, consumerId: string): ServeEnvelope;
112
64
 
65
+ declare class SdkTransport {
66
+ private readonly session;
67
+
68
+ private readonly docSyncTimeoutMs;
69
+
70
+ private readonly sessionTag;
71
+
72
+ private static readonly DEFAULT_DOC_SYNC_GATE_TIMEOUT_MS;
73
+ constructor(session: UrunSessionLike,
74
+
75
+ docSyncTimeoutMs?: number);
76
+ get consumerId(): string;
77
+
78
+
79
+ private ensureDocSynced;
80
+ private write;
81
+ sendResponses(params: {
82
+ model?: string;
83
+ input: unknown;
84
+ stream?: boolean;
85
+
86
+ instructions?: string;
87
+ tools?: unknown;
88
+ tool_choice?: unknown;
89
+ temperature?: number;
90
+ top_p?: number;
91
+ stop?: string[];
92
+ max_output_tokens?: number;
93
+ reasoning_effort?: string;
94
+ chat_template_kwargs?: Record<string, unknown>;
95
+
96
+ response_format?: unknown;
97
+
98
+ voice?: string;
99
+ }, requestId: string): Promise<AsyncIterable<unknown>>;
100
+ sendResponseCreate(ev: {
101
+ type: 'response.create';
102
+ response?: Record<string, unknown>;
103
+ }, conversation: Array<{
104
+ role: string;
105
+ content: unknown;
106
+ }>, requestId: string): Promise<AsyncIterable<unknown>>;
107
+
108
+ private writeGated;
109
+ }
110
+
111
+ declare function decodeResponsesLane(session: UrunSessionLike, requestId: string): AsyncIterable<unknown>;
112
+
113
113
  export { SdkTransport, type ServeEnvelope, UrunSessionLike, decodeResponsesLane, responseCreateToEnvelope, responsesCreateToEnvelope };
@@ -1 +1 @@
1
- import{a as c,b as C,c as L,d as M,e as R,f as D,g as f,h as N,i as v,j as g,k as x,l as k,m as y,n as G,o as B,p as F,q as P,r as H,s as W,t as b,u as w,v as K,w as h,x as Q}from"./chunk-3JWYIKHM.js";import{a as i,b as s,c as O,d,e as a,f as E,g as _,h as p,i as u,j as A,k as S,l as I,m as T,n as l,o as m,p as U,q as V}from"./chunk-6M5JK4YC.js";import{a as o,b as t,d as n,e as r}from"./chunk-7V2JKPIG.js";import{c as e}from"./chunk-YSFSRI3D.js";e();export{s as AudioBridge,C as CLOSE_PROTOCOL,R as CLOSE_SESSION_GONE,L as CLOSE_UNKNOWN_MODEL,M as CLOSE_UPSTREAM,B as GEMINI_AUDIO_IN_RATE,P as GEMINI_AUDIO_OUT_MIME,F as GEMINI_AUDIO_OUT_RATE,c as GEMINI_LIVE_PATH,D as GeminiLiveError,i as NATIVE_AUDIO_SAMPLE_RATE,H as OUTBOUND_AUDIO_FLUSH_B64,d as RT_VIDEO_IN_STREAM,u as RT_VIDEO_OUT_STREAM,r as SdkTransport,a as VIDEO_FRAME_MESSAGE_BUDGET,S as VIDEO_OUT_DEFAULT_CODEC,A as VIDEO_OUT_FRAMING,N as VIDEO_OUT_SETUP_KEY,m as VIDEO_OUT_WS_FRAMING,V as consumeVideoOut,n as decodeResponsesLane,T as decodeVideoOutRecord,O as enableSessionAudio,E as enableSessionVideo,I as encodeVideoOutRecord,y as goAwayMsg,l as negotiateSessionVideoOutQuic,p as nodeAudioBackend,U as openSessionVideoOutLane,f as parseClientMessage,W as resamplePcm16,o as responseCreateToEnvelope,t as responsesCreateToEnvelope,h as serverContentOfAudio,K as serverContentOfDelta,k as sessionResumptionUpdateMsg,G as translateClientContent,b as translateRealtimeInput,x as translateSetup,w as translateToolResponse,Q as turnEndOfCompleted,v as videoOutAck,g as videoOutChunkMsg,_ as weriftAudioBackend};
1
+ import{a as c,b as C,c as L,d as M,e as R,f as D,g as f,h as N,i as v,j as g,k as x,l as k,m as y,n as G,o as B,p as F,q as P,r as H,s as W,t as b,u as w,v as K,w as h,x as Q}from"./chunk-3JWYIKHM.js";import{a as i,b as s,c as O,d,e as a,f as E,g as _,h as p,i as u,j as A,k as S,l as I,m as T,n as l,o as m,p as U,q as V}from"./chunk-6M5JK4YC.js";import{a as o,b as t,e as n,f as r}from"./chunk-NN6TQQUG.js";import{c as e}from"./chunk-YSFSRI3D.js";e();export{s as AudioBridge,C as CLOSE_PROTOCOL,R as CLOSE_SESSION_GONE,L as CLOSE_UNKNOWN_MODEL,M as CLOSE_UPSTREAM,B as GEMINI_AUDIO_IN_RATE,P as GEMINI_AUDIO_OUT_MIME,F as GEMINI_AUDIO_OUT_RATE,c as GEMINI_LIVE_PATH,D as GeminiLiveError,i as NATIVE_AUDIO_SAMPLE_RATE,H as OUTBOUND_AUDIO_FLUSH_B64,d as RT_VIDEO_IN_STREAM,u as RT_VIDEO_OUT_STREAM,r as SdkTransport,a as VIDEO_FRAME_MESSAGE_BUDGET,S as VIDEO_OUT_DEFAULT_CODEC,A as VIDEO_OUT_FRAMING,N as VIDEO_OUT_SETUP_KEY,m as VIDEO_OUT_WS_FRAMING,V as consumeVideoOut,n as decodeResponsesLane,T as decodeVideoOutRecord,O as enableSessionAudio,E as enableSessionVideo,I as encodeVideoOutRecord,y as goAwayMsg,l as negotiateSessionVideoOutQuic,p as nodeAudioBackend,U as openSessionVideoOutLane,f as parseClientMessage,W as resamplePcm16,o as responseCreateToEnvelope,t as responsesCreateToEnvelope,h as serverContentOfAudio,K as serverContentOfDelta,k as sessionResumptionUpdateMsg,G as translateClientContent,b as translateRealtimeInput,x as translateSetup,w as translateToolResponse,Q as turnEndOfCompleted,v as videoOutAck,g as videoOutChunkMsg,_ as weriftAudioBackend};