@xyo-network/os-runtime 4.1.1 → 4.1.2
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/DappCallerBase.d.ts +2 -2
- package/dist/neutral/OsCallerBase.d.ts +2 -2
- package/dist/neutral/XyOs.d.ts +2 -2
- package/dist/neutral/XyOsDapp.d.ts +2 -2
- package/dist/neutral/access-interfaces/registered-names/helpers/AccessNodeQueries.d.ts +1 -1
- package/dist/neutral/access-interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +1 -1
- package/dist/neutral/adapter/Network.d.ts +1 -1
- package/dist/neutral/adapter/Settings.d.ts +1 -1
- package/dist/neutral/classes/cache/RunningAccessDappCache.d.ts +1 -1
- package/dist/neutral/classes/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
- package/dist/neutral/classes/settings/CallerBase.d.ts +1 -1
- package/dist/neutral/index.mjs +989 -640
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/stack/OsPubSubNetworkStack.d.ts +2 -2
- package/dist/node/DappCallerBase.d.ts +2 -2
- package/dist/node/OsCallerBase.d.ts +2 -2
- package/dist/node/XyOs.d.ts +2 -2
- package/dist/node/XyOsDapp.d.ts +2 -2
- package/dist/node/access-interfaces/registered-names/helpers/AccessNodeQueries.d.ts +1 -1
- package/dist/node/access-interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +1 -1
- package/dist/node/adapter/Network.d.ts +1 -1
- package/dist/node/adapter/Settings.d.ts +1 -1
- package/dist/node/classes/cache/RunningAccessDappCache.d.ts +1 -1
- package/dist/node/classes/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
- package/dist/node/classes/settings/CallerBase.d.ts +1 -1
- package/dist/node/index.mjs +989 -640
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/scripts/xyos/command/index.mjs +486 -345
- package/dist/node/scripts/xyos/command/index.mjs.map +1 -1
- package/dist/node/scripts/xyos/index.mjs +487 -360
- package/dist/node/scripts/xyos/index.mjs.map +1 -1
- package/dist/node/scripts/xyos/lib/index.mjs +453 -327
- package/dist/node/scripts/xyos/lib/index.mjs.map +1 -1
- package/dist/node/stack/OsPubSubNetworkStack.d.ts +2 -2
- package/package.json +14 -15
- package/src/classes/registration/ValidateDappAccessDiviner/Diviner.ts +6 -7
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/scripts/xyos/index.ts
|
|
2
5
|
import { default as yargs } from "yargs";
|
|
3
6
|
import { hideBin } from "yargs/helpers";
|
|
4
7
|
|
|
5
8
|
// src/scripts/xyos/command/config.ts
|
|
6
|
-
var commandConfig = (argv) => {
|
|
9
|
+
var commandConfig = /* @__PURE__ */ __name((argv) => {
|
|
7
10
|
return argv.command("config [action] <target>", "Create an xyos project", (yargs2) => {
|
|
8
11
|
return yargs2.positional("action", {
|
|
9
|
-
choices: [
|
|
12
|
+
choices: [
|
|
13
|
+
"create",
|
|
14
|
+
"validate",
|
|
15
|
+
"display"
|
|
16
|
+
],
|
|
10
17
|
description: "Action to take on config",
|
|
11
18
|
type: "string"
|
|
12
19
|
}).positional("target", {
|
|
@@ -17,13 +24,13 @@ var commandConfig = (argv) => {
|
|
|
17
24
|
console.log(`Taking action [${action}] on manifest at ${target}`);
|
|
18
25
|
return await Promise.resolve();
|
|
19
26
|
});
|
|
20
|
-
};
|
|
27
|
+
}, "commandConfig");
|
|
21
28
|
|
|
22
29
|
// src/scripts/xyos/lib/createFromTemplate.ts
|
|
23
|
-
var createFromTemplate = async ({ target, template }) => {
|
|
30
|
+
var createFromTemplate = /* @__PURE__ */ __name(async ({ target, template }) => {
|
|
24
31
|
console.log("Creating from template", template, "at", target);
|
|
25
32
|
return await Promise.resolve();
|
|
26
|
-
};
|
|
33
|
+
}, "createFromTemplate");
|
|
27
34
|
|
|
28
35
|
// src/scripts/xyos/lib/headless.ts
|
|
29
36
|
import fs from "node:fs";
|
|
@@ -57,6 +64,10 @@ var DappsArchivistPayloadDivinerModuleName = "DappsArchivistPayloadDiviner";
|
|
|
57
64
|
var DappsArchivistPayloadDevelopmentDivinerModuleName = `${DappsArchivistPayloadDivinerModuleName}Development`;
|
|
58
65
|
var RegisteredDappInterfacesArchivistModuleName = "RegisteredDappInterfacesArchivist";
|
|
59
66
|
var OsCallerBase = class {
|
|
67
|
+
static {
|
|
68
|
+
__name(this, "OsCallerBase");
|
|
69
|
+
}
|
|
70
|
+
context;
|
|
60
71
|
constructor(context) {
|
|
61
72
|
this.context = context;
|
|
62
73
|
}
|
|
@@ -67,48 +78,39 @@ var OsCallerBase = class {
|
|
|
67
78
|
}
|
|
68
79
|
// Get the dapps archivist development
|
|
69
80
|
async getDappsArchivistDevelopment() {
|
|
70
|
-
const mod = assertEx(
|
|
71
|
-
await this.context.root.resolve(DappsArchivistDevelopmentModuleName),
|
|
72
|
-
() => `${DappsArchivistDevelopmentModuleName} not found`
|
|
73
|
-
);
|
|
81
|
+
const mod = assertEx(await this.context.root.resolve(DappsArchivistDevelopmentModuleName), () => `${DappsArchivistDevelopmentModuleName} not found`);
|
|
74
82
|
return asArchivistInstance(mod, () => `${DappsArchivistDevelopmentModuleName} is not an archivist`);
|
|
75
83
|
}
|
|
76
84
|
// Get the dapps archivist payload diviner
|
|
77
85
|
async getDappsArchivistPayloadDiviner() {
|
|
78
|
-
const mod = assertEx(
|
|
79
|
-
await this.context.root.resolve(DappsArchivistPayloadDivinerModuleName),
|
|
80
|
-
() => `${DappsArchivistPayloadDivinerModuleName} not found`
|
|
81
|
-
);
|
|
86
|
+
const mod = assertEx(await this.context.root.resolve(DappsArchivistPayloadDivinerModuleName), () => `${DappsArchivistPayloadDivinerModuleName} not found`);
|
|
82
87
|
return asDivinerInstance(mod, () => `${DappsArchivistPayloadDivinerModuleName} is not a diviner`);
|
|
83
88
|
}
|
|
84
89
|
// Get the dapps archivist payload diviner development
|
|
85
90
|
async getDappsArchivistPayloadDivinerDevelopment() {
|
|
86
|
-
const mod = assertEx(
|
|
87
|
-
await this.context.root.resolve(DappsArchivistPayloadDevelopmentDivinerModuleName),
|
|
88
|
-
() => `${DappsArchivistPayloadDevelopmentDivinerModuleName} not found`
|
|
89
|
-
);
|
|
91
|
+
const mod = assertEx(await this.context.root.resolve(DappsArchivistPayloadDevelopmentDivinerModuleName), () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} not found`);
|
|
90
92
|
return asDivinerInstance(mod, () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} is not a diviner`);
|
|
91
93
|
}
|
|
92
94
|
// Get the registered dapp interfaces archivist
|
|
93
95
|
async getRegisteredDappInterfacesArchivist() {
|
|
94
|
-
const mod = assertEx(
|
|
95
|
-
await this.context.root.resolve(RegisteredDappInterfacesArchivistModuleName),
|
|
96
|
-
() => `${RegisteredDappInterfacesArchivistModuleName} not found`
|
|
97
|
-
);
|
|
96
|
+
const mod = assertEx(await this.context.root.resolve(RegisteredDappInterfacesArchivistModuleName), () => `${RegisteredDappInterfacesArchivistModuleName} not found`);
|
|
98
97
|
return asArchivistInstance(mod, () => `${RegisteredDappInterfacesArchivistModuleName} is not an archivist`);
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
100
|
|
|
102
101
|
// src/wallet/DappSeedPhraseRepository.ts
|
|
103
102
|
var DappSeedPhraseRepository = class extends OsCallerBase {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.allowedNames = allowedNames;
|
|
103
|
+
static {
|
|
104
|
+
__name(this, "DappSeedPhraseRepository");
|
|
107
105
|
}
|
|
106
|
+
allowedNames;
|
|
108
107
|
// record of all dapps that have requested a seed phrase with the OS
|
|
109
|
-
dappIdRepository
|
|
108
|
+
dappIdRepository;
|
|
110
109
|
// record of all walletIds that have been issued to registered dapps
|
|
111
|
-
walletIdRepository
|
|
110
|
+
walletIdRepository;
|
|
111
|
+
constructor(xyOs, allowedNames) {
|
|
112
|
+
super(xyOs), this.allowedNames = allowedNames, this.dappIdRepository = /* @__PURE__ */ new Map(), this.walletIdRepository = /* @__PURE__ */ new Map();
|
|
113
|
+
}
|
|
112
114
|
async add(dappId) {
|
|
113
115
|
const archivist = await this.getDappsArchivist();
|
|
114
116
|
const seedPhrase = this.newPhrase();
|
|
@@ -119,7 +121,9 @@ var DappSeedPhraseRepository = class extends OsCallerBase {
|
|
|
119
121
|
seedPhrase,
|
|
120
122
|
walletId
|
|
121
123
|
};
|
|
122
|
-
await archivist.insert([
|
|
124
|
+
await archivist.insert([
|
|
125
|
+
payload
|
|
126
|
+
]);
|
|
123
127
|
this.dappIdRepository.set(dappId, payload);
|
|
124
128
|
this.walletIdRepository.set(walletId, payload);
|
|
125
129
|
return walletId;
|
|
@@ -151,9 +155,13 @@ var DappSeedPhraseRepository = class extends OsCallerBase {
|
|
|
151
155
|
limit: 1,
|
|
152
156
|
order: "desc",
|
|
153
157
|
schema: PayloadDivinerQuerySchema,
|
|
154
|
-
schemas: [
|
|
158
|
+
schemas: [
|
|
159
|
+
DappWalletSeedPhraseSchema
|
|
160
|
+
]
|
|
155
161
|
};
|
|
156
|
-
const results = await diviner.divine([
|
|
162
|
+
const results = await diviner.divine([
|
|
163
|
+
query
|
|
164
|
+
]);
|
|
157
165
|
return results.length > 0 ? results[0] : void 0;
|
|
158
166
|
}
|
|
159
167
|
async checkWalletId(walletId) {
|
|
@@ -162,10 +170,14 @@ var DappSeedPhraseRepository = class extends OsCallerBase {
|
|
|
162
170
|
limit: 1,
|
|
163
171
|
order: "desc",
|
|
164
172
|
schema: PayloadDivinerQuerySchema,
|
|
165
|
-
schemas: [
|
|
173
|
+
schemas: [
|
|
174
|
+
DappWalletSeedPhraseSchema
|
|
175
|
+
],
|
|
166
176
|
walletId
|
|
167
177
|
};
|
|
168
|
-
const results = await diviner.divine([
|
|
178
|
+
const results = await diviner.divine([
|
|
179
|
+
query
|
|
180
|
+
]);
|
|
169
181
|
return results.length > 0 ? results[0] : void 0;
|
|
170
182
|
}
|
|
171
183
|
newPhrase() {
|
|
@@ -183,42 +195,37 @@ var IntentArchivistModuleName = "IntentArchivist";
|
|
|
183
195
|
var IntentArchivistPayloadDivinerModuleName = "IntentArchivistPayloadDiviner";
|
|
184
196
|
var DappArchivistPayloadDivinerModuleName = "DappArchivistPayloadDiviner";
|
|
185
197
|
var DappCallerBase = class {
|
|
198
|
+
static {
|
|
199
|
+
__name(this, "DappCallerBase");
|
|
200
|
+
}
|
|
201
|
+
context;
|
|
186
202
|
constructor(context) {
|
|
187
203
|
this.context = context;
|
|
188
204
|
}
|
|
189
205
|
/**
|
|
190
|
-
|
|
191
|
-
|
|
206
|
+
* Get the DappArchivist
|
|
207
|
+
*/
|
|
192
208
|
async getDappArchivist() {
|
|
193
|
-
const mod = assertEx2(
|
|
194
|
-
await this.context.root.resolve(DappArchivistModuleName),
|
|
195
|
-
() => `${DappArchivistModuleName} not found [${toJsonString(this.context.root.publicChildren())}]`
|
|
196
|
-
);
|
|
209
|
+
const mod = assertEx2(await this.context.root.resolve(DappArchivistModuleName), () => `${DappArchivistModuleName} not found [${toJsonString(this.context.root.publicChildren())}]`);
|
|
197
210
|
return asArchivistInstance2(mod, () => `${DappArchivistModuleName} is not an archivist`);
|
|
198
211
|
}
|
|
199
212
|
/**
|
|
200
|
-
|
|
201
|
-
|
|
213
|
+
* Get the DappArchivistPayloadDiviner
|
|
214
|
+
*/
|
|
202
215
|
async getDappArchivistPayloadDiviner() {
|
|
203
|
-
const mod = assertEx2(
|
|
204
|
-
await this.context.root.resolve(DappArchivistPayloadDivinerModuleName),
|
|
205
|
-
() => `${DappArchivistPayloadDivinerModuleName} not found`
|
|
206
|
-
);
|
|
216
|
+
const mod = assertEx2(await this.context.root.resolve(DappArchivistPayloadDivinerModuleName), () => `${DappArchivistPayloadDivinerModuleName} not found`);
|
|
207
217
|
return asDivinerInstance2(mod, () => `${DappArchivistPayloadDivinerModuleName} is not a diviner`);
|
|
208
218
|
}
|
|
209
219
|
/**
|
|
210
|
-
|
|
211
|
-
|
|
220
|
+
* Get the IntentArchivist
|
|
221
|
+
*/
|
|
212
222
|
async getDappIntentArchivist() {
|
|
213
223
|
const mod = assertEx2(await this.context.root.resolve(IntentArchivistModuleName), () => `${IntentArchivistModuleName} not found`);
|
|
214
224
|
return asArchivistInstance2(mod, () => `${IntentArchivistModuleName} is not an archivist`);
|
|
215
225
|
}
|
|
216
226
|
// Get the IntentArchivistPayloadDiviner
|
|
217
227
|
async getDappIntentArchivistPayloadDiviner() {
|
|
218
|
-
const mod = assertEx2(
|
|
219
|
-
await this.context.root.resolve(IntentArchivistPayloadDivinerModuleName),
|
|
220
|
-
() => `${IntentArchivistPayloadDivinerModuleName} not found`
|
|
221
|
-
);
|
|
228
|
+
const mod = assertEx2(await this.context.root.resolve(IntentArchivistPayloadDivinerModuleName), () => `${IntentArchivistPayloadDivinerModuleName} not found`);
|
|
222
229
|
return asDivinerInstance2(mod, () => `${IntentArchivistPayloadDivinerModuleName} is not a diviner`);
|
|
223
230
|
}
|
|
224
231
|
};
|
|
@@ -361,20 +368,26 @@ var os_node_manifest_default = {
|
|
|
361
368
|
import { asDivinerInstance as asDivinerInstance3 } from "@xyo-network/diviner-model";
|
|
362
369
|
import { ResolveHelper } from "@xyo-network/module-model";
|
|
363
370
|
import { NameRegistrarTransformer } from "@xyo-network/module-resolver";
|
|
364
|
-
var initializeXns = async (xnsNode) => {
|
|
371
|
+
var initializeXns = /* @__PURE__ */ __name(async (xnsNode) => {
|
|
365
372
|
if (ResolveHelper.transformers.length === 0) {
|
|
366
373
|
const registrarDiviner = asDivinerInstance3(await xnsNode?.resolve("AddressRecords:AddressRecordIndexDiviner"));
|
|
367
374
|
if (registrarDiviner) {
|
|
368
375
|
const transformer = new NameRegistrarTransformer(registrarDiviner, "xyo");
|
|
369
|
-
ResolveHelper.transformers = [
|
|
376
|
+
ResolveHelper.transformers = [
|
|
377
|
+
transformer
|
|
378
|
+
];
|
|
370
379
|
return true;
|
|
371
380
|
}
|
|
372
381
|
}
|
|
373
382
|
return false;
|
|
374
|
-
};
|
|
383
|
+
}, "initializeXns");
|
|
375
384
|
|
|
376
385
|
// src/lib/NameTransforms.ts
|
|
377
386
|
var NameTransforms = class _NameTransforms {
|
|
387
|
+
static {
|
|
388
|
+
__name(this, "NameTransforms");
|
|
389
|
+
}
|
|
390
|
+
value;
|
|
378
391
|
constructor(value) {
|
|
379
392
|
this.value = value;
|
|
380
393
|
}
|
|
@@ -402,19 +415,22 @@ var NameTransforms = class _NameTransforms {
|
|
|
402
415
|
import { PayloadDivinerQuerySchema as PayloadDivinerQuerySchema2 } from "@xyo-network/diviner-payload-model";
|
|
403
416
|
import { DappIntentSchema, DappMode } from "@xyo-network/os-model";
|
|
404
417
|
var DappIntentCaller = class _DappIntentCaller extends DappCallerBase {
|
|
418
|
+
static {
|
|
419
|
+
__name(this, "DappIntentCaller");
|
|
420
|
+
}
|
|
405
421
|
static OsDappName = "XyOs";
|
|
406
422
|
constructor(context) {
|
|
407
423
|
super(context);
|
|
408
424
|
}
|
|
409
425
|
/**
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
426
|
+
* Build a new intent
|
|
427
|
+
* @param {DappId} sourceDappId
|
|
428
|
+
* @param {DappIntentTypes} intent
|
|
429
|
+
* @param {DappId} targetDappId
|
|
430
|
+
* @param {DappMode} targetMode
|
|
431
|
+
* @param {DappIntent['params']} params?
|
|
432
|
+
* @returns DappIntent
|
|
433
|
+
*/
|
|
418
434
|
static buildIntent(sourceDappId, intent, targetDappId, targetMode = DappMode.Window, params) {
|
|
419
435
|
return {
|
|
420
436
|
intent,
|
|
@@ -430,7 +446,9 @@ var DappIntentCaller = class _DappIntentCaller extends DappCallerBase {
|
|
|
430
446
|
async addIntent(id, intent, mode) {
|
|
431
447
|
const intentArchivist = await this.getDappIntentArchivist();
|
|
432
448
|
const newIntent = _DappIntentCaller.buildIntent(id, intent, mode);
|
|
433
|
-
await intentArchivist.insert([
|
|
449
|
+
await intentArchivist.insert([
|
|
450
|
+
newIntent
|
|
451
|
+
]);
|
|
434
452
|
}
|
|
435
453
|
// Get all intents
|
|
436
454
|
async allIntents() {
|
|
@@ -451,7 +469,9 @@ var DappIntentCaller = class _DappIntentCaller extends DappCallerBase {
|
|
|
451
469
|
schema: PayloadDivinerQuerySchema2,
|
|
452
470
|
sourceDappId: dappName
|
|
453
471
|
};
|
|
454
|
-
return await diviner.divine([
|
|
472
|
+
return await diviner.divine([
|
|
473
|
+
query
|
|
474
|
+
]);
|
|
455
475
|
}
|
|
456
476
|
};
|
|
457
477
|
|
|
@@ -459,17 +479,15 @@ var DappIntentCaller = class _DappIntentCaller extends DappCallerBase {
|
|
|
459
479
|
import { forget as forget2 } from "@xylabs/forget";
|
|
460
480
|
import { fulfilled, rejected } from "@xylabs/promise";
|
|
461
481
|
import { ModuleFactoryLocator as ModuleFactoryLocator3 } from "@xyo-network/module-factory-locator";
|
|
462
|
-
import {
|
|
463
|
-
DappIntentTypes,
|
|
464
|
-
DappMode as DappMode2,
|
|
465
|
-
isRegisteredDappAccessDappSet,
|
|
466
|
-
isRegisteredDappExposedDappSet
|
|
467
|
-
} from "@xyo-network/os-model";
|
|
482
|
+
import { DappIntentTypes, DappMode as DappMode2, isRegisteredDappAccessDappSet, isRegisteredDappExposedDappSet } from "@xyo-network/os-model";
|
|
468
483
|
|
|
469
484
|
// src/event/bus/Connection.ts
|
|
470
485
|
import { assertEx as assertEx3 } from "@xylabs/assert";
|
|
471
486
|
import { BaseEmitter } from "@xyo-network/module-event-emitter";
|
|
472
487
|
var EventBusConnection = class extends BaseEmitter {
|
|
488
|
+
static {
|
|
489
|
+
__name(this, "EventBusConnection");
|
|
490
|
+
}
|
|
473
491
|
_id;
|
|
474
492
|
description;
|
|
475
493
|
type;
|
|
@@ -489,19 +507,15 @@ var EventBusConnection = class extends BaseEmitter {
|
|
|
489
507
|
// src/event/bus/EventBus.ts
|
|
490
508
|
import { assertEx as assertEx4 } from "@xylabs/assert";
|
|
491
509
|
import { forget } from "@xylabs/forget";
|
|
492
|
-
import {
|
|
493
|
-
|
|
494
|
-
MemoryArchivist,
|
|
495
|
-
MemoryArchivistConfigSchema
|
|
496
|
-
} from "@xyo-network/archivist";
|
|
497
|
-
import {
|
|
498
|
-
isEventBusEvent,
|
|
499
|
-
isPubSubConnections
|
|
500
|
-
} from "@xyo-network/os-model";
|
|
510
|
+
import { asArchivistInstance as asArchivistInstance3, MemoryArchivist, MemoryArchivistConfigSchema } from "@xyo-network/archivist";
|
|
511
|
+
import { isEventBusEvent, isPubSubConnections } from "@xyo-network/os-model";
|
|
501
512
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
502
513
|
import { Mutex } from "async-mutex";
|
|
503
514
|
import { v4 as uuid2 } from "uuid";
|
|
504
515
|
var EventBus = class {
|
|
516
|
+
static {
|
|
517
|
+
__name(this, "EventBus");
|
|
518
|
+
}
|
|
505
519
|
// Internal Archivist to store event data
|
|
506
520
|
_archivist;
|
|
507
521
|
// Store all connections
|
|
@@ -510,10 +524,7 @@ var EventBus = class {
|
|
|
510
524
|
publisherCallbacks = {};
|
|
511
525
|
startMutex = new Mutex();
|
|
512
526
|
get archivist() {
|
|
513
|
-
return asArchivistInstance3(
|
|
514
|
-
assertEx4(this._archivist, () => "Archivist not found. Did you forget to call start()?"),
|
|
515
|
-
"not a valid archivist instance"
|
|
516
|
-
);
|
|
527
|
+
return asArchivistInstance3(assertEx4(this._archivist, () => "Archivist not found. Did you forget to call start()?"), "not a valid archivist instance");
|
|
517
528
|
}
|
|
518
529
|
addConnection(connection) {
|
|
519
530
|
const id = uuid2();
|
|
@@ -542,7 +553,12 @@ var EventBus = class {
|
|
|
542
553
|
console.warn("EventBus already started");
|
|
543
554
|
return this;
|
|
544
555
|
}
|
|
545
|
-
this._archivist = await MemoryArchivist.create({
|
|
556
|
+
this._archivist = await MemoryArchivist.create({
|
|
557
|
+
config: {
|
|
558
|
+
name: storeName,
|
|
559
|
+
schema: MemoryArchivistConfigSchema
|
|
560
|
+
}
|
|
561
|
+
});
|
|
546
562
|
this.archivist.on("inserted", ({ payloads }) => {
|
|
547
563
|
const eventBusEvent = payloads.find(isEventBusEvent);
|
|
548
564
|
if (!eventBusEvent) return;
|
|
@@ -552,7 +568,9 @@ var EventBus = class {
|
|
|
552
568
|
for (const [eventName, callback] of connection.subscribableEvents.entries()) {
|
|
553
569
|
if (eventName !== eventBusEvent.name) continue;
|
|
554
570
|
if (callback) {
|
|
555
|
-
const forgettable = async () => await callback({
|
|
571
|
+
const forgettable = /* @__PURE__ */ __name(async () => await callback({
|
|
572
|
+
payloads
|
|
573
|
+
}), "forgettable");
|
|
556
574
|
forget(forgettable());
|
|
557
575
|
}
|
|
558
576
|
}
|
|
@@ -564,16 +582,22 @@ var EventBus = class {
|
|
|
564
582
|
}
|
|
565
583
|
handlePublisherAdd(connection) {
|
|
566
584
|
for (const eventName of connection.publishableEvents ?? []) {
|
|
567
|
-
const connectionPublisherCallback = async ({ payloads }) => {
|
|
568
|
-
const event = {
|
|
585
|
+
const connectionPublisherCallback = /* @__PURE__ */ __name(async ({ payloads }) => {
|
|
586
|
+
const event = {
|
|
587
|
+
name: eventName,
|
|
588
|
+
schema: "network.xyo.event.bus.event"
|
|
589
|
+
};
|
|
569
590
|
const eventPayloads = payloads ?? [];
|
|
570
591
|
event.sources = await PayloadBuilder.dataHashes(eventPayloads);
|
|
571
592
|
try {
|
|
572
|
-
await this.archivist.insert([
|
|
593
|
+
await this.archivist.insert([
|
|
594
|
+
event,
|
|
595
|
+
...payloads ?? []
|
|
596
|
+
]);
|
|
573
597
|
} catch (e) {
|
|
574
598
|
console.error("Error inserting event into archivist", e);
|
|
575
599
|
}
|
|
576
|
-
};
|
|
600
|
+
}, "connectionPublisherCallback");
|
|
577
601
|
connection.on(eventName, connectionPublisherCallback);
|
|
578
602
|
const callbackId = connection.id + eventName;
|
|
579
603
|
this.publisherCallbacks[callbackId] = connectionPublisherCallback;
|
|
@@ -590,6 +614,9 @@ var EventBus = class {
|
|
|
590
614
|
|
|
591
615
|
// src/event/bus/PubSubConnection.ts
|
|
592
616
|
var EventBusPubSubConnection = class extends EventBusConnection {
|
|
617
|
+
static {
|
|
618
|
+
__name(this, "EventBusPubSubConnection");
|
|
619
|
+
}
|
|
593
620
|
publishableEvents;
|
|
594
621
|
subscribableEvents;
|
|
595
622
|
constructor(request) {
|
|
@@ -605,42 +632,52 @@ var EventBusPubSubConnection = class extends EventBusConnection {
|
|
|
605
632
|
// src/event/connections/DappAccessRequest.ts
|
|
606
633
|
var DappAccessRequestEvent = "dappAccessRequest";
|
|
607
634
|
var dappAccessRequestConnectionRequest = {
|
|
608
|
-
publishableEvents: [
|
|
635
|
+
publishableEvents: [
|
|
636
|
+
DappAccessRequestEvent
|
|
637
|
+
],
|
|
609
638
|
type: "PubSub"
|
|
610
639
|
};
|
|
611
|
-
var dappAccessRequestConnection = () => new EventBusPubSubConnection(dappAccessRequestConnectionRequest);
|
|
640
|
+
var dappAccessRequestConnection = /* @__PURE__ */ __name(() => new EventBusPubSubConnection(dappAccessRequestConnectionRequest), "dappAccessRequestConnection");
|
|
612
641
|
|
|
613
642
|
// src/event/connections/ExposeDappRequest.ts
|
|
614
643
|
var ExposeDappRequestEvent = "exposeDappRequest";
|
|
615
644
|
var exposeDappConnectionRequest = {
|
|
616
|
-
publishableEvents: [
|
|
645
|
+
publishableEvents: [
|
|
646
|
+
ExposeDappRequestEvent
|
|
647
|
+
],
|
|
617
648
|
type: "PubSub"
|
|
618
649
|
};
|
|
619
|
-
var exposeDappRequestConnection = () => new EventBusPubSubConnection(exposeDappConnectionRequest);
|
|
650
|
+
var exposeDappRequestConnection = /* @__PURE__ */ __name(() => new EventBusPubSubConnection(exposeDappConnectionRequest), "exposeDappRequestConnection");
|
|
620
651
|
|
|
621
652
|
// src/event/connections/OsPubSubNetworkReady.ts
|
|
622
653
|
var OsPubSubNetworkReadyEvent = "osPubSubNetworkReady";
|
|
623
654
|
var osPubSubNetworkConnectionRequest = {
|
|
624
|
-
publishableEvents: [
|
|
655
|
+
publishableEvents: [
|
|
656
|
+
OsPubSubNetworkReadyEvent
|
|
657
|
+
],
|
|
625
658
|
type: "PubSub"
|
|
626
659
|
};
|
|
627
|
-
var osPubSubNetworkReadyConnection = () => new EventBusPubSubConnection(osPubSubNetworkConnectionRequest);
|
|
660
|
+
var osPubSubNetworkReadyConnection = /* @__PURE__ */ __name(() => new EventBusPubSubConnection(osPubSubNetworkConnectionRequest), "osPubSubNetworkReadyConnection");
|
|
628
661
|
|
|
629
662
|
// src/event/connections/OsSettingsReady.ts
|
|
630
663
|
var OsSettingsReadyEvent = "osSettingsReady";
|
|
631
664
|
var osSettingsConnectionRequest = {
|
|
632
|
-
publishableEvents: [
|
|
665
|
+
publishableEvents: [
|
|
666
|
+
OsSettingsReadyEvent
|
|
667
|
+
],
|
|
633
668
|
type: "PubSub"
|
|
634
669
|
};
|
|
635
|
-
var osSettingsReadyConnection = () => new EventBusPubSubConnection(osSettingsConnectionRequest);
|
|
670
|
+
var osSettingsReadyConnection = /* @__PURE__ */ __name(() => new EventBusPubSubConnection(osSettingsConnectionRequest), "osSettingsReadyConnection");
|
|
636
671
|
|
|
637
672
|
// src/event/connections/OsXyoPublicReady.ts
|
|
638
673
|
var OsXyoPublicNetworkReadyEvent = "osXyoPublicNetworkReady";
|
|
639
674
|
var osXyoPublicNetworkConnectionRequest = {
|
|
640
|
-
publishableEvents: [
|
|
675
|
+
publishableEvents: [
|
|
676
|
+
OsXyoPublicNetworkReadyEvent
|
|
677
|
+
],
|
|
641
678
|
type: "PubSub"
|
|
642
679
|
};
|
|
643
|
-
var osXyoPublicNetworkReadyConnection = () => new EventBusPubSubConnection(osXyoPublicNetworkConnectionRequest);
|
|
680
|
+
var osXyoPublicNetworkReadyConnection = /* @__PURE__ */ __name(() => new EventBusPubSubConnection(osXyoPublicNetworkConnectionRequest), "osXyoPublicNetworkReadyConnection");
|
|
644
681
|
|
|
645
682
|
// src/XyOsDapp.ts
|
|
646
683
|
import { assertEx as assertEx6 } from "@xylabs/assert";
|
|
@@ -692,6 +729,9 @@ import { BaseEmitter as BaseEmitter2 } from "@xyo-network/module-event-emitter";
|
|
|
692
729
|
import { ModuleFactoryLocator } from "@xyo-network/module-factory-locator";
|
|
693
730
|
import { Mutex as Mutex2 } from "async-mutex";
|
|
694
731
|
var XyOsContextBase = class extends BaseEmitter2 {
|
|
732
|
+
static {
|
|
733
|
+
__name(this, "XyOsContextBase");
|
|
734
|
+
}
|
|
695
735
|
_bootMutex = new Mutex2();
|
|
696
736
|
_platformLocator;
|
|
697
737
|
_root;
|
|
@@ -775,10 +815,15 @@ var XyOsContextBase = class extends BaseEmitter2 {
|
|
|
775
815
|
|
|
776
816
|
// src/XyOsDapp.ts
|
|
777
817
|
var XyOsDapp = class extends XyOsContextBase {
|
|
818
|
+
static {
|
|
819
|
+
__name(this, "XyOsDapp");
|
|
820
|
+
}
|
|
778
821
|
dapp;
|
|
779
822
|
constructor(params) {
|
|
780
823
|
super(params);
|
|
781
|
-
this.dapp = {
|
|
824
|
+
this.dapp = {
|
|
825
|
+
...params.dapp
|
|
826
|
+
};
|
|
782
827
|
}
|
|
783
828
|
get eventBus() {
|
|
784
829
|
return this.parent.eventBus;
|
|
@@ -790,12 +835,12 @@ var XyOsDapp = class extends XyOsContextBase {
|
|
|
790
835
|
return this.parent.exposedNodeOuter;
|
|
791
836
|
}
|
|
792
837
|
/**
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
838
|
+
* @deprecated Dapps should not have access to the bios. This is done for the
|
|
839
|
+
* settings dapp, but should be refactored out. Bios could possibly be an
|
|
840
|
+
* optional property of the parent context passed in for dapps that require
|
|
841
|
+
* elevated permissions.
|
|
842
|
+
* ^^^ I believe we may want this here in that is a dApp requests access to the bios it will optionally be there
|
|
843
|
+
*/
|
|
799
844
|
get kernel() {
|
|
800
845
|
return assertEx6(this.parent.kernel, () => "Missing kernel");
|
|
801
846
|
}
|
|
@@ -814,15 +859,17 @@ var XyOsDapp = class extends XyOsContextBase {
|
|
|
814
859
|
assertEx6(this._root === void 0, () => "Dapp already booted");
|
|
815
860
|
const finalLocator = locator ? (this.params.locator ?? new ModuleFactoryLocator2()).merge(locator) : this.params.locator ?? new ModuleFactoryLocator2();
|
|
816
861
|
console.log("XyOsDapp:boot:finalLocator", finalLocator);
|
|
817
|
-
const dappNodesWrapper = new ManifestWrapper({
|
|
862
|
+
const dappNodesWrapper = new ManifestWrapper({
|
|
863
|
+
...this.manifest,
|
|
864
|
+
schema: DappPackageManifestPayloadSchema
|
|
865
|
+
}, wallet, finalLocator);
|
|
818
866
|
const dappNodes = await dappNodesWrapper.loadNodes();
|
|
819
867
|
const dappManifestWallet = await wallet.derivePath("99999");
|
|
820
868
|
dapp_window_manifest_default.nodes[0].config.name = this.dapp.name + "Root";
|
|
821
|
-
const wrapper = new ManifestWrapper(
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
);
|
|
869
|
+
const wrapper = new ManifestWrapper({
|
|
870
|
+
...dapp_window_manifest_default,
|
|
871
|
+
schema: DappPackageManifestPayloadSchema
|
|
872
|
+
}, dappManifestWallet, finalLocator);
|
|
826
873
|
const node = await wrapper.loadNodeFromIndex(0);
|
|
827
874
|
for (const dappNode of dappNodes) {
|
|
828
875
|
await node.register(dappNode);
|
|
@@ -844,12 +891,7 @@ import semver from "semver";
|
|
|
844
891
|
|
|
845
892
|
// src/classes/system/Queries.ts
|
|
846
893
|
import { PayloadDivinerQuerySchema as PayloadDivinerQuerySchema3 } from "@xyo-network/diviner-payload-model";
|
|
847
|
-
import {
|
|
848
|
-
DappConfigSchema,
|
|
849
|
-
DappIconSchema,
|
|
850
|
-
DappWidgetConfigSchema,
|
|
851
|
-
UnregisteredDappAccessSchema
|
|
852
|
-
} from "@xyo-network/os-model";
|
|
894
|
+
import { DappConfigSchema, DappIconSchema, DappWidgetConfigSchema, UnregisteredDappAccessSchema } from "@xyo-network/os-model";
|
|
853
895
|
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
854
896
|
var SystemDappQueries = {
|
|
855
897
|
async getDappAccess(diviner, name, version) {
|
|
@@ -857,10 +899,14 @@ var SystemDappQueries = {
|
|
|
857
899
|
order: "desc",
|
|
858
900
|
registeringDappId: name,
|
|
859
901
|
schema: PayloadDivinerQuerySchema3,
|
|
860
|
-
schemas: [
|
|
902
|
+
schemas: [
|
|
903
|
+
UnregisteredDappAccessSchema
|
|
904
|
+
],
|
|
861
905
|
version
|
|
862
906
|
};
|
|
863
|
-
return await diviner.divine([
|
|
907
|
+
return await diviner.divine([
|
|
908
|
+
accessQuery
|
|
909
|
+
]);
|
|
864
910
|
},
|
|
865
911
|
async getLatestConfig(diviner, name) {
|
|
866
912
|
const configQuery = {
|
|
@@ -868,9 +914,13 @@ var SystemDappQueries = {
|
|
|
868
914
|
name,
|
|
869
915
|
order: "desc",
|
|
870
916
|
schema: PayloadDivinerQuerySchema3,
|
|
871
|
-
schemas: [
|
|
917
|
+
schemas: [
|
|
918
|
+
DappConfigSchema
|
|
919
|
+
]
|
|
872
920
|
};
|
|
873
|
-
const [dappConfig] = await diviner.divine([
|
|
921
|
+
const [dappConfig] = await diviner.divine([
|
|
922
|
+
configQuery
|
|
923
|
+
]);
|
|
874
924
|
return dappConfig;
|
|
875
925
|
},
|
|
876
926
|
async getLatestIcon(diviner, name, version) {
|
|
@@ -878,10 +928,14 @@ var SystemDappQueries = {
|
|
|
878
928
|
name,
|
|
879
929
|
order: "desc",
|
|
880
930
|
schema: PayloadDivinerQuerySchema3,
|
|
881
|
-
schemas: [
|
|
931
|
+
schemas: [
|
|
932
|
+
DappIconSchema
|
|
933
|
+
],
|
|
882
934
|
version
|
|
883
935
|
};
|
|
884
|
-
const [dappIcon] = await diviner.divine([
|
|
936
|
+
const [dappIcon] = await diviner.divine([
|
|
937
|
+
iconQuery
|
|
938
|
+
]);
|
|
885
939
|
return dappIcon;
|
|
886
940
|
},
|
|
887
941
|
async getWidgetConfigs(diviner, name, version) {
|
|
@@ -889,10 +943,14 @@ var SystemDappQueries = {
|
|
|
889
943
|
dappId: name,
|
|
890
944
|
order: "desc",
|
|
891
945
|
schema: PayloadDivinerQuerySchema3,
|
|
892
|
-
schemas: [
|
|
946
|
+
schemas: [
|
|
947
|
+
DappWidgetConfigSchema
|
|
948
|
+
],
|
|
893
949
|
version
|
|
894
950
|
};
|
|
895
|
-
const widgetConfigs = await diviner.divine([
|
|
951
|
+
const widgetConfigs = await diviner.divine([
|
|
952
|
+
widgetConfigQuery
|
|
953
|
+
]);
|
|
896
954
|
const uniqueConfigs = {};
|
|
897
955
|
for (const widgetConfig of widgetConfigs) {
|
|
898
956
|
const hash = await PayloadBuilder2.dataHash(widgetConfig);
|
|
@@ -904,25 +962,28 @@ var SystemDappQueries = {
|
|
|
904
962
|
|
|
905
963
|
// src/classes/system/ManageSystemDapps.ts
|
|
906
964
|
var ManageSystemDapps = class extends OsCallerBase {
|
|
965
|
+
static {
|
|
966
|
+
__name(this, "ManageSystemDapps");
|
|
967
|
+
}
|
|
968
|
+
defaultSystemNames;
|
|
969
|
+
defaultSystemDapps;
|
|
970
|
+
defaultSystemDappParams;
|
|
971
|
+
locator;
|
|
972
|
+
developmentMode;
|
|
973
|
+
onErrorCallbacks;
|
|
907
974
|
constructor(context, defaultSystemNames, defaultSystemDapps, defaultSystemDappParams, locator, developmentMode) {
|
|
908
|
-
super(context);
|
|
909
|
-
this.defaultSystemNames = defaultSystemNames;
|
|
910
|
-
this.defaultSystemDapps = defaultSystemDapps;
|
|
911
|
-
this.defaultSystemDappParams = defaultSystemDappParams;
|
|
912
|
-
this.locator = locator;
|
|
913
|
-
this.developmentMode = developmentMode;
|
|
975
|
+
super(context), this.defaultSystemNames = defaultSystemNames, this.defaultSystemDapps = defaultSystemDapps, this.defaultSystemDappParams = defaultSystemDappParams, this.locator = locator, this.developmentMode = developmentMode, this.onErrorCallbacks = [];
|
|
914
976
|
}
|
|
915
|
-
onErrorCallbacks = [];
|
|
916
977
|
/**
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
978
|
+
* Add a callback to listen for errors throwing during system dapp registration
|
|
979
|
+
* @param {ErrorListener} errorListener
|
|
980
|
+
*/
|
|
920
981
|
addErrorListener(errorListener) {
|
|
921
982
|
this.onErrorCallbacks.push(errorListener);
|
|
922
983
|
}
|
|
923
984
|
/**
|
|
924
|
-
|
|
925
|
-
|
|
985
|
+
* Installs the dapps into the OS and builds the appropriate DappSet
|
|
986
|
+
*/
|
|
926
987
|
async install() {
|
|
927
988
|
await this.insertPayloads();
|
|
928
989
|
return await this.latestSets();
|
|
@@ -946,9 +1007,13 @@ var ManageSystemDapps = class extends OsCallerBase {
|
|
|
946
1007
|
console.error(`${systemDappPayload.version} does not appear to be a valid semver value`, e);
|
|
947
1008
|
continue;
|
|
948
1009
|
}
|
|
949
|
-
const [existing] = await archivist.get([
|
|
1010
|
+
const [existing] = await archivist.get([
|
|
1011
|
+
await PayloadBuilder3.dataHash(systemDappPayload)
|
|
1012
|
+
]);
|
|
950
1013
|
if (existing) continue;
|
|
951
|
-
await archivist.insert([
|
|
1014
|
+
await archivist.insert([
|
|
1015
|
+
systemDappPayload
|
|
1016
|
+
]);
|
|
952
1017
|
}
|
|
953
1018
|
return true;
|
|
954
1019
|
} catch (e) {
|
|
@@ -1003,11 +1068,7 @@ var ManageSystemDapps = class extends OsCallerBase {
|
|
|
1003
1068
|
|
|
1004
1069
|
// src/classes/registration/DappRegistry.ts
|
|
1005
1070
|
import { HDWallet as HDWallet3 } from "@xyo-network/account";
|
|
1006
|
-
import {
|
|
1007
|
-
DappRegisteredSchema,
|
|
1008
|
-
DappRegisteredState,
|
|
1009
|
-
isRegisteredDappAccess
|
|
1010
|
-
} from "@xyo-network/os-model";
|
|
1071
|
+
import { DappRegisteredSchema, DappRegisteredState, isRegisteredDappAccess } from "@xyo-network/os-model";
|
|
1011
1072
|
|
|
1012
1073
|
// src/classes/registration/ValidateDappAccessDiviner/Config.ts
|
|
1013
1074
|
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
@@ -1019,20 +1080,22 @@ var ValidateDappAccessDivinerConfigSchema = "network.xyo.os.dapp.access.registra
|
|
|
1019
1080
|
import { HDWallet as HDWallet2 } from "@xyo-network/account";
|
|
1020
1081
|
import { AbstractDiviner } from "@xyo-network/diviner-abstract";
|
|
1021
1082
|
import { ManifestWrapper as ManifestWrapper2, PackageManifestPayloadSchema } from "@xyo-network/manifest";
|
|
1022
|
-
import {
|
|
1023
|
-
isDappPackageManifestPayload,
|
|
1024
|
-
isUnregisteredDappAccess,
|
|
1025
|
-
RegisteredDappAccessSchema
|
|
1026
|
-
} from "@xyo-network/os-model";
|
|
1027
|
-
import { PayloadBuilder as PayloadBuilder4 } from "@xyo-network/payload-builder";
|
|
1083
|
+
import { isDappPackageManifestPayload, isUnregisteredDappAccess, RegisteredDappAccessSchema } from "@xyo-network/os-model";
|
|
1028
1084
|
|
|
1029
1085
|
// src/access-interfaces/ValidDappAccessInterfaces.ts
|
|
1030
1086
|
import { RegisteredNames, RegisteredNamesInterface } from "@xyo-network/os-model";
|
|
1031
|
-
var ValidDappAccessInterfaces = {
|
|
1087
|
+
var ValidDappAccessInterfaces = {
|
|
1088
|
+
[RegisteredNames]: RegisteredNamesInterface
|
|
1089
|
+
};
|
|
1032
1090
|
|
|
1033
1091
|
// src/classes/registration/ValidateDappAccessDiviner/Diviner.ts
|
|
1034
1092
|
var ValidateDappAccessDiviner = class extends AbstractDiviner {
|
|
1035
|
-
static
|
|
1093
|
+
static {
|
|
1094
|
+
__name(this, "ValidateDappAccessDiviner");
|
|
1095
|
+
}
|
|
1096
|
+
static configSchemas = [
|
|
1097
|
+
ValidateDappAccessDivinerConfigSchema
|
|
1098
|
+
];
|
|
1036
1099
|
async divineHandler(payloads) {
|
|
1037
1100
|
const dappManifest = payloads?.filter(isDappPackageManifestPayload);
|
|
1038
1101
|
const accessors = payloads?.filter(isUnregisteredDappAccess);
|
|
@@ -1058,48 +1121,49 @@ var ValidateDappAccessDiviner = class extends AbstractDiviner {
|
|
|
1058
1121
|
const interfaceChildren = await getNodeChildren(dappAccessInterface.manifest, dappParams);
|
|
1059
1122
|
const valid = compareChildren(interfaceChildren, dappChildren);
|
|
1060
1123
|
if (valid) {
|
|
1061
|
-
const payload =
|
|
1124
|
+
const payload = {
|
|
1062
1125
|
...access,
|
|
1063
1126
|
schema: RegisteredDappAccessSchema,
|
|
1064
1127
|
timestamp: Date.now()
|
|
1065
|
-
}
|
|
1128
|
+
};
|
|
1066
1129
|
registeredAccessors.push(payload);
|
|
1067
1130
|
} else {
|
|
1068
|
-
const failedRegistration =
|
|
1131
|
+
const failedRegistration = {
|
|
1069
1132
|
accessor: access,
|
|
1070
1133
|
errorMessage: "Invalid dapp access interface",
|
|
1071
1134
|
schema: FailedAccessorSchema
|
|
1072
|
-
}
|
|
1135
|
+
};
|
|
1073
1136
|
failedAccessors.push(failedRegistration);
|
|
1074
1137
|
}
|
|
1075
1138
|
}
|
|
1076
1139
|
} catch (e) {
|
|
1077
|
-
failedAccessors.push(
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
})
|
|
1083
|
-
);
|
|
1140
|
+
failedAccessors.push({
|
|
1141
|
+
accessor: access,
|
|
1142
|
+
errorMessage: e.message,
|
|
1143
|
+
schema: FailedAccessorSchema
|
|
1144
|
+
});
|
|
1084
1145
|
}
|
|
1085
1146
|
}
|
|
1086
|
-
return [
|
|
1147
|
+
return [
|
|
1148
|
+
...registeredAccessors,
|
|
1149
|
+
...failedAccessors
|
|
1150
|
+
];
|
|
1087
1151
|
}
|
|
1088
1152
|
};
|
|
1089
|
-
var compareChildren = (interfaceChildren, dappChildren) => {
|
|
1153
|
+
var compareChildren = /* @__PURE__ */ __name((interfaceChildren, dappChildren) => {
|
|
1090
1154
|
return interfaceChildren.every((interfaceChild) => Object.values(interfaceChild).every((interfaceChildName) => dappChildren.some((dappChild) => Object.values(dappChild).includes(interfaceChildName))));
|
|
1091
|
-
};
|
|
1092
|
-
var dappPackageManifestToPackageManifest = (dappPackageManifest) => {
|
|
1155
|
+
}, "compareChildren");
|
|
1156
|
+
var dappPackageManifestToPackageManifest = /* @__PURE__ */ __name((dappPackageManifest) => {
|
|
1093
1157
|
return {
|
|
1094
1158
|
...dappPackageManifest,
|
|
1095
1159
|
schema: PackageManifestPayloadSchema
|
|
1096
1160
|
};
|
|
1097
|
-
};
|
|
1098
|
-
var getChildrenFromNode = async (node) => {
|
|
1161
|
+
}, "dappPackageManifestToPackageManifest");
|
|
1162
|
+
var getChildrenFromNode = /* @__PURE__ */ __name(async (node) => {
|
|
1099
1163
|
const nodeManifest = (await node.state())?.[0];
|
|
1100
1164
|
return nodeManifest.status?.children;
|
|
1101
|
-
};
|
|
1102
|
-
var getNodeChildren = async (manifestToTest, dappParams) => {
|
|
1165
|
+
}, "getChildrenFromNode");
|
|
1166
|
+
var getNodeChildren = /* @__PURE__ */ __name(async (manifestToTest, dappParams) => {
|
|
1103
1167
|
const testNodes = await getNodeToTest(manifestToTest, dappParams);
|
|
1104
1168
|
const children = [];
|
|
1105
1169
|
for (const node of testNodes) {
|
|
@@ -1109,35 +1173,32 @@ var getNodeChildren = async (manifestToTest, dappParams) => {
|
|
|
1109
1173
|
}
|
|
1110
1174
|
}
|
|
1111
1175
|
return children;
|
|
1112
|
-
};
|
|
1113
|
-
var getNodeToTest = async (manifestToTest, dappParams) => {
|
|
1176
|
+
}, "getNodeChildren");
|
|
1177
|
+
var getNodeToTest = /* @__PURE__ */ __name(async (manifestToTest, dappParams) => {
|
|
1114
1178
|
const dappManifestWrapper = new ManifestWrapper2(manifestToTest, await HDWallet2.random(), dappParams.locator);
|
|
1115
1179
|
return await dappManifestWrapper.loadNodes();
|
|
1116
|
-
};
|
|
1180
|
+
}, "getNodeToTest");
|
|
1117
1181
|
|
|
1118
1182
|
// src/classes/registration/DappRegistry.ts
|
|
1119
1183
|
var DappRegistry = class {
|
|
1184
|
+
static {
|
|
1185
|
+
__name(this, "DappRegistry");
|
|
1186
|
+
}
|
|
1187
|
+
dappSeedPhraseRepository;
|
|
1188
|
+
dappRegistry;
|
|
1120
1189
|
constructor(dappSeedPhraseRepository) {
|
|
1121
1190
|
this.dappSeedPhraseRepository = dappSeedPhraseRepository;
|
|
1191
|
+
this.dappRegistry = /* @__PURE__ */ new Map();
|
|
1122
1192
|
}
|
|
1123
|
-
dappRegistry = /* @__PURE__ */ new Map();
|
|
1124
1193
|
/**
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1194
|
+
* Register a Dapp with window manager and if successful, return its id
|
|
1195
|
+
*
|
|
1196
|
+
* @param {UnregisteredDapp} dapp Manifest and UI of the Dapp to register
|
|
1197
|
+
* @returns {RegisteredDapp} dapp with registration fields
|
|
1198
|
+
**/
|
|
1130
1199
|
async registerDapp(dapp) {
|
|
1131
1200
|
if (dapp) {
|
|
1132
|
-
const {
|
|
1133
|
-
exposedModuleIds,
|
|
1134
|
-
manifest,
|
|
1135
|
-
modes,
|
|
1136
|
-
name,
|
|
1137
|
-
version,
|
|
1138
|
-
params,
|
|
1139
|
-
widgetConfigs
|
|
1140
|
-
} = this.extractDappProperties(dapp);
|
|
1201
|
+
const { exposedModuleIds, manifest, modes, name, version, params, widgetConfigs } = this.extractDappProperties(dapp);
|
|
1141
1202
|
try {
|
|
1142
1203
|
const walletId = await this.dappSeedPhraseRepository.findOrCreate(name);
|
|
1143
1204
|
const registeredAccessors = await this.validateDappAccessPayloads(manifest, dapp.accessors, params);
|
|
@@ -1172,27 +1233,16 @@ var DappRegistry = class {
|
|
|
1172
1233
|
}
|
|
1173
1234
|
}
|
|
1174
1235
|
/**
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1236
|
+
* Unregister a dapp so it can no longer be launched
|
|
1237
|
+
*
|
|
1238
|
+
* @param dappId
|
|
1239
|
+
*/
|
|
1179
1240
|
unregisterDapp(dappId) {
|
|
1180
1241
|
this.dappRegistry.delete(dappId);
|
|
1181
1242
|
}
|
|
1182
1243
|
extractDappProperties(dapp) {
|
|
1183
|
-
const {
|
|
1184
|
-
|
|
1185
|
-
config,
|
|
1186
|
-
widgetConfigs
|
|
1187
|
-
} = dapp;
|
|
1188
|
-
const {
|
|
1189
|
-
exposedModuleIds,
|
|
1190
|
-
manifest,
|
|
1191
|
-
modes,
|
|
1192
|
-
name,
|
|
1193
|
-
sources,
|
|
1194
|
-
version
|
|
1195
|
-
} = config;
|
|
1244
|
+
const { params, config, widgetConfigs } = dapp;
|
|
1245
|
+
const { exposedModuleIds, manifest, modes, name, sources, version } = config;
|
|
1196
1246
|
return {
|
|
1197
1247
|
exposedModuleIds,
|
|
1198
1248
|
manifest,
|
|
@@ -1207,10 +1257,15 @@ var DappRegistry = class {
|
|
|
1207
1257
|
async validateDappAccessPayloads(manifest, accessors = [], params) {
|
|
1208
1258
|
const validateDappAccess = await ValidateDappAccessDiviner.create({
|
|
1209
1259
|
account: await HDWallet3.random(),
|
|
1210
|
-
config: {
|
|
1260
|
+
config: {
|
|
1261
|
+
schema: ValidateDappAccessDivinerConfigSchema
|
|
1262
|
+
},
|
|
1211
1263
|
dappParams: params
|
|
1212
1264
|
});
|
|
1213
|
-
const payloads = await validateDappAccess.divine([
|
|
1265
|
+
const payloads = await validateDappAccess.divine([
|
|
1266
|
+
manifest,
|
|
1267
|
+
...accessors
|
|
1268
|
+
]);
|
|
1214
1269
|
const failedAccessors = payloads.filter(isFailedAccessor);
|
|
1215
1270
|
const registeredAccessors = payloads.filter(isRegisteredDappAccess);
|
|
1216
1271
|
if (failedAccessors.length > 0) {
|
|
@@ -1222,6 +1277,26 @@ var DappRegistry = class {
|
|
|
1222
1277
|
|
|
1223
1278
|
// src/classes/registration/DappRegistrationService.ts
|
|
1224
1279
|
var DappRegistrationService = class {
|
|
1280
|
+
static {
|
|
1281
|
+
__name(this, "DappRegistrationService");
|
|
1282
|
+
}
|
|
1283
|
+
context;
|
|
1284
|
+
params;
|
|
1285
|
+
locator;
|
|
1286
|
+
developmentMode;
|
|
1287
|
+
// Dapps that have been built with their own context
|
|
1288
|
+
builtDapps;
|
|
1289
|
+
dappRegistry;
|
|
1290
|
+
dappSeedPhraseRepository;
|
|
1291
|
+
manageSystemDapps;
|
|
1292
|
+
// Dapps that have been registered with dappAccessRequests
|
|
1293
|
+
registeredAccessDappSets;
|
|
1294
|
+
// Dapps that have been registered with the dapp registry
|
|
1295
|
+
registeredDappSets;
|
|
1296
|
+
// Dapps that have been registered with exposeDappRequests
|
|
1297
|
+
registeredExposedDappSets;
|
|
1298
|
+
dappAccessRequestConnection;
|
|
1299
|
+
exposeDappRequestConnection;
|
|
1225
1300
|
constructor(context, params = {
|
|
1226
1301
|
dappNames: [],
|
|
1227
1302
|
dappParams: {},
|
|
@@ -1231,34 +1306,23 @@ var DappRegistrationService = class {
|
|
|
1231
1306
|
this.params = params;
|
|
1232
1307
|
this.locator = locator;
|
|
1233
1308
|
this.developmentMode = developmentMode;
|
|
1234
|
-
this.
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
);
|
|
1309
|
+
this.builtDapps = {};
|
|
1310
|
+
this.registeredAccessDappSets = /* @__PURE__ */ new Set();
|
|
1311
|
+
this.registeredDappSets = /* @__PURE__ */ new Set();
|
|
1312
|
+
this.registeredExposedDappSets = /* @__PURE__ */ new Set();
|
|
1313
|
+
this.dappAccessRequestConnection = dappAccessRequestConnection();
|
|
1314
|
+
this.exposeDappRequestConnection = exposeDappRequestConnection();
|
|
1315
|
+
this.manageSystemDapps = new ManageSystemDapps(context, this.params?.dappNames ?? [], this.params?.dappPayloads ?? [], this.params?.dappParams ?? {}, this.locator, this.developmentMode);
|
|
1242
1316
|
this.dappSeedPhraseRepository = new DappSeedPhraseRepository(context, this.params?.dappNames ?? []);
|
|
1243
1317
|
this.dappRegistry = new DappRegistry(this.dappSeedPhraseRepository);
|
|
1244
1318
|
this.addConnectionRequests();
|
|
1245
1319
|
}
|
|
1246
|
-
// Dapps that have been built with their own context
|
|
1247
|
-
builtDapps = {};
|
|
1248
|
-
dappRegistry;
|
|
1249
|
-
dappSeedPhraseRepository;
|
|
1250
|
-
manageSystemDapps;
|
|
1251
|
-
// Dapps that have been registered with dappAccessRequests
|
|
1252
|
-
registeredAccessDappSets = /* @__PURE__ */ new Set();
|
|
1253
|
-
// Dapps that have been registered with the dapp registry
|
|
1254
|
-
registeredDappSets = /* @__PURE__ */ new Set();
|
|
1255
|
-
// Dapps that have been registered with exposeDappRequests
|
|
1256
|
-
registeredExposedDappSets = /* @__PURE__ */ new Set();
|
|
1257
|
-
dappAccessRequestConnection = dappAccessRequestConnection();
|
|
1258
|
-
exposeDappRequestConnection = exposeDappRequestConnection();
|
|
1259
1320
|
async buildDapp(manifest, dappId = NameTransforms.slug(manifest.nodes[0]?.config.name), name = NameTransforms.moduleName(manifest.nodes[0]?.config.name)) {
|
|
1260
1321
|
const dapp = new XyOsDapp({
|
|
1261
|
-
dapp: {
|
|
1322
|
+
dapp: {
|
|
1323
|
+
id: dappId,
|
|
1324
|
+
name
|
|
1325
|
+
},
|
|
1262
1326
|
locator: this.locator,
|
|
1263
1327
|
manifest,
|
|
1264
1328
|
parent: this.context,
|
|
@@ -1271,37 +1335,43 @@ var DappRegistrationService = class {
|
|
|
1271
1335
|
return this.params?.dappParams[dappId];
|
|
1272
1336
|
}
|
|
1273
1337
|
async start() {
|
|
1274
|
-
const systemDapps = await this.context.monitor(async () => await this.manageSystemDapps.install(), {
|
|
1338
|
+
const systemDapps = await this.context.monitor(async () => await this.manageSystemDapps.install(), {
|
|
1339
|
+
name: "Install System dApps"
|
|
1340
|
+
});
|
|
1275
1341
|
const activeDapps = systemDapps.filter(({ dapp }) => dapp.icon.active === true);
|
|
1276
|
-
const results = await Promise.allSettled(
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1342
|
+
const results = await Promise.allSettled(activeDapps.map(async (dappSet) => {
|
|
1343
|
+
const { dapp } = dappSet;
|
|
1344
|
+
const registeredDapp = await this.dappRegistry.registerDapp(dapp);
|
|
1345
|
+
const result = {
|
|
1346
|
+
dapp: registeredDapp,
|
|
1347
|
+
dappIcon: dapp.icon
|
|
1348
|
+
};
|
|
1349
|
+
const forgetHandlers = /* @__PURE__ */ __name(async () => {
|
|
1350
|
+
try {
|
|
1351
|
+
await this.postRegistrationHandlers(result);
|
|
1352
|
+
} catch (e) {
|
|
1353
|
+
console.error("Error in post registration handlers", e);
|
|
1354
|
+
}
|
|
1355
|
+
}, "forgetHandlers");
|
|
1356
|
+
forget2(forgetHandlers());
|
|
1357
|
+
return result;
|
|
1358
|
+
}));
|
|
1292
1359
|
const failed = results.filter(rejected).map((result) => result.reason);
|
|
1293
1360
|
const succeeded = results.filter(fulfilled).map((result) => result.value);
|
|
1294
1361
|
for (const registeredDapp of succeeded) this.registeredDappSets.add(registeredDapp);
|
|
1295
|
-
return {
|
|
1362
|
+
return {
|
|
1363
|
+
failed,
|
|
1364
|
+
succeeded
|
|
1365
|
+
};
|
|
1296
1366
|
}
|
|
1297
1367
|
addConnectionRequests() {
|
|
1298
1368
|
this.context.eventBus.addConnection(this.dappAccessRequestConnection);
|
|
1299
1369
|
this.context.eventBus.addConnection(this.exposeDappRequestConnection);
|
|
1300
1370
|
}
|
|
1301
1371
|
/**
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1372
|
+
* A method to get the user property from context and eventually modify it before handing it to a dapp
|
|
1373
|
+
* i.e. curating user-approved signers
|
|
1374
|
+
*/
|
|
1305
1375
|
getUser() {
|
|
1306
1376
|
return this.context.user;
|
|
1307
1377
|
}
|
|
@@ -1309,17 +1379,19 @@ var DappRegistrationService = class {
|
|
|
1309
1379
|
if (registeredDapp.dapp) {
|
|
1310
1380
|
if (isRegisteredDappExposedDappSet(registeredDapp)) {
|
|
1311
1381
|
this.registeredExposedDappSets.add(registeredDapp);
|
|
1312
|
-
const exposeIntent = DappIntentCaller.buildIntent(
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1382
|
+
const exposeIntent = DappIntentCaller.buildIntent(DappIntentCaller.OsDappName, DappIntentTypes.Launch, registeredDapp.dapp.config.name, DappMode2.Exposed);
|
|
1383
|
+
await this.exposeDappRequestConnection.emit(ExposeDappRequestEvent, {
|
|
1384
|
+
payloads: [
|
|
1385
|
+
registeredDapp.dapp.config,
|
|
1386
|
+
exposeIntent
|
|
1387
|
+
]
|
|
1388
|
+
});
|
|
1319
1389
|
}
|
|
1320
1390
|
if (isRegisteredDappAccessDappSet(registeredDapp)) {
|
|
1321
1391
|
this.registeredAccessDappSets.add(registeredDapp);
|
|
1322
|
-
await this.dappAccessRequestConnection.emit(DappAccessRequestEvent, {
|
|
1392
|
+
await this.dappAccessRequestConnection.emit(DappAccessRequestEvent, {
|
|
1393
|
+
payloads: registeredDapp.dapp.accessors
|
|
1394
|
+
});
|
|
1323
1395
|
}
|
|
1324
1396
|
}
|
|
1325
1397
|
}
|
|
@@ -1329,6 +1401,9 @@ var DappRegistrationService = class {
|
|
|
1329
1401
|
import { assertEx as assertEx7 } from "@xylabs/assert";
|
|
1330
1402
|
import { HDWallet as HDWallet4 } from "@xyo-network/account";
|
|
1331
1403
|
var Signers = class {
|
|
1404
|
+
static {
|
|
1405
|
+
__name(this, "Signers");
|
|
1406
|
+
}
|
|
1332
1407
|
_paths;
|
|
1333
1408
|
_signerAccounts;
|
|
1334
1409
|
_walletStore;
|
|
@@ -1379,26 +1454,32 @@ import { IndexedDbPayloadDiviner } from "@xyo-network/diviner-payload-indexeddb"
|
|
|
1379
1454
|
import { ManifestWrapper as ManifestWrapper3 } from "@xyo-network/manifest-wrapper";
|
|
1380
1455
|
import { ModuleFactoryLocator as ModuleFactoryLocator4 } from "@xyo-network/module-factory-locator";
|
|
1381
1456
|
var OS_NODE_PATH = "1'";
|
|
1382
|
-
var getDefaultOsNodeLocator = () => {
|
|
1457
|
+
var getDefaultOsNodeLocator = /* @__PURE__ */ __name(() => {
|
|
1383
1458
|
const locator = new ModuleFactoryLocator4();
|
|
1384
|
-
locator.register(IndexedDbArchivist, {
|
|
1385
|
-
|
|
1459
|
+
locator.register(IndexedDbArchivist, {
|
|
1460
|
+
"network.xyo.archivist.persistence.scope": "device"
|
|
1461
|
+
});
|
|
1462
|
+
locator.register(IndexedDbPayloadDiviner, {
|
|
1463
|
+
"network.xyo.archivist.persistence.scope": "device"
|
|
1464
|
+
});
|
|
1386
1465
|
return locator;
|
|
1387
|
-
};
|
|
1388
|
-
var loadOsNode = async (osWallet, locator) => {
|
|
1466
|
+
}, "getDefaultOsNodeLocator");
|
|
1467
|
+
var loadOsNode = /* @__PURE__ */ __name(async (osWallet, locator) => {
|
|
1389
1468
|
try {
|
|
1390
1469
|
const osNodeWallet = await osWallet.derivePath(OS_NODE_PATH);
|
|
1391
1470
|
const osNodeLocator = locator ?? getDefaultOsNodeLocator();
|
|
1392
1471
|
const manifestWrapper = new ManifestWrapper3(os_node_manifest_default, osNodeWallet, osNodeLocator);
|
|
1393
1472
|
const osNode = (await manifestWrapper.loadNodes())[0];
|
|
1394
|
-
return [
|
|
1473
|
+
return [
|
|
1474
|
+
osNode
|
|
1475
|
+
];
|
|
1395
1476
|
} catch (e) {
|
|
1396
1477
|
const error = e;
|
|
1397
1478
|
console.error(`Error creating os node: ${error.message}`);
|
|
1398
1479
|
console.error(`Error creating os node: ${error.stack}`);
|
|
1399
1480
|
throw new Error(`Error creating os node: ${error.message}`);
|
|
1400
1481
|
}
|
|
1401
|
-
};
|
|
1482
|
+
}, "loadOsNode");
|
|
1402
1483
|
|
|
1403
1484
|
// src/stack/Base.ts
|
|
1404
1485
|
import { assertEx as assertEx8 } from "@xylabs/assert";
|
|
@@ -1407,6 +1488,9 @@ import { BaseEmitter as BaseEmitter3 } from "@xyo-network/module-event-emitter";
|
|
|
1407
1488
|
import { isModuleInstance } from "@xyo-network/module-model";
|
|
1408
1489
|
import { asAttachableNodeInstance } from "@xyo-network/node-model";
|
|
1409
1490
|
var StackBase = class extends BaseEmitter3 {
|
|
1491
|
+
static {
|
|
1492
|
+
__name(this, "StackBase");
|
|
1493
|
+
}
|
|
1410
1494
|
// flag to check that all adapters are initialized
|
|
1411
1495
|
initialized = false;
|
|
1412
1496
|
// adapters to initialize into the stack
|
|
@@ -1441,57 +1525,57 @@ var StackBase = class extends BaseEmitter3 {
|
|
|
1441
1525
|
initialize() {
|
|
1442
1526
|
this.assignStack();
|
|
1443
1527
|
for (const adapter of this.adapterSet) {
|
|
1444
|
-
const driverReadyListener = async ({ node }) => await this.handleDriverReady(node);
|
|
1528
|
+
const driverReadyListener = /* @__PURE__ */ __name(async ({ node }) => await this.handleDriverReady(node), "driverReadyListener");
|
|
1445
1529
|
adapter.on("driverReady", driverReadyListener);
|
|
1446
1530
|
this.listeners.push({
|
|
1447
1531
|
adapter,
|
|
1448
1532
|
eventName: "driverReady",
|
|
1449
1533
|
listener: driverReadyListener
|
|
1450
1534
|
});
|
|
1451
|
-
const driverErrorListener = async ({ error }) => {
|
|
1535
|
+
const driverErrorListener = /* @__PURE__ */ __name(async ({ error }) => {
|
|
1452
1536
|
console.error(`Error updating ${this.stackNodeModuleId} stack node`, error);
|
|
1453
|
-
await this.emit("driverError", {
|
|
1454
|
-
|
|
1537
|
+
await this.emit("driverError", {
|
|
1538
|
+
error
|
|
1539
|
+
});
|
|
1540
|
+
}, "driverErrorListener");
|
|
1455
1541
|
adapter.on("driverError", driverErrorListener);
|
|
1456
1542
|
this.listeners.push({
|
|
1457
1543
|
adapter,
|
|
1458
1544
|
eventName: "driverError",
|
|
1459
1545
|
listener: driverErrorListener
|
|
1460
1546
|
});
|
|
1461
|
-
const startAdapter = async () => await adapter.start();
|
|
1547
|
+
const startAdapter = /* @__PURE__ */ __name(async () => await adapter.start(), "startAdapter");
|
|
1462
1548
|
forget3(startAdapter());
|
|
1463
1549
|
}
|
|
1464
1550
|
}
|
|
1465
1551
|
/**
|
|
1466
|
-
|
|
1467
|
-
|
|
1552
|
+
* Stops the stack
|
|
1553
|
+
*/
|
|
1468
1554
|
stop() {
|
|
1469
|
-
for (const {
|
|
1470
|
-
eventName,
|
|
1471
|
-
listener,
|
|
1472
|
-
adapter
|
|
1473
|
-
} of this.listeners) {
|
|
1555
|
+
for (const { eventName, listener, adapter } of this.listeners) {
|
|
1474
1556
|
adapter.off(eventName, listener);
|
|
1475
1557
|
}
|
|
1476
1558
|
}
|
|
1477
1559
|
/**
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1560
|
+
* Adds a node to the stack. Idempotent to avoid adding the
|
|
1561
|
+
* same node multiple times
|
|
1562
|
+
* @param node The node to add to the stack
|
|
1563
|
+
* @returns
|
|
1564
|
+
*/
|
|
1483
1565
|
async addNodeToStackNode(node) {
|
|
1484
1566
|
const stackNode = await this.getStackNode();
|
|
1485
|
-
const existingModule = await stackNode.resolve(node.address, {
|
|
1567
|
+
const existingModule = await stackNode.resolve(node.address, {
|
|
1568
|
+
direction: "down"
|
|
1569
|
+
});
|
|
1486
1570
|
if (isModuleInstance(existingModule)) return;
|
|
1487
1571
|
await stackNode.register?.(node);
|
|
1488
1572
|
await stackNode.attach?.(node.address, true);
|
|
1489
1573
|
}
|
|
1490
1574
|
assignStack() {
|
|
1491
|
-
const assign = async () => {
|
|
1575
|
+
const assign = /* @__PURE__ */ __name(async () => {
|
|
1492
1576
|
const stackNode = await this.getStackNode();
|
|
1493
1577
|
this._stack = stackNode;
|
|
1494
|
-
};
|
|
1578
|
+
}, "assign");
|
|
1495
1579
|
forget3(assign());
|
|
1496
1580
|
}
|
|
1497
1581
|
async getStackNode() {
|
|
@@ -1500,25 +1584,34 @@ var StackBase = class extends BaseEmitter3 {
|
|
|
1500
1584
|
}
|
|
1501
1585
|
async handleDriverReady(node) {
|
|
1502
1586
|
try {
|
|
1503
|
-
await this.emit("driverReady", {
|
|
1587
|
+
await this.emit("driverReady", {
|
|
1588
|
+
node
|
|
1589
|
+
});
|
|
1504
1590
|
await this.addNodeToStackNode(node);
|
|
1505
1591
|
await this.updateInitializationState(node);
|
|
1506
1592
|
} catch (error) {
|
|
1507
1593
|
console.error(`Error updating ${this.stackNodeModuleId} stack node`, node.id, error);
|
|
1508
|
-
await this.emit("stackError", {
|
|
1594
|
+
await this.emit("stackError", {
|
|
1595
|
+
error
|
|
1596
|
+
});
|
|
1509
1597
|
}
|
|
1510
1598
|
}
|
|
1511
1599
|
async updateInitializationState(node) {
|
|
1512
1600
|
this.initializedNodes.push(node);
|
|
1513
1601
|
this.initialized = this.adapterSet.every((n) => n.initialized);
|
|
1514
1602
|
if (this.initialized) {
|
|
1515
|
-
await this.emit("initialized", {
|
|
1603
|
+
await this.emit("initialized", {
|
|
1604
|
+
stack: await this.getStackNode()
|
|
1605
|
+
});
|
|
1516
1606
|
}
|
|
1517
1607
|
}
|
|
1518
1608
|
};
|
|
1519
1609
|
|
|
1520
1610
|
// src/stack/Manager.ts
|
|
1521
1611
|
var StackManager = class {
|
|
1612
|
+
static {
|
|
1613
|
+
__name(this, "StackManager");
|
|
1614
|
+
}
|
|
1522
1615
|
initializedStacksMap = /* @__PURE__ */ new Map();
|
|
1523
1616
|
stackMap;
|
|
1524
1617
|
constructor(stackMap) {
|
|
@@ -1560,27 +1653,30 @@ import { BaseEmitter as BaseEmitter4 } from "@xyo-network/module-event-emitter";
|
|
|
1560
1653
|
import { asAttachableNodeInstance as asAttachableNodeInstance2 } from "@xyo-network/node-model";
|
|
1561
1654
|
import { v4 as uuid3 } from "uuid";
|
|
1562
1655
|
var NodeAdapterBase = class extends BaseEmitter4 {
|
|
1656
|
+
static {
|
|
1657
|
+
__name(this, "NodeAdapterBase");
|
|
1658
|
+
}
|
|
1659
|
+
kernel;
|
|
1660
|
+
driverName;
|
|
1661
|
+
initialized;
|
|
1662
|
+
_id;
|
|
1563
1663
|
constructor(kernel, driverName) {
|
|
1564
|
-
super({});
|
|
1565
|
-
this.kernel = kernel;
|
|
1566
|
-
this.driverName = driverName;
|
|
1664
|
+
super({}), this.kernel = kernel, this.driverName = driverName, this.initialized = false, this._id = "";
|
|
1567
1665
|
this._id = uuid3();
|
|
1568
1666
|
}
|
|
1569
|
-
initialized = false;
|
|
1570
|
-
_id = "";
|
|
1571
1667
|
get id() {
|
|
1572
1668
|
return assertEx9(this._id, () => "NodeAdapterBase id not initialized");
|
|
1573
1669
|
}
|
|
1574
1670
|
async start() {
|
|
1575
1671
|
try {
|
|
1576
|
-
const moduleAttachedInsertListener = ({ payloads }) => {
|
|
1672
|
+
const moduleAttachedInsertListener = /* @__PURE__ */ __name(({ payloads }) => {
|
|
1577
1673
|
const moduleAttachedEvent = this.findModuleEventPayloads(payloads);
|
|
1578
1674
|
for (const payload of moduleAttachedEvent) {
|
|
1579
1675
|
if (payload.name === this.driverName) {
|
|
1580
1676
|
this.validateAndReturnDriver();
|
|
1581
1677
|
}
|
|
1582
1678
|
}
|
|
1583
|
-
};
|
|
1679
|
+
}, "moduleAttachedInsertListener");
|
|
1584
1680
|
const eventsArchivist = await this.getEventsArchivist();
|
|
1585
1681
|
const weakRefInsertListener = new WeakRef(moduleAttachedInsertListener);
|
|
1586
1682
|
const insertListenerRef = weakRefInsertListener.deref();
|
|
@@ -1589,7 +1685,9 @@ var NodeAdapterBase = class extends BaseEmitter4 {
|
|
|
1589
1685
|
if (node) return node;
|
|
1590
1686
|
this.initialized = false;
|
|
1591
1687
|
} catch (error) {
|
|
1592
|
-
await this.emit("driverError", {
|
|
1688
|
+
await this.emit("driverError", {
|
|
1689
|
+
error
|
|
1690
|
+
});
|
|
1593
1691
|
}
|
|
1594
1692
|
}
|
|
1595
1693
|
findModuleEventPayloads(payloads) {
|
|
@@ -1607,7 +1705,9 @@ var NodeAdapterBase = class extends BaseEmitter4 {
|
|
|
1607
1705
|
if (mod) {
|
|
1608
1706
|
const node = asAttachableNodeInstance2(mod, () => `${mod.id} is not a node`);
|
|
1609
1707
|
this.initialized = true;
|
|
1610
|
-
const emit = async () => await this.emit("driverReady", {
|
|
1708
|
+
const emit = /* @__PURE__ */ __name(async () => await this.emit("driverReady", {
|
|
1709
|
+
node
|
|
1710
|
+
}), "emit");
|
|
1611
1711
|
forget4(emit());
|
|
1612
1712
|
return node;
|
|
1613
1713
|
}
|
|
@@ -1616,6 +1716,9 @@ var NodeAdapterBase = class extends BaseEmitter4 {
|
|
|
1616
1716
|
|
|
1617
1717
|
// src/adapter/Network.ts
|
|
1618
1718
|
var NetworkAdapter = class extends NodeAdapterBase {
|
|
1719
|
+
static {
|
|
1720
|
+
__name(this, "NetworkAdapter");
|
|
1721
|
+
}
|
|
1619
1722
|
_connection;
|
|
1620
1723
|
constructor(kernel, driverName) {
|
|
1621
1724
|
super(kernel, driverName);
|
|
@@ -1636,6 +1739,9 @@ var NetworkAdapter = class extends NodeAdapterBase {
|
|
|
1636
1739
|
|
|
1637
1740
|
// src/adapter/Settings.ts
|
|
1638
1741
|
var SettingsAdapter = class extends NodeAdapterBase {
|
|
1742
|
+
static {
|
|
1743
|
+
__name(this, "SettingsAdapter");
|
|
1744
|
+
}
|
|
1639
1745
|
_settings = void 0;
|
|
1640
1746
|
constructor(kernel, driverName) {
|
|
1641
1747
|
super(kernel, driverName);
|
|
@@ -1655,26 +1761,31 @@ var SettingsAdapter = class extends NodeAdapterBase {
|
|
|
1655
1761
|
};
|
|
1656
1762
|
|
|
1657
1763
|
// src/adapters/OsPubSubBridgeNetwork.ts
|
|
1658
|
-
var OsPubSubBridgeNetworkAdapters = (kernel) => [
|
|
1764
|
+
var OsPubSubBridgeNetworkAdapters = /* @__PURE__ */ __name((kernel) => [
|
|
1659
1765
|
new NetworkAdapter(kernel, PubSubBridgeNodeNodeName),
|
|
1660
1766
|
new NetworkAdapter(kernel, ExposedNodeOuterNodeName)
|
|
1661
|
-
];
|
|
1767
|
+
], "OsPubSubBridgeNetworkAdapters");
|
|
1662
1768
|
|
|
1663
1769
|
// src/adapters/OsSettings.ts
|
|
1664
1770
|
import { OsSettingsNodeName } from "@xyo-network/os-model";
|
|
1665
|
-
var OsSettingsAdapters = (kernel) => [
|
|
1771
|
+
var OsSettingsAdapters = /* @__PURE__ */ __name((kernel) => [
|
|
1772
|
+
new SettingsAdapter(kernel, OsSettingsNodeName)
|
|
1773
|
+
], "OsSettingsAdapters");
|
|
1666
1774
|
|
|
1667
1775
|
// src/adapters/OsXyoPublicNetwork.ts
|
|
1668
1776
|
import { XyoPublicNodeName } from "@xyo-network/os-model";
|
|
1669
|
-
var OsXyoPublicNetworkAdapters = (kernel) => [
|
|
1777
|
+
var OsXyoPublicNetworkAdapters = /* @__PURE__ */ __name((kernel) => [
|
|
1670
1778
|
new NetworkAdapter(kernel, XyoPublicNodeName)
|
|
1671
|
-
];
|
|
1779
|
+
], "OsXyoPublicNetworkAdapters");
|
|
1672
1780
|
|
|
1673
1781
|
// src/stack/OsPubSubNetworkStack.ts
|
|
1674
1782
|
import { assertEx as assertEx10 } from "@xylabs/assert";
|
|
1675
1783
|
import { asAttachableNodeInstance as asAttachableNodeInstance3, asNodeInstance } from "@xyo-network/node-model";
|
|
1676
1784
|
import { ExposedNodeOuterNodeName as ExposedNodeOuterNodeName2, PubSubBridgeNodeNodeName as PubSubBridgeNodeNodeName2 } from "@xyo-network/os-model";
|
|
1677
1785
|
var OsPubSubNetworkStack = class extends StackBase {
|
|
1786
|
+
static {
|
|
1787
|
+
__name(this, "OsPubSubNetworkStack");
|
|
1788
|
+
}
|
|
1678
1789
|
_exposedNode;
|
|
1679
1790
|
_exposedNodeOuter;
|
|
1680
1791
|
busConnection = osPubSubNetworkReadyConnection();
|
|
@@ -1717,13 +1828,15 @@ var OsPubSubNetworkStack = class extends StackBase {
|
|
|
1717
1828
|
super.stop();
|
|
1718
1829
|
this._exposedNode = void 0;
|
|
1719
1830
|
this._exposedNodeOuter = void 0;
|
|
1720
|
-
if (this.busConnection._id)
|
|
1721
|
-
this.context.eventBus.removeConnection(this.busConnection.id);
|
|
1831
|
+
if (this.busConnection._id) this.context.eventBus.removeConnection(this.busConnection.id);
|
|
1722
1832
|
}
|
|
1723
1833
|
};
|
|
1724
1834
|
|
|
1725
1835
|
// src/stack/OsSettingsStack.ts
|
|
1726
1836
|
var OsSettingsStack = class extends StackBase {
|
|
1837
|
+
static {
|
|
1838
|
+
__name(this, "OsSettingsStack");
|
|
1839
|
+
}
|
|
1727
1840
|
busConnection = osSettingsReadyConnection();
|
|
1728
1841
|
constructor(context, adapters) {
|
|
1729
1842
|
super(context, adapters, "OsSettingsStackNode");
|
|
@@ -1741,6 +1854,9 @@ var OsSettingsStack = class extends StackBase {
|
|
|
1741
1854
|
// src/stack/XyoPublicNetworkStack.ts
|
|
1742
1855
|
import { XyoPublicNodeName as XyoPublicNodeName2 } from "@xyo-network/os-model";
|
|
1743
1856
|
var XyoPublicNetworkStack = class extends StackBase {
|
|
1857
|
+
static {
|
|
1858
|
+
__name(this, "XyoPublicNetworkStack");
|
|
1859
|
+
}
|
|
1744
1860
|
busConnection = osXyoPublicNetworkReadyConnection();
|
|
1745
1861
|
constructor(context, adapters) {
|
|
1746
1862
|
super(context, adapters, "OsXyoPublicNetworkStackNode");
|
|
@@ -1779,6 +1895,9 @@ var OsStackMap = {
|
|
|
1779
1895
|
|
|
1780
1896
|
// src/XyOs.ts
|
|
1781
1897
|
var XyOs = class _XyOs extends XyOsContextBase {
|
|
1898
|
+
static {
|
|
1899
|
+
__name(this, "XyOs");
|
|
1900
|
+
}
|
|
1782
1901
|
_exposedNode;
|
|
1783
1902
|
_exposedNodeOuter;
|
|
1784
1903
|
_kernel;
|
|
@@ -1786,16 +1905,9 @@ var XyOs = class _XyOs extends XyOsContextBase {
|
|
|
1786
1905
|
dappRegistrationService;
|
|
1787
1906
|
signers;
|
|
1788
1907
|
stackManager;
|
|
1789
|
-
constructor({
|
|
1790
|
-
logger
|
|
1791
|
-
|
|
1792
|
-
kernel = new Kernel({ logger }),
|
|
1793
|
-
locator = new ModuleFactoryLocator5(),
|
|
1794
|
-
dappsConfiguration,
|
|
1795
|
-
developmentMode,
|
|
1796
|
-
stackMap = OsStackMap,
|
|
1797
|
-
...params
|
|
1798
|
-
} = {}) {
|
|
1908
|
+
constructor({ logger = console, eventBus = new EventBus(), kernel = new Kernel({
|
|
1909
|
+
logger
|
|
1910
|
+
}), locator = new ModuleFactoryLocator5(), dappsConfiguration, developmentMode, stackMap = OsStackMap, ...params } = {}) {
|
|
1799
1911
|
super({
|
|
1800
1912
|
eventBus,
|
|
1801
1913
|
kernel,
|
|
@@ -1833,14 +1945,19 @@ var XyOs = class _XyOs extends XyOsContextBase {
|
|
|
1833
1945
|
return this.stackManager.stacks;
|
|
1834
1946
|
}
|
|
1835
1947
|
get user() {
|
|
1836
|
-
return {
|
|
1948
|
+
return {
|
|
1949
|
+
signers: this.signers?.getWalletKindSigner("user")
|
|
1950
|
+
};
|
|
1837
1951
|
}
|
|
1838
1952
|
static async monitor(fn, eventConfig) {
|
|
1839
1953
|
const { name, additionalProperties } = eventConfig;
|
|
1840
1954
|
const monitor = this.monitoring;
|
|
1841
1955
|
monitor?.startTimer(name);
|
|
1842
1956
|
const result = await fn();
|
|
1843
|
-
monitor?.stopTimer({
|
|
1957
|
+
monitor?.stopTimer({
|
|
1958
|
+
additionalProperties,
|
|
1959
|
+
name
|
|
1960
|
+
});
|
|
1844
1961
|
return result;
|
|
1845
1962
|
}
|
|
1846
1963
|
async boot(wallet, locator = new ModuleFactoryLocator5()) {
|
|
@@ -1849,13 +1966,18 @@ var XyOs = class _XyOs extends XyOsContextBase {
|
|
|
1849
1966
|
return await this._bootMutex.runExclusive(async () => {
|
|
1850
1967
|
await this.eventBus.start();
|
|
1851
1968
|
if (this.kernel?.status === "created") {
|
|
1852
|
-
await this.kernel.boot(await boot(), {
|
|
1969
|
+
await this.kernel.boot(await boot(), {
|
|
1970
|
+
locator: fullLocator,
|
|
1971
|
+
kernelDrivers: []
|
|
1972
|
+
});
|
|
1853
1973
|
}
|
|
1854
1974
|
if (this.kernel?.status !== "booted") {
|
|
1855
1975
|
throw new Error("Kernel not booted");
|
|
1856
1976
|
}
|
|
1857
1977
|
assertEx11(this._root === void 0, () => "XyOs already booted");
|
|
1858
|
-
const [root] = await _XyOs.monitor(async () => await loadOsNode(wallet, fullLocator), {
|
|
1978
|
+
const [root] = await _XyOs.monitor(async () => await loadOsNode(wallet, fullLocator), {
|
|
1979
|
+
name: "Load XyOs"
|
|
1980
|
+
});
|
|
1859
1981
|
this._root = root;
|
|
1860
1982
|
this.stackManager.initialize(this);
|
|
1861
1983
|
if (this.signers) await this.signers.initialize();
|
|
@@ -1886,26 +2008,32 @@ var XyOs = class _XyOs extends XyOsContextBase {
|
|
|
1886
2008
|
|
|
1887
2009
|
// src/scripts/xyos/lib/headless.ts
|
|
1888
2010
|
var { terminal } = tk;
|
|
1889
|
-
var terminate = () => {
|
|
2011
|
+
var terminate = /* @__PURE__ */ __name(() => {
|
|
1890
2012
|
terminal.grabInput(false);
|
|
1891
2013
|
setTimeout(function() {
|
|
1892
2014
|
process.exit(0);
|
|
1893
2015
|
}, 100);
|
|
1894
|
-
};
|
|
1895
|
-
var headless = async ({
|
|
1896
|
-
manifest,
|
|
1897
|
-
config,
|
|
1898
|
-
kernelDrivers
|
|
1899
|
-
} = {}) => {
|
|
2016
|
+
}, "terminate");
|
|
2017
|
+
var headless = /* @__PURE__ */ __name(async ({ manifest, config, kernelDrivers } = {}) => {
|
|
1900
2018
|
console.log(chalk.green("Starting Headless xyOS..."));
|
|
1901
|
-
const configExplorer = cosmiconfig("xyos", {
|
|
2019
|
+
const configExplorer = cosmiconfig("xyos", {
|
|
2020
|
+
cache: true,
|
|
2021
|
+
loaders: {
|
|
2022
|
+
".ts": TypeScriptLoader()
|
|
2023
|
+
}
|
|
2024
|
+
});
|
|
1902
2025
|
const configResult = await (config ? configExplorer.load(config) : configExplorer.search());
|
|
1903
2026
|
const xyosConfig = configResult?.config ?? {};
|
|
1904
2027
|
const manifestToLoad = manifest ?? (typeof xyosConfig.manifest === "string" ? xyosConfig.manifest : void 0);
|
|
1905
2028
|
const manifestObject = manifestToLoad ? JSON.parse(fs.readFileSync(manifestToLoad, "utf8")) : typeof xyosConfig.manifest === "object" ? xyosConfig.manifest : void 0;
|
|
1906
2029
|
const osWallet = await HDWallet5.random();
|
|
1907
|
-
const kernel = new Kernel2({
|
|
1908
|
-
|
|
2030
|
+
const kernel = new Kernel2({
|
|
2031
|
+
logColor: "cyan",
|
|
2032
|
+
logger: console
|
|
2033
|
+
});
|
|
2034
|
+
await kernel.boot(await boot2(), {
|
|
2035
|
+
kernelDrivers
|
|
2036
|
+
});
|
|
1909
2037
|
const xyOs = new XyOs({
|
|
1910
2038
|
kernel,
|
|
1911
2039
|
stackMap: {},
|
|
@@ -1914,20 +2042,28 @@ var headless = async ({
|
|
|
1914
2042
|
});
|
|
1915
2043
|
await xyOs.boot(osWallet);
|
|
1916
2044
|
console.log(chalk.green("Started Headless xyOS..."));
|
|
1917
|
-
terminal.grabInput({
|
|
2045
|
+
terminal.grabInput({
|
|
2046
|
+
mouse: "button"
|
|
2047
|
+
});
|
|
1918
2048
|
terminal.on("key", function(name) {
|
|
1919
2049
|
console.log("'key' event:", name);
|
|
1920
2050
|
if (name === "CTRL_C") {
|
|
1921
2051
|
terminate();
|
|
1922
2052
|
}
|
|
1923
2053
|
});
|
|
1924
|
-
};
|
|
2054
|
+
}, "headless");
|
|
1925
2055
|
|
|
1926
2056
|
// src/scripts/xyos/command/create.ts
|
|
1927
|
-
var commandCreate = (argv) => {
|
|
2057
|
+
var commandCreate = /* @__PURE__ */ __name((argv) => {
|
|
1928
2058
|
return argv.command("create [template] <target>", "Create an xyos project", (yargs2) => {
|
|
1929
2059
|
return yargs2.positional("template", {
|
|
1930
|
-
choices: [
|
|
2060
|
+
choices: [
|
|
2061
|
+
"react",
|
|
2062
|
+
"headless",
|
|
2063
|
+
"dapp",
|
|
2064
|
+
"diviner",
|
|
2065
|
+
"witness"
|
|
2066
|
+
],
|
|
1931
2067
|
description: "Template to use",
|
|
1932
2068
|
type: "string"
|
|
1933
2069
|
}).positional("target", {
|
|
@@ -1936,15 +2072,22 @@ var commandCreate = (argv) => {
|
|
|
1936
2072
|
});
|
|
1937
2073
|
}, async ({ template, target }) => {
|
|
1938
2074
|
console.log(`Using template ${template} at location ${target}`);
|
|
1939
|
-
return await createFromTemplate({
|
|
2075
|
+
return await createFromTemplate({
|
|
2076
|
+
target,
|
|
2077
|
+
template
|
|
2078
|
+
});
|
|
1940
2079
|
});
|
|
1941
|
-
};
|
|
2080
|
+
}, "commandCreate");
|
|
1942
2081
|
|
|
1943
2082
|
// src/scripts/xyos/command/manifest.ts
|
|
1944
|
-
var commandManifest = (argv) => {
|
|
2083
|
+
var commandManifest = /* @__PURE__ */ __name((argv) => {
|
|
1945
2084
|
return argv.command("manifest [action] <target>", "Create an xyos project", (yargs2) => {
|
|
1946
2085
|
return yargs2.positional("action", {
|
|
1947
|
-
choices: [
|
|
2086
|
+
choices: [
|
|
2087
|
+
"create",
|
|
2088
|
+
"validate",
|
|
2089
|
+
"display"
|
|
2090
|
+
],
|
|
1948
2091
|
description: "Action to take on manifest",
|
|
1949
2092
|
type: "string"
|
|
1950
2093
|
}).positional("target", {
|
|
@@ -1955,10 +2098,10 @@ var commandManifest = (argv) => {
|
|
|
1955
2098
|
console.log(`Taking action [${action}] on manifest at ${target}`);
|
|
1956
2099
|
return await Promise.resolve();
|
|
1957
2100
|
});
|
|
1958
|
-
};
|
|
2101
|
+
}, "commandManifest");
|
|
1959
2102
|
|
|
1960
2103
|
// src/scripts/xyos/command/start.ts
|
|
1961
|
-
var commandStart = (argv) => {
|
|
2104
|
+
var commandStart = /* @__PURE__ */ __name((argv) => {
|
|
1962
2105
|
return argv.command("start", "Start xyOS in headless mode", (yargs2) => {
|
|
1963
2106
|
return yargs2.option("config", {
|
|
1964
2107
|
alias: "c",
|
|
@@ -1973,11 +2116,7 @@ var commandStart = (argv) => {
|
|
|
1973
2116
|
description: "Kernel driver to load",
|
|
1974
2117
|
type: "string"
|
|
1975
2118
|
});
|
|
1976
|
-
}, async ({
|
|
1977
|
-
config,
|
|
1978
|
-
manifest,
|
|
1979
|
-
kernelDriver
|
|
1980
|
-
}) => {
|
|
2119
|
+
}, async ({ config, manifest, kernelDriver }) => {
|
|
1981
2120
|
if (config) {
|
|
1982
2121
|
console.log(`Using config: ${config}`);
|
|
1983
2122
|
}
|
|
@@ -1987,25 +2126,13 @@ var commandStart = (argv) => {
|
|
|
1987
2126
|
await headless({
|
|
1988
2127
|
manifest,
|
|
1989
2128
|
config,
|
|
1990
|
-
kernelDrivers: kernelDriver ? [
|
|
2129
|
+
kernelDrivers: kernelDriver ? [
|
|
2130
|
+
kernelDriver
|
|
2131
|
+
] : []
|
|
1991
2132
|
});
|
|
1992
2133
|
});
|
|
1993
|
-
};
|
|
2134
|
+
}, "commandStart");
|
|
1994
2135
|
|
|
1995
2136
|
// src/scripts/xyos/index.ts
|
|
1996
|
-
commandManifest(
|
|
1997
|
-
commandConfig(
|
|
1998
|
-
commandCreate(
|
|
1999
|
-
commandStart(
|
|
2000
|
-
yargs(
|
|
2001
|
-
hideBin(
|
|
2002
|
-
process.argv
|
|
2003
|
-
)
|
|
2004
|
-
)
|
|
2005
|
-
)
|
|
2006
|
-
)
|
|
2007
|
-
)
|
|
2008
|
-
).usage("Usage: $0 <command> [options]").scriptName("xyos").demandCommand(1).parse().catch(
|
|
2009
|
-
console.error
|
|
2010
|
-
);
|
|
2137
|
+
commandManifest(commandConfig(commandCreate(commandStart(yargs(hideBin(process.argv)))))).usage("Usage: $0 <command> [options]").scriptName("xyos").demandCommand(1).parse().catch(console.error);
|
|
2011
2138
|
//# sourceMappingURL=index.mjs.map
|