@xyo-network/os-runtime 5.0.13 → 6.0.0
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/index.mjs +88 -55
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/index.mjs +88 -55
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/scripts/xyos/index.mjs +57 -38
- package/dist/node/scripts/xyos/index.mjs.map +1 -1
- package/dist/types/DappCallerBase.d.ts +4 -52
- package/dist/types/DappCallerBase.d.ts.map +1 -1
- package/dist/types/OsCallerBase.d.ts +5 -61
- package/dist/types/OsCallerBase.d.ts.map +1 -1
- package/dist/types/XyOs.d.ts +2 -18
- package/dist/types/XyOs.d.ts.map +1 -1
- package/dist/types/XyOsDapp.d.ts +2 -18
- package/dist/types/XyOsDapp.d.ts.map +1 -1
- package/dist/types/access/RunningAccessDappCache.d.ts +1 -9
- package/dist/types/access/RunningAccessDappCache.d.ts.map +1 -1
- package/dist/types/access/interfaces/registered-names/helpers/AccessNodeQueries.d.ts +1 -9
- package/dist/types/access/interfaces/registered-names/helpers/AccessNodeQueries.d.ts.map +1 -1
- package/dist/types/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +3 -35
- package/dist/types/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts.map +1 -1
- package/dist/types/adapter/Base.d.ts +1 -9
- package/dist/types/adapter/Base.d.ts.map +1 -1
- package/dist/types/adapter/Network.d.ts +1 -9
- package/dist/types/adapter/Network.d.ts.map +1 -1
- package/dist/types/adapter/Settings.d.ts +1 -9
- package/dist/types/adapter/Settings.d.ts.map +1 -1
- package/dist/types/classes/settings/CallerBase.d.ts +2 -26
- package/dist/types/classes/settings/CallerBase.d.ts.map +1 -1
- package/dist/types/event/bus/EventBus.d.ts +1 -9
- package/dist/types/event/bus/EventBus.d.ts.map +1 -1
- package/dist/types/lib/isPayload.d.ts +1 -4
- package/dist/types/lib/isPayload.d.ts.map +1 -1
- package/dist/types/stack/OsPubSubNetworkStack.d.ts +2 -18
- package/dist/types/stack/OsPubSubNetworkStack.d.ts.map +1 -1
- package/package.json +44 -44
- package/src/DappCallerBase.ts +4 -4
- package/src/OsCallerBase.ts +5 -5
- package/src/PubSubBridgeCaller.ts +1 -1
- package/src/access/Caller.ts +1 -1
- package/src/access/interfaces/registered-names/helpers/AccessNodeQueries.ts +2 -2
- package/src/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.ts +3 -3
- package/src/adapter/Base.ts +2 -2
- package/src/classes/settings/CallerBase.ts +2 -2
- package/src/dapp/context/creator/createDappContext.ts +1 -1
- package/src/event/bus/EventBus.ts +1 -0
- package/src/loadOsNode.ts +2 -2
- package/src/stack/Base.ts +1 -1
|
@@ -33,7 +33,7 @@ var createFromTemplate = /* @__PURE__ */ __name(async ({ target, template }) =>
|
|
|
33
33
|
}, "createFromTemplate");
|
|
34
34
|
|
|
35
35
|
// src/scripts/xyos/lib/headless.ts
|
|
36
|
-
import fs from "
|
|
36
|
+
import fs from "fs";
|
|
37
37
|
import { boot as boot2 } from "@xyo-network/bios";
|
|
38
38
|
import { Kernel as Kernel2 } from "@xyo-network/kernel";
|
|
39
39
|
import { HDWallet as HDWallet5 } from "@xyo-network/wallet";
|
|
@@ -93,7 +93,9 @@ var EventBus = class {
|
|
|
93
93
|
publisherCallbacks = {};
|
|
94
94
|
startMutex = new Mutex();
|
|
95
95
|
get archivist() {
|
|
96
|
-
return asArchivistInstance(assertEx2(this._archivist, () => "Archivist not found. Did you forget to call start()?"), "not a valid archivist instance"
|
|
96
|
+
return asArchivistInstance(assertEx2(this._archivist, () => "Archivist not found. Did you forget to call start()?"), "not a valid archivist instance", {
|
|
97
|
+
required: true
|
|
98
|
+
});
|
|
97
99
|
}
|
|
98
100
|
addConnection(connection) {
|
|
99
101
|
const id = uuid();
|
|
@@ -439,10 +441,10 @@ var os_node_manifest_default = {
|
|
|
439
441
|
var OS_NODE_PATH = "1'";
|
|
440
442
|
var getDefaultOsNodeLocator = /* @__PURE__ */ __name(() => {
|
|
441
443
|
const locator = new ModuleFactoryLocator();
|
|
442
|
-
locator.register(IndexedDbArchivist, {
|
|
444
|
+
locator.register(IndexedDbArchivist.factory(), {
|
|
443
445
|
"network.xyo.archivist.persistence.scope": "device"
|
|
444
446
|
});
|
|
445
|
-
locator.register(IndexedDbPayloadDiviner, {
|
|
447
|
+
locator.register(IndexedDbPayloadDiviner.factory(), {
|
|
446
448
|
"network.xyo.archivist.persistence.scope": "device"
|
|
447
449
|
});
|
|
448
450
|
return locator;
|
|
@@ -496,26 +498,34 @@ var DappCallerBase = class {
|
|
|
496
498
|
*/
|
|
497
499
|
async getDappArchivist() {
|
|
498
500
|
const mod = assertEx3(await this.context.root.resolve(DappArchivistModuleName), () => `${DappArchivistModuleName} not found [${toJsonString(this.context.root.publicChildren())}]`);
|
|
499
|
-
return asArchivistInstance2(mod, () => `${DappArchivistModuleName} is not an archivist
|
|
501
|
+
return asArchivistInstance2(mod, () => `${DappArchivistModuleName} is not an archivist`, {
|
|
502
|
+
required: true
|
|
503
|
+
});
|
|
500
504
|
}
|
|
501
505
|
/**
|
|
502
506
|
* Get the DappArchivistPayloadDiviner
|
|
503
507
|
*/
|
|
504
508
|
async getDappArchivistPayloadDiviner() {
|
|
505
509
|
const mod = assertEx3(await this.context.root.resolve(DappArchivistPayloadDivinerModuleName), () => `${DappArchivistPayloadDivinerModuleName} not found`);
|
|
506
|
-
return asDivinerInstance2(mod, () => `${DappArchivistPayloadDivinerModuleName} is not a diviner
|
|
510
|
+
return asDivinerInstance2(mod, () => `${DappArchivistPayloadDivinerModuleName} is not a diviner`, {
|
|
511
|
+
required: true
|
|
512
|
+
});
|
|
507
513
|
}
|
|
508
514
|
/**
|
|
509
515
|
* Get the IntentArchivist
|
|
510
516
|
*/
|
|
511
517
|
async getDappIntentArchivist() {
|
|
512
518
|
const mod = assertEx3(await this.context.root.resolve(IntentArchivistModuleName), () => `${IntentArchivistModuleName} not found`);
|
|
513
|
-
return asArchivistInstance2(mod, () => `${IntentArchivistModuleName} is not an archivist
|
|
519
|
+
return asArchivistInstance2(mod, () => `${IntentArchivistModuleName} is not an archivist`, {
|
|
520
|
+
required: true
|
|
521
|
+
});
|
|
514
522
|
}
|
|
515
523
|
// Get the IntentArchivistPayloadDiviner
|
|
516
524
|
async getDappIntentArchivistPayloadDiviner() {
|
|
517
525
|
const mod = assertEx3(await this.context.root.resolve(IntentArchivistPayloadDivinerModuleName), () => `${IntentArchivistPayloadDivinerModuleName} not found`);
|
|
518
|
-
return asDivinerInstance2(mod, () => `${IntentArchivistPayloadDivinerModuleName} is not a diviner
|
|
526
|
+
return asDivinerInstance2(mod, () => `${IntentArchivistPayloadDivinerModuleName} is not a diviner`, {
|
|
527
|
+
required: true
|
|
528
|
+
});
|
|
519
529
|
}
|
|
520
530
|
};
|
|
521
531
|
|
|
@@ -605,27 +615,37 @@ var OsCallerBase = class {
|
|
|
605
615
|
// Get the dapps archivist
|
|
606
616
|
async getDappsArchivist() {
|
|
607
617
|
const mod = assertEx4(await this.context.root.resolve(DappsArchivistModuleName), () => `${DappsArchivistModuleName} not found`);
|
|
608
|
-
return asArchivistInstance3(mod, () => `${DappsArchivistModuleName} is not an archivist
|
|
618
|
+
return asArchivistInstance3(mod, () => `${DappsArchivistModuleName} is not an archivist`, {
|
|
619
|
+
required: true
|
|
620
|
+
});
|
|
609
621
|
}
|
|
610
622
|
// Get the dapps archivist development
|
|
611
623
|
async getDappsArchivistDevelopment() {
|
|
612
624
|
const mod = assertEx4(await this.context.root.resolve(DappsArchivistDevelopmentModuleName), () => `${DappsArchivistDevelopmentModuleName} not found`);
|
|
613
|
-
return asArchivistInstance3(mod, () => `${DappsArchivistDevelopmentModuleName} is not an archivist
|
|
625
|
+
return asArchivistInstance3(mod, () => `${DappsArchivistDevelopmentModuleName} is not an archivist`, {
|
|
626
|
+
required: true
|
|
627
|
+
});
|
|
614
628
|
}
|
|
615
629
|
// Get the dapps archivist payload diviner
|
|
616
630
|
async getDappsArchivistPayloadDiviner() {
|
|
617
631
|
const mod = assertEx4(await this.context.root.resolve(DappsArchivistPayloadDivinerModuleName), () => `${DappsArchivistPayloadDivinerModuleName} not found`);
|
|
618
|
-
return asDivinerInstance3(mod, () => `${DappsArchivistPayloadDivinerModuleName} is not a diviner
|
|
632
|
+
return asDivinerInstance3(mod, () => `${DappsArchivistPayloadDivinerModuleName} is not a diviner`, {
|
|
633
|
+
required: true
|
|
634
|
+
});
|
|
619
635
|
}
|
|
620
636
|
// Get the dapps archivist payload diviner development
|
|
621
637
|
async getDappsArchivistPayloadDivinerDevelopment() {
|
|
622
638
|
const mod = assertEx4(await this.context.root.resolve(DappsArchivistPayloadDevelopmentDivinerModuleName), () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} not found`);
|
|
623
|
-
return asDivinerInstance3(mod, () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} is not a diviner
|
|
639
|
+
return asDivinerInstance3(mod, () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} is not a diviner`, {
|
|
640
|
+
required: true
|
|
641
|
+
});
|
|
624
642
|
}
|
|
625
643
|
// Get the registered dapp interfaces archivist
|
|
626
644
|
async getRegisteredDappInterfacesArchivist() {
|
|
627
645
|
const mod = assertEx4(await this.context.root.resolve(RegisteredDappInterfacesArchivistModuleName), () => `${RegisteredDappInterfacesArchivistModuleName} not found`);
|
|
628
|
-
return asArchivistInstance3(mod, () => `${RegisteredDappInterfacesArchivistModuleName} is not an archivist
|
|
646
|
+
return asArchivistInstance3(mod, () => `${RegisteredDappInterfacesArchivistModuleName} is not an archivist`, {
|
|
647
|
+
required: true
|
|
648
|
+
});
|
|
629
649
|
}
|
|
630
650
|
};
|
|
631
651
|
|
|
@@ -710,9 +730,9 @@ var ManageSystemDapps = class extends OsCallerBase {
|
|
|
710
730
|
defaultSystemDappParams;
|
|
711
731
|
locator;
|
|
712
732
|
developmentMode;
|
|
713
|
-
onErrorCallbacks;
|
|
733
|
+
onErrorCallbacks = [];
|
|
714
734
|
constructor(context, defaultSystemNames, defaultSystemDapps, defaultSystemDappParams, locator, developmentMode) {
|
|
715
|
-
super(context), this.defaultSystemNames = defaultSystemNames, this.defaultSystemDapps = defaultSystemDapps, this.defaultSystemDappParams = defaultSystemDappParams, this.locator = locator, this.developmentMode = developmentMode
|
|
735
|
+
super(context), this.defaultSystemNames = defaultSystemNames, this.defaultSystemDapps = defaultSystemDapps, this.defaultSystemDappParams = defaultSystemDappParams, this.locator = locator, this.developmentMode = developmentMode;
|
|
716
736
|
}
|
|
717
737
|
/**
|
|
718
738
|
* Add a callback to listen for errors throwing during system dapp registration
|
|
@@ -817,11 +837,11 @@ var DappSeedPhraseRepository = class extends OsCallerBase {
|
|
|
817
837
|
}
|
|
818
838
|
allowedNames;
|
|
819
839
|
// record of all dapps that have requested a seed phrase with the OS
|
|
820
|
-
dappIdRepository;
|
|
840
|
+
dappIdRepository = /* @__PURE__ */ new Map();
|
|
821
841
|
// record of all walletIds that have been issued to registered dapps
|
|
822
|
-
walletIdRepository;
|
|
842
|
+
walletIdRepository = /* @__PURE__ */ new Map();
|
|
823
843
|
constructor(xyOs, allowedNames) {
|
|
824
|
-
super(xyOs), this.allowedNames = allowedNames
|
|
844
|
+
super(xyOs), this.allowedNames = allowedNames;
|
|
825
845
|
}
|
|
826
846
|
async add(dappId) {
|
|
827
847
|
const archivist = await this.getDappsArchivist();
|
|
@@ -1223,10 +1243,9 @@ var DappRegistry = class {
|
|
|
1223
1243
|
__name(this, "DappRegistry");
|
|
1224
1244
|
}
|
|
1225
1245
|
dappSeedPhraseRepository;
|
|
1226
|
-
dappRegistry;
|
|
1246
|
+
dappRegistry = /* @__PURE__ */ new Map();
|
|
1227
1247
|
constructor(dappSeedPhraseRepository) {
|
|
1228
1248
|
this.dappSeedPhraseRepository = dappSeedPhraseRepository;
|
|
1229
|
-
this.dappRegistry = /* @__PURE__ */ new Map();
|
|
1230
1249
|
}
|
|
1231
1250
|
/**
|
|
1232
1251
|
* Register a Dapp with window manager and if successful, return its id
|
|
@@ -1323,18 +1342,18 @@ var DappRegistrationService = class {
|
|
|
1323
1342
|
locator;
|
|
1324
1343
|
developmentMode;
|
|
1325
1344
|
// Dapps that have been built with their own context
|
|
1326
|
-
builtDapps;
|
|
1345
|
+
builtDapps = {};
|
|
1327
1346
|
dappRegistry;
|
|
1328
1347
|
dappSeedPhraseRepository;
|
|
1329
1348
|
manageSystemDapps;
|
|
1330
1349
|
// Dapps that have been registered with dappAccessRequests
|
|
1331
|
-
registeredAccessDappSets;
|
|
1350
|
+
registeredAccessDappSets = /* @__PURE__ */ new Set();
|
|
1332
1351
|
// Dapps that have been registered with the dapp registry
|
|
1333
|
-
registeredDappSets;
|
|
1352
|
+
registeredDappSets = /* @__PURE__ */ new Set();
|
|
1334
1353
|
// Dapps that have been registered with exposeDappRequests
|
|
1335
|
-
registeredExposedDappSets;
|
|
1336
|
-
dappAccessRequestConnection;
|
|
1337
|
-
exposeDappRequestConnection;
|
|
1354
|
+
registeredExposedDappSets = /* @__PURE__ */ new Set();
|
|
1355
|
+
dappAccessRequestConnection = dappAccessRequestConnection();
|
|
1356
|
+
exposeDappRequestConnection = exposeDappRequestConnection();
|
|
1338
1357
|
constructor(context, params = {
|
|
1339
1358
|
dappNames: [],
|
|
1340
1359
|
dappParams: {},
|
|
@@ -1344,12 +1363,6 @@ var DappRegistrationService = class {
|
|
|
1344
1363
|
this.params = params;
|
|
1345
1364
|
this.locator = locator;
|
|
1346
1365
|
this.developmentMode = developmentMode;
|
|
1347
|
-
this.builtDapps = {};
|
|
1348
|
-
this.registeredAccessDappSets = /* @__PURE__ */ new Set();
|
|
1349
|
-
this.registeredDappSets = /* @__PURE__ */ new Set();
|
|
1350
|
-
this.registeredExposedDappSets = /* @__PURE__ */ new Set();
|
|
1351
|
-
this.dappAccessRequestConnection = dappAccessRequestConnection();
|
|
1352
|
-
this.exposeDappRequestConnection = exposeDappRequestConnection();
|
|
1353
1366
|
this.manageSystemDapps = new ManageSystemDapps(context, this.params?.dappNames ?? [], this.params?.dappPayloads ?? [], this.params?.dappParams ?? {}, this.locator, this.developmentMode);
|
|
1354
1367
|
this.dappSeedPhraseRepository = new DappSeedPhraseRepository(context, this.params?.dappNames ?? []);
|
|
1355
1368
|
this.dappRegistry = new DappRegistry(this.dappSeedPhraseRepository);
|
|
@@ -1585,7 +1598,9 @@ var StackBase = class extends BaseEmitter3 {
|
|
|
1585
1598
|
}
|
|
1586
1599
|
async getStackNode() {
|
|
1587
1600
|
const mod = assertEx8(await this.context.root.resolve(this.stackNodeModuleId), () => `${this.stackNodeModuleId} not found`);
|
|
1588
|
-
return asAttachableNodeInstance(mod, () => `${this.stackNodeModuleId} not a NodeInstance
|
|
1601
|
+
return asAttachableNodeInstance(mod, () => `${this.stackNodeModuleId} not a NodeInstance`, {
|
|
1602
|
+
required: true
|
|
1603
|
+
});
|
|
1589
1604
|
}
|
|
1590
1605
|
async handleDriverReady(node) {
|
|
1591
1606
|
try {
|
|
@@ -1663,10 +1678,10 @@ var NodeAdapterBase = class extends BaseEmitter4 {
|
|
|
1663
1678
|
}
|
|
1664
1679
|
kernel;
|
|
1665
1680
|
driverName;
|
|
1666
|
-
initialized;
|
|
1667
|
-
_id;
|
|
1681
|
+
initialized = false;
|
|
1682
|
+
_id = "";
|
|
1668
1683
|
constructor(kernel, driverName) {
|
|
1669
|
-
super({}), this.kernel = kernel, this.driverName = driverName
|
|
1684
|
+
super({}), this.kernel = kernel, this.driverName = driverName;
|
|
1670
1685
|
this._id = uuid3();
|
|
1671
1686
|
}
|
|
1672
1687
|
get id() {
|
|
@@ -1703,12 +1718,16 @@ var NodeAdapterBase = class extends BaseEmitter4 {
|
|
|
1703
1718
|
}
|
|
1704
1719
|
async getEventsArchivist() {
|
|
1705
1720
|
const mod = assertEx9(await (await this.kernel.getNode()).resolve("KernelNode:ModuleEvents"), () => "KernelNode:ModuleEvents not found");
|
|
1706
|
-
return asArchivistInstance4(mod, () => `${mod.id} is not an archivist
|
|
1721
|
+
return asArchivistInstance4(mod, () => `${mod.id} is not an archivist`, {
|
|
1722
|
+
required: true
|
|
1723
|
+
});
|
|
1707
1724
|
}
|
|
1708
1725
|
validateAndReturnDriver() {
|
|
1709
1726
|
const mod = this.kernel.initialized[this.driverName];
|
|
1710
1727
|
if (mod) {
|
|
1711
|
-
const node = asAttachableNodeInstance2(mod, () => `${mod.id} is not a node
|
|
1728
|
+
const node = asAttachableNodeInstance2(mod, () => `${mod.id} is not a node`, {
|
|
1729
|
+
required: true
|
|
1730
|
+
});
|
|
1712
1731
|
this.initialized = true;
|
|
1713
1732
|
const emit = /* @__PURE__ */ __name(async () => await this.emit("driverReady", {
|
|
1714
1733
|
node
|