@xyo-network/os-runtime 7.0.1 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/DappCallerBase.d.ts.map +1 -1
- package/dist/neutral/OsCallerBase.d.ts.map +1 -1
- package/dist/neutral/PubSubBridgeCaller.d.ts.map +1 -1
- package/dist/neutral/XyOs.d.ts +2 -3
- package/dist/neutral/XyOs.d.ts.map +1 -1
- package/dist/neutral/XyOsBase.d.ts +2 -1
- package/dist/neutral/XyOsBase.d.ts.map +1 -1
- package/dist/neutral/XyOsDapp.d.ts +2 -1
- package/dist/neutral/XyOsDapp.d.ts.map +1 -1
- package/dist/neutral/access/Caller.d.ts +3 -3
- package/dist/neutral/access/Caller.d.ts.map +1 -1
- package/dist/neutral/access/interfaces/registered-names/helpers/AccessNodeQueries.d.ts.map +1 -1
- package/dist/neutral/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts.map +1 -1
- package/dist/neutral/access/interfaces/registered-names/helpers/resource/RegistrationsResource.d.ts +2 -2
- package/dist/neutral/access/interfaces/registered-names/helpers/resource/RegistrationsResource.d.ts.map +1 -1
- package/dist/neutral/adapter/Base.d.ts +2 -2
- package/dist/neutral/adapter/Base.d.ts.map +1 -1
- package/dist/neutral/classes/settings/CallerBase.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/Creator.d.ts +5 -5
- package/dist/neutral/dapp/context/creator/Creator.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/DefaultPayloads/DappAccessPayloads.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/DefaultPayloads/DefaultPayloads.d.ts +1 -1
- package/dist/neutral/dapp/context/creator/DefaultPayloads/DefaultPayloads.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/DefaultPayloads/NodeInfoPayload.d.ts +1 -1
- package/dist/neutral/dapp/context/creator/DefaultPayloads/NodeInfoPayload.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.d.ts +2 -2
- package/dist/neutral/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.d.ts.map +1 -1
- package/dist/neutral/index.mjs +81 -37
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/lib/NameTransforms.d.ts.map +1 -1
- package/dist/neutral/lib/PayloadStore.d.ts +1 -1
- package/dist/neutral/lib/PayloadStore.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistrationService.d.ts +6 -6
- package/dist/neutral/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistry.d.ts +1 -1
- package/dist/neutral/registration/DappRegistry.d.ts.map +1 -1
- package/dist/neutral/system/ManageSystemDapps.d.ts +5 -5
- package/dist/neutral/system/ManageSystemDapps.d.ts.map +1 -1
- package/dist/neutral/wallet/DappSeedPhraseRepository.d.ts.map +1 -1
- package/dist/node/DappCallerBase.d.ts.map +1 -1
- package/dist/node/OsCallerBase.d.ts.map +1 -1
- package/dist/node/PubSubBridgeCaller.d.ts.map +1 -1
- package/dist/node/XyOs.d.ts +2 -3
- package/dist/node/XyOs.d.ts.map +1 -1
- package/dist/node/XyOsBase.d.ts +2 -1
- package/dist/node/XyOsBase.d.ts.map +1 -1
- package/dist/node/XyOsDapp.d.ts +2 -1
- package/dist/node/XyOsDapp.d.ts.map +1 -1
- package/dist/node/access/Caller.d.ts +3 -3
- package/dist/node/access/Caller.d.ts.map +1 -1
- package/dist/node/access/interfaces/registered-names/helpers/AccessNodeQueries.d.ts.map +1 -1
- package/dist/node/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts.map +1 -1
- package/dist/node/access/interfaces/registered-names/helpers/resource/RegistrationsResource.d.ts +2 -2
- package/dist/node/access/interfaces/registered-names/helpers/resource/RegistrationsResource.d.ts.map +1 -1
- package/dist/node/adapter/Base.d.ts +2 -2
- package/dist/node/adapter/Base.d.ts.map +1 -1
- package/dist/node/classes/settings/CallerBase.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/Creator.d.ts +5 -5
- package/dist/node/dapp/context/creator/Creator.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/DefaultPayloads/DappAccessPayloads.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/DefaultPayloads/DefaultPayloads.d.ts +1 -1
- package/dist/node/dapp/context/creator/DefaultPayloads/DefaultPayloads.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/DefaultPayloads/NodeInfoPayload.d.ts +1 -1
- package/dist/node/dapp/context/creator/DefaultPayloads/NodeInfoPayload.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.d.ts +2 -2
- package/dist/node/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.d.ts.map +1 -1
- package/dist/node/index.mjs +81 -37
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/lib/NameTransforms.d.ts.map +1 -1
- package/dist/node/lib/PayloadStore.d.ts +1 -1
- package/dist/node/lib/PayloadStore.d.ts.map +1 -1
- package/dist/node/registration/DappRegistrationService.d.ts +6 -6
- package/dist/node/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/node/registration/DappRegistry.d.ts +1 -1
- package/dist/node/registration/DappRegistry.d.ts.map +1 -1
- package/dist/node/scripts/xyos/index.mjs +44 -28
- package/dist/node/scripts/xyos/index.mjs.map +1 -1
- package/dist/node/system/ManageSystemDapps.d.ts +5 -5
- package/dist/node/system/ManageSystemDapps.d.ts.map +1 -1
- package/dist/node/wallet/DappSeedPhraseRepository.d.ts.map +1 -1
- package/package.json +49 -49
- package/src/DappCallerBase.ts +5 -1
- package/src/OsCallerBase.ts +5 -1
- package/src/PubSubBridgeCaller.ts +4 -1
- package/src/XyOs.ts +1 -1
- package/src/XyOsBase.ts +2 -1
- package/src/XyOsDapp.ts +2 -1
- package/src/access/Caller.ts +17 -5
- package/src/access/interfaces/registered-names/helpers/AccessNodeQueries.ts +12 -4
- package/src/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.ts +5 -1
- package/src/access/interfaces/registered-names/helpers/resource/RegistrationsResource.ts +3 -1
- package/src/adapter/Base.ts +6 -2
- package/src/classes/menu/Queries.ts +1 -1
- package/src/classes/settings/CallerBase.ts +4 -1
- package/src/dapp/context/creator/Creator.ts +21 -7
- package/src/dapp/context/creator/DefaultPayloads/DappAccessPayloads.ts +5 -2
- package/src/dapp/context/creator/DefaultPayloads/DefaultPayloads.ts +12 -4
- package/src/dapp/context/creator/DefaultPayloads/NodeInfoPayload.ts +5 -2
- package/src/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.ts +15 -5
- package/src/lib/NameTransforms.ts +4 -1
- package/src/lib/PayloadStore.ts +4 -1
- package/src/registration/DappRegistrationService.ts +20 -6
- package/src/registration/DappRegistry.ts +4 -1
- package/src/system/ManageSystemDapps.ts +17 -5
- package/src/wallet/DappSeedPhraseRepository.ts +4 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model';
|
|
2
2
|
import type { DappConfig, DappIcon, DappParams, DappSet, PayloadWithVersion, XyOsContext } from '@xyo-network/os-model';
|
|
3
3
|
import { OsCallerBase } from '../OsCallerBase.ts';
|
|
4
4
|
export type ErrorListener = (failedPayloads: DappConfig[]) => void;
|
|
@@ -10,13 +10,13 @@ export type DappSetsAndPayloads = {
|
|
|
10
10
|
* Manage the installation of system dapps from payloads and return the built sets
|
|
11
11
|
*/
|
|
12
12
|
export declare class ManageSystemDapps extends OsCallerBase {
|
|
13
|
-
private defaultSystemNames;
|
|
14
|
-
private defaultSystemDapps;
|
|
15
13
|
private defaultSystemDappParams;
|
|
16
|
-
private
|
|
14
|
+
private defaultSystemDapps;
|
|
15
|
+
private defaultSystemNames;
|
|
17
16
|
private developmentMode?;
|
|
17
|
+
private locator?;
|
|
18
18
|
private onErrorCallbacks;
|
|
19
|
-
constructor(context: XyOsContext, defaultSystemNames: string[], defaultSystemDapps: PayloadWithVersion[], defaultSystemDappParams: Record<string, DappParams>, locator?:
|
|
19
|
+
constructor(context: XyOsContext, defaultSystemNames: string[], defaultSystemDapps: PayloadWithVersion[], defaultSystemDappParams: Record<string, DappParams>, locator?: ModuleFactoryLocatorInstance, developmentMode?: boolean);
|
|
20
20
|
/**
|
|
21
21
|
* Add a callback to listen for errors throwing during system dapp registration
|
|
22
22
|
* @param {ErrorListener} errorListener
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageSystemDapps.d.ts","sourceRoot":"","sources":["../../../src/system/ManageSystemDapps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManageSystemDapps.d.ts","sourceRoot":"","sources":["../../../src/system/ManageSystemDapps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,EACV,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAC3E,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,MAAM,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;AAClE,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,CAAC,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAA;IACvC,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAO,CAAC,uBAAuB,CAA4B;IAC3D,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,kBAAkB,CAAU;IACpC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,OAAO,CAAC,CAA8B;IAE9C,OAAO,CAAC,gBAAgB,CAAsB;gBAG5C,OAAO,EAAE,WAAW,EACpB,kBAAkB,EAAE,MAAM,EAAE,EAC5B,kBAAkB,EAAE,kBAAkB,EAAE,EACxC,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACnD,OAAO,CAAC,EAAE,4BAA4B,EACtC,eAAe,CAAC,EAAE,OAAO;IAU3B;;;OAGG;IACH,gBAAgB,CAAC,aAAa,EAAE,aAAa;IAI7C;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAKrB,YAAY;YAIZ,cAAc;YA6Bd,UAAU;CAmDzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DappSeedPhraseRepository.d.ts","sourceRoot":"","sources":["../../../src/wallet/DappSeedPhraseRepository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EAAwB,QAAQ,EAAE,WAAW,EACpD,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAgB,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEnF,qBAAa,wBAAyB,SAAQ,YAAa,YAAW,oBAAoB;
|
|
1
|
+
{"version":3,"file":"DappSeedPhraseRepository.d.ts","sourceRoot":"","sources":["../../../src/wallet/DappSeedPhraseRepository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EAAwB,QAAQ,EAAE,WAAW,EACpD,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAgB,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEnF,qBAAa,wBAAyB,SAAQ,YAAa,YAAW,oBAAoB;IACxF,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAA;IAGzC,OAAO,CAAC,gBAAgB,CAAgD;IAExE,OAAO,CAAC,kBAAkB,CAA4C;gBAGpE,IAAI,EAAE,WAAW,EACjB,YAAY,EAAE,MAAM,EAAE;IAMlB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBpC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAoBjD,OAAO,CAAC,QAAQ,EAAE,QAAQ;YAIlB,WAAW;YAcX,aAAa;IAc3B,OAAO,CAAC,SAAS;CAGlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/os-runtime",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -40,63 +40,63 @@
|
|
|
40
40
|
"src"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@xylabs/array": "~5.0.
|
|
44
|
-
"@xylabs/assert": "~5.0.
|
|
45
|
-
"@xylabs/base": "~5.0.
|
|
46
|
-
"@xylabs/events": "~5.0.
|
|
47
|
-
"@xylabs/forget": "~5.0.
|
|
48
|
-
"@xylabs/hex": "~5.0.
|
|
49
|
-
"@xylabs/object": "~5.0.
|
|
50
|
-
"@xylabs/promise": "~5.0.
|
|
51
|
-
"@xyo-network/account-model": "~5.
|
|
52
|
-
"@xyo-network/archivist": "~5.
|
|
53
|
-
"@xyo-network/archivist-indexeddb": "~5.
|
|
54
|
-
"@xyo-network/archivist-memory": "~5.
|
|
55
|
-
"@xyo-network/archivist-model": "~5.
|
|
56
|
-
"@xyo-network/bios": "~7.
|
|
57
|
-
"@xyo-network/bridge-model": "~5.
|
|
58
|
-
"@xyo-network/diviner-abstract": "~5.
|
|
59
|
-
"@xyo-network/diviner-model": "~5.
|
|
60
|
-
"@xyo-network/diviner-payload-generic": "~5.
|
|
61
|
-
"@xyo-network/diviner-payload-indexeddb": "~5.
|
|
62
|
-
"@xyo-network/diviner-payload-model": "~5.
|
|
63
|
-
"@xyo-network/diviner-temporal-indexing-model": "~5.
|
|
64
|
-
"@xyo-network/kernel": "~7.
|
|
65
|
-
"@xyo-network/kernel-model": "~7.
|
|
66
|
-
"@xyo-network/manifest": "~5.
|
|
67
|
-
"@xyo-network/manifest-wrapper": "~5.
|
|
68
|
-
"@xyo-network/module-factory-locator": "~5.
|
|
69
|
-
"@xyo-network/module-model": "~5.
|
|
70
|
-
"@xyo-network/module-resolver": "~5.
|
|
71
|
-
"@xyo-network/node-model": "~5.
|
|
72
|
-
"@xyo-network/os-model": "~7.
|
|
73
|
-
"@xyo-network/payload-builder": "~5.
|
|
74
|
-
"@xyo-network/payload-model": "~5.
|
|
75
|
-
"@xyo-network/storage-model": "~7.
|
|
76
|
-
"@xyo-network/wallet": "~5.
|
|
77
|
-
"@xyo-network/wallet-model": "~5.
|
|
43
|
+
"@xylabs/array": "~5.0.12",
|
|
44
|
+
"@xylabs/assert": "~5.0.12",
|
|
45
|
+
"@xylabs/base": "~5.0.12",
|
|
46
|
+
"@xylabs/events": "~5.0.12",
|
|
47
|
+
"@xylabs/forget": "~5.0.12",
|
|
48
|
+
"@xylabs/hex": "~5.0.12",
|
|
49
|
+
"@xylabs/object": "~5.0.12",
|
|
50
|
+
"@xylabs/promise": "~5.0.12",
|
|
51
|
+
"@xyo-network/account-model": "~5.1.6",
|
|
52
|
+
"@xyo-network/archivist": "~5.1.6",
|
|
53
|
+
"@xyo-network/archivist-indexeddb": "~5.1.6",
|
|
54
|
+
"@xyo-network/archivist-memory": "~5.1.6",
|
|
55
|
+
"@xyo-network/archivist-model": "~5.1.6",
|
|
56
|
+
"@xyo-network/bios": "~7.1.1",
|
|
57
|
+
"@xyo-network/bridge-model": "~5.1.6",
|
|
58
|
+
"@xyo-network/diviner-abstract": "~5.1.6",
|
|
59
|
+
"@xyo-network/diviner-model": "~5.1.6",
|
|
60
|
+
"@xyo-network/diviner-payload-generic": "~5.1.6",
|
|
61
|
+
"@xyo-network/diviner-payload-indexeddb": "~5.1.6",
|
|
62
|
+
"@xyo-network/diviner-payload-model": "~5.1.6",
|
|
63
|
+
"@xyo-network/diviner-temporal-indexing-model": "~5.1.6",
|
|
64
|
+
"@xyo-network/kernel": "~7.1.1",
|
|
65
|
+
"@xyo-network/kernel-model": "~7.1.1",
|
|
66
|
+
"@xyo-network/manifest": "~5.1.6",
|
|
67
|
+
"@xyo-network/manifest-wrapper": "~5.1.6",
|
|
68
|
+
"@xyo-network/module-factory-locator": "~5.1.6",
|
|
69
|
+
"@xyo-network/module-model": "~5.1.6",
|
|
70
|
+
"@xyo-network/module-resolver": "~5.1.6",
|
|
71
|
+
"@xyo-network/node-model": "~5.1.6",
|
|
72
|
+
"@xyo-network/os-model": "~7.1.1",
|
|
73
|
+
"@xyo-network/payload-builder": "~5.1.6",
|
|
74
|
+
"@xyo-network/payload-model": "~5.1.6",
|
|
75
|
+
"@xyo-network/storage-model": "~7.1.1",
|
|
76
|
+
"@xyo-network/wallet": "~5.1.6",
|
|
77
|
+
"@xyo-network/wallet-model": "~5.1.6",
|
|
78
78
|
"async-mutex": "~0.5.0",
|
|
79
|
-
"chalk": "~5.
|
|
79
|
+
"chalk": "~5.6.2",
|
|
80
80
|
"cosmiconfig": "~9.0.0",
|
|
81
|
-
"cosmiconfig-typescript-loader": "~6.
|
|
81
|
+
"cosmiconfig-typescript-loader": "~6.2.0",
|
|
82
82
|
"ethers": "~6.15.0",
|
|
83
|
-
"semver": "~7.7.
|
|
83
|
+
"semver": "~7.7.3",
|
|
84
84
|
"terminal-kit": "~3.1.2",
|
|
85
|
-
"uuid": "~
|
|
85
|
+
"uuid": "~13.0.0",
|
|
86
86
|
"yargs": "~18.0.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@types/node": "~24.2
|
|
90
|
-
"@types/semver": "~7.7.
|
|
89
|
+
"@types/node": "~24.7.2",
|
|
90
|
+
"@types/semver": "~7.7.1",
|
|
91
91
|
"@types/terminal-kit": "~2.5.7",
|
|
92
|
-
"@types/uuid": "~
|
|
92
|
+
"@types/uuid": "~11.0.0",
|
|
93
93
|
"@types/yargs": "~17.0.33",
|
|
94
|
-
"@xylabs/ts-scripts-yarn3": "~7.
|
|
95
|
-
"@xylabs/tsconfig": "~7.
|
|
96
|
-
"@xyo-network/archivist-memory": "~5.
|
|
97
|
-
"@xyo-network/bios-model": "~7.
|
|
98
|
-
"@xyo-network/bios-nodejs": "~7.
|
|
99
|
-
"typescript": "~5.9.
|
|
94
|
+
"@xylabs/ts-scripts-yarn3": "~7.1.8",
|
|
95
|
+
"@xylabs/tsconfig": "~7.1.8",
|
|
96
|
+
"@xyo-network/archivist-memory": "~5.1.6",
|
|
97
|
+
"@xyo-network/bios-model": "~7.1.1",
|
|
98
|
+
"@xyo-network/bios-nodejs": "~7.1.1",
|
|
99
|
+
"typescript": "~5.9.3",
|
|
100
100
|
"vitest": "~3.2.4"
|
|
101
101
|
},
|
|
102
102
|
"publishConfig": {
|
package/src/DappCallerBase.ts
CHANGED
|
@@ -10,7 +10,11 @@ export const IntentArchivistPayloadDivinerModuleName = 'IntentArchivistPayloadDi
|
|
|
10
10
|
export const DappArchivistPayloadDivinerModuleName = 'DappArchivistPayloadDiviner'
|
|
11
11
|
|
|
12
12
|
export class DappCallerBase {
|
|
13
|
-
|
|
13
|
+
protected context: XyOsContext
|
|
14
|
+
constructor(context: XyOsContext) {
|
|
15
|
+
this.context = context
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
/**
|
|
15
19
|
* Get the DappArchivist
|
|
16
20
|
*/
|
package/src/OsCallerBase.ts
CHANGED
|
@@ -10,7 +10,11 @@ export const DappsArchivistPayloadDevelopmentDivinerModuleName = `${DappsArchivi
|
|
|
10
10
|
export const RegisteredDappInterfacesArchivistModuleName = 'RegisteredDappInterfacesArchivist'
|
|
11
11
|
|
|
12
12
|
export class OsCallerBase {
|
|
13
|
-
|
|
13
|
+
protected context: XyOsContext
|
|
14
|
+
constructor(context: XyOsContext) {
|
|
15
|
+
this.context = context
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
// Get the dapps archivist
|
|
15
19
|
async getDappsArchivist() {
|
|
16
20
|
const mod = assertEx(await this.context.root.resolve(DappsArchivistModuleName), () => `${DappsArchivistModuleName} not found`)
|
|
@@ -6,7 +6,10 @@ import type { NodeInstance } from '@xyo-network/node-model'
|
|
|
6
6
|
import { BridgedPubSubModuleName } from '@xyo-network/os-model'
|
|
7
7
|
|
|
8
8
|
export class PubSubBridgeCaller {
|
|
9
|
-
|
|
9
|
+
private node: NodeInstance
|
|
10
|
+
constructor(node: NodeInstance) {
|
|
11
|
+
this.node = node
|
|
12
|
+
}
|
|
10
13
|
|
|
11
14
|
async exposeAddresses(addresses: Address[], options?: BridgeExposeOptions) {
|
|
12
15
|
const pubSubBridge = await this.getPubSubBridge()
|
package/src/XyOs.ts
CHANGED
|
@@ -42,7 +42,7 @@ export class XyOs extends XyOsContextBase<XyOsParams> implements XyOsContext {
|
|
|
42
42
|
protected _exposedNode: NodeInstance | undefined
|
|
43
43
|
protected _exposedNodeOuter: NodeInstance | undefined
|
|
44
44
|
protected _kernel: KernelExternal
|
|
45
|
-
protected _locator:
|
|
45
|
+
protected _locator: ModuleFactoryLocatorInstance
|
|
46
46
|
protected dappRegistrationService: DappRegistrationService
|
|
47
47
|
protected signers: SignersExternal | undefined
|
|
48
48
|
private stackManager: StackManager
|
package/src/XyOsBase.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { Promisable } from '@xylabs/promise'
|
|
|
6
6
|
import type { KernelExternal } from '@xyo-network/kernel-model'
|
|
7
7
|
import type { PackageManifest } from '@xyo-network/manifest'
|
|
8
8
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
9
|
+
import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
|
|
9
10
|
import type { NodeInstance } from '@xyo-network/node-model'
|
|
10
11
|
import type {
|
|
11
12
|
DappId, DappPackageManifestPayload, DappParams, EventBusInterface, OsUser,
|
|
@@ -16,7 +17,7 @@ import { Mutex } from 'async-mutex'
|
|
|
16
17
|
|
|
17
18
|
export interface XyOsContextParams<TManifest extends PackageManifest = PackageManifest> extends BaseParams {
|
|
18
19
|
eventBus?: EventBusInterface
|
|
19
|
-
locator?:
|
|
20
|
+
locator?: ModuleFactoryLocatorInstance
|
|
20
21
|
manifest?: TManifest
|
|
21
22
|
platformLocator?: ModuleFactoryLocator
|
|
22
23
|
signerPaths?: WalletKindSignerPaths
|
package/src/XyOsDapp.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { ManifestWrapper } from '@xyo-network/manifest-wrapper'
|
|
3
3
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
4
|
+
import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
|
|
4
5
|
import type {
|
|
5
6
|
DappPackageManifestPayload, OsUser, XyOsContext, XyOsDappContext, XyOsDappDetails,
|
|
6
7
|
} from '@xyo-network/os-model'
|
|
@@ -13,7 +14,7 @@ import { XyOsContextBase } from './XyOsBase.ts'
|
|
|
13
14
|
|
|
14
15
|
export interface XyOsDappContextParams extends XyOsContextParams<DappPackageManifestPayload> {
|
|
15
16
|
dapp: XyOsDappDetails
|
|
16
|
-
locator:
|
|
17
|
+
locator: ModuleFactoryLocatorInstance
|
|
17
18
|
parent: XyOsContext
|
|
18
19
|
user: OsUser
|
|
19
20
|
}
|
package/src/access/Caller.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
3
|
+
import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
|
|
3
4
|
import { asNodeInstance } from '@xyo-network/node-model'
|
|
4
5
|
import type {
|
|
5
6
|
PostRegistrationHandler,
|
|
@@ -23,15 +24,26 @@ import { RunningDappAccessCache } from './RunningAccessDappCache.ts'
|
|
|
23
24
|
* Keep Service running that can service requests for Access Nodes
|
|
24
25
|
**/
|
|
25
26
|
export class DappAccessCaller extends OsCallerBase implements PostRegistrationHandler {
|
|
27
|
+
private allowedNames: string[]
|
|
28
|
+
private platformLocator: ModuleFactoryLocatorInstance
|
|
29
|
+
private registeredDapps: RegisteredDappSetResult[]
|
|
30
|
+
private xnsNetwork: string | undefined
|
|
31
|
+
private xnsNodeUrl: string | undefined
|
|
32
|
+
|
|
26
33
|
constructor(
|
|
27
34
|
context: XyOsContext,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
registeredDapps: RegisteredDappSetResult[],
|
|
36
|
+
allowedNames: string[],
|
|
37
|
+
xnsNodeUrl: string | undefined,
|
|
38
|
+
xnsNetwork: string | undefined,
|
|
39
|
+
platformLocator = new ModuleFactoryLocator(),
|
|
33
40
|
) {
|
|
34
41
|
super(context)
|
|
42
|
+
this.registeredDapps = registeredDapps
|
|
43
|
+
this.allowedNames = allowedNames
|
|
44
|
+
this.xnsNodeUrl = xnsNodeUrl
|
|
45
|
+
this.xnsNetwork = xnsNetwork
|
|
46
|
+
this.platformLocator = platformLocator
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
async start() {
|
|
@@ -8,11 +8,19 @@ import type { Payload } from '@xyo-network/payload-model'
|
|
|
8
8
|
import { RunningDappAccessCache } from '../../../RunningAccessDappCache.ts'
|
|
9
9
|
|
|
10
10
|
export class AccessNodeQueries {
|
|
11
|
+
protected xyOsContext: XyOsContext
|
|
12
|
+
private accessRequest: DappAccessRequest
|
|
13
|
+
private registeredDappAccess: RegisteredDappAccess
|
|
14
|
+
|
|
11
15
|
constructor(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
) {
|
|
16
|
+
xyOsContext: XyOsContext,
|
|
17
|
+
accessRequest: DappAccessRequest,
|
|
18
|
+
registeredDappAccess: RegisteredDappAccess,
|
|
19
|
+
) {
|
|
20
|
+
this.xyOsContext = xyOsContext
|
|
21
|
+
this.accessRequest = accessRequest
|
|
22
|
+
this.registeredDappAccess = registeredDappAccess
|
|
23
|
+
}
|
|
16
24
|
|
|
17
25
|
get nameServiceNamesAccessNode() {
|
|
18
26
|
return assertEx(RunningDappAccessCache.get(this.registeredDappAccess.registeringDappId), () => 'No access node found')
|
|
@@ -8,7 +8,11 @@ export const XnsArchivistModuleName = 'XnsArchivist'
|
|
|
8
8
|
export const XnsRegistrationsArchivistModuleName = 'XnsRegistrationsArchivist'
|
|
9
9
|
|
|
10
10
|
export abstract class AbstractXnsCaller {
|
|
11
|
-
|
|
11
|
+
protected context: XyOsContext
|
|
12
|
+
constructor(context: XyOsContext) {
|
|
13
|
+
this.context = context
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
/**
|
|
13
17
|
* Get the XnsArchivist
|
|
14
18
|
*/
|
|
@@ -13,12 +13,14 @@ export type XnsRegistrationsViews = 'allRegistrations'
|
|
|
13
13
|
|
|
14
14
|
export class XnsRegistrationsResource extends AbstractXnsCaller implements ResourceStore<XnsRegistrationsViews> {
|
|
15
15
|
protected _allRegistrations: PayloadStore<WithSources<TemporalIndexRegistrationResults>> | undefined
|
|
16
|
+
private pathPrefix?: string
|
|
16
17
|
|
|
17
18
|
constructor(
|
|
18
19
|
context: XyOsContext,
|
|
19
|
-
|
|
20
|
+
pathPrefix?: string,
|
|
20
21
|
) {
|
|
21
22
|
super(context)
|
|
23
|
+
this.pathPrefix = pathPrefix
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
get allRegistrations() {
|
package/src/adapter/Base.ts
CHANGED
|
@@ -20,13 +20,17 @@ export class NodeAdapterBase extends BaseEmitter<BaseParams, NodeAdapterBaseEven
|
|
|
20
20
|
initialized = false
|
|
21
21
|
|
|
22
22
|
private _id: string = ''
|
|
23
|
+
private driverName: string
|
|
24
|
+
private kernel: KernelExternal
|
|
23
25
|
|
|
24
26
|
constructor(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
kernel: KernelExternal,
|
|
28
|
+
driverName: string,
|
|
27
29
|
) {
|
|
28
30
|
super({})
|
|
29
31
|
this._id = uuid()
|
|
32
|
+
this.kernel = kernel
|
|
33
|
+
this.driverName = driverName
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
get id() {
|
|
@@ -55,6 +55,6 @@ export const DappMenuQueries = {
|
|
|
55
55
|
schemas: [DappNavItemSchema],
|
|
56
56
|
}
|
|
57
57
|
const results = (await diviner.divine([query])) as WithSources<DappNavItem>[]
|
|
58
|
-
return results.filter(menuItem => menuItem.hidden !== true).
|
|
58
|
+
return results.filter(menuItem => menuItem.hidden !== true).toSorted((a, b) => ((a.weight ?? 0) > (b.weight ?? 0) ? 1 : -1))
|
|
59
59
|
},
|
|
60
60
|
}
|
|
@@ -7,7 +7,10 @@ const OsSettingsArchivistModuleName = 'OsSettingsNode:OsSettingsArchivist'
|
|
|
7
7
|
const OsSettingsArchivistPayloadDivinerModuleName = 'OsSettingsNode:OsSettingsArchivistPayloadDiviner'
|
|
8
8
|
|
|
9
9
|
export class OsSettingsCallerBase {
|
|
10
|
-
|
|
10
|
+
protected context: XyOsContext
|
|
11
|
+
constructor(context: XyOsContext) {
|
|
12
|
+
this.context = context
|
|
13
|
+
}
|
|
11
14
|
|
|
12
15
|
async getOsSettingsArchivist() {
|
|
13
16
|
const mod = assertEx(await this.context.root.resolve(OsSettingsArchivistModuleName), () => `${OsSettingsArchivistModuleName} not found`)
|
|
@@ -23,14 +23,28 @@ export class DappContextCreator {
|
|
|
23
23
|
// Designated offset path for the wallet used by windowed dapps. In the future, other offsets could be used for other dapp modes
|
|
24
24
|
private static DAPP_WINDOW_WALLET_PATH = '1'
|
|
25
25
|
|
|
26
|
+
private context: XyOsContext
|
|
27
|
+
private dappId: DappId
|
|
28
|
+
private externalPermissions?: ExternalModule[]
|
|
29
|
+
private rootWallet: WalletInstance
|
|
30
|
+
private sharedLocator?: ModuleFactoryLocatorInstance
|
|
31
|
+
private targetDappManifestParams: TargetDappManifestParams
|
|
32
|
+
|
|
26
33
|
constructor(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
) {
|
|
34
|
+
targetDappManifestParams: TargetDappManifestParams,
|
|
35
|
+
dappId: DappId,
|
|
36
|
+
context: XyOsContext,
|
|
37
|
+
rootWallet: WalletInstance,
|
|
38
|
+
externalPermissions?: ExternalModule[],
|
|
39
|
+
sharedLocator?: ModuleFactoryLocatorInstance,
|
|
40
|
+
) {
|
|
41
|
+
this.targetDappManifestParams = targetDappManifestParams
|
|
42
|
+
this.dappId = dappId
|
|
43
|
+
this.context = context
|
|
44
|
+
this.rootWallet = rootWallet
|
|
45
|
+
this.externalPermissions = externalPermissions
|
|
46
|
+
this.sharedLocator = sharedLocator
|
|
47
|
+
}
|
|
34
48
|
|
|
35
49
|
static async create(params: DappNodesCreatorParams, xnsNodeUrl: string | undefined, xnsNetwork: string | undefined) {
|
|
36
50
|
const {
|
|
@@ -4,10 +4,13 @@ import type { DefaultPayloadsInsertable } from '../../../../classes/lib/index.ts
|
|
|
4
4
|
import { OsCallerBase } from '../../../../OsCallerBase.ts'
|
|
5
5
|
|
|
6
6
|
export class DappAccessPayloads implements DefaultPayloadsInsertable {
|
|
7
|
+
private context: XyOsContext
|
|
7
8
|
constructor(
|
|
8
|
-
|
|
9
|
+
context: XyOsContext,
|
|
9
10
|
_dappName: DappName,
|
|
10
|
-
) {
|
|
11
|
+
) {
|
|
12
|
+
this.context = context
|
|
13
|
+
}
|
|
11
14
|
|
|
12
15
|
async payloads() {
|
|
13
16
|
const osCaller = new OsCallerBase(this.context)
|
|
@@ -9,11 +9,19 @@ import { DappAccessPayloads } from './DappAccessPayloads.ts'
|
|
|
9
9
|
import { NodeInfoPayload } from './NodeInfoPayload.ts'
|
|
10
10
|
|
|
11
11
|
export class DefaultPayloads {
|
|
12
|
+
private dappArchivist: ArchivistInstance
|
|
13
|
+
private dappName: DappName
|
|
14
|
+
private xyOs: XyOsContext
|
|
15
|
+
|
|
12
16
|
constructor(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
) {
|
|
17
|
+
dappArchivist: ArchivistInstance,
|
|
18
|
+
xyOs: XyOsContext,
|
|
19
|
+
dappName: DappName,
|
|
20
|
+
) {
|
|
21
|
+
this.dappArchivist = dappArchivist
|
|
22
|
+
this.xyOs = xyOs
|
|
23
|
+
this.dappName = dappName
|
|
24
|
+
}
|
|
17
25
|
|
|
18
26
|
async insert() {
|
|
19
27
|
const insertables: InsertableConstructor[] = [NodeInfoPayload, DappAccessPayloads]
|
|
@@ -7,10 +7,13 @@ import { NodeOsInfoSchema } from '@xyo-network/os-model'
|
|
|
7
7
|
import type { DefaultPayloadsInsertable } from '../../../../classes/lib/index.ts'
|
|
8
8
|
|
|
9
9
|
export class NodeInfoPayload implements DefaultPayloadsInsertable {
|
|
10
|
+
private _context: XyOsContext
|
|
10
11
|
constructor(
|
|
11
|
-
|
|
12
|
+
context: XyOsContext,
|
|
12
13
|
_dappName: DappName,
|
|
13
|
-
) {
|
|
14
|
+
) {
|
|
15
|
+
this._context = context
|
|
16
|
+
}
|
|
14
17
|
|
|
15
18
|
async payloads() {
|
|
16
19
|
const exposedNode = this._context.exposedNode
|
|
@@ -8,12 +8,22 @@ import type {
|
|
|
8
8
|
const ALLOWED_MODULES_FROM_PARENT = ['IntentArchivist', 'OsSettingsNode', 'OsPubSubNetworkStackNode', 'OsXyoPublicNetworkStackNode'] as const
|
|
9
9
|
|
|
10
10
|
export class ExternalModulePermissions {
|
|
11
|
+
private context: XyOsContext
|
|
12
|
+
private dappName: DappName
|
|
13
|
+
private dappWindowNode: NodeInstance
|
|
14
|
+
private externalPermissions?: ExternalModule[]
|
|
15
|
+
|
|
11
16
|
constructor(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
) {
|
|
17
|
+
context: XyOsContext,
|
|
18
|
+
dappWindowNode: NodeInstance,
|
|
19
|
+
dappName: DappName,
|
|
20
|
+
externalPermissions?: ExternalModule[],
|
|
21
|
+
) {
|
|
22
|
+
this.context = context
|
|
23
|
+
this.dappWindowNode = dappWindowNode
|
|
24
|
+
this.dappName = dappName
|
|
25
|
+
this.externalPermissions = externalPermissions
|
|
26
|
+
}
|
|
17
27
|
|
|
18
28
|
async permit() {
|
|
19
29
|
for (const permission of this.externalPermissions ?? []) {
|
package/src/lib/PayloadStore.ts
CHANGED
|
@@ -13,11 +13,14 @@ export interface PayloadStoreConfig<T extends Payload = Payload> {
|
|
|
13
13
|
|
|
14
14
|
export class PayloadStore<T extends Payload = Payload> implements ExternalStore {
|
|
15
15
|
latest: T[] = []
|
|
16
|
+
private archivist: ArchivistInstance
|
|
16
17
|
private deleteListeners: WeakRef<(args: ArchivistModuleEventData['deleted']) => void>[] = []
|
|
17
18
|
private insertListeners: WeakRef<(args: ArchivistModuleEventData['inserted']) => void>[] = []
|
|
18
19
|
private listeners: Listener[] = []
|
|
19
20
|
|
|
20
|
-
private constructor(
|
|
21
|
+
private constructor(archivist: ArchivistInstance) {
|
|
22
|
+
this.archivist = archivist
|
|
23
|
+
}
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* Initialize listeners on the archivist that update class member variables when new payloads are inserted
|
|
@@ -2,6 +2,7 @@ import { forget } from '@xylabs/forget'
|
|
|
2
2
|
import type { Promisable } from '@xylabs/promise'
|
|
3
3
|
import { fulfilled, rejected } from '@xylabs/promise'
|
|
4
4
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
5
|
+
import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
|
|
5
6
|
import type {
|
|
6
7
|
DappPackageManifestPayload,
|
|
7
8
|
DappParams,
|
|
@@ -51,17 +52,30 @@ export class DappRegistrationService {
|
|
|
51
52
|
// Dapps that have been registered with exposeDappRequests
|
|
52
53
|
registeredExposedDappSets: Set<RegisteredDappSetResult> = new Set()
|
|
53
54
|
|
|
55
|
+
private context: XyOsContext
|
|
56
|
+
|
|
54
57
|
private dappAccessRequestConnection = dappAccessRequestConnection()
|
|
58
|
+
private developmentMode?: boolean
|
|
59
|
+
|
|
55
60
|
private exposeDappRequestConnection = exposeDappRequestConnection()
|
|
56
61
|
|
|
62
|
+
private locator: ModuleFactoryLocatorInstance
|
|
63
|
+
|
|
64
|
+
private params: DappRegistrationServiceParams
|
|
65
|
+
|
|
57
66
|
constructor(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
private locator = new ModuleFactoryLocator(),
|
|
63
|
-
private developmentMode?: boolean,
|
|
67
|
+
context: XyOsContext,
|
|
68
|
+
params?: DappRegistrationServiceParams,
|
|
69
|
+
locator: ModuleFactoryLocatorInstance = new ModuleFactoryLocator(),
|
|
70
|
+
developmentMode?: boolean,
|
|
64
71
|
) {
|
|
72
|
+
this.context = context
|
|
73
|
+
this.params = params ?? {
|
|
74
|
+
dappNames: [], dappParams: {}, dappPayloads: [],
|
|
75
|
+
}
|
|
76
|
+
this.locator = locator
|
|
77
|
+
this.developmentMode = developmentMode
|
|
78
|
+
|
|
65
79
|
this.manageSystemDapps = new ManageSystemDapps(
|
|
66
80
|
context,
|
|
67
81
|
this.params?.dappNames ?? [],
|
|
@@ -29,8 +29,11 @@ export type DappRegisteredId = string
|
|
|
29
29
|
*/
|
|
30
30
|
export class DappRegistry {
|
|
31
31
|
private dappRegistry: Map<DappRegisteredId, RegisteredDapp> = new Map()
|
|
32
|
+
private dappSeedPhraseRepository: DappSeedPhraseRepository
|
|
32
33
|
|
|
33
|
-
constructor(
|
|
34
|
+
constructor(dappSeedPhraseRepository: DappSeedPhraseRepository) {
|
|
35
|
+
this.dappSeedPhraseRepository = dappSeedPhraseRepository
|
|
36
|
+
}
|
|
34
37
|
|
|
35
38
|
/**
|
|
36
39
|
* Register a Dapp with window manager and if successful, return its id
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
2
2
|
import type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
3
|
+
import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
|
|
3
4
|
import type {
|
|
4
5
|
DappConfig, DappIcon, DappParams, DappSet, PayloadWithVersion, XyOsContext,
|
|
5
6
|
} from '@xyo-network/os-model'
|
|
@@ -20,17 +21,28 @@ export type DappSetsAndPayloads = {
|
|
|
20
21
|
* Manage the installation of system dapps from payloads and return the built sets
|
|
21
22
|
*/
|
|
22
23
|
export class ManageSystemDapps extends OsCallerBase {
|
|
24
|
+
private defaultSystemDappParams: Record<string, DappParams>
|
|
25
|
+
private defaultSystemDapps: PayloadWithVersion[]
|
|
26
|
+
private defaultSystemNames: string[]
|
|
27
|
+
private developmentMode?: boolean
|
|
28
|
+
private locator?: ModuleFactoryLocatorInstance
|
|
29
|
+
|
|
23
30
|
private onErrorCallbacks: ErrorListener[] = []
|
|
24
31
|
|
|
25
32
|
constructor(
|
|
26
33
|
context: XyOsContext,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
defaultSystemNames: string[],
|
|
35
|
+
defaultSystemDapps: PayloadWithVersion[],
|
|
36
|
+
defaultSystemDappParams: Record<string, DappParams>,
|
|
37
|
+
locator?: ModuleFactoryLocatorInstance,
|
|
38
|
+
developmentMode?: boolean,
|
|
32
39
|
) {
|
|
33
40
|
super(context)
|
|
41
|
+
this.defaultSystemNames = defaultSystemNames
|
|
42
|
+
this.defaultSystemDapps = defaultSystemDapps
|
|
43
|
+
this.defaultSystemDappParams = defaultSystemDappParams
|
|
44
|
+
this.locator = locator
|
|
45
|
+
this.developmentMode = developmentMode
|
|
34
46
|
}
|
|
35
47
|
|
|
36
48
|
/**
|