@decartai/sdk 0.1.7 → 0.1.8
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.
|
@@ -15,6 +15,7 @@ declare const realTimeClientInitialStateSchema: z.ZodObject<{
|
|
|
15
15
|
enhance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
16
16
|
}, z.core.$strip>>;
|
|
17
17
|
image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<Blob, Blob>, z.ZodCustom<File, File>, z.ZodString]>>;
|
|
18
|
+
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
18
19
|
}, z.core.$strip>;
|
|
19
20
|
type OnRemoteStreamFn = (stream: MediaStream) => void;
|
|
20
21
|
type OnConnectionChangeFn = (state: ConnectionState) => void;
|
|
@@ -46,6 +47,7 @@ declare const realTimeClientConnectOptionsSchema: z.ZodObject<{
|
|
|
46
47
|
enhance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
47
48
|
}, z.core.$strip>>;
|
|
48
49
|
image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<Blob, Blob>, z.ZodCustom<File, File>, z.ZodString]>>;
|
|
50
|
+
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
49
51
|
}, z.core.$strip>>;
|
|
50
52
|
queryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
51
53
|
mirror: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodBoolean]>>;
|
package/dist/realtime/client.js
CHANGED
|
@@ -63,14 +63,19 @@ var SignalingChannel = class {
|
|
|
63
63
|
this.config.observability?.startPhase("room-join");
|
|
64
64
|
const roomInfoWait = this.waitForRoomInfo(handshakeTimeout);
|
|
65
65
|
const initialStateRequest = buildInitialStateRequest(opts.initialState);
|
|
66
|
+
const userSetInitialState = opts.initialState != null && (opts.initialState.image != null || opts.initialState.imageRef != null || opts.initialState.prompt != null);
|
|
66
67
|
const joinMessage = {
|
|
67
68
|
type: "livekit_join",
|
|
68
|
-
|
|
69
|
+
passthrough: opts.passthrough ?? !userSetInitialState
|
|
69
70
|
};
|
|
70
71
|
if (!this.writeMessage(joinMessage)) {
|
|
71
72
|
roomInfoWait.cancel();
|
|
72
73
|
throw new Error("WebSocket is not open");
|
|
73
74
|
}
|
|
75
|
+
if (initialStateRequest && !this.writeMessage(initialStateRequest.message)) {
|
|
76
|
+
roomInfoWait.cancel();
|
|
77
|
+
throw new Error("WebSocket is not open");
|
|
78
|
+
}
|
|
74
79
|
let roomInfo;
|
|
75
80
|
try {
|
|
76
81
|
roomInfo = await roomInfoWait.promise;
|
|
@@ -103,7 +103,8 @@ var StreamSession = class {
|
|
|
103
103
|
this.config.observability?.markGlassToGlassStart();
|
|
104
104
|
const { roomInfo, initialStateAck } = await this.signaling.openAndJoin({
|
|
105
105
|
connectTimeout: REALTIME_CONFIG.session.connectionTimeoutMs,
|
|
106
|
-
initialState
|
|
106
|
+
initialState,
|
|
107
|
+
passthrough: this.config.initialPassthrough
|
|
107
108
|
});
|
|
108
109
|
this.watchInitialStateAck(initialStateAck, attempt);
|
|
109
110
|
if (this.disposed || this.currentAttempt !== attempt) {
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare const modelStateSchema: z.ZodObject<{
|
|
|
7
7
|
enhance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
8
|
}, z.core.$strip>>;
|
|
9
9
|
image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<Blob, Blob>, z.ZodCustom<File, File>, z.ZodString]>>;
|
|
10
|
+
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
type ModelState = z.infer<typeof modelStateSchema>;
|
|
12
13
|
//#endregion
|
package/dist/shared/types.js
CHANGED