@xyo-network/os-runtime 8.0.1 → 8.0.3
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/neutral/Caller.d.ts.map +1 -1
- package/dist/neutral/adapter/Base.d.ts.map +1 -1
- package/dist/neutral/adapter/Network.d.ts +1 -1
- package/dist/neutral/adapter/Network.d.ts.map +1 -1
- package/dist/neutral/classes/settings/Caller.d.ts.map +1 -1
- package/dist/neutral/classes/settings/SettingsQueries.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/Creator.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.d.ts.map +1 -1
- package/dist/neutral/event/bus/Connection.d.ts +2 -1
- package/dist/neutral/event/bus/Connection.d.ts.map +1 -1
- package/dist/neutral/event/bus/EventBus.d.ts.map +1 -1
- package/dist/neutral/helpers/monitor/XyOsMonitor.d.ts.map +1 -1
- package/dist/neutral/index.mjs +91 -87
- package/dist/neutral/index.mjs.map +2 -2
- package/dist/neutral/lib/PayloadStore.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistry.d.ts.map +1 -1
- package/dist/neutral/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
- package/dist/neutral/stack/OsPubSubNetworkStack.d.ts.map +1 -1
- package/dist/neutral/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
- package/dist/neutral/wallet/DappSeedPhraseRepository.d.ts +1 -1
- package/dist/neutral/wallet/DappSeedPhraseRepository.d.ts.map +1 -1
- package/dist/node/Caller.d.ts.map +1 -1
- package/dist/node/adapter/Base.d.ts.map +1 -1
- package/dist/node/adapter/Network.d.ts +1 -1
- package/dist/node/adapter/Network.d.ts.map +1 -1
- package/dist/node/classes/settings/Caller.d.ts.map +1 -1
- package/dist/node/classes/settings/SettingsQueries.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/Creator.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.d.ts.map +1 -1
- package/dist/node/event/bus/Connection.d.ts +2 -1
- package/dist/node/event/bus/Connection.d.ts.map +1 -1
- package/dist/node/event/bus/EventBus.d.ts.map +1 -1
- package/dist/node/helpers/monitor/XyOsMonitor.d.ts.map +1 -1
- package/dist/node/index.mjs +91 -87
- package/dist/node/index.mjs.map +2 -2
- package/dist/node/lib/PayloadStore.d.ts.map +1 -1
- package/dist/node/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/node/registration/DappRegistry.d.ts.map +1 -1
- package/dist/node/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
- package/dist/node/scripts/xyos/index.mjs +76 -72
- package/dist/node/scripts/xyos/index.mjs.map +2 -2
- package/dist/node/stack/OsPubSubNetworkStack.d.ts.map +1 -1
- package/dist/node/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
- package/dist/node/wallet/DappSeedPhraseRepository.d.ts +1 -1
- package/dist/node/wallet/DappSeedPhraseRepository.d.ts.map +1 -1
- package/package.json +24 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadStore.d.ts","sourceRoot":"","sources":["../../../src/lib/PayloadStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IAC7D,SAAS,EAAE,iBAAiB,CAAA;IAC5B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,CAAA;IAC7B,UAAU,EAAE,CAAC,MAAM,EAAE,OAAO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MAAM,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EAC/C,SAAS,EAAE,SAAS,EAAE,UAAU,GACjC,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAmCxB;;OAEG;IACH,gBAAgB;IAOhB;;OAEG;IACH,WAAW,IAAI,CAAC,EAAE;IAIlB;;;OAGG;IACH,SAAS,CAAC,aAAa,EAAE,QAAQ;IAOjC,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,eAAe;CAMxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DappRegistrationService.d.ts","sourceRoot":"","sources":["../../../src/registration/DappRegistrationService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,EACV,0BAA0B,EAC1B,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAc9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACtC,YAAY,EAAE,kBAAkB,EAAE,CAAA;CACnC;AAED,qBAAa,uBAAuB;IAElC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAK;IAEhD,YAAY,EAAE,YAAY,CAAA;IAC1B,wBAAwB,EAAE,wBAAwB,CAAA;IAClD,iBAAiB,EAAE,iBAAiB,CAAA;IAGpC,wBAAwB,2FAAqC;IAG7D,kBAAkB,2FAAqC;IAGvD,yBAAyB,2FAAqC;IAE9D,OAAO,CAAC,OAAO,CAAa;IAE5B,OAAO,CAAC,2BAA2B,CAAgC;IACnE,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC,OAAO,CAAC,2BAA2B,CAAgC;IAEnE,OAAO,CAAC,OAAO,CAA8B;IAE7C,OAAO,CAAC,MAAM,CAA+B;gBAG3C,OAAO,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,6BAA6B,EACtC,OAAO,GAAE,4BAAyD,EAClE,eAAe,CAAC,EAAE,OAAO;IAuBrB,SAAS,CACb,QAAQ,EAAE,0BAA0B,EACpC,MAAM,SAAsD,EAC5D,IAAI,SAA4D,GAC/D,OAAO,CAAC,eAAe,CAAC;IAY3B,0BAA0B,CAAC,MAAM,EAAE,MAAM;IAInC,KAAK,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAiC/C,OAAO,CAAC,qBAAqB;IAK7B;;;OAGG;IACH,OAAO,CAAC,OAAO;YAID,wBAAwB;
|
|
1
|
+
{"version":3,"file":"DappRegistrationService.d.ts","sourceRoot":"","sources":["../../../src/registration/DappRegistrationService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,EACV,0BAA0B,EAC1B,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAc9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACtC,YAAY,EAAE,kBAAkB,EAAE,CAAA;CACnC;AAED,qBAAa,uBAAuB;IAElC,UAAU,EAAE,MAAM,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OAAO,CAAC,wBAAwB,CAA0B;gBAE9C,wBAAwB,EAAE,wBAAwB;IAI9D;;;;OAIG;IACG,YAAY,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"DappRegistry.d.ts","sourceRoot":"","sources":["../../../src/registration/DappRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAGV,cAAc,EACd,gBAAgB,EAEjB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAOlE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAErC;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,wBAAwB,CAA0B;gBAE9C,wBAAwB,EAAE,wBAAwB;IAI9D;;;;OAIG;IACG,YAAY,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAkD3E;;;OAGG;IACH,cAAc,CAAC,MAAM,EAAE,IAAI;IAI3B,OAAO,CAAC,qBAAqB;YAaf,0BAA0B;CAgBzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../../src/registration/ValidateDappAccessDiviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAkB/D,OAAO,KAAK,EAEV,2BAA2B,EAC3B,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,aAAa,CAAA;AAOpB,qBAAa,yBAAyB,CAAC,OAAO,SAAS,+BAA+B,GAAG,+BAA+B,CAAE,SAAQ,eAAe,CAC/I,OAAO,EACP,2BAA2B,EAC3B,4BAA4B,CAC7B;IACC,OAAgB,aAAa;;SAA0C;cAE9C,aAAa,CAAC,QAAQ,CAAC,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,4BAA4B,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../../src/registration/ValidateDappAccessDiviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAkB/D,OAAO,KAAK,EAEV,2BAA2B,EAC3B,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,aAAa,CAAA;AAOpB,qBAAa,yBAAyB,CAAC,OAAO,SAAS,+BAA+B,GAAG,+BAA+B,CAAE,SAAQ,eAAe,CAC/I,OAAO,EACP,2BAA2B,EAC3B,4BAA4B,CAC7B;IACC,OAAgB,aAAa;;SAA0C;cAE9C,aAAa,CAAC,QAAQ,CAAC,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,4BAA4B,EAAE,CAAC;CAyD1H"}
|
|
@@ -44,19 +44,22 @@ import { ModuleFactoryLocator as ModuleFactoryLocator6 } from "@xyo-network/sdk-
|
|
|
44
44
|
// src/event/bus/Connection.ts
|
|
45
45
|
import { assertEx, BaseEmitter } from "@xylabs/sdk-js";
|
|
46
46
|
var EventBusConnection = class extends BaseEmitter {
|
|
47
|
-
_id;
|
|
48
47
|
description;
|
|
49
48
|
type;
|
|
49
|
+
#id;
|
|
50
50
|
constructor(request) {
|
|
51
51
|
super({});
|
|
52
52
|
this.description = request.description;
|
|
53
53
|
this.type = request.type;
|
|
54
54
|
}
|
|
55
|
+
get hasId() {
|
|
56
|
+
return this.#id !== void 0;
|
|
57
|
+
}
|
|
55
58
|
get id() {
|
|
56
|
-
return assertEx(this
|
|
59
|
+
return assertEx(this.#id, () => "Connection ID not set. Did you forget to call buildConnection()?");
|
|
57
60
|
}
|
|
58
61
|
buildConnection(id) {
|
|
59
|
-
this
|
|
62
|
+
this.#id = id;
|
|
60
63
|
}
|
|
61
64
|
};
|
|
62
65
|
|
|
@@ -122,15 +125,18 @@ var EventBus = class {
|
|
|
122
125
|
this.archivist.on("inserted", ({ payloads }) => {
|
|
123
126
|
const eventBusEvent = findAs(payloads, asOptionalEventBusEvent);
|
|
124
127
|
if (!eventBusEvent) return;
|
|
128
|
+
const notifySubscribableEvent = ([eventName, callback]) => {
|
|
129
|
+
if (eventName !== eventBusEvent.name) return;
|
|
130
|
+
if (callback) {
|
|
131
|
+
const forgettable = async () => await callback({ payloads });
|
|
132
|
+
forget(forgettable());
|
|
133
|
+
}
|
|
134
|
+
};
|
|
125
135
|
for (const connectionId in this.connections) {
|
|
126
136
|
const connection = this.connections[connectionId];
|
|
127
137
|
if (isPubSubConnections(connection) && connection.subscribableEvents) {
|
|
128
|
-
for (const
|
|
129
|
-
|
|
130
|
-
if (callback) {
|
|
131
|
-
const forgettable = async () => await callback({ payloads });
|
|
132
|
-
forget(forgettable());
|
|
133
|
-
}
|
|
138
|
+
for (const subscribableEvent of connection.subscribableEvents) {
|
|
139
|
+
notifySubscribableEvent(subscribableEvent);
|
|
134
140
|
}
|
|
135
141
|
}
|
|
136
142
|
}
|
|
@@ -525,12 +531,12 @@ var DappIntentCaller = class _DappIntentCaller extends DappCallerBase {
|
|
|
525
531
|
// Get all intents
|
|
526
532
|
async allIntents() {
|
|
527
533
|
const archivist = await this.getDappIntentArchivist();
|
|
528
|
-
return await archivist.
|
|
534
|
+
return await archivist.next();
|
|
529
535
|
}
|
|
530
536
|
// Get the latest intent saved to the archivist
|
|
531
537
|
async latestIntent() {
|
|
532
538
|
const archivist = await this.getDappIntentArchivist();
|
|
533
|
-
return (await archivist.
|
|
539
|
+
return (await archivist.next()).at(-1);
|
|
534
540
|
}
|
|
535
541
|
// Get the latest intent for a dapp
|
|
536
542
|
async latestIntentForDappName(dappName) {
|
|
@@ -698,7 +704,7 @@ var ManageSystemDapps = class extends OsCallerBase {
|
|
|
698
704
|
async insertPayloads() {
|
|
699
705
|
const archivist = this.developmentMode ? await this.getDappsArchivistDevelopment() : await this.getDappsArchivist();
|
|
700
706
|
try {
|
|
701
|
-
const allPayloads = await archivist.
|
|
707
|
+
const allPayloads = await archivist.next();
|
|
702
708
|
if (allPayloads.length === 0) {
|
|
703
709
|
await this.freshInstall(archivist);
|
|
704
710
|
return true;
|
|
@@ -826,7 +832,7 @@ var DappSeedPhraseRepository = class extends OsCallerBase {
|
|
|
826
832
|
schemas: [DappWalletSeedPhraseSchema]
|
|
827
833
|
};
|
|
828
834
|
const results = await diviner.divine([query]);
|
|
829
|
-
return results
|
|
835
|
+
return results[0];
|
|
830
836
|
}
|
|
831
837
|
async checkWalletId(walletId) {
|
|
832
838
|
const diviner = await this.getDappsArchivistPayloadDiviner();
|
|
@@ -838,7 +844,7 @@ var DappSeedPhraseRepository = class extends OsCallerBase {
|
|
|
838
844
|
walletId
|
|
839
845
|
};
|
|
840
846
|
const results = await diviner.divine([query]);
|
|
841
|
-
return results
|
|
847
|
+
return results[0];
|
|
842
848
|
}
|
|
843
849
|
newPhrase() {
|
|
844
850
|
return HDWallet.generateMnemonic();
|
|
@@ -1077,14 +1083,14 @@ var ValidateDappAccessDiviner = class extends AbstractDiviner {
|
|
|
1077
1083
|
static configSchemas = [ValidateDappAccessDivinerConfigSchema];
|
|
1078
1084
|
async divineHandler(payloads) {
|
|
1079
1085
|
const dappManifest = payloads?.filter(isDappPackageManifestPayload) ?? [];
|
|
1080
|
-
const accessors = payloads?.filter(isUnregisteredDappAccess) ?? [];
|
|
1081
|
-
const dappParams = this.params.dappParams;
|
|
1082
1086
|
if (dappManifest.length > 1) {
|
|
1083
1087
|
throw new Error("Only one dapp manifest payload is allowed");
|
|
1084
1088
|
}
|
|
1089
|
+
const accessors = payloads?.filter(isUnregisteredDappAccess) ?? [];
|
|
1085
1090
|
if (dappManifest.length === 0 || accessors.length === 0) {
|
|
1086
1091
|
return [];
|
|
1087
1092
|
}
|
|
1093
|
+
const dappParams = this.params.dappParams;
|
|
1088
1094
|
const registeredAccessors = [];
|
|
1089
1095
|
const failedAccessors = [];
|
|
1090
1096
|
for (const access of accessors) {
|
|
@@ -1182,6 +1188,10 @@ var DappRegistry = class {
|
|
|
1182
1188
|
} = this.extractDappProperties(dapp);
|
|
1183
1189
|
try {
|
|
1184
1190
|
const walletId = await this.dappSeedPhraseRepository.findOrCreate(name);
|
|
1191
|
+
if (this.dappRegistry.get(name)) {
|
|
1192
|
+
console.warn("tried to register two dapps with the same name", name);
|
|
1193
|
+
return null;
|
|
1194
|
+
}
|
|
1185
1195
|
const registeredAccessors = await this.validateDappAccessPayloads(manifest, dapp.accessors, params);
|
|
1186
1196
|
const registeredDapp = {
|
|
1187
1197
|
accessors: registeredAccessors,
|
|
@@ -1199,10 +1209,6 @@ var DappRegistry = class {
|
|
|
1199
1209
|
params,
|
|
1200
1210
|
widgetConfigs
|
|
1201
1211
|
};
|
|
1202
|
-
if (this.dappRegistry.get(name)) {
|
|
1203
|
-
console.warn("tried to register two dapps with the same name", name);
|
|
1204
|
-
return null;
|
|
1205
|
-
}
|
|
1206
1212
|
this.dappRegistry.set(name, registeredDapp);
|
|
1207
1213
|
return registeredDapp;
|
|
1208
1214
|
} catch (e) {
|
|
@@ -1354,21 +1360,22 @@ var DappRegistrationService = class {
|
|
|
1354
1360
|
return this.context.user;
|
|
1355
1361
|
}
|
|
1356
1362
|
async postRegistrationHandlers(registeredDapp) {
|
|
1357
|
-
if (registeredDapp.dapp) {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1363
|
+
if (!registeredDapp.dapp) {
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
if (isRegisteredDappExposedDappSet(registeredDapp)) {
|
|
1367
|
+
this.registeredExposedDappSets.add(registeredDapp);
|
|
1368
|
+
const exposeIntent = DappIntentCaller.buildIntent(
|
|
1369
|
+
DappIntentCaller.OsDappName,
|
|
1370
|
+
DappIntentTypes.Launch,
|
|
1371
|
+
registeredDapp.dapp.config.name,
|
|
1372
|
+
DappMode2.Exposed
|
|
1373
|
+
);
|
|
1374
|
+
await this.exposeDappRequestConnection.emit(ExposeDappRequestEvent, { payloads: [registeredDapp.dapp.config, exposeIntent] });
|
|
1375
|
+
}
|
|
1376
|
+
if (isRegisteredDappAccessDappSet(registeredDapp)) {
|
|
1377
|
+
this.registeredAccessDappSets.add(registeredDapp);
|
|
1378
|
+
await this.dappAccessRequestConnection.emit(DappAccessRequestEvent, { payloads: registeredDapp.dapp.accessors });
|
|
1372
1379
|
}
|
|
1373
1380
|
}
|
|
1374
1381
|
};
|
|
@@ -1402,7 +1409,7 @@ var Signers = class {
|
|
|
1402
1409
|
}
|
|
1403
1410
|
async initialize() {
|
|
1404
1411
|
for (const [walletKindName, signerPaths] of this.paths) {
|
|
1405
|
-
for (const [signerName, walletPath] of signerPaths
|
|
1412
|
+
for (const [signerName, walletPath] of signerPaths) {
|
|
1406
1413
|
await this.initializeSigners(walletKindName, signerName, walletPath);
|
|
1407
1414
|
}
|
|
1408
1415
|
}
|
|
@@ -1548,7 +1555,7 @@ var StackManager = class {
|
|
|
1548
1555
|
this.stackMap = stackMap;
|
|
1549
1556
|
}
|
|
1550
1557
|
get stacks() {
|
|
1551
|
-
return
|
|
1558
|
+
return this.initializedStacksMap.keys().toArray();
|
|
1552
1559
|
}
|
|
1553
1560
|
get initializedStacks() {
|
|
1554
1561
|
return this.initializedStacksMap;
|
|
@@ -1646,21 +1653,21 @@ var NodeAdapterBase = class extends BaseEmitter4 {
|
|
|
1646
1653
|
|
|
1647
1654
|
// src/adapter/Network.ts
|
|
1648
1655
|
var NetworkAdapter = class extends NodeAdapterBase {
|
|
1649
|
-
|
|
1656
|
+
#connection;
|
|
1650
1657
|
constructor(kernel, driverName) {
|
|
1651
1658
|
super(kernel, driverName);
|
|
1652
1659
|
this.on("driverReady", ({ node }) => {
|
|
1653
|
-
this
|
|
1660
|
+
this.#connection = node;
|
|
1654
1661
|
});
|
|
1655
1662
|
}
|
|
1656
1663
|
get connection() {
|
|
1657
|
-
return this
|
|
1664
|
+
return this.#connection;
|
|
1658
1665
|
}
|
|
1659
1666
|
get hasConnection() {
|
|
1660
1667
|
return !!this.connection;
|
|
1661
1668
|
}
|
|
1662
1669
|
removeConnection() {
|
|
1663
|
-
this
|
|
1670
|
+
this.#connection = void 0;
|
|
1664
1671
|
}
|
|
1665
1672
|
};
|
|
1666
1673
|
|
|
@@ -1722,24 +1729,22 @@ var OsPubSubNetworkStack = class extends StackBase {
|
|
|
1722
1729
|
this.context.eventBus.addConnection(this.busConnection);
|
|
1723
1730
|
this.on("initialized", () => this.busConnection.emit(OsPubSubNetworkReadyEvent, {}));
|
|
1724
1731
|
super.on("driverReady", async ({ node }) => {
|
|
1725
|
-
if (node.id
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
}
|
|
1732
|
+
if (node.id !== PubSubBridgeNodeNodeName2) return;
|
|
1733
|
+
const httpBridge = assertEx10(await node.resolve("NsHttpBridge"), () => "HttpBridge not found");
|
|
1734
|
+
const xnsNode = asNodeInstance(await httpBridge.resolve("XNS"));
|
|
1735
|
+
if (xnsNode) {
|
|
1736
|
+
const initializedXns = await initializeXns(xnsNode);
|
|
1737
|
+
console.log(`Xns: ${initializedXns}`);
|
|
1738
|
+
} else {
|
|
1739
|
+
console.log("Xns: Failed to contact Xns Node");
|
|
1734
1740
|
}
|
|
1735
1741
|
});
|
|
1736
1742
|
super.on("driverReady", async ({ node }) => {
|
|
1737
|
-
if (node.id
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
}
|
|
1743
|
+
if (node.id !== ExposedNodeOuterNodeName2) return;
|
|
1744
|
+
this._exposedNodeOuter = node;
|
|
1745
|
+
const mod = assertEx10(await node.resolve("ExposedNode"), () => "ExposedNode not found");
|
|
1746
|
+
const exposedNode = asAttachableNodeInstance3(mod, () => "ExposedNode is not a node");
|
|
1747
|
+
this._exposedNode = exposedNode;
|
|
1743
1748
|
});
|
|
1744
1749
|
super.on("driverError", (error) => console.error("Unable to assign exposed node(s) to context", error));
|
|
1745
1750
|
}
|
|
@@ -1747,7 +1752,7 @@ var OsPubSubNetworkStack = class extends StackBase {
|
|
|
1747
1752
|
super.stop();
|
|
1748
1753
|
this._exposedNode = void 0;
|
|
1749
1754
|
this._exposedNodeOuter = void 0;
|
|
1750
|
-
if (this.busConnection.
|
|
1755
|
+
if (this.busConnection.hasId)
|
|
1751
1756
|
this.context.eventBus.removeConnection(this.busConnection.id);
|
|
1752
1757
|
}
|
|
1753
1758
|
};
|
|
@@ -2023,19 +2028,18 @@ var commandStart = (argv) => {
|
|
|
2023
2028
|
};
|
|
2024
2029
|
|
|
2025
2030
|
// src/scripts/xyos/index.ts
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
);
|
|
2031
|
+
async function main() {
|
|
2032
|
+
const cli = yargs(hideBin(process.argv));
|
|
2033
|
+
const withStart = commandStart(cli);
|
|
2034
|
+
const withCreate = commandCreate(withStart);
|
|
2035
|
+
const withConfig = commandConfig(withCreate);
|
|
2036
|
+
const withManifest = commandManifest(withConfig);
|
|
2037
|
+
const parsed = withManifest.usage("Usage: $0 <command> [options]").scriptName("xyos").demandCommand(1).parse();
|
|
2038
|
+
await parsed;
|
|
2039
|
+
}
|
|
2040
|
+
try {
|
|
2041
|
+
await main();
|
|
2042
|
+
} catch (error) {
|
|
2043
|
+
console.error(error);
|
|
2044
|
+
}
|
|
2041
2045
|
//# sourceMappingURL=index.mjs.map
|