@reactor-team/js-sdk 2.1.0 → 2.2.1
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/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -103,16 +103,20 @@ var ConflictError = class extends Error {
|
|
|
103
103
|
// src/core/types.ts
|
|
104
104
|
var import_zod = require("zod");
|
|
105
105
|
var SessionState = /* @__PURE__ */ ((SessionState2) => {
|
|
106
|
-
SessionState2[SessionState2["
|
|
107
|
-
SessionState2[SessionState2["
|
|
108
|
-
SessionState2[SessionState2["
|
|
109
|
-
SessionState2[SessionState2["
|
|
110
|
-
SessionState2[SessionState2["
|
|
111
|
-
SessionState2[SessionState2["
|
|
106
|
+
SessionState2[SessionState2["CREATED"] = 0] = "CREATED";
|
|
107
|
+
SessionState2[SessionState2["PENDING"] = 1] = "PENDING";
|
|
108
|
+
SessionState2[SessionState2["SUSPENDED"] = 2] = "SUSPENDED";
|
|
109
|
+
SessionState2[SessionState2["WAITING"] = 3] = "WAITING";
|
|
110
|
+
SessionState2[SessionState2["ACTIVE"] = 4] = "ACTIVE";
|
|
111
|
+
SessionState2[SessionState2["INACTIVE"] = 5] = "INACTIVE";
|
|
112
|
+
SessionState2[SessionState2["CLOSED"] = 6] = "CLOSED";
|
|
112
113
|
return SessionState2;
|
|
113
114
|
})(SessionState || {});
|
|
115
|
+
var ModelSchema = import_zod.z.object({
|
|
116
|
+
name: import_zod.z.string()
|
|
117
|
+
});
|
|
114
118
|
var CreateSessionRequestSchema = import_zod.z.object({
|
|
115
|
-
model:
|
|
119
|
+
model: ModelSchema,
|
|
116
120
|
sdp_offer: import_zod.z.string(),
|
|
117
121
|
extra_args: import_zod.z.record(import_zod.z.string(), import_zod.z.any())
|
|
118
122
|
// Dictionary
|
|
@@ -299,7 +303,7 @@ var CoordinatorClient = class {
|
|
|
299
303
|
return __async(this, null, function* () {
|
|
300
304
|
console.debug("[CoordinatorClient] Creating session...");
|
|
301
305
|
const requestBody = {
|
|
302
|
-
model: this.model,
|
|
306
|
+
model: { name: this.model },
|
|
303
307
|
sdp_offer,
|
|
304
308
|
extra_args: {}
|
|
305
309
|
};
|
|
@@ -1097,7 +1101,9 @@ var Reactor = class {
|
|
|
1097
1101
|
setupMachineClientHandlers() {
|
|
1098
1102
|
if (!this.machineClient) return;
|
|
1099
1103
|
this.machineClient.on("application", (message) => {
|
|
1100
|
-
|
|
1104
|
+
if ((message == null ? void 0 : message.type) === "application" && (message == null ? void 0 : message.data) !== void 0) {
|
|
1105
|
+
this.emit("newMessage", message.data);
|
|
1106
|
+
}
|
|
1101
1107
|
});
|
|
1102
1108
|
this.machineClient.on("statusChanged", (status) => {
|
|
1103
1109
|
switch (status) {
|