@xyo-network/os-runtime 7.2.0 → 7.2.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.
Files changed (145) hide show
  1. package/dist/neutral/Caller.d.ts +18 -20
  2. package/dist/neutral/Caller.d.ts.map +1 -1
  3. package/dist/neutral/DappCallerBase.d.ts.map +1 -1
  4. package/dist/neutral/PubSubBridgeCaller.d.ts +1 -1
  5. package/dist/neutral/PubSubBridgeCaller.d.ts.map +1 -1
  6. package/dist/neutral/XyOs.d.ts +1 -1
  7. package/dist/neutral/XyOs.d.ts.map +1 -1
  8. package/dist/neutral/XyOsBase.d.ts +2 -4
  9. package/dist/neutral/XyOsBase.d.ts.map +1 -1
  10. package/dist/neutral/XyOsDapp.d.ts.map +1 -1
  11. package/dist/neutral/access/Caller.d.ts +1 -1
  12. package/dist/neutral/access/Caller.d.ts.map +1 -1
  13. package/dist/neutral/adapter/Base.d.ts +2 -2
  14. package/dist/neutral/adapter/Base.d.ts.map +1 -1
  15. package/dist/neutral/classes/menu/Caller.d.ts +1 -2
  16. package/dist/neutral/classes/menu/Caller.d.ts.map +1 -1
  17. package/dist/neutral/classes/settings/Caller.d.ts +2 -2
  18. package/dist/neutral/classes/settings/badge/Caller.d.ts +2 -2
  19. package/dist/neutral/classes/settings/badge/Resource.d.ts +1 -1
  20. package/dist/neutral/classes/settings/badge/Resource.d.ts.map +1 -1
  21. package/dist/neutral/event/bus/Connection.d.ts +3 -4
  22. package/dist/neutral/event/bus/Connection.d.ts.map +1 -1
  23. package/dist/neutral/event/bus/EventBus.d.ts.map +1 -1
  24. package/dist/neutral/event/bus/PubSubConnection.d.ts +1 -1
  25. package/dist/neutral/helpers/monitor/types.d.ts +1 -1
  26. package/dist/neutral/index.mjs +1000 -658
  27. package/dist/neutral/index.mjs.map +1 -1
  28. package/dist/neutral/intent/Caller.d.ts +5 -5
  29. package/dist/neutral/lib/PayloadStore.d.ts +1 -2
  30. package/dist/neutral/lib/PayloadStore.d.ts.map +1 -1
  31. package/dist/neutral/lib/isPayload.d.ts +1 -1
  32. package/dist/neutral/profileModuleEvents.d.ts +1 -1
  33. package/dist/neutral/profileModuleEvents.d.ts.map +1 -1
  34. package/dist/neutral/registration/DappRegistrationService.d.ts.map +1 -1
  35. package/dist/neutral/registration/DappRegistry.d.ts +4 -6
  36. package/dist/neutral/registration/DappRegistry.d.ts.map +1 -1
  37. package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts +6 -2
  38. package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
  39. package/dist/neutral/registration/ValidateDappAccessDiviner/Diviner.d.ts +3 -1
  40. package/dist/neutral/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
  41. package/dist/neutral/stack/Base.d.ts +2 -2
  42. package/dist/neutral/stack/Base.d.ts.map +1 -1
  43. package/dist/neutral/system/ManageSystemDapps.d.ts +1 -1
  44. package/dist/neutral/utils/buildWalletSeedPhrasePayload.d.ts +1 -1
  45. package/dist/neutral/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
  46. package/dist/neutral/wallet/SeedPhraseRepository.d.ts +3 -4
  47. package/dist/neutral/wallet/SeedPhraseRepository.d.ts.map +1 -1
  48. package/dist/node/Caller.d.ts +18 -20
  49. package/dist/node/Caller.d.ts.map +1 -1
  50. package/dist/node/DappCallerBase.d.ts.map +1 -1
  51. package/dist/node/PubSubBridgeCaller.d.ts +1 -1
  52. package/dist/node/PubSubBridgeCaller.d.ts.map +1 -1
  53. package/dist/node/XyOs.d.ts +1 -1
  54. package/dist/node/XyOs.d.ts.map +1 -1
  55. package/dist/node/XyOsBase.d.ts +2 -4
  56. package/dist/node/XyOsBase.d.ts.map +1 -1
  57. package/dist/node/XyOsDapp.d.ts.map +1 -1
  58. package/dist/node/access/Caller.d.ts +1 -1
  59. package/dist/node/access/Caller.d.ts.map +1 -1
  60. package/dist/node/adapter/Base.d.ts +2 -2
  61. package/dist/node/adapter/Base.d.ts.map +1 -1
  62. package/dist/node/classes/menu/Caller.d.ts +1 -2
  63. package/dist/node/classes/menu/Caller.d.ts.map +1 -1
  64. package/dist/node/classes/settings/Caller.d.ts +2 -2
  65. package/dist/node/classes/settings/badge/Caller.d.ts +2 -2
  66. package/dist/node/classes/settings/badge/Resource.d.ts +1 -1
  67. package/dist/node/classes/settings/badge/Resource.d.ts.map +1 -1
  68. package/dist/node/event/bus/Connection.d.ts +3 -4
  69. package/dist/node/event/bus/Connection.d.ts.map +1 -1
  70. package/dist/node/event/bus/EventBus.d.ts.map +1 -1
  71. package/dist/node/event/bus/PubSubConnection.d.ts +1 -1
  72. package/dist/node/helpers/monitor/types.d.ts +1 -1
  73. package/dist/node/index.mjs +1000 -658
  74. package/dist/node/index.mjs.map +1 -1
  75. package/dist/node/intent/Caller.d.ts +5 -5
  76. package/dist/node/lib/PayloadStore.d.ts +1 -2
  77. package/dist/node/lib/PayloadStore.d.ts.map +1 -1
  78. package/dist/node/lib/isPayload.d.ts +1 -1
  79. package/dist/node/profileModuleEvents.d.ts +1 -1
  80. package/dist/node/profileModuleEvents.d.ts.map +1 -1
  81. package/dist/node/registration/DappRegistrationService.d.ts.map +1 -1
  82. package/dist/node/registration/DappRegistry.d.ts +4 -6
  83. package/dist/node/registration/DappRegistry.d.ts.map +1 -1
  84. package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts +6 -2
  85. package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
  86. package/dist/node/registration/ValidateDappAccessDiviner/Diviner.d.ts +3 -1
  87. package/dist/node/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
  88. package/dist/node/scripts/xyos/index.mjs +493 -360
  89. package/dist/node/scripts/xyos/index.mjs.map +1 -1
  90. package/dist/node/stack/Base.d.ts +2 -2
  91. package/dist/node/stack/Base.d.ts.map +1 -1
  92. package/dist/node/system/ManageSystemDapps.d.ts +1 -1
  93. package/dist/node/utils/buildWalletSeedPhrasePayload.d.ts +1 -1
  94. package/dist/node/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
  95. package/dist/node/wallet/SeedPhraseRepository.d.ts +3 -4
  96. package/dist/node/wallet/SeedPhraseRepository.d.ts.map +1 -1
  97. package/package.json +38 -45
  98. package/src/Caller.ts +19 -21
  99. package/src/DappCallerBase.ts +1 -2
  100. package/src/OsCallerBase.ts +1 -1
  101. package/src/PubSubBridgeCaller.ts +2 -2
  102. package/src/RunningDappCache.ts +1 -1
  103. package/src/XyOs.ts +2 -2
  104. package/src/XyOsBase.ts +4 -5
  105. package/src/XyOsDapp.ts +6 -3
  106. package/src/access/Caller.ts +2 -2
  107. package/src/access/Resource.ts +1 -1
  108. package/src/access/interfaces/registered-names/helpers/AccessNodeQueries.ts +1 -1
  109. package/src/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.ts +1 -1
  110. package/src/access/interfaces/registered-names/helpers/resource/RegistrationsResource.ts +1 -1
  111. package/src/adapter/Base.ts +11 -9
  112. package/src/classes/dapp/DefaultsResource.ts +1 -1
  113. package/src/classes/menu/Caller.ts +1 -2
  114. package/src/classes/menu/Resource.ts +1 -1
  115. package/src/classes/settings/Caller.ts +3 -3
  116. package/src/classes/settings/CallerBase.ts +1 -1
  117. package/src/classes/settings/Resource.ts +1 -1
  118. package/src/classes/settings/badge/Caller.ts +2 -2
  119. package/src/classes/settings/badge/Resource.ts +2 -2
  120. package/src/dapp/context/creator/Creator.ts +1 -1
  121. package/src/dapp/context/creator/DefaultPayloads/NodeInfoPayload.ts +1 -1
  122. package/src/event/bus/Connection.ts +3 -5
  123. package/src/event/bus/EventBus.ts +5 -4
  124. package/src/event/bus/PubSubConnection.ts +1 -1
  125. package/src/helpers/monitor/types.ts +1 -1
  126. package/src/initializer/DappInitializer.ts +1 -1
  127. package/src/intent/Caller.ts +5 -5
  128. package/src/intent/Resource.ts +1 -1
  129. package/src/lib/PayloadStore.ts +1 -2
  130. package/src/lib/isEqual.ts +1 -1
  131. package/src/lib/isPayload.ts +1 -1
  132. package/src/lib/tokenPlacesSplit.ts +1 -1
  133. package/src/loadOsNode.ts +1 -1
  134. package/src/profileModuleEvents.ts +1 -1
  135. package/src/registration/DappRegistrationService.ts +4 -3
  136. package/src/registration/DappRegistry.ts +4 -6
  137. package/src/registration/ValidateDappAccessDiviner/Config.ts +3 -3
  138. package/src/registration/ValidateDappAccessDiviner/Diviner.ts +1 -1
  139. package/src/scripts/xyos/index.ts +0 -1
  140. package/src/signer/Signers.ts +1 -1
  141. package/src/stack/Base.ts +5 -6
  142. package/src/stack/OsPubSubNetworkStack.ts +1 -1
  143. package/src/system/ManageSystemDapps.ts +1 -1
  144. package/src/utils/buildWalletSeedPhrasePayload.ts +1 -1
  145. package/src/wallet/SeedPhraseRepository.ts +3 -4
@@ -15,11 +15,11 @@ export class DappIntentCaller extends DappCallerBase {
15
15
 
16
16
  /**
17
17
  * Build a new intent
18
- * @param {DappId} sourceDappId
19
- * @param {DappIntentTypes} intent
20
- * @param {DappId} targetDappId
21
- * @param {DappMode} targetMode
22
- * @param {DappIntent['params']} params?
18
+ * @param sourceDappId
19
+ * @param intent
20
+ * @param targetDappId
21
+ * @param targetMode
22
+ * @param params?
23
23
  * @returns DappIntent
24
24
  */
25
25
  static buildIntent(
@@ -1,4 +1,4 @@
1
- import { assertEx } from '@xylabs/assert'
1
+ import { assertEx } from '@xylabs/sdk-js'
2
2
  import type { DappIntent, XyOsContext } from '@xyo-network/os-model'
3
3
  import { isDappIntent } from '@xyo-network/os-model'
4
4
  import type { WithSources, WithStorageMeta } from '@xyo-network/payload-model'
@@ -80,8 +80,7 @@ export class PayloadStore<T extends Payload = Payload> implements ExternalStore
80
80
 
81
81
  /**
82
82
  * Add a call back function that is invoked when new Payloads are inserted
83
- *
84
- * @param {PayloadListener} onStoreChange
83
+ * @param onStoreChange
85
84
  */
86
85
  subscribe(onStoreChange: Listener) {
87
86
  this.listeners.push(onStoreChange)
@@ -1,4 +1,4 @@
1
- import { isObject } from '@xylabs/object'
1
+ import { isObject } from '@xylabs/sdk-js'
2
2
 
3
3
  export function isEqual(a: unknown, b: unknown): boolean {
4
4
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,4 +1,4 @@
1
- import { AsObjectFactory } from '@xylabs/object'
1
+ import { AsObjectFactory } from '@xylabs/sdk-js'
2
2
  import type { Payload, Schema } from '@xyo-network/payload-model'
3
3
 
4
4
  export const isObject = (x: unknown): x is Record<string | symbol | number, unknown> => {
@@ -1,4 +1,4 @@
1
- import { assertEx } from '@xylabs/assert'
1
+ import { assertEx } from '@xylabs/sdk-js'
2
2
 
3
3
  export const tokenPlacesSplit = (value: bigint, places: number): [bigint, bigint] => {
4
4
  assertEx(places >= 0, () => 'Places has to be >= 0')
package/src/loadOsNode.ts CHANGED
@@ -29,7 +29,7 @@ export const loadOsNode = async (
29
29
 
30
30
  // Create the OS node manifest
31
31
  const osNodeLocator: ModuleFactoryLocatorInstance = locator ?? getDefaultOsNodeLocator()
32
- const manifestWrapper = new ManifestWrapper(osNodeManifest as PackageManifestPayload, osNodeWallet, osNodeLocator)
32
+ const manifestWrapper = new ManifestWrapper(osNodeManifest as unknown as PackageManifestPayload, osNodeWallet, osNodeLocator)
33
33
 
34
34
  // Create the OS & kernel nodes
35
35
  const osNode = (await manifestWrapper.loadNodes())[0]
@@ -1,4 +1,4 @@
1
- import type { Address } from '@xylabs/hex'
1
+ import type { Address } from '@xylabs/sdk-js'
2
2
  import type { QuerySendStartedEventArgs } from '@xyo-network/bridge-model'
3
3
  import type { ModuleInstance } from '@xyo-network/module-model'
4
4
  import { PayloadBuilder } from '@xyo-network/payload-builder'
@@ -1,6 +1,7 @@
1
- import { forget } from '@xylabs/forget'
2
- import type { Promisable } from '@xylabs/promise'
3
- import { fulfilled, rejected } from '@xylabs/promise'
1
+ import type { Promisable } from '@xylabs/sdk-js'
2
+ import {
3
+ forget, fulfilled, rejected,
4
+ } from '@xylabs/sdk-js'
4
5
  import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
5
6
  import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
6
7
  import type {
@@ -1,4 +1,4 @@
1
- import type { Hash } from '@xylabs/hex'
1
+ import type { Hash } from '@xylabs/sdk-js'
2
2
  import type {
3
3
  DappPackageManifestPayload,
4
4
  DappParams,
@@ -37,10 +37,9 @@ export class DappRegistry {
37
37
 
38
38
  /**
39
39
  * Register a Dapp with window manager and if successful, return its id
40
- *
41
- * @param {UnregisteredDapp} dapp Manifest and UI of the Dapp to register
42
- * @returns {RegisteredDapp} dapp with registration fields
43
- **/
40
+ * @param dapp Manifest and UI of the Dapp to register
41
+ * @returns dapp with registration fields
42
+ */
44
43
  async registerDapp(dapp?: UnregisteredDapp): Promise<RegisteredDapp | null> {
45
44
  if (dapp) {
46
45
  const {
@@ -92,7 +91,6 @@ export class DappRegistry {
92
91
 
93
92
  /**
94
93
  * Unregister a dapp so it can no longer be launched
95
- *
96
94
  * @param dappId
97
95
  */
98
96
  unregisterDapp(dappId: Hash) {
@@ -4,9 +4,9 @@ import type {
4
4
  DappPackageManifestPayload, DappParams, RegisteredDappAccess, UnregisteredDappAccess,
5
5
  } from '@xyo-network/os-model'
6
6
  import type { Payload } from '@xyo-network/payload-model'
7
- import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
7
+ import { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'
8
8
 
9
- export const FailedAccessorSchema = 'network.xyo.os.failed.accessor.registration' as const
9
+ export const FailedAccessorSchema = asSchema('network.xyo.os.failed.accessor.registration', true)
10
10
  export type FailedAccessorSchema = typeof FailedAccessorSchema
11
11
 
12
12
  export type FailedAccessor = Payload<{
@@ -20,5 +20,5 @@ export type ValidateDappAccessDivinerParams = DivinerParams & { dappParams: Dapp
20
20
  export type ValidateDappAccessDivinerIn = DappPackageManifestPayload | PackageManifestPayload | UnregisteredDappAccess
21
21
  export type ValidateDappAccessDivinerOut = RegisteredDappAccess | FailedAccessor
22
22
 
23
- export const ValidateDappAccessDivinerConfigSchema = 'network.xyo.os.dapp.access.registration.validate' as const
23
+ export const ValidateDappAccessDivinerConfigSchema = asSchema('network.xyo.os.dapp.access.registration.validate', true)
24
24
  export type ValidateDappAccessDivinerConfigSchema = typeof ValidateDappAccessDivinerConfigSchema
@@ -1,4 +1,4 @@
1
- import type { Address } from '@xylabs/hex'
1
+ import type { Address } from '@xylabs/sdk-js'
2
2
  import { AbstractDiviner } from '@xyo-network/diviner-abstract'
3
3
  import type { NodeManifestPayload, PackageManifestPayload } from '@xyo-network/manifest'
4
4
  import { ManifestWrapper, PackageManifestPayloadSchema } from '@xyo-network/manifest'
@@ -1,5 +1,4 @@
1
1
  import yargs from 'yargs'
2
- // eslint-disable-next-line import-x/no-internal-modules
3
2
  import { hideBin } from 'yargs/helpers'
4
3
 
5
4
  import {
@@ -1,4 +1,4 @@
1
- import { assertEx } from '@xylabs/assert'
1
+ import { assertEx } from '@xylabs/sdk-js'
2
2
  import { type AccountInstance } from '@xyo-network/account-model'
3
3
  import type {
4
4
  SignerAccounts, SignersExternal, WalletKindSignerPaths,
package/src/stack/Base.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { assertEx } from '@xylabs/assert'
2
- import type { BaseParams } from '@xylabs/base'
3
- import { BaseEmitter } from '@xylabs/events'
4
- import { forget } from '@xylabs/forget'
5
- import type { Promisable } from '@xylabs/promise'
1
+ import type { BaseParams, Promisable } from '@xylabs/sdk-js'
2
+ import {
3
+ assertEx, BaseEmitter, forget,
4
+ } from '@xylabs/sdk-js'
6
5
  import type { ModuleIdentifier } from '@xyo-network/module-model'
7
6
  import { isModuleInstance } from '@xyo-network/module-model'
8
7
  import type { AttachableNodeInstance } from '@xyo-network/node-model'
@@ -46,7 +45,7 @@ export class StackBase extends BaseEmitter<BaseParams, StackBaseEvents> implemen
46
45
  constructor(context: XyOsContext, adapterSet: AdapterSetCreator, stackNodeModuleId: ModuleIdentifier) {
47
46
  super({})
48
47
  this._context = context
49
- this._adapterSet = adapterSet(assertEx(this.context.kernel, 'Kernel access required'))
48
+ this._adapterSet = adapterSet(assertEx(this.context.kernel, () => 'Kernel access required'))
50
49
  this._stackNodeModuleId = stackNodeModuleId
51
50
  }
52
51
 
@@ -1,4 +1,4 @@
1
- import { assertEx } from '@xylabs/assert'
1
+ import { assertEx } from '@xylabs/sdk-js'
2
2
  import type { NodeInstance } from '@xyo-network/node-model'
3
3
  import { asAttachableNodeInstance, asNodeInstance } from '@xyo-network/node-model'
4
4
  import type { AdapterSetCreator, XyOsContext } from '@xyo-network/os-model'
@@ -47,7 +47,7 @@ export class ManageSystemDapps extends OsCallerBase {
47
47
 
48
48
  /**
49
49
  * Add a callback to listen for errors throwing during system dapp registration
50
- * @param {ErrorListener} errorListener
50
+ * @param errorListener
51
51
  */
52
52
  addErrorListener(errorListener: ErrorListener) {
53
53
  this.onErrorCallbacks.push(errorListener)
@@ -1,4 +1,4 @@
1
- import type { Hash } from '@xylabs/hex'
1
+ import type { Hash } from '@xylabs/sdk-js'
2
2
  import type { WalletSeedPhrase } from '@xyo-network/os-model'
3
3
  import { WalletSeedPhraseSchema } from '@xyo-network/os-model'
4
4
  import { PayloadBuilder } from '@xyo-network/payload-builder'
@@ -10,22 +10,21 @@ export type SeedPhrase = string
10
10
  export interface SeedPhraseRepository {
11
11
  /**
12
12
  * Add a seed phrase for a given SeedPhraseId
13
- * @param {SeedPhraseId} id
13
+ * @param id
14
14
  * @returns Promise
15
15
  */
16
16
  add(id: SeedPhraseId): Promise<string>
17
17
 
18
18
  /**
19
19
  * For a given DappId, find its wallet or create a new wallet and return its walletId
20
- * @param {SeedPhraseId} dappName
20
+ * @param dappName
21
21
  * @returns Promise
22
22
  */
23
23
  findOrCreate(dappName: SeedPhraseId): Promise<WalletId>
24
24
 
25
25
  /**
26
26
  * Request a seed phrase by supplying a walletId. Note: In the future, the OS might require verification along side the walletId
27
- *
28
- * @param {WalletId} walletId
27
+ * @param walletId
29
28
  * @returns DappWalletSeedPhrase
30
29
  */
31
30
  request(walletId: WalletId): Promise<SeedPhrase | undefined>