@kosdev-code/kos-ui-sdk 2.0.17 → 2.0.18
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/core/core/lifecycle/model-machine.d.ts.map +1 -1
- package/core/core/model/kos-child-resolver.d.ts.map +1 -1
- package/core/util/model-utils.d.ts.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.js +93 -74
- package/index.js.map +1 -1
- package/models/models/future/future-aware.d.ts +3 -2
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +3 -0
- package/models/models/future/future-types.d.ts.map +1 -1
- package/models/models/future/index.d.ts +1 -1
- package/models/models/future/index.d.ts.map +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var _a = Object.defineProperty;
|
|
2
2
|
var Ia = (e, t, s) => t in e ? _a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
3
|
var a = (e, t, s) => (Ia(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
-
import
|
|
4
|
+
import $ from "loglevel";
|
|
5
5
|
import { runInAction as U, observable as H, when as Lt, makeAutoObservable as ge, action as Hr, ObservableMap as Ao, reaction as Pt, autorun as Ns, makeObservable as qr, computed as Zr, createAtom as $a, observe as Wr, isComputedProp as Ea, isObservable as Ta } from "mobx";
|
|
6
6
|
import { makeAutoObservable as Qy, makeObservable as Xy } from "mobx";
|
|
7
|
-
import { createMachine as Mt, state as F, transition as
|
|
7
|
+
import { createMachine as Mt, state as F, transition as I, invoke as ue, action as C, interpret as _t, immediate as Ye } from "robot3";
|
|
8
8
|
import { format as Se, parseISO as Oa } from "date-fns";
|
|
9
9
|
import { jsx as w, jsxs as It, Fragment as Da } from "@emotion/react/jsx-runtime";
|
|
10
10
|
import Sa from "@emotion/styled";
|
|
@@ -17,22 +17,22 @@ import { useGesture as ka } from "@use-gesture/react";
|
|
|
17
17
|
const Ro = "method", Na = "topic", Nt = "url", Fs = "request-id", Lo = "response-id", Jr = "status", _e = "dst-addr", Fa = "src-addr", ye = "type", Qr = "ordered", Xr = "tracker", xa = "Content-Type", Ua = "Cache-Control", ja = "requestId", Ba = process.env.KOS_LOGIN_URL || "http://localhost", Ka = process.env.KOS_APP_PORT || "8080", Op = `${Ba}:${Ka}`, go = "{MODEL_ID}";
|
|
18
18
|
var xs = /* @__PURE__ */ ((e) => (e.SEND = "/ws/log/msg/send", e.RECEIVED = "/ws/log/msg/receive", e))(xs || {}), Ga = /* @__PURE__ */ ((e) => (e.MSG_RECEIVE = "/mock/msg/receive", e))(Ga || {});
|
|
19
19
|
const en = "/kos/model/ready/";
|
|
20
|
-
|
|
20
|
+
$.info("Initializing event bus");
|
|
21
21
|
globalThis.kos = globalThis.kos || {};
|
|
22
22
|
globalThis.kos.subscriptions = globalThis.kos.subscriptions || {};
|
|
23
23
|
const k = globalThis.kos.subscriptions, za = () => Symbol("eventKey");
|
|
24
24
|
function G(e, t) {
|
|
25
25
|
const s = za();
|
|
26
|
-
return k[e] || (
|
|
26
|
+
return k[e] || ($.debug(`Initializing subscription for ${e}`), k[e] = {}), $.debug(`Subscribing to ${e} with id ${s.toString()}`), k[e][s] = t, {
|
|
27
27
|
count: k[e] ? Object.getOwnPropertySymbols(k[e]).length : 0,
|
|
28
|
-
unsubscribe: () => (
|
|
28
|
+
unsubscribe: () => ($.debug(`Unsubscribing from ${e} with id ${s.toString()}`), k[e] && k[e][s] && delete k[e][s], k[e] && Object.getOwnPropertySymbols(k[e]).length === 0 && delete k[e], {
|
|
29
29
|
count: k[e] ? Object.getOwnPropertySymbols(k[e]).length : 0
|
|
30
30
|
})
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
function z(e, t, s = {}) {
|
|
34
34
|
if (!k[e] || Object.getOwnPropertySymbols(k[e]).length === 0)
|
|
35
|
-
return
|
|
35
|
+
return $.debug(`No subscriptions for ${e}. Not publishing.`), {
|
|
36
36
|
eventType: e,
|
|
37
37
|
subscribers: 0
|
|
38
38
|
};
|
|
@@ -40,24 +40,24 @@ function z(e, t, s = {}) {
|
|
|
40
40
|
return Object.getOwnPropertySymbols(k[e]).forEach((r) => {
|
|
41
41
|
if (s.sync) {
|
|
42
42
|
const n = s.sync;
|
|
43
|
-
|
|
43
|
+
$.debug(
|
|
44
44
|
`Performing sync publish for ${e} with sync id ${n}`
|
|
45
45
|
), k[e][r]({ body: t, headers: s }).then(
|
|
46
46
|
(i) => {
|
|
47
|
-
|
|
47
|
+
$.debug(
|
|
48
48
|
`Response recieved for ${n}, publishing back to source.`
|
|
49
49
|
), z(n, i);
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
} else
|
|
53
|
-
|
|
53
|
+
$.debug(`Performing async publish for ${e}`), k[e][r]({ body: t, headers: s });
|
|
54
54
|
}), {
|
|
55
55
|
eventType: e,
|
|
56
56
|
subscribers: o
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
function Va() {
|
|
60
|
-
|
|
60
|
+
$.warn("Resetting event bus"), Object.keys(k).forEach((e) => delete k[e]);
|
|
61
61
|
}
|
|
62
62
|
const Dp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
63
63
|
__proto__: null,
|
|
@@ -332,8 +332,8 @@ const cn = an, cc = () => cn.profiles || [], or = (e) => cc().includes(e), jp =
|
|
|
332
332
|
}, uc = () => {
|
|
333
333
|
const e = be(), t = dc(), o = e.kosLogLevel ?? t ?? window.kosLogLevel ?? process.env.KOS_LOG_LEVEL;
|
|
334
334
|
return o || "WARN";
|
|
335
|
-
}, hc = () => window.kosMessageLogging || process.env.KOS_MESSAGE_LOGGING === "true", gc = () => window.kosMessageStudioLogging || process.env.KOS_MESSAGE_STUDIO_LOGGING === "true", dn = "ws-log", fc =
|
|
336
|
-
|
|
335
|
+
}, hc = () => window.kosMessageLogging || process.env.KOS_MESSAGE_LOGGING === "true", gc = () => window.kosMessageStudioLogging || process.env.KOS_MESSAGE_STUDIO_LOGGING === "true", dn = "ws-log", fc = $.methodFactory, un = hc(), pc = gc();
|
|
336
|
+
$.methodFactory = function(e, t, s) {
|
|
337
337
|
const o = fc(e, t, s);
|
|
338
338
|
return function(r, n) {
|
|
339
339
|
var l;
|
|
@@ -342,16 +342,16 @@ I.methodFactory = function(e, t, s) {
|
|
|
342
342
|
};
|
|
343
343
|
};
|
|
344
344
|
let hn = uc();
|
|
345
|
-
|
|
345
|
+
$.setLevel(hn);
|
|
346
346
|
window.setKosLogLevel = (e) => {
|
|
347
|
-
hn = e,
|
|
347
|
+
hn = e, $.setLevel(e);
|
|
348
348
|
};
|
|
349
|
-
const ps =
|
|
349
|
+
const ps = $.getLogger(dn);
|
|
350
350
|
window.enableKosMessageLog = () => {
|
|
351
|
-
ps.setLevel(
|
|
351
|
+
ps.setLevel($.levels.INFO);
|
|
352
352
|
};
|
|
353
353
|
window.disableKosMessageLog = () => {
|
|
354
|
-
ps.setLevel(
|
|
354
|
+
ps.setLevel($.levels.ERROR);
|
|
355
355
|
};
|
|
356
356
|
un ? window.enableKosMessageLog() : window.disableKosMessageLog();
|
|
357
357
|
const mc = [
|
|
@@ -373,15 +373,15 @@ const mc = [
|
|
|
373
373
|
"box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 5px 3px -5px rgba(0, 0, 0, 0.5), 0 -13px 5px -10px rgba(255, 255, 255, 0.4) inset",
|
|
374
374
|
"font-weight: bold"
|
|
375
375
|
].join(";"), Gt = (e) => (t) => {
|
|
376
|
-
|
|
376
|
+
$.getLevel() <= e && t();
|
|
377
377
|
}, g = {
|
|
378
|
-
|
|
379
|
-
ifDebug: Gt(
|
|
380
|
-
ifInfo: Gt(
|
|
381
|
-
ifWarn: Gt(
|
|
382
|
-
ifError: Gt(
|
|
383
|
-
getLogger: (e) =>
|
|
384
|
-
createLogger: ({ name: e, group: t }) =>
|
|
378
|
+
...$,
|
|
379
|
+
ifDebug: Gt($.levels.DEBUG),
|
|
380
|
+
ifInfo: Gt($.levels.INFO),
|
|
381
|
+
ifWarn: Gt($.levels.WARN),
|
|
382
|
+
ifError: Gt($.levels.ERROR),
|
|
383
|
+
getLogger: (e) => $.getLogger(`kos::${e}`),
|
|
384
|
+
createLogger: ({ name: e, group: t }) => $.getLogger(`${t ? `${t}:` : "kos"}::${e}`),
|
|
385
385
|
wsSend: (...e) => {
|
|
386
386
|
const t = String(e).replace(/\n/g, "\\n");
|
|
387
387
|
ps.info(`%c⬆ ${t}`, mc);
|
|
@@ -822,11 +822,14 @@ const ro = {
|
|
|
822
822
|
e.status
|
|
823
823
|
);
|
|
824
824
|
return Promise.race([
|
|
825
|
-
d(c.model, i.modelType, l).then(
|
|
826
|
-
()
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
825
|
+
d(c.model, i.modelType, l).then(() => {
|
|
826
|
+
h();
|
|
827
|
+
}).catch((p) => {
|
|
828
|
+
console.error(
|
|
829
|
+
`Error waiting for dependent model ${i.modelType} with id ${l}:`,
|
|
830
|
+
p
|
|
831
|
+
), h();
|
|
832
|
+
}),
|
|
830
833
|
u
|
|
831
834
|
]);
|
|
832
835
|
}).filter((n) => !!n);
|
|
@@ -859,6 +862,10 @@ const ro = {
|
|
|
859
862
|
return Promise.race([
|
|
860
863
|
(u = c.promise) == null ? void 0 : u.then(() => {
|
|
861
864
|
d();
|
|
865
|
+
}).catch((h) => {
|
|
866
|
+
g.error(
|
|
867
|
+
`Model ${c.modelId} - ${c.type} failed to transition to ${s}: ${h.message}`
|
|
868
|
+
), d();
|
|
862
869
|
}),
|
|
863
870
|
l
|
|
864
871
|
]);
|
|
@@ -1018,7 +1025,7 @@ class zc {
|
|
|
1018
1025
|
...this.getResolvedDecoratedChildren(),
|
|
1019
1026
|
...this.getAdditionalChildren(),
|
|
1020
1027
|
...this.model.companionModels.all()
|
|
1021
|
-
]), s = Array.from(t).map((o) => this.model.modelManager.getModelById(o.id || "")).filter((o) => !!o);
|
|
1028
|
+
]), s = Array.from(t).map((o) => this.model.modelManager.getModelById(o.id || "")).filter((o) => o && o.status !== f.FAILED).filter((o) => !!o);
|
|
1022
1029
|
return s.forEach((o) => {
|
|
1023
1030
|
try {
|
|
1024
1031
|
x.setParentContext(
|
|
@@ -1096,21 +1103,21 @@ class Yc {
|
|
|
1096
1103
|
const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
1097
1104
|
const t = Mt(f.INACTIVE, {
|
|
1098
1105
|
[f.FAILED]: F(
|
|
1099
|
-
|
|
1106
|
+
I(O.GO_ACTIVE, f.ACTIVATING)
|
|
1100
1107
|
),
|
|
1101
1108
|
[f.INACTIVE]: F(
|
|
1102
|
-
|
|
1109
|
+
I(O.GO_ACTIVE, f.ACTIVATING)
|
|
1103
1110
|
),
|
|
1104
1111
|
[f.ACTIVATING]: ue(
|
|
1105
1112
|
() => (e.activeStatus = f.ACTIVATING, e.activate()),
|
|
1106
|
-
|
|
1113
|
+
I(
|
|
1107
1114
|
"done",
|
|
1108
1115
|
f.ACTIVE,
|
|
1109
1116
|
C(() => {
|
|
1110
1117
|
e.activeStatus = f.ACTIVE;
|
|
1111
1118
|
})
|
|
1112
1119
|
),
|
|
1113
|
-
|
|
1120
|
+
I(
|
|
1114
1121
|
"error",
|
|
1115
1122
|
f.FAILED,
|
|
1116
1123
|
C(() => {
|
|
@@ -1119,18 +1126,18 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1119
1126
|
)
|
|
1120
1127
|
),
|
|
1121
1128
|
[f.ACTIVE]: F(
|
|
1122
|
-
|
|
1129
|
+
I(O.GO_INACTIVE, f.DEACTIVATING)
|
|
1123
1130
|
),
|
|
1124
1131
|
[f.DEACTIVATING]: ue(
|
|
1125
1132
|
() => (e.activeStatus = f.DEACTIVATING, e.deactivate()),
|
|
1126
|
-
|
|
1133
|
+
I(
|
|
1127
1134
|
"done",
|
|
1128
1135
|
f.INACTIVE,
|
|
1129
1136
|
C(() => {
|
|
1130
1137
|
e.activeStatus = f.INACTIVE;
|
|
1131
1138
|
})
|
|
1132
1139
|
),
|
|
1133
|
-
|
|
1140
|
+
I(
|
|
1134
1141
|
"error",
|
|
1135
1142
|
f.FAILED,
|
|
1136
1143
|
C(() => {
|
|
@@ -1146,7 +1153,7 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1146
1153
|
}, cr = g.createLogger({ name: "model-online-machine" }), Zc = (e) => {
|
|
1147
1154
|
const t = Mt(f.OFFLINE, {
|
|
1148
1155
|
[f.ONLINE]: F(
|
|
1149
|
-
|
|
1156
|
+
I(
|
|
1150
1157
|
O.GO_OFFLINE,
|
|
1151
1158
|
f.OFFLINE,
|
|
1152
1159
|
C(async () => {
|
|
@@ -1155,7 +1162,7 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1155
1162
|
)
|
|
1156
1163
|
),
|
|
1157
1164
|
[f.OFFLINE]: F(
|
|
1158
|
-
|
|
1165
|
+
I(
|
|
1159
1166
|
O.GO_ONLINE,
|
|
1160
1167
|
f.ONLINE,
|
|
1161
1168
|
C(async () => {
|
|
@@ -1176,19 +1183,28 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1176
1183
|
const t = qc(e).service, s = Zc(e).service;
|
|
1177
1184
|
return Mt(f.CREATING, {
|
|
1178
1185
|
[f.CREATING]: F(
|
|
1179
|
-
|
|
1186
|
+
I(O.CREATE, f.CREATED)
|
|
1180
1187
|
),
|
|
1181
1188
|
[f.CREATED]: F(Ye(f.INITIALIZING)),
|
|
1182
1189
|
[f.INITIALIZING]: ue(
|
|
1183
1190
|
() => (X(() => {
|
|
1184
1191
|
e.status = f.INITIALIZING;
|
|
1185
1192
|
}), e.init()),
|
|
1186
|
-
|
|
1193
|
+
I(
|
|
1187
1194
|
"done",
|
|
1188
1195
|
f.INITIALIZED,
|
|
1189
1196
|
C(() => {
|
|
1190
1197
|
e.status = f.INITIALIZED;
|
|
1191
1198
|
})
|
|
1199
|
+
),
|
|
1200
|
+
I(
|
|
1201
|
+
"error",
|
|
1202
|
+
f.FAILED,
|
|
1203
|
+
C(() => {
|
|
1204
|
+
g.error(
|
|
1205
|
+
`Model ${e.modelId} - ${e.modelTypeName} failed to initialize. Transitioning to FAILED state.`
|
|
1206
|
+
), e.status = f.FAILED;
|
|
1207
|
+
})
|
|
1192
1208
|
)
|
|
1193
1209
|
),
|
|
1194
1210
|
[f.INITIALIZED]: F(Ye(f.LOADING)),
|
|
@@ -1196,14 +1212,14 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1196
1212
|
() => (X(() => {
|
|
1197
1213
|
e.status = f.LOADING;
|
|
1198
1214
|
}), e.load()),
|
|
1199
|
-
|
|
1215
|
+
I(
|
|
1200
1216
|
"done",
|
|
1201
1217
|
f.LOADED,
|
|
1202
1218
|
C(() => {
|
|
1203
1219
|
e.status = f.LOADED;
|
|
1204
1220
|
})
|
|
1205
1221
|
),
|
|
1206
|
-
|
|
1222
|
+
I(
|
|
1207
1223
|
"error",
|
|
1208
1224
|
f.FAILED,
|
|
1209
1225
|
C(() => {
|
|
@@ -1213,7 +1229,7 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1213
1229
|
),
|
|
1214
1230
|
[f.LOADED]: F(
|
|
1215
1231
|
Ye(f.READYING),
|
|
1216
|
-
|
|
1232
|
+
I(O.UNLOAD, f.UNLOADING)
|
|
1217
1233
|
),
|
|
1218
1234
|
[f.RESETTING]: ue(
|
|
1219
1235
|
() => {
|
|
@@ -1222,7 +1238,7 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1222
1238
|
e.status = f.RESETTING;
|
|
1223
1239
|
}), (r = e.unload) == null || r.call(e), e.load();
|
|
1224
1240
|
},
|
|
1225
|
-
|
|
1241
|
+
I(
|
|
1226
1242
|
"done",
|
|
1227
1243
|
f.LOADED,
|
|
1228
1244
|
C(() => {
|
|
@@ -1234,7 +1250,7 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1234
1250
|
() => (X(() => {
|
|
1235
1251
|
e.status = f.READYING;
|
|
1236
1252
|
}), e.ready()),
|
|
1237
|
-
|
|
1253
|
+
I(
|
|
1238
1254
|
"done",
|
|
1239
1255
|
f.READY,
|
|
1240
1256
|
C(() => {
|
|
@@ -1243,7 +1259,7 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1243
1259
|
}), s.send(O.GO_ONLINE);
|
|
1244
1260
|
})
|
|
1245
1261
|
),
|
|
1246
|
-
|
|
1262
|
+
I(
|
|
1247
1263
|
"error",
|
|
1248
1264
|
f.FAILED,
|
|
1249
1265
|
C(() => {
|
|
@@ -1252,34 +1268,34 @@ const Hc = g.createLogger({ name: "model-active-machine" }), qc = (e) => {
|
|
|
1252
1268
|
)
|
|
1253
1269
|
),
|
|
1254
1270
|
[f.READY]: F(
|
|
1255
|
-
|
|
1271
|
+
I(
|
|
1256
1272
|
O.UNLOAD,
|
|
1257
1273
|
f.UNLOADED,
|
|
1258
1274
|
C((o = e.unload) == null ? void 0 : o.bind(e))
|
|
1259
1275
|
),
|
|
1260
|
-
|
|
1261
|
-
|
|
1276
|
+
I(O.RESET, f.RESETTING),
|
|
1277
|
+
I(
|
|
1262
1278
|
O.GO_ONLINE,
|
|
1263
1279
|
f.READY,
|
|
1264
1280
|
C(() => {
|
|
1265
1281
|
s.send(O.GO_ONLINE);
|
|
1266
1282
|
})
|
|
1267
1283
|
),
|
|
1268
|
-
|
|
1284
|
+
I(
|
|
1269
1285
|
O.GO_OFFLINE,
|
|
1270
1286
|
f.READY,
|
|
1271
1287
|
C(() => {
|
|
1272
1288
|
s.send(O.GO_OFFLINE);
|
|
1273
1289
|
})
|
|
1274
1290
|
),
|
|
1275
|
-
|
|
1291
|
+
I(
|
|
1276
1292
|
O.GO_ACTIVE,
|
|
1277
1293
|
f.READY,
|
|
1278
1294
|
C(() => {
|
|
1279
1295
|
t.send(O.GO_ACTIVE);
|
|
1280
1296
|
})
|
|
1281
1297
|
),
|
|
1282
|
-
|
|
1298
|
+
I(
|
|
1283
1299
|
O.GO_INACTIVE,
|
|
1284
1300
|
f.READY,
|
|
1285
1301
|
C(() => {
|
|
@@ -1806,17 +1822,17 @@ class yl {
|
|
|
1806
1822
|
a(this, "_onopen");
|
|
1807
1823
|
a(this, "messageQueue", []);
|
|
1808
1824
|
a(this, "isSending", !1);
|
|
1809
|
-
|
|
1825
|
+
$.debug(`called Bridge Transport with addr ${t}`);
|
|
1810
1826
|
const s = this;
|
|
1811
1827
|
globalThis.kosWindowWebsocketRecv = (o) => {
|
|
1812
1828
|
if (s.onmessage) {
|
|
1813
1829
|
const r = { data: o };
|
|
1814
1830
|
s.onmessage(r);
|
|
1815
1831
|
}
|
|
1816
|
-
},
|
|
1832
|
+
}, $.debug("Opening bridge transport"), globalThis.kosWindowWebsocketOpen(), $.debug("Opened bridge transport"), this._onclose = null, this._onerror = null, this._onmessage = null, this._onopen = null, this.addEventListener = () => $.debug("not implemented"), this.dispatchEvent = () => $.debug("not implemented"), this.removeEventListener = () => $.debug("not implemented");
|
|
1817
1833
|
}
|
|
1818
1834
|
close() {
|
|
1819
|
-
|
|
1835
|
+
$.debug("closing");
|
|
1820
1836
|
}
|
|
1821
1837
|
sendNextMessage() {
|
|
1822
1838
|
if (this.messageQueue.length > 0) {
|
|
@@ -1940,7 +1956,7 @@ Ml.fos && (window.kosUseFos = !0);
|
|
|
1940
1956
|
const fr = process.env.KOS_FOS_PORT;
|
|
1941
1957
|
window.kosUseFos = !!(window.kosUseFos || process.env.KOS_USE_FOS === "true");
|
|
1942
1958
|
window.kosFosPort = fr ? parseInt(fr) : 0;
|
|
1943
|
-
const Oe =
|
|
1959
|
+
const Oe = $.getLogger("web-socket-transport");
|
|
1944
1960
|
var _l = /* @__PURE__ */ ((e) => (e.NOT_INITIALIZED = "not_initialized", e.INITIALIZED = "initialized", e.OFFLINE = "OFFLINE", e.ONLINE = "ONLINE", e))(_l || {}), as = /* @__PURE__ */ ((e) => (e.CONNECTED = "websocket.connected", e.DISCONNECTED = "websocket.disconnected", e.RELOAD = "websocket.reload", e))(as || {});
|
|
1945
1961
|
class Bs {
|
|
1946
1962
|
constructor({
|
|
@@ -2255,7 +2271,7 @@ class Tl {
|
|
|
2255
2271
|
return u;
|
|
2256
2272
|
}
|
|
2257
2273
|
}
|
|
2258
|
-
const S =
|
|
2274
|
+
const S = $.getLogger("kos-model"), pr = "kos.extension.model.loader";
|
|
2259
2275
|
class Ol {
|
|
2260
2276
|
constructor({ modelTypeName: t, id: s, modelData: o }) {
|
|
2261
2277
|
a(this, "_id");
|
|
@@ -2899,7 +2915,7 @@ var cs = /* @__PURE__ */ ((e) => (e.CREATING = "creating", e.CREATED = "created"
|
|
|
2899
2915
|
const Nl = (e) => {
|
|
2900
2916
|
const t = Mt("offline", {
|
|
2901
2917
|
online: F(
|
|
2902
|
-
|
|
2918
|
+
I(
|
|
2903
2919
|
"go_offline",
|
|
2904
2920
|
"offline",
|
|
2905
2921
|
C(() => {
|
|
@@ -2910,7 +2926,7 @@ const Nl = (e) => {
|
|
|
2910
2926
|
)
|
|
2911
2927
|
),
|
|
2912
2928
|
offline: F(
|
|
2913
|
-
|
|
2929
|
+
I(
|
|
2914
2930
|
"go_online",
|
|
2915
2931
|
"online",
|
|
2916
2932
|
C(() => {
|
|
@@ -2922,10 +2938,10 @@ const Nl = (e) => {
|
|
|
2922
2938
|
)
|
|
2923
2939
|
}), s = _t(
|
|
2924
2940
|
t,
|
|
2925
|
-
(n) =>
|
|
2941
|
+
(n) => $.debug(n.machine.current)
|
|
2926
2942
|
), o = Mt({
|
|
2927
2943
|
creating: F(
|
|
2928
|
-
|
|
2944
|
+
I(
|
|
2929
2945
|
"create",
|
|
2930
2946
|
"created"
|
|
2931
2947
|
/* CREATED */
|
|
@@ -2937,7 +2953,7 @@ const Nl = (e) => {
|
|
|
2937
2953
|
)),
|
|
2938
2954
|
initializing: ue(
|
|
2939
2955
|
() => e.init(),
|
|
2940
|
-
|
|
2956
|
+
I(
|
|
2941
2957
|
"done",
|
|
2942
2958
|
"initialized"
|
|
2943
2959
|
/* INITIALIZED */
|
|
@@ -2949,7 +2965,7 @@ const Nl = (e) => {
|
|
|
2949
2965
|
)),
|
|
2950
2966
|
loading: ue(
|
|
2951
2967
|
() => e.load(),
|
|
2952
|
-
|
|
2968
|
+
I(
|
|
2953
2969
|
"done",
|
|
2954
2970
|
"loaded"
|
|
2955
2971
|
/* LOADED */
|
|
@@ -2960,7 +2976,7 @@ const Nl = (e) => {
|
|
|
2960
2976
|
"readying"
|
|
2961
2977
|
/* READYING */
|
|
2962
2978
|
),
|
|
2963
|
-
|
|
2979
|
+
I(
|
|
2964
2980
|
"unload",
|
|
2965
2981
|
"unloading"
|
|
2966
2982
|
/* UNLOADING */
|
|
@@ -2968,7 +2984,7 @@ const Nl = (e) => {
|
|
|
2968
2984
|
),
|
|
2969
2985
|
readying: ue(
|
|
2970
2986
|
() => e.ready(),
|
|
2971
|
-
|
|
2987
|
+
I(
|
|
2972
2988
|
"done",
|
|
2973
2989
|
"ready",
|
|
2974
2990
|
C(() => {
|
|
@@ -2980,24 +2996,24 @@ const Nl = (e) => {
|
|
|
2980
2996
|
),
|
|
2981
2997
|
reloading: ue(
|
|
2982
2998
|
() => e.reload(),
|
|
2983
|
-
|
|
2999
|
+
I(
|
|
2984
3000
|
"done",
|
|
2985
3001
|
"loading"
|
|
2986
3002
|
/* LOADING */
|
|
2987
3003
|
)
|
|
2988
3004
|
),
|
|
2989
3005
|
ready: F(
|
|
2990
|
-
|
|
3006
|
+
I(
|
|
2991
3007
|
"reload",
|
|
2992
3008
|
"reloading"
|
|
2993
3009
|
/* RELOADING */
|
|
2994
3010
|
),
|
|
2995
|
-
|
|
3011
|
+
I(
|
|
2996
3012
|
"unload",
|
|
2997
3013
|
"unloaded",
|
|
2998
3014
|
C(e.unload.bind(e))
|
|
2999
3015
|
),
|
|
3000
|
-
|
|
3016
|
+
I(
|
|
3001
3017
|
"go_online",
|
|
3002
3018
|
"ready",
|
|
3003
3019
|
C(() => {
|
|
@@ -3007,7 +3023,7 @@ const Nl = (e) => {
|
|
|
3007
3023
|
);
|
|
3008
3024
|
})
|
|
3009
3025
|
),
|
|
3010
|
-
|
|
3026
|
+
I(
|
|
3011
3027
|
"go_offline",
|
|
3012
3028
|
"ready",
|
|
3013
3029
|
C(() => {
|
|
@@ -3022,7 +3038,7 @@ const Nl = (e) => {
|
|
|
3022
3038
|
});
|
|
3023
3039
|
return { service: _t(
|
|
3024
3040
|
o,
|
|
3025
|
-
(n) =>
|
|
3041
|
+
(n) => $.debug(n.machine.current)
|
|
3026
3042
|
), online: s };
|
|
3027
3043
|
}, re = async (e) => {
|
|
3028
3044
|
if (e.id) {
|
|
@@ -4209,7 +4225,7 @@ const Ir = (e, t, s) => async ({
|
|
|
4209
4225
|
}
|
|
4210
4226
|
}, gd = Us(), fd = () => `kos-${gd}`, bm = (e) => !!e && !e.includes("VM_SERVICE") && e.startsWith(fd()), In = async (e, t = 6e4) => new Promise((s, o) => {
|
|
4211
4227
|
const { unsubscribe: r } = G(e, (i) => {
|
|
4212
|
-
|
|
4228
|
+
$.debug(`recieved response for refId ${e}: ${i}`), r(), clearTimeout(n);
|
|
4213
4229
|
try {
|
|
4214
4230
|
const c = i != null && i.body ? JSON.parse(i.body) : {};
|
|
4215
4231
|
s(c);
|
|
@@ -5887,6 +5903,9 @@ class Cm {
|
|
|
5887
5903
|
getFuture(t) {
|
|
5888
5904
|
return this.futures.get(t || this.context);
|
|
5889
5905
|
}
|
|
5906
|
+
get futureMap() {
|
|
5907
|
+
return this.futures;
|
|
5908
|
+
}
|
|
5890
5909
|
}
|
|
5891
5910
|
class Nn {
|
|
5892
5911
|
constructor(t) {
|