@zhivex-ai/qwen 0.15.3 → 0.16.2

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 (66) hide show
  1. package/README.md +46 -1
  2. package/dist/browser-realtime.d.ts +58 -0
  3. package/dist/browser-realtime.d.ts.map +1 -0
  4. package/dist/browser-realtime.js +259 -0
  5. package/dist/browser-realtime.js.map +1 -0
  6. package/dist/browser.d.ts +9 -0
  7. package/dist/browser.d.ts.map +1 -0
  8. package/dist/browser.js +7 -0
  9. package/dist/browser.js.map +1 -0
  10. package/dist/cloud-media.d.ts +89 -0
  11. package/dist/cloud-media.d.ts.map +1 -0
  12. package/dist/cloud-media.js +221 -0
  13. package/dist/cloud-media.js.map +1 -0
  14. package/dist/cloud-realtime.d.ts +58 -0
  15. package/dist/cloud-realtime.d.ts.map +1 -0
  16. package/dist/cloud-realtime.js +123 -0
  17. package/dist/cloud-realtime.js.map +1 -0
  18. package/dist/decision.d.ts +69 -0
  19. package/dist/decision.d.ts.map +1 -0
  20. package/dist/decision.js +122 -0
  21. package/dist/decision.js.map +1 -0
  22. package/dist/embeddings.d.ts +30 -0
  23. package/dist/embeddings.d.ts.map +1 -0
  24. package/dist/embeddings.js +94 -0
  25. package/dist/embeddings.js.map +1 -0
  26. package/dist/index.d.ts +40 -2
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +365 -144
  29. package/dist/index.js.map +1 -1
  30. package/dist/inference-audio.d.ts +146 -0
  31. package/dist/inference-audio.d.ts.map +1 -0
  32. package/dist/inference-audio.js +256 -0
  33. package/dist/inference-audio.js.map +1 -0
  34. package/dist/native-asr.d.ts +52 -0
  35. package/dist/native-asr.d.ts.map +1 -0
  36. package/dist/native-asr.js +162 -0
  37. package/dist/native-asr.js.map +1 -0
  38. package/dist/rtc-protocol.d.ts +10 -0
  39. package/dist/rtc-protocol.d.ts.map +1 -0
  40. package/dist/rtc-protocol.js +10 -0
  41. package/dist/rtc-protocol.js.map +1 -0
  42. package/dist/sdp-exchange.d.ts +8 -0
  43. package/dist/sdp-exchange.d.ts.map +1 -0
  44. package/dist/sdp-exchange.js +25 -0
  45. package/dist/sdp-exchange.js.map +1 -0
  46. package/dist/temporary-keys.d.ts +15 -0
  47. package/dist/temporary-keys.d.ts.map +1 -0
  48. package/dist/temporary-keys.js +28 -0
  49. package/dist/temporary-keys.js.map +1 -0
  50. package/dist/text-profiles.d.ts +7 -0
  51. package/dist/text-profiles.d.ts.map +1 -0
  52. package/dist/text-profiles.js +55 -0
  53. package/dist/text-profiles.js.map +1 -0
  54. package/dist/url-path.d.ts +3 -0
  55. package/dist/url-path.d.ts.map +1 -0
  56. package/dist/url-path.js +8 -0
  57. package/dist/url-path.js.map +1 -0
  58. package/dist/world-rtc.d.ts +30 -0
  59. package/dist/world-rtc.d.ts.map +1 -0
  60. package/dist/world-rtc.js +33 -0
  61. package/dist/world-rtc.js.map +1 -0
  62. package/dist/worlds.d.ts +134 -0
  63. package/dist/worlds.d.ts.map +1 -0
  64. package/dist/worlds.js +196 -0
  65. package/dist/worlds.js.map +1 -0
  66. package/package.json +6 -2
package/README.md CHANGED
@@ -339,7 +339,7 @@ Repository and full documentation:
339
339
 
340
340
  ## Qwen 3.8 snapshots
341
341
 
342
- `qwen3.8-max-0902` preserves its exact upstream ID while inheriting the `qwen3.8-max` validation, vision, tools, and token-limit request mapping. Dated four-digit Max/Flash snapshots are recognized separately from Token Plan previews. `qwen3.8-2.4t-a95b` is listed for discovery without automatic recommendations; its specialized behavior has not been live-certified.
342
+ `qwen3.8-max-0902` preserves its exact upstream ID while inheriting the `qwen3.8-max` validation, vision, tools, and token-limit request mapping. Dated four-digit Max/Flash snapshots are recognized separately from Token Plan previews. `qwen3.8-2.4t-a95b` is listed without automatic recommendations and supports image/video mapping; its specialized behavior has not been live-certified. The full `qwen3.8-max-2026-09-02` alias inherits the Max profile as well.
343
343
 
344
344
  See the [QwenCloud model inventory](https://docs.qwencloud.com/developer-guides/getting-started/text-generation-models).
345
345
 
@@ -593,3 +593,48 @@ It uses `qwen3.8-omni-flash`, writes `model-audio-review.json`, and labels its c
593
593
  The longer same-language synthetic control also completed baseline/once/always with acknowledged cloning and output audio. Its model evaluator preferred the cloned prosody but still did not confirm source-timbre fidelity, and some source-voice descriptions were inconsistent across evaluations. Therefore these automated assessments are retained as limited evidence, not a passing perceptual certification. Enrollment and `never` subsequently passed the live create/use/delete check for the exact 3.8 target.
594
594
 
595
595
  The focused `never` run also received a favorable qualitative timbre assessment from Qwen Omni, with the same limitations as the earlier model-based reviews. A post-cleanup inventory check confirmed that neither of the two temporary voices created during enrollment validation remained in the account.
596
+
597
+
598
+ ## Qwen Cloud specialized models
599
+
600
+ Configure `baseURL: QWEN_CLOUD_BASE_URL` to use Qwen Cloud with standard credentials. Task and realtime hosts follow that endpoint. `QWEN_DECISION_PREVIEW_BASE_URL` can be supplied explicitly as `decisionBaseURL` for the separately deployed Decision preview.
601
+
602
+ The provider exposes `decisionModel().decide()`, `textEmbeddingModel().embedNative()`, `streamingASRModel()`, `fileTranscriptionModel()`, `imageTranslationModel()` and `worlds()` alongside the portable text, embedding, image, video, speech and realtime factories. Dedicated models reject accidental use through the chat factory. Cloud Audio TTS/streaming ASR use binary inference WebSockets; optional binary methods extend the existing connection factory contract.
603
+
604
+ See the [support matrix, usage and validation boundaries](../../docs/QWEN_CLOUD_SUPPORT.md), [Decision model with a small measured comparison](../../docs/QWEN_CLOUD_DECISION.md), and [native ASR contract](../../docs/QWEN_CLOUD_ASR.md). Public Cloud-specific types are exported from this package. Live tests are opt-in and favor tiny requests and Flash/Lite models.
605
+
606
+ Detailed contracts: [audio and realtime](../../docs/QWEN_CLOUD_AUDIO.md), [embeddings](../../docs/QWEN_CLOUD_EMBEDDINGS.md), and [media and worlds](../../docs/QWEN_CLOUD_MEDIA.md). Use `qwen.temporaryKeys.create({ expiresInSeconds: 60 })` on your server to issue short-lived tokens for client SDKs; the returned token inherits the primary key permissions. `inferenceURL` explicitly overrides binary speech transport when using a custom gateway.
607
+
608
+ ### Responses argument and stream errors
609
+
610
+ Responses function arguments must be JSON objects. Both `generate` and `stream`
611
+ reject invalid, empty or missing arguments with `ProviderToolCallError`, provider
612
+ `qwen`, transport `responses`, and diagnostic code
613
+ `QWEN_RESPONSES_TOOL_CALL_INVALID`. Reasons use the shared finite error contract;
614
+ non-object JSON uses `invalid_json`. Errors contain a fixed message, no raw
615
+ arguments or parser cause, and only validated terminal token accounting when
616
+ available. They are not automatically retried or repaired.
617
+
618
+ The streaming adapter buffers function calls until the response terminates and
619
+ validates the entire batch before emitting any `tool-call`. A malformed member,
620
+ incomplete response, truncated stream or contradictory completion rejects the
621
+ batch. Matching duplicate completion events materialize a call only once. Valid
622
+ call IDs and Qwen receipt metadata are preserved. Text and provider events may
623
+ already have been emitted; this does not undo prior steps or hosted effects.
624
+ `effectsPossible` is conservative when provider-side items have been observed;
625
+ the shared runtime additionally accounts for effects in prior local steps.
626
+ Cancellation keeps its original error instead of becoming a parser failure.
627
+
628
+ Malformed SSE JSON in Responses or Chat throws a separate bounded
629
+ `QwenStreamEventError` (`QWEN_SSE_EVENT_INVALID`, reason `invalid_json` or
630
+ `invalid_event`, explicit transport). It never retains the event body or a
631
+ sensitive `SyntaxError` cause. This diagnostic fix does not establish the cause
632
+ of historical Harness failures or certify model behavior.
633
+
634
+ Offline regression: `bun run test packages/qwen/tests/responses-invalid-arguments.test.ts`.
635
+ For an installed-artifact check, build and pack Core/Qwen with `bun pm pack`,
636
+ install both tarballs into an isolated consumer with a Core override pointing to
637
+ the same local tarball, copy `scripts/qwen-responses-packed-smoke.mjs` into that
638
+ consumer and run it with Bun. The smoke covers ten valid/invalid generate,
639
+ stream and SSE cases without provider credentials. Local tarball results do not
640
+ constitute registry publication or a live Harness matrix.
@@ -0,0 +1,58 @@
1
+ import { type QwenSDPExchange } from "./rtc-protocol.js";
2
+ export type { QwenSDPExchange, QwenSDPExchangeInput } from "./rtc-protocol.js";
3
+ export interface QwenWebRTCSession {
4
+ readonly peerConnection: RTCPeerConnection;
5
+ sendEvent(event: Record<string, unknown>): void;
6
+ setInputMuted(muted: boolean): void;
7
+ close(): void;
8
+ }
9
+ export interface QwenWebRTCOptions {
10
+ modelId: string;
11
+ /** Already-permissioned application stream. The connector uses clones and never stops caller tracks. */
12
+ mediaStream: MediaStream;
13
+ /** Calls your authenticated AppServer, which proxies the SDP request. */
14
+ exchangeSdp: QwenSDPExchange;
15
+ session?: Record<string, unknown>;
16
+ onEvent?: (event: Record<string, unknown>) => void;
17
+ onTrack?: (event: RTCTrackEvent) => void;
18
+ onError?: (error: Error) => void;
19
+ signal?: AbortSignal;
20
+ timeoutMs?: number;
21
+ peerConnectionFactory?: () => RTCPeerConnection;
22
+ }
23
+ /** Native browser WebRTC. Audio/video use media tracks; control events use RTCDataChannel. */
24
+ export declare const connectQwenWebRTC: (options: QwenWebRTCOptions) => Promise<QwenWebRTCSession>;
25
+ export interface QwenAOQEngine<TConnection, TTrack> {
26
+ connect(config: TConnection): void | Promise<void>;
27
+ disconnect(): void | Promise<void>;
28
+ enableSendMediaStream(track: TTrack, enabled: boolean): void | Promise<void>;
29
+ sendDataMsg(message: {
30
+ data: ArrayBuffer;
31
+ }): void | Promise<void>;
32
+ }
33
+ export interface QwenAOQBridgeOptions<TConnection, TTrack> {
34
+ engine: QwenAOQEngine<TConnection, TTrack>;
35
+ /** Credential/configuration object issued for the official SDK; never a permanent API key. */
36
+ connection: TConnection;
37
+ /** Official SDK enum values for upstream audio/video; omit the data track. */
38
+ mediaTracks: readonly TTrack[];
39
+ session?: Record<string, unknown>;
40
+ /** Adapt official onConnectionStatusChange/onDataMsg/onError callbacks. Return an unsubscribe function. */
41
+ subscribe(handlers: {
42
+ connected(): void;
43
+ data(data: ArrayBuffer | Uint8Array | string): void;
44
+ error(error: Error): void;
45
+ }): () => void;
46
+ onEvent?: (event: Record<string, unknown>) => void;
47
+ onError?: (error: Error) => void;
48
+ signal?: AbortSignal;
49
+ timeoutMs?: number;
50
+ }
51
+ export interface QwenAOQSession {
52
+ sendEvent(event: Record<string, unknown>): Promise<void>;
53
+ setInputMuted(muted: boolean): Promise<void>;
54
+ close(): Promise<void>;
55
+ }
56
+ /** Optional bridge to an application-owned official AOQ native SDK, not an implementation of QUIC. */
57
+ export declare const connectQwenAOQ: <TConnection, TTrack>(options: QwenAOQBridgeOptions<TConnection, TTrack>) => Promise<QwenAOQSession>;
58
+ //# sourceMappingURL=browser-realtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-realtime.d.ts","sourceRoot":"","sources":["../src/browser-realtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE/E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,cAAc,EAAE,iBAAiB,CAAC;IAC3C,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChD,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,KAAK,IAAI,IAAI,CAAC;CACf;AACD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,wGAAwG;IACxG,WAAW,EAAE,WAAW,CAAC;IACzB,yEAAyE;IACzE,WAAW,EAAE,eAAe,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CA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;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AACD,sGAAsG;AACtG,eAAO,MAAM,cAAc,GAAU,WAAW,EAAE,MAAM,WAAW,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,KAAG,OAAO,CAAC,cAAc,CAyDpI,CAAC"}
@@ -0,0 +1,259 @@
1
+ import { ConfigurationError, withTimeoutSignal } from "@zhivex-ai/core/runtime";
2
+ import { MAX_BYTES, model, sdp } from "./rtc-protocol.js";
3
+ const validateWebRTCSession = (session) => {
4
+ const vad = session.turn_detection;
5
+ if (vad === null || vad?.type !== undefined && !["server_vad", "semantic_vad"].includes(String(vad.type)))
6
+ throw new ConfigurationError("Qwen WebRTC requires server_vad or semantic_vad; manual mode is unsupported.");
7
+ };
8
+ /** Native browser WebRTC. Audio/video use media tracks; control events use RTCDataChannel. */
9
+ export const connectQwenWebRTC = async (options) => {
10
+ model(options.modelId);
11
+ const config = { modalities: ["text", "audio"], voice: "Tina", turn_detection: { type: "server_vad" }, ...options.session };
12
+ validateWebRTCSession(config);
13
+ if (!options.mediaStream.getAudioTracks().length)
14
+ throw new ConfigurationError("WebRTC requires an audio track.");
15
+ const { signal, cleanup } = withTimeoutSignal({ abortSignal: options.signal, timeoutMs: options.timeoutMs ?? 15_000 });
16
+ const pc = (() => {
17
+ try {
18
+ return (options.peerConnectionFactory ?? (() => new RTCPeerConnection({ iceServers: [] })))();
19
+ }
20
+ catch (error) {
21
+ cleanup();
22
+ throw error;
23
+ }
24
+ })();
25
+ const tracks = [];
26
+ const channels = new Set();
27
+ let control;
28
+ let closed = false, ready = false, muted = false, updateSent = false;
29
+ let resolveReady = () => { };
30
+ let rejectReady = () => { };
31
+ const readyPromise = new Promise((resolve, reject) => { resolveReady = resolve; rejectReady = reject; });
32
+ void readyPromise.catch(() => { });
33
+ const bounded = (pending) => Promise.race([pending, readyPromise.then(() => new Promise(() => { }))]);
34
+ const close = () => {
35
+ if (closed)
36
+ return;
37
+ closed = true;
38
+ cleanup();
39
+ options.signal?.removeEventListener("abort", onCallerAbort);
40
+ signal.removeEventListener("abort", onAbort);
41
+ for (const channel of channels) {
42
+ channel.onmessage = null;
43
+ channel.onerror = null;
44
+ channel.close();
45
+ }
46
+ pc.ondatachannel = null;
47
+ pc.ontrack = null;
48
+ pc.onconnectionstatechange = null;
49
+ for (const entry of tracks)
50
+ entry.track.stop();
51
+ pc.close();
52
+ };
53
+ const fail = (error) => { rejectReady(error); close(); try {
54
+ options.onError?.(error);
55
+ }
56
+ catch { /* User callback cannot prevent teardown. */ } };
57
+ const onAbort = () => fail(signal.reason instanceof Error ? signal.reason : new Error("WebRTC connection aborted."));
58
+ const onCallerAbort = () => fail(options.signal?.reason instanceof Error ? options.signal.reason : new Error("WebRTC session aborted."));
59
+ const send = (event) => {
60
+ if (closed || !control || control.readyState !== "open")
61
+ throw new ConfigurationError("WebRTC data channel is not open.");
62
+ if (event.type === "session.update")
63
+ validateWebRTCSession(event.session ?? {});
64
+ if (["input_audio_buffer.commit", "input_audio_buffer.append", "input_image_buffer.append"].includes(String(event.type)))
65
+ throw new ConfigurationError("WebRTC media uses tracks and server VAD.");
66
+ const json = JSON.stringify(event);
67
+ if (new TextEncoder().encode(json).length > MAX_BYTES || control.bufferedAmount > MAX_BYTES)
68
+ throw new ConfigurationError("WebRTC data channel buffer limit exceeded.");
69
+ control.send(json);
70
+ };
71
+ const attach = (channel) => {
72
+ channels.add(channel);
73
+ channel.onerror = () => fail(new Error("WebRTC data channel failed."));
74
+ channel.onmessage = message => {
75
+ void (async () => {
76
+ if (closed)
77
+ return;
78
+ if (typeof message.data !== "string" || new TextEncoder().encode(message.data).length > MAX_BYTES)
79
+ throw new ConfigurationError("Invalid or oversized WebRTC event.");
80
+ const event = JSON.parse(message.data);
81
+ if (!event || typeof event !== "object" || typeof event.type !== "string")
82
+ throw new ConfigurationError("Invalid WebRTC event.");
83
+ control = channel;
84
+ if (event.type === "error")
85
+ throw new Error("Qwen WebRTC returned a session error.");
86
+ if (event.type === "session.created" && !updateSent) {
87
+ updateSent = true;
88
+ send({ type: "session.update", session: config });
89
+ }
90
+ if (event.type === "session.updated" && updateSent && !ready) {
91
+ ready = true;
92
+ for (const entry of tracks) {
93
+ if (closed)
94
+ return;
95
+ await entry.sender.replaceTrack(entry.track);
96
+ entry.track.enabled = !muted;
97
+ }
98
+ if (closed)
99
+ return;
100
+ if (signal.aborted) {
101
+ onAbort();
102
+ return;
103
+ }
104
+ cleanup();
105
+ signal.removeEventListener("abort", onAbort);
106
+ options.signal?.addEventListener("abort", onCallerAbort, { once: true });
107
+ if (options.signal?.aborted) {
108
+ onCallerAbort();
109
+ return;
110
+ }
111
+ resolveReady();
112
+ }
113
+ options.onEvent?.(event);
114
+ })().catch(error => fail(error instanceof Error ? error : new Error("Invalid WebRTC event.")));
115
+ };
116
+ };
117
+ signal.addEventListener("abort", onAbort, { once: true });
118
+ try {
119
+ if (signal.aborted)
120
+ throw signal.reason;
121
+ pc.ontrack = event => options.onTrack?.(event);
122
+ pc.onconnectionstatechange = () => { if (["failed", "closed", "disconnected"].includes(pc.connectionState) && !closed)
123
+ fail(new Error("WebRTC connection ended.")); };
124
+ pc.ondatachannel = event => attach(event.channel);
125
+ for (const source of options.mediaStream.getTracks()) {
126
+ const track = source.clone();
127
+ track.enabled = false;
128
+ const sender = pc.addTrack(track, options.mediaStream);
129
+ tracks.push({ track, sender });
130
+ await bounded(sender.replaceTrack(null));
131
+ }
132
+ const local = pc.createDataChannel("oai-events");
133
+ attach(local);
134
+ control = local;
135
+ const offer = await bounded(pc.createOffer());
136
+ await bounded(pc.setLocalDescription(offer));
137
+ if (pc.iceGatheringState !== "complete")
138
+ await new Promise((resolve, reject) => {
139
+ const finish = (error) => { pc.removeEventListener("icegatheringstatechange", check); signal.removeEventListener("abort", abort); error ? reject(error) : resolve(); };
140
+ const check = () => { if (pc.iceGatheringState === "complete")
141
+ finish(); };
142
+ const abort = () => finish(signal.reason);
143
+ pc.addEventListener("icegatheringstatechange", check);
144
+ signal.addEventListener("abort", abort, { once: true });
145
+ check();
146
+ if (signal.aborted)
147
+ abort();
148
+ });
149
+ const answer = await bounded(options.exchangeSdp({ modelId: options.modelId, offerSdp: sdp(pc.localDescription?.sdp ?? ""), signal }));
150
+ if (closed)
151
+ throw signal.reason ?? new Error("WebRTC closed during signaling.");
152
+ await bounded(pc.setRemoteDescription({ type: "answer", sdp: sdp(answer) }));
153
+ await readyPromise;
154
+ return { peerConnection: pc, sendEvent: send, setInputMuted(value) { if (closed)
155
+ throw new ConfigurationError("WebRTC session is closed."); muted = value; for (const entry of tracks)
156
+ entry.track.enabled = ready && !muted; }, close };
157
+ }
158
+ catch (error) {
159
+ close();
160
+ throw error;
161
+ }
162
+ };
163
+ /** Optional bridge to an application-owned official AOQ native SDK, not an implementation of QUIC. */
164
+ export const connectQwenAOQ = async (options) => {
165
+ if (!options.mediaTracks.length)
166
+ throw new ConfigurationError("AOQ requires upstream media track enum values.");
167
+ const { signal, cleanup } = withTimeoutSignal({ abortSignal: options.signal, timeoutMs: options.timeoutMs ?? 15_000 });
168
+ let closed = false, ready = false, connected = false;
169
+ let unsubscribe = () => { };
170
+ let resolveReady = () => { }, rejectReady = () => { };
171
+ const ack = new Promise((resolve, reject) => { resolveReady = resolve; rejectReady = reject; });
172
+ void ack.catch(() => { });
173
+ const gate = async (enabled) => { for (const track of options.mediaTracks) {
174
+ if (closed)
175
+ return;
176
+ await options.engine.enableSendMediaStream(track, enabled);
177
+ } };
178
+ const close = async () => {
179
+ if (closed)
180
+ return;
181
+ closed = true;
182
+ cleanup();
183
+ unsubscribe();
184
+ signal.removeEventListener("abort", onAbort);
185
+ options.signal?.removeEventListener("abort", onCallerAbort);
186
+ await options.engine.disconnect();
187
+ };
188
+ const fail = (error) => { rejectReady(error); void close().catch(() => { }); try {
189
+ options.onError?.(error);
190
+ }
191
+ catch { /* Teardown already started. */ } };
192
+ const onAbort = () => fail(signal.reason instanceof Error ? signal.reason : new Error("AOQ initialization aborted."));
193
+ const onCallerAbort = () => fail(options.signal?.reason instanceof Error ? options.signal.reason : new Error("AOQ session aborted."));
194
+ const send = async (event) => {
195
+ if (closed)
196
+ throw new ConfigurationError("AOQ session is closed.");
197
+ const bytes = new TextEncoder().encode(JSON.stringify(event));
198
+ if (bytes.length > MAX_BYTES)
199
+ throw new ConfigurationError("AOQ event exceeds size limit.");
200
+ await options.engine.sendDataMsg({ data: bytes.buffer });
201
+ };
202
+ signal.addEventListener("abort", onAbort, { once: true });
203
+ try {
204
+ if (signal.aborted)
205
+ throw signal.reason;
206
+ unsubscribe = options.subscribe({
207
+ connected() {
208
+ if (closed || connected)
209
+ return;
210
+ connected = true;
211
+ void send({ type: "session.update", session: { modalities: ["text", "audio"], voice: "Tina", turn_detection: { type: "semantic_vad" }, ...options.session } }).catch(fail);
212
+ },
213
+ data(data) {
214
+ if (closed)
215
+ return;
216
+ void (async () => {
217
+ const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data instanceof Uint8Array ? data : new Uint8Array(data);
218
+ if (bytes.length > MAX_BYTES)
219
+ throw new ConfigurationError("AOQ event exceeds size limit.");
220
+ const event = JSON.parse(new TextDecoder().decode(bytes));
221
+ if (!event || typeof event.type !== "string")
222
+ throw new ConfigurationError("Invalid AOQ event.");
223
+ if (event.type === "error")
224
+ throw new Error("Qwen AOQ returned a session error.");
225
+ if (event.type === "session.updated" && connected && !ready) {
226
+ ready = true;
227
+ await gate(true);
228
+ if (closed)
229
+ return;
230
+ if (signal.aborted) {
231
+ onAbort();
232
+ return;
233
+ }
234
+ cleanup();
235
+ signal.removeEventListener("abort", onAbort);
236
+ options.signal?.addEventListener("abort", onCallerAbort, { once: true });
237
+ if (options.signal?.aborted) {
238
+ onCallerAbort();
239
+ return;
240
+ }
241
+ resolveReady();
242
+ }
243
+ options.onEvent?.(event);
244
+ })().catch(fail);
245
+ },
246
+ error: fail,
247
+ });
248
+ await Promise.race([(async () => { await gate(false); if (!closed)
249
+ await options.engine.connect(options.connection); })(), ack]);
250
+ await ack;
251
+ return { sendEvent: send, async setInputMuted(muted) { if (closed)
252
+ throw new ConfigurationError("AOQ session is closed."); await gate(!muted); }, close };
253
+ }
254
+ catch (error) {
255
+ await close();
256
+ throw error;
257
+ }
258
+ };
259
+ //# sourceMappingURL=browser-realtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-realtime.js","sourceRoot":"","sources":["../src/browser-realtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAwB,MAAM,mBAAmB,CAAC;AAuBhF,MAAM,qBAAqB,GAAG,CAAC,OAAgC,EAAE,EAAE;IACjE,MAAM,GAAG,GAAG,OAAO,CAAC,cAA4D,CAAC;IACjF,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,EAAE,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,kBAAkB,CAAC,8EAA8E,CAAC,CAAC;AAC1N,CAAC,CAAC;AACF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAA0B,EAA8B,EAAE;IAChG,KAAK,CAAC,OAAO,CAAC,OAAO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AClI,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;4BAAC,aAAa,EAAE,CAAC;4BAAC,OAAO;wBAAC,CAAC;wBACzD,YAAY,EAAE,CAAC;oBACjB,CAAC;oBACD,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;gBAC3B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;YACD,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;gBAAE,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACjI,MAAM,GAAG,CAAC;QACV,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,IAAI,MAAM;gBAAE,MAAM,IAAI,kBAAkB,CAAC,wBAAwB,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IAC5J,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAAC,MAAM,KAAK,EAAE,CAAC;QAAC,MAAM,KAAK,CAAC;IAAC,CAAC;AACjD,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Browser and optional native-SDK bridges; no provider construction or API-key lookup. */
2
+ import { connectQwenWebRTC as webRTC, connectQwenAOQ as aoq } from "./browser-realtime.js";
3
+ export declare const connectQwenWebRTC: typeof webRTC;
4
+ export declare const connectQwenAOQ: typeof aoq;
5
+ export type { QwenSDPExchange, QwenSDPExchangeInput, QwenWebRTCSession, QwenWebRTCOptions, QwenAOQEngine, QwenAOQBridgeOptions, QwenAOQSession } from "./browser-realtime.js";
6
+ import { createQwenWorldRTC as worldRTC } from "./world-rtc.js";
7
+ export declare const createQwenWorldRTC: typeof worldRTC;
8
+ export type * from "./world-rtc.js";
9
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,EAAE,iBAAiB,IAAI,MAAM,EAAE,cAAc,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC3F,eAAO,MAAM,iBAAiB,eAAS,CAAC;AACxC,eAAO,MAAM,cAAc,YAAM,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9K,OAAO,EAAE,kBAAkB,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,eAAO,MAAM,kBAAkB,iBAAW,CAAC;AAC3C,mBAAmB,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Browser and optional native-SDK bridges; no provider construction or API-key lookup. */
2
+ import { connectQwenWebRTC as webRTC, connectQwenAOQ as aoq } from "./browser-realtime.js";
3
+ export const connectQwenWebRTC = webRTC;
4
+ export const connectQwenAOQ = aoq;
5
+ import { createQwenWorldRTC as worldRTC } from "./world-rtc.js";
6
+ export const createQwenWorldRTC = worldRTC;
7
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,EAAE,iBAAiB,IAAI,MAAM,EAAE,cAAc,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC3F,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC,OAAO,EAAE,kBAAkB,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,89 @@
1
+ export interface QwenCloudRequestOptions {
2
+ abortSignal?: AbortSignal;
3
+ timeoutMs?: number;
4
+ }
5
+ export declare function requireCloudText(value: unknown, name: string, max?: number): asserts value is string;
6
+ export declare function requireCloudURL(value: unknown): asserts value is string;
7
+ /** Mutations are deliberately not retried: these APIs have no idempotency key. */
8
+ export declare function cloudRequest(apiKey: string, url: string, fetcher: typeof globalThis.fetch, options: QwenCloudRequestOptions, body?: unknown, async?: boolean): Promise<any>;
9
+ export interface QwenImageTranslationInput extends QwenCloudRequestOptions {
10
+ imageUrl: string;
11
+ sourceLanguage: string;
12
+ targetLanguage: string;
13
+ domainHint?: string;
14
+ sensitiveWords?: string[];
15
+ terminologies?: Array<{
16
+ src: string;
17
+ tgt: string;
18
+ }>;
19
+ imageSegment?: boolean;
20
+ }
21
+ export interface QwenImageTranslationResult {
22
+ imageUrl?: string;
23
+ operationName?: string;
24
+ requestId?: string;
25
+ rawResponse: unknown;
26
+ }
27
+ export interface QwenImageTranslationModel {
28
+ readonly modelId: string;
29
+ translate(input: QwenImageTranslationInput & {
30
+ async?: boolean;
31
+ }): Promise<QwenImageTranslationResult>;
32
+ }
33
+ export declare function createQwenImageTranslationModel(modelId: string, apiKey: string, taskBaseURL: string, fetcher: typeof globalThis.fetch): QwenImageTranslationModel;
34
+ export interface QwenWan30Media {
35
+ type: "first_frame" | "last_frame" | "reference_image" | "reference_video" | "reference_audio" | "file" | "link";
36
+ url: string;
37
+ }
38
+ export interface QwenWan30Parameters {
39
+ resolution?: "480P" | "720P" | "1080P";
40
+ ratio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
41
+ duration?: number;
42
+ audio?: boolean;
43
+ prompt_extend?: boolean;
44
+ watermark?: boolean;
45
+ seed?: number;
46
+ }
47
+ export declare function validateWan30(media: unknown, parameters: Record<string, unknown>): void;
48
+ export interface QwenImage30Parameters {
49
+ n?: number;
50
+ size?: string;
51
+ negative_prompt?: string;
52
+ prompt_extend?: boolean;
53
+ prompt_extend_mode?: "direct" | "agent";
54
+ enable_thinking?: boolean;
55
+ watermark?: boolean;
56
+ seed?: number;
57
+ }
58
+ export interface QwenHappyHorseMedia {
59
+ type: "first_frame" | "reference_image" | "video";
60
+ url: string;
61
+ }
62
+ export interface QwenHappyHorseParameters {
63
+ resolution?: "480P" | "720P" | "1080P";
64
+ ratio?: string;
65
+ duration?: number;
66
+ watermark?: boolean;
67
+ seed?: number;
68
+ audio_setting?: "auto" | "origin";
69
+ }
70
+ export declare function validateQwenImage30(input: {
71
+ prompt: string;
72
+ images?: unknown[];
73
+ count?: number;
74
+ size?: string;
75
+ }, parameters: Record<string, unknown>): void;
76
+ /** HappyHorse uses media[], including first-frame input; it does not accept legacy img_url. */
77
+ export declare function validateHappyHorse(modelId: string, media: unknown, parameters: Record<string, unknown>): void;
78
+ export interface QwenViduMedia {
79
+ type: "image";
80
+ url: string;
81
+ }
82
+ export declare function prepareViduVideo(modelId: string, media: unknown, parameters: Record<string, unknown>): Record<string, unknown>;
83
+ export declare function validateViduImage(input: {
84
+ prompt: string;
85
+ images?: unknown[];
86
+ count?: number;
87
+ size?: string;
88
+ }, parameters: Record<string, unknown>): void;
89
+ //# sourceMappingURL=cloud-media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-media.d.ts","sourceRoot":"","sources":["../src/cloud-media.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IAAG,WAAW,CAAC,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;AAC1F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAQ,GAAG,OAAO,CAAC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