@xyo-network/os-runtime 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) 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 +2 -2
  4. package/dist/neutral/DappCallerBase.d.ts.map +1 -1
  5. package/dist/neutral/OsCallerBase.d.ts +2 -2
  6. package/dist/neutral/PubSubBridgeCaller.d.ts +1 -1
  7. package/dist/neutral/PubSubBridgeCaller.d.ts.map +1 -1
  8. package/dist/neutral/RunningDappCache.d.ts.map +1 -1
  9. package/dist/neutral/XyOs.d.ts +5 -6
  10. package/dist/neutral/XyOs.d.ts.map +1 -1
  11. package/dist/neutral/XyOsBase.d.ts +124 -7
  12. package/dist/neutral/XyOsBase.d.ts.map +1 -1
  13. package/dist/neutral/XyOsDapp.d.ts +3 -3
  14. package/dist/neutral/XyOsDapp.d.ts.map +1 -1
  15. package/dist/neutral/access/Caller.d.ts +2 -2
  16. package/dist/neutral/access/Caller.d.ts.map +1 -1
  17. package/dist/neutral/access/RunningAccessDappCache.d.ts.map +1 -1
  18. package/dist/neutral/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +1 -1
  19. package/dist/neutral/adapter/Base.d.ts +2 -2
  20. package/dist/neutral/adapter/Base.d.ts.map +1 -1
  21. package/dist/neutral/classes/lib/DappCreatorParams.d.ts +3 -3
  22. package/dist/neutral/classes/lib/DappCreatorParams.d.ts.map +1 -1
  23. package/dist/neutral/classes/lib/Insertable.d.ts +1 -3
  24. package/dist/neutral/classes/lib/Insertable.d.ts.map +1 -1
  25. package/dist/neutral/classes/menu/Caller.d.ts +1 -2
  26. package/dist/neutral/classes/menu/Caller.d.ts.map +1 -1
  27. package/dist/neutral/classes/settings/Caller.d.ts +2 -2
  28. package/dist/neutral/classes/settings/CallerBase.d.ts +1 -1
  29. package/dist/neutral/classes/settings/SettingsQueries.d.ts.map +1 -1
  30. package/dist/neutral/classes/settings/badge/Caller.d.ts +2 -2
  31. package/dist/neutral/classes/settings/badge/Resource.d.ts +1 -1
  32. package/dist/neutral/classes/settings/badge/Resource.d.ts.map +1 -1
  33. package/dist/neutral/dapp/context/creator/Creator.d.ts +1 -1
  34. package/dist/neutral/dapp/context/creator/Creator.d.ts.map +1 -1
  35. package/dist/neutral/dapp/context/creator/createDappContext.d.ts.map +1 -1
  36. package/dist/neutral/event/bus/Connection.d.ts +3 -4
  37. package/dist/neutral/event/bus/Connection.d.ts.map +1 -1
  38. package/dist/neutral/event/bus/EventBus.d.ts +1 -1
  39. package/dist/neutral/event/bus/EventBus.d.ts.map +1 -1
  40. package/dist/neutral/event/bus/PubSubConnection.d.ts +1 -1
  41. package/dist/neutral/helpers/monitor/XyOsMonitor.d.ts +2 -2
  42. package/dist/neutral/helpers/monitor/XyOsMonitor.d.ts.map +1 -1
  43. package/dist/neutral/helpers/monitor/types.d.ts +3 -3
  44. package/dist/neutral/helpers/monitor/types.d.ts.map +1 -1
  45. package/dist/neutral/index.mjs +1042 -694
  46. package/dist/neutral/index.mjs.map +1 -1
  47. package/dist/neutral/intent/Caller.d.ts +5 -5
  48. package/dist/neutral/lib/Listener.d.ts +1 -1
  49. package/dist/neutral/lib/Listener.d.ts.map +1 -1
  50. package/dist/neutral/lib/PayloadStore.d.ts +1 -2
  51. package/dist/neutral/lib/PayloadStore.d.ts.map +1 -1
  52. package/dist/neutral/lib/isPayload.d.ts +1 -1
  53. package/dist/neutral/loadOsNode.d.ts.map +1 -1
  54. package/dist/neutral/profileModuleEvents.d.ts +2 -4
  55. package/dist/neutral/profileModuleEvents.d.ts.map +1 -1
  56. package/dist/neutral/registration/DappRegistrationService.d.ts +3 -3
  57. package/dist/neutral/registration/DappRegistrationService.d.ts.map +1 -1
  58. package/dist/neutral/registration/DappRegistry.d.ts +4 -6
  59. package/dist/neutral/registration/DappRegistry.d.ts.map +1 -1
  60. package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts +7 -3
  61. package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
  62. package/dist/neutral/registration/ValidateDappAccessDiviner/Diviner.d.ts +3 -1
  63. package/dist/neutral/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
  64. package/dist/neutral/scripts/xyos/lib/headless.d.ts.map +1 -1
  65. package/dist/neutral/signer/Signers.d.ts.map +1 -1
  66. package/dist/neutral/stack/Base.d.ts +2 -2
  67. package/dist/neutral/stack/Base.d.ts.map +1 -1
  68. package/dist/neutral/stack/Manager.d.ts +2 -6
  69. package/dist/neutral/stack/Manager.d.ts.map +1 -1
  70. package/dist/neutral/system/ManageSystemDapps.d.ts +3 -3
  71. package/dist/neutral/system/ManageSystemDapps.d.ts.map +1 -1
  72. package/dist/neutral/utils/buildWalletSeedPhrasePayload.d.ts +1 -1
  73. package/dist/neutral/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
  74. package/dist/neutral/wallet/SeedPhraseRepository.d.ts +3 -4
  75. package/dist/neutral/wallet/SeedPhraseRepository.d.ts.map +1 -1
  76. package/dist/node/Caller.d.ts +18 -20
  77. package/dist/node/Caller.d.ts.map +1 -1
  78. package/dist/node/DappCallerBase.d.ts +2 -2
  79. package/dist/node/DappCallerBase.d.ts.map +1 -1
  80. package/dist/node/OsCallerBase.d.ts +2 -2
  81. package/dist/node/PubSubBridgeCaller.d.ts +1 -1
  82. package/dist/node/PubSubBridgeCaller.d.ts.map +1 -1
  83. package/dist/node/RunningDappCache.d.ts.map +1 -1
  84. package/dist/node/XyOs.d.ts +5 -6
  85. package/dist/node/XyOs.d.ts.map +1 -1
  86. package/dist/node/XyOsBase.d.ts +124 -7
  87. package/dist/node/XyOsBase.d.ts.map +1 -1
  88. package/dist/node/XyOsDapp.d.ts +3 -3
  89. package/dist/node/XyOsDapp.d.ts.map +1 -1
  90. package/dist/node/access/Caller.d.ts +2 -2
  91. package/dist/node/access/Caller.d.ts.map +1 -1
  92. package/dist/node/access/RunningAccessDappCache.d.ts.map +1 -1
  93. package/dist/node/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +1 -1
  94. package/dist/node/adapter/Base.d.ts +2 -2
  95. package/dist/node/adapter/Base.d.ts.map +1 -1
  96. package/dist/node/classes/lib/DappCreatorParams.d.ts +3 -3
  97. package/dist/node/classes/lib/DappCreatorParams.d.ts.map +1 -1
  98. package/dist/node/classes/lib/Insertable.d.ts +1 -3
  99. package/dist/node/classes/lib/Insertable.d.ts.map +1 -1
  100. package/dist/node/classes/menu/Caller.d.ts +1 -2
  101. package/dist/node/classes/menu/Caller.d.ts.map +1 -1
  102. package/dist/node/classes/settings/Caller.d.ts +2 -2
  103. package/dist/node/classes/settings/CallerBase.d.ts +1 -1
  104. package/dist/node/classes/settings/SettingsQueries.d.ts.map +1 -1
  105. package/dist/node/classes/settings/badge/Caller.d.ts +2 -2
  106. package/dist/node/classes/settings/badge/Resource.d.ts +1 -1
  107. package/dist/node/classes/settings/badge/Resource.d.ts.map +1 -1
  108. package/dist/node/dapp/context/creator/Creator.d.ts +1 -1
  109. package/dist/node/dapp/context/creator/Creator.d.ts.map +1 -1
  110. package/dist/node/dapp/context/creator/createDappContext.d.ts.map +1 -1
  111. package/dist/node/event/bus/Connection.d.ts +3 -4
  112. package/dist/node/event/bus/Connection.d.ts.map +1 -1
  113. package/dist/node/event/bus/EventBus.d.ts +1 -1
  114. package/dist/node/event/bus/EventBus.d.ts.map +1 -1
  115. package/dist/node/event/bus/PubSubConnection.d.ts +1 -1
  116. package/dist/node/helpers/monitor/XyOsMonitor.d.ts +2 -2
  117. package/dist/node/helpers/monitor/XyOsMonitor.d.ts.map +1 -1
  118. package/dist/node/helpers/monitor/types.d.ts +3 -3
  119. package/dist/node/helpers/monitor/types.d.ts.map +1 -1
  120. package/dist/node/index.mjs +1042 -694
  121. package/dist/node/index.mjs.map +1 -1
  122. package/dist/node/intent/Caller.d.ts +5 -5
  123. package/dist/node/lib/Listener.d.ts +1 -1
  124. package/dist/node/lib/Listener.d.ts.map +1 -1
  125. package/dist/node/lib/PayloadStore.d.ts +1 -2
  126. package/dist/node/lib/PayloadStore.d.ts.map +1 -1
  127. package/dist/node/lib/isPayload.d.ts +1 -1
  128. package/dist/node/loadOsNode.d.ts.map +1 -1
  129. package/dist/node/profileModuleEvents.d.ts +2 -4
  130. package/dist/node/profileModuleEvents.d.ts.map +1 -1
  131. package/dist/node/registration/DappRegistrationService.d.ts +3 -3
  132. package/dist/node/registration/DappRegistrationService.d.ts.map +1 -1
  133. package/dist/node/registration/DappRegistry.d.ts +4 -6
  134. package/dist/node/registration/DappRegistry.d.ts.map +1 -1
  135. package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts +7 -3
  136. package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
  137. package/dist/node/registration/ValidateDappAccessDiviner/Diviner.d.ts +3 -1
  138. package/dist/node/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
  139. package/dist/node/scripts/xyos/index.mjs +520 -384
  140. package/dist/node/scripts/xyos/index.mjs.map +1 -1
  141. package/dist/node/scripts/xyos/lib/headless.d.ts.map +1 -1
  142. package/dist/node/signer/Signers.d.ts.map +1 -1
  143. package/dist/node/stack/Base.d.ts +2 -2
  144. package/dist/node/stack/Base.d.ts.map +1 -1
  145. package/dist/node/stack/Manager.d.ts +2 -6
  146. package/dist/node/stack/Manager.d.ts.map +1 -1
  147. package/dist/node/system/ManageSystemDapps.d.ts +3 -3
  148. package/dist/node/system/ManageSystemDapps.d.ts.map +1 -1
  149. package/dist/node/utils/buildWalletSeedPhrasePayload.d.ts +1 -1
  150. package/dist/node/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
  151. package/dist/node/wallet/SeedPhraseRepository.d.ts +3 -4
  152. package/dist/node/wallet/SeedPhraseRepository.d.ts.map +1 -1
  153. package/package.json +165 -55
  154. package/dist/neutral/signer/Signer.spec.d.ts +0 -2
  155. package/dist/neutral/signer/Signer.spec.d.ts.map +0 -1
  156. package/dist/neutral/spec/boot.spec.d.ts +0 -2
  157. package/dist/neutral/spec/boot.spec.d.ts.map +0 -1
  158. package/dist/node/signer/Signer.spec.d.ts +0 -2
  159. package/dist/node/signer/Signer.spec.d.ts.map +0 -1
  160. package/dist/node/spec/boot.spec.d.ts +0 -2
  161. package/dist/node/spec/boot.spec.d.ts.map +0 -1
  162. package/src/Caller.ts +0 -202
  163. package/src/DappCallerBase.ts +0 -56
  164. package/src/DefaultsQueries.ts +0 -27
  165. package/src/OsCallerBase.ts +0 -59
  166. package/src/PubSubBridgeCaller.ts +0 -33
  167. package/src/RunningDappCache.ts +0 -58
  168. package/src/XyOs.ts +0 -166
  169. package/src/XyOsBase.ts +0 -136
  170. package/src/XyOsDapp.ts +0 -103
  171. package/src/access/Caller.ts +0 -85
  172. package/src/access/Queries.ts +0 -38
  173. package/src/access/Resource.ts +0 -65
  174. package/src/access/RunningAccessDappCache.ts +0 -21
  175. package/src/access/index.ts +0 -4
  176. package/src/access/interfaces/index.ts +0 -1
  177. package/src/access/interfaces/registered-names/helpers/AccessNodeQueries.ts +0 -68
  178. package/src/access/interfaces/registered-names/helpers/index.ts +0 -2
  179. package/src/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.ts +0 -42
  180. package/src/access/interfaces/registered-names/helpers/resource/RegistrationsResource.ts +0 -52
  181. package/src/access/interfaces/registered-names/helpers/resource/RegistrationsResourceQueries.ts +0 -23
  182. package/src/access/interfaces/registered-names/helpers/resource/index.ts +0 -3
  183. package/src/access/interfaces/registered-names/index.ts +0 -1
  184. package/src/adapter/Base.ts +0 -104
  185. package/src/adapter/Network.ts +0 -31
  186. package/src/adapter/Settings.ts +0 -30
  187. package/src/adapter/index.ts +0 -2
  188. package/src/adapters/OsPubSubBridgeNetwork.ts +0 -10
  189. package/src/adapters/OsSettings.ts +0 -7
  190. package/src/adapters/OsXyoPublicNetwork.ts +0 -9
  191. package/src/adapters/index.ts +0 -3
  192. package/src/classes/dapp/DefaultsResource.ts +0 -67
  193. package/src/classes/dapp/index.ts +0 -1
  194. package/src/classes/index.ts +0 -4
  195. package/src/classes/lib/DappCreatorParams.ts +0 -18
  196. package/src/classes/lib/Insertable.ts +0 -10
  197. package/src/classes/lib/index.ts +0 -2
  198. package/src/classes/menu/Caller.ts +0 -77
  199. package/src/classes/menu/Queries.ts +0 -60
  200. package/src/classes/menu/Resource.ts +0 -105
  201. package/src/classes/menu/index.ts +0 -2
  202. package/src/classes/settings/Caller.ts +0 -78
  203. package/src/classes/settings/CallerBase.ts +0 -27
  204. package/src/classes/settings/Resource.ts +0 -81
  205. package/src/classes/settings/SettingsQueries.ts +0 -56
  206. package/src/classes/settings/badge/Caller.ts +0 -30
  207. package/src/classes/settings/badge/Queries.ts +0 -19
  208. package/src/classes/settings/badge/Resource.ts +0 -50
  209. package/src/classes/settings/badge/index.ts +0 -2
  210. package/src/classes/settings/index.ts +0 -5
  211. package/src/dapp/context/creator/Creator.ts +0 -122
  212. package/src/dapp/context/creator/DefaultPayloads/DappAccessPayloads.ts +0 -20
  213. package/src/dapp/context/creator/DefaultPayloads/DefaultPayloads.ts +0 -40
  214. package/src/dapp/context/creator/DefaultPayloads/NodeInfoPayload.ts +0 -33
  215. package/src/dapp/context/creator/DefaultPayloads/index.ts +0 -1
  216. package/src/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.ts +0 -59
  217. package/src/dapp/context/creator/ExternalModulePermissions/index.ts +0 -1
  218. package/src/dapp/context/creator/createDappContext.ts +0 -61
  219. package/src/dapp/context/creator/index.ts +0 -3
  220. package/src/dapp/context/index.ts +0 -1
  221. package/src/dapp/index.ts +0 -1
  222. package/src/event/bus/Connection.ts +0 -33
  223. package/src/event/bus/EventBus.ts +0 -159
  224. package/src/event/bus/PubSubConnection.ts +0 -28
  225. package/src/event/bus/index.ts +0 -3
  226. package/src/event/connections/DappAccessRequest.ts +0 -11
  227. package/src/event/connections/DappsReady.ts +0 -9
  228. package/src/event/connections/ExposeDappRequest.ts +0 -11
  229. package/src/event/connections/OsPubSubNetworkReady.ts +0 -12
  230. package/src/event/connections/OsSettingsReady.ts +0 -12
  231. package/src/event/connections/OsXyoPublicReady.ts +0 -12
  232. package/src/event/connections/index.ts +0 -6
  233. package/src/event/index.ts +0 -2
  234. package/src/helpers/index.ts +0 -1
  235. package/src/helpers/monitor/XyOsMonitor.ts +0 -52
  236. package/src/helpers/monitor/index.ts +0 -2
  237. package/src/helpers/monitor/types.ts +0 -8
  238. package/src/index.ts +0 -29
  239. package/src/initializer/DappInitializer.ts +0 -57
  240. package/src/initializer/index.ts +0 -1
  241. package/src/intent/Caller.ts +0 -74
  242. package/src/intent/Resource.ts +0 -66
  243. package/src/intent/index.ts +0 -2
  244. package/src/lib/ExternalStore.ts +0 -7
  245. package/src/lib/Listener.ts +0 -1
  246. package/src/lib/ModuleAccountPaths.ts +0 -23
  247. package/src/lib/ModuleNames.ts +0 -3
  248. package/src/lib/NameTransforms.ts +0 -34
  249. package/src/lib/PayloadStore.ts +0 -106
  250. package/src/lib/ResourceStores.ts +0 -7
  251. package/src/lib/index.ts +0 -11
  252. package/src/lib/initializeXns.ts +0 -16
  253. package/src/lib/isEqual.ts +0 -42
  254. package/src/lib/isPayload.ts +0 -24
  255. package/src/lib/tokenPlacesSplit.ts +0 -17
  256. package/src/loadOsNode.ts +0 -44
  257. package/src/manifest/index.ts +0 -2
  258. package/src/manifest/manifestReplacementTokens.ts +0 -6
  259. package/src/manifest/os-node.manifest.json +0 -132
  260. package/src/manifests/dapp-window.manifest.json +0 -36
  261. package/src/manifests/index.ts +0 -1
  262. package/src/models/access/ValidDappAccessInterfaces.ts +0 -6
  263. package/src/models/access/index.ts +0 -1
  264. package/src/models/index.ts +0 -1
  265. package/src/profileModuleEvents.ts +0 -43
  266. package/src/registration/DappRegistrationService.ts +0 -179
  267. package/src/registration/DappRegistry.ts +0 -131
  268. package/src/registration/ValidateDappAccessDiviner/Config.ts +0 -24
  269. package/src/registration/ValidateDappAccessDiviner/Diviner.ts +0 -133
  270. package/src/registration/ValidateDappAccessDiviner/index.ts +0 -2
  271. package/src/registration/index.ts +0 -2
  272. package/src/scripts/xyos/command/config.ts +0 -19
  273. package/src/scripts/xyos/command/create.ts +0 -22
  274. package/src/scripts/xyos/command/index.ts +0 -7
  275. package/src/scripts/xyos/command/manifest.ts +0 -19
  276. package/src/scripts/xyos/command/start.ts +0 -35
  277. package/src/scripts/xyos/index.ts +0 -32
  278. package/src/scripts/xyos/lib/createFromTemplate.ts +0 -11
  279. package/src/scripts/xyos/lib/headless.ts +0 -68
  280. package/src/scripts/xyos/lib/index.ts +0 -2
  281. package/src/signer/Signer.spec.ts +0 -65
  282. package/src/signer/Signers.ts +0 -74
  283. package/src/signer/index.ts +0 -1
  284. package/src/spec/boot.spec.ts +0 -89
  285. package/src/stack/Base.ts +0 -166
  286. package/src/stack/Manager.ts +0 -51
  287. package/src/stack/Map.ts +0 -22
  288. package/src/stack/OsPubSubNetworkStack.ts +0 -70
  289. package/src/stack/OsSettingsStack.ts +0 -24
  290. package/src/stack/XyoPublicNetworkStack.ts +0 -32
  291. package/src/stack/index.ts +0 -6
  292. package/src/system/ManageSystemDapps.ts +0 -148
  293. package/src/system/Queries.ts +0 -69
  294. package/src/system/index.ts +0 -1
  295. package/src/types/global.d.ts +0 -9
  296. package/src/types/images.d.ts +0 -5
  297. package/src/utils/buildWalletSeedPhrasePayload.ts +0 -51
  298. package/src/utils/getApiDomain.ts +0 -14
  299. package/src/utils/index.ts +0 -3
  300. package/src/utils/renameObjKey.ts +0 -22
  301. package/src/wallet/DappSeedPhraseRepository.ts +0 -99
  302. package/src/wallet/SeedPhraseRepository.ts +0 -32
  303. package/src/wallet/index.ts +0 -2
@@ -1,11 +0,0 @@
1
- import type { EventBusPubSubConnectionRequest } from '@xyo-network/os-model'
2
-
3
- import { EventBusPubSubConnection } from '../bus/index.ts'
4
-
5
- export const ExposeDappRequestEvent = 'exposeDappRequest'
6
-
7
- const exposeDappConnectionRequest: EventBusPubSubConnectionRequest = {
8
- publishableEvents: [ExposeDappRequestEvent],
9
- type: 'PubSub',
10
- }
11
- export const exposeDappRequestConnection = () => new EventBusPubSubConnection(exposeDappConnectionRequest)
@@ -1,12 +0,0 @@
1
- import type { EventBusPubSubConnectionRequest } from '@xyo-network/os-model'
2
-
3
- import { EventBusPubSubConnection } from '../bus/index.ts'
4
-
5
- export const OsPubSubNetworkReadyEvent = 'osPubSubNetworkReady'
6
-
7
- const osPubSubNetworkConnectionRequest: EventBusPubSubConnectionRequest = {
8
- publishableEvents: [OsPubSubNetworkReadyEvent],
9
- type: 'PubSub',
10
- }
11
-
12
- export const osPubSubNetworkReadyConnection = () => new EventBusPubSubConnection(osPubSubNetworkConnectionRequest)
@@ -1,12 +0,0 @@
1
- import type { EventBusPubSubConnectionRequest } from '@xyo-network/os-model'
2
-
3
- import { EventBusPubSubConnection } from '../bus/index.ts'
4
-
5
- export const OsSettingsReadyEvent = 'osSettingsReady'
6
-
7
- const osSettingsConnectionRequest: EventBusPubSubConnectionRequest = {
8
- publishableEvents: [OsSettingsReadyEvent],
9
- type: 'PubSub',
10
- }
11
-
12
- export const osSettingsReadyConnection = () => new EventBusPubSubConnection(osSettingsConnectionRequest)
@@ -1,12 +0,0 @@
1
- import type { EventBusPubSubConnectionRequest } from '@xyo-network/os-model'
2
-
3
- import { EventBusPubSubConnection } from '../bus/index.ts'
4
-
5
- export const OsXyoPublicNetworkReadyEvent = 'osXyoPublicNetworkReady'
6
-
7
- const osXyoPublicNetworkConnectionRequest: EventBusPubSubConnectionRequest = {
8
- publishableEvents: [OsXyoPublicNetworkReadyEvent],
9
- type: 'PubSub',
10
- }
11
-
12
- export const osXyoPublicNetworkReadyConnection = () => new EventBusPubSubConnection(osXyoPublicNetworkConnectionRequest)
@@ -1,6 +0,0 @@
1
- export * from './DappAccessRequest.ts'
2
- export * from './DappsReady.ts'
3
- export * from './ExposeDappRequest.ts'
4
- export * from './OsPubSubNetworkReady.ts'
5
- export * from './OsSettingsReady.ts'
6
- export * from './OsXyoPublicReady.ts'
@@ -1,2 +0,0 @@
1
- export * from './bus/index.ts'
2
- export * from './connections/index.ts'
@@ -1 +0,0 @@
1
- export * from './monitor/index.ts'
@@ -1,52 +0,0 @@
1
- import type { XyOsGlobal } from '@xyo-network/os-model'
2
-
3
- import type { MonitorEventConfig } from './types.ts'
4
-
5
- // See - https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation
6
- export type Connection = {
7
- downlink: number
8
- effectiveType: string
9
- rtt: number
10
- }
11
-
12
- const DEFAULT_MONITORING_EVENT_NAME = 'System Task Duration'
13
-
14
- globalThis.getXyOsGlobal
15
- = globalThis.getXyOsGlobal
16
- ?? ((): XyOsGlobal => {
17
- return { tracking: { trackEvent: (_event: string, _properties?: Record<string, unknown>) => void {} } }
18
- })
19
-
20
- // TODO: Make this node compatible
21
- const xyOsGlobal = globalThis.getXyOsGlobal()
22
-
23
- export abstract class XyOsMonitor {
24
- static trackEvent = xyOsGlobal.tracking.trackEvent
25
-
26
- private performanceTimers = new Map<string, number>()
27
-
28
- startTimer(name: string): void {
29
- this.performanceTimers.set(name, performance.now())
30
- }
31
-
32
- stopTimer(eventConfig: MonitorEventConfig): void {
33
- const { additionalProperties, name } = eventConfig
34
- const start = this.performanceTimers.get(name)
35
- if (start) {
36
- const end = performance.now()
37
- const duration = end - start
38
- this.performanceTimers.delete(name)
39
- const connection = this.connection()
40
- XyOsMonitor.trackEvent(DEFAULT_MONITORING_EVENT_NAME, {
41
- downloadSpeedMbps: connection?.downlink,
42
- duration: duration.toString(),
43
- effectiveConnectionSpeed: connection?.effectiveType,
44
- name,
45
- roundTripTime: connection?.rtt,
46
- ...additionalProperties,
47
- })
48
- }
49
- }
50
-
51
- protected abstract connection(): Connection | undefined
52
- }
@@ -1,2 +0,0 @@
1
- export * from './types.ts'
2
- export * from './XyOsMonitor.ts'
@@ -1,8 +0,0 @@
1
- import type { JsonObject } from '@xylabs/object'
2
-
3
- export type MonitorEventNames = 'Load XyOs' | 'Install System dApps' | 'Expose dApps' | 'Loading dApp'
4
-
5
- export type MonitorEventConfig = {
6
- additionalProperties?: JsonObject
7
- name: MonitorEventNames
8
- }
package/src/index.ts DELETED
@@ -1,29 +0,0 @@
1
- export * from './access/index.ts'
2
- export * from './adapter/index.ts'
3
- export * from './adapters/index.ts'
4
- export * from './Caller.ts'
5
- export * from './classes/index.ts'
6
- export * from './dapp/index.ts'
7
- export * from './DappCallerBase.ts'
8
- export * from './DefaultsQueries.ts'
9
- export * from './event/index.ts'
10
- export * from './helpers/index.ts'
11
- export * from './initializer/index.ts'
12
- export * from './intent/index.ts'
13
- export * from './lib/index.ts'
14
- export * from './loadOsNode.ts'
15
- export * from './manifest/index.ts'
16
- export * from './models/index.ts'
17
- export * from './OsCallerBase.ts'
18
- export * from './profileModuleEvents.ts'
19
- export * from './PubSubBridgeCaller.ts'
20
- export * from './registration/index.ts'
21
- export * from './RunningDappCache.ts'
22
- export * from './signer/index.ts'
23
- export * from './stack/index.ts'
24
- export * from './system/index.ts'
25
- export * from './utils/index.ts'
26
- export * from './wallet/index.ts'
27
- export * from './XyOs.ts'
28
- export * from './XyOsBase.ts'
29
- export * from './XyOsDapp.ts'
@@ -1,57 +0,0 @@
1
- import { assertEx } from '@xylabs/assert'
2
- import type {
3
- RegisteredDapp, WindowDappNodeSet, XyOsContext,
4
- } from '@xyo-network/os-model'
5
-
6
- import { RunningDappCache } from '../RunningDappCache.ts'
7
- import { DappSeedPhraseRepository } from '../wallet/index.ts'
8
-
9
- /** Helper class to simulate full dapp initialization by the OS */
10
- export interface DappInitializerConfig<T extends RegisteredDapp = RegisteredDapp> {
11
- allowedNames: string[]
12
- dapp: T
13
- xnsNetwork: string | undefined
14
- xnsNodeUrl: string | undefined
15
- xyOs: XyOsContext
16
- }
17
-
18
- export class DappInitializer<T extends RegisteredDapp = RegisteredDapp> {
19
- private _config: DappInitializerConfig
20
-
21
- constructor(config: DappInitializerConfig) {
22
- this._config = config
23
- }
24
-
25
- get config() {
26
- return assertEx(this._config, () => new Error('Options not set'))
27
- }
28
-
29
- async install(): Promise<WindowDappNodeSet> {
30
- const dappWithWalletId = await this.installDappWallet()
31
-
32
- return await this.initializeDappContext(dappWithWalletId)
33
- }
34
-
35
- private async initializeDappContext(dappWithWalletId: T): Promise<WindowDappNodeSet> {
36
- const {
37
- allowedNames, xnsNetwork, xnsNodeUrl, xyOs,
38
- } = this.config
39
-
40
- return await RunningDappCache.findOrCreate(dappWithWalletId, xyOs, allowedNames ?? [], xnsNodeUrl, xnsNetwork)
41
- }
42
-
43
- private async installDappWallet(): Promise<T> {
44
- const { xyOs, dapp } = this.config
45
- const dappSeedPhraseRepository = new DappSeedPhraseRepository(xyOs, [dapp.config.name])
46
- const walletId = await dappSeedPhraseRepository.findOrCreate(dapp.config.name)
47
-
48
- // Update the dapp with the walletId
49
- return {
50
- ...dapp,
51
- config: {
52
- ...dapp.config,
53
- walletId,
54
- },
55
- } as T
56
- }
57
- }
@@ -1 +0,0 @@
1
- export * from './DappInitializer.ts'
@@ -1,74 +0,0 @@
1
- import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
2
- import type {
3
- DappId, DappIntent, DappIntentTypes, XyOsContext,
4
- } from '@xyo-network/os-model'
5
- import { DappIntentSchema, DappMode } from '@xyo-network/os-model'
6
- import type { WithStorageMeta } from '@xyo-network/payload-model'
7
-
8
- import { DappCallerBase } from '../DappCallerBase.ts'
9
-
10
- export class DappIntentCaller extends DappCallerBase {
11
- static OsDappName = 'XyOs'
12
- constructor(context: XyOsContext) {
13
- super(context)
14
- }
15
-
16
- /**
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?
23
- * @returns DappIntent
24
- */
25
- static buildIntent(
26
- sourceDappId: DappId,
27
- intent: DappIntentTypes,
28
- targetDappId?: DappId,
29
- targetMode: DappMode = DappMode.Window,
30
- params?: DappIntent['params'],
31
- ): DappIntent {
32
- return {
33
- intent,
34
- params: params || '',
35
- schema: DappIntentSchema,
36
- sourceDappId,
37
- targetDappId,
38
- targetMode: targetMode || DappMode.Window,
39
- timestamp: Date.now(),
40
- }
41
- }
42
-
43
- // Add a new intent
44
- async addIntent(id: DappId, intent: DappIntentTypes, mode: DappMode) {
45
- const intentArchivist = await this.getDappIntentArchivist()
46
- const newIntent = DappIntentCaller.buildIntent(id, intent, mode)
47
- await intentArchivist.insert([newIntent])
48
- }
49
-
50
- // Get all intents
51
- async allIntents() {
52
- const archivist = await this.getDappIntentArchivist()
53
- return await archivist.all()
54
- }
55
-
56
- // Get the latest intent saved to the archivist
57
- async latestIntent() {
58
- const archivist = await this.getDappIntentArchivist()
59
- return (await archivist.all()).at(-1) as WithStorageMeta<DappIntent>
60
- }
61
-
62
- // Get the latest intent for a dapp
63
- async latestIntentForDappName(dappName: DappId) {
64
- const diviner = await this.getDappIntentArchivistPayloadDiviner()
65
- const query = {
66
- limit: 1,
67
- order: 'desc',
68
- schema: PayloadDivinerQuerySchema,
69
- sourceDappId: dappName,
70
- }
71
-
72
- return (await diviner.divine([query])) as DappIntent[]
73
- }
74
- }
@@ -1,66 +0,0 @@
1
- import { assertEx } from '@xylabs/assert'
2
- import type { DappIntent, XyOsContext } from '@xyo-network/os-model'
3
- import { isDappIntent } from '@xyo-network/os-model'
4
- import type { WithSources, WithStorageMeta } from '@xyo-network/payload-model'
5
-
6
- import { DappCallerBase } from '../DappCallerBase.ts'
7
- import type { Listener, ResourceStore } from '../lib/index.ts'
8
- import { PayloadStore } from '../lib/index.ts'
9
-
10
- export type DappIntentViews = 'latestDappIntent' | 'allDappIntents'
11
- const NO_RESULTS: [] = []
12
-
13
- export class DappIntentResource extends DappCallerBase implements ResourceStore<DappIntentViews> {
14
- private _allDappIntents: PayloadStore<DappIntent> | undefined
15
- private _latestDappIntent: PayloadStore<DappIntent> | undefined
16
-
17
- constructor(context: XyOsContext) {
18
- super(context)
19
- }
20
-
21
- get allDappIntents() {
22
- return assertEx(this._allDappIntents, () => 'allDappIntents not set')
23
- }
24
-
25
- get latestDappIntent() {
26
- return assertEx(this._latestDappIntent, () => 'latestDappIntent not set')
27
- }
28
-
29
- get subscriptions() {
30
- return {
31
- allDappIntents: (cb: Listener) => this.allDappIntents.subscribe(cb),
32
- latestDappIntent: (cb: Listener) => this.latestDappIntent.subscribe(cb),
33
- }
34
- }
35
-
36
- get views() {
37
- return {
38
- allDappIntents: () => this.allDappIntents.getSnapshot(),
39
- latestDappIntent: () => this.latestDappIntent.getSnapshot(),
40
- }
41
- }
42
-
43
- cleanupListeners() {
44
- this.latestDappIntent.cleanupListeners()
45
- this.allDappIntents.cleanupListeners()
46
- }
47
-
48
- async start() {
49
- const archivist = await this.getDappIntentArchivist()
50
-
51
- this._allDappIntents = await PayloadStore.create<DappIntent>({
52
- archivist,
53
- getLatest: async () => (await archivist.all()) as WithStorageMeta<WithSources<DappIntent>>[],
54
- idFunction: isDappIntent,
55
- })
56
- this._latestDappIntent = await PayloadStore.create<DappIntent>({
57
- archivist,
58
- getLatest: async () => {
59
- const all = await archivist.all()
60
- const result = all.length > 0 ? [all.at(-1)] : NO_RESULTS
61
- return result as WithStorageMeta<WithSources<DappIntent>>[]
62
- },
63
- idFunction: isDappIntent,
64
- })
65
- }
66
- }
@@ -1,2 +0,0 @@
1
- export * from './Caller.ts'
2
- export * from './Resource.ts'
@@ -1,7 +0,0 @@
1
- import type { Payload } from '@xyo-network/payload-model'
2
-
3
- export interface ExternalStore<T extends Payload = Payload> {
4
- getSnapshot: () => T[]
5
- latest: T[]
6
- subscribe: (onStoreChange: () => void) => () => void
7
- }
@@ -1 +0,0 @@
1
- export type Listener = (...args: Array<unknown>) => void
@@ -1,23 +0,0 @@
1
- import { DevelopArchivist, NodeSentinel } from './ModuleNames.ts'
2
-
3
- export const RemoteNodeArchivistOffsetPaths: Record<string, Record<string, string>> = {
4
- Kerplunk: { [DevelopArchivist]: '118' },
5
- Local: { [DevelopArchivist]: '115' },
6
- Main: { [DevelopArchivist]: '121' },
7
- }
8
-
9
- export const ModuleOffsetPaths: Record<string, string> = {
10
- IdWitness: '1',
11
- DomainWitness: '2',
12
- LocationWitness: '3',
13
- SchemaWitness: '4',
14
- CryptoCardsGameWitness: '5',
15
- CryptoCardsMoveWitness: '6',
16
- EthereumGasEtherchainV2Witness: '7',
17
- CoingeckoCryptoMarketWitness: '8',
18
- UniswapCryptoMarketWitness: '9',
19
- EthereumGasEtherscanWitness: '10',
20
- [NodeSentinel]: '11',
21
- [DevelopArchivist]: '12',
22
- BowserSystemInfoPluginWitness: '13',
23
- }
@@ -1,3 +0,0 @@
1
- export const DevelopArchivist = 'DevelopArchivist'
2
-
3
- export const NodeSentinel = 'NodeSentinel'
@@ -1,34 +0,0 @@
1
- export class NameTransforms {
2
- private value: string
3
- constructor(value: string) {
4
- this.value = value
5
- }
6
-
7
- static deSlug(value: string) {
8
- return value
9
- .replaceAll('-', ' ')
10
- .split(' ')
11
- .map(word => word.charAt(0).toUpperCase() + word.slice(1))
12
- .join(' ')
13
- }
14
-
15
- static moduleName(value: string) {
16
- return value.replaceAll(' ', '')
17
- }
18
-
19
- static slug(value: string) {
20
- return value.replaceAll(' ', '-').toLocaleLowerCase()
21
- }
22
-
23
- deSlug() {
24
- return NameTransforms.deSlug(this.value)
25
- }
26
-
27
- moduleName() {
28
- return NameTransforms.moduleName(this.value)
29
- }
30
-
31
- slug() {
32
- return NameTransforms.slug(this.value)
33
- }
34
- }
@@ -1,106 +0,0 @@
1
- import type { ArchivistInstance, ArchivistModuleEventData } from '@xyo-network/archivist'
2
- import type { Payload } from '@xyo-network/payload-model'
3
-
4
- import type { ExternalStore } from './ExternalStore.ts'
5
- import { isEqual } from './isEqual.ts'
6
- import type { Listener } from './Listener.ts'
7
-
8
- export interface PayloadStoreConfig<T extends Payload = Payload> {
9
- archivist: ArchivistInstance
10
- getLatest: () => Promise<T[]>
11
- idFunction: (schema: Payload) => boolean
12
- }
13
-
14
- export class PayloadStore<T extends Payload = Payload> implements ExternalStore {
15
- latest: T[] = []
16
- private archivist: ArchivistInstance
17
- private deleteListeners: WeakRef<(args: ArchivistModuleEventData['deleted']) => void>[] = []
18
- private insertListeners: WeakRef<(args: ArchivistModuleEventData['inserted']) => void>[] = []
19
- private listeners: Listener[] = []
20
-
21
- private constructor(archivist: ArchivistInstance) {
22
- this.archivist = archivist
23
- }
24
-
25
- /**
26
- * Initialize listeners on the archivist that update class member variables when new payloads are inserted
27
- */
28
- static async create<T extends Payload = Payload>({
29
- archivist, getLatest, idFunction,
30
- }: PayloadStoreConfig<T>) {
31
- const instance = new this<T>(archivist)
32
-
33
- const insertListener = async ({ payloads }: ArchivistModuleEventData['inserted']) => {
34
- // if any of the newly inserted payloads pass the idFunction check, rerun the query
35
- if (payloads.some(idFunction)) {
36
- const latest = await getLatest()
37
- if (isEqual(latest, instance.latest)) return
38
- instance.latest = latest
39
- instance.emitChange()
40
- }
41
- }
42
-
43
- // when payloads are deleted, rerun the diviner query
44
- const deleteListener = async () => {
45
- instance.latest = await getLatest()
46
- instance.emitChange()
47
- }
48
-
49
- const weakRefInsertListener = new WeakRef(insertListener)
50
- const weakRefDeleteListener = new WeakRef(deleteListener)
51
- const insertListenerRef = weakRefInsertListener.deref()
52
- const deleteListenerRef = weakRefDeleteListener.deref()
53
-
54
- if (insertListenerRef) instance.archivist.on('inserted', insertListenerRef)
55
- if (deleteListenerRef) instance.archivist.on('deleted', deleteListenerRef)
56
-
57
- instance.insertListeners.push(weakRefInsertListener)
58
- instance.deleteListeners.push(weakRefDeleteListener)
59
-
60
- instance.latest = await getLatest()
61
- return instance
62
- }
63
-
64
- /**
65
- * Remove all listeners and reset their class members
66
- */
67
- cleanupListeners() {
68
- this.removeListeners(this.insertListeners, 'inserted')
69
- this.removeListeners(this.deleteListeners, 'deleted')
70
- this.insertListeners = []
71
- this.deleteListeners = []
72
- }
73
-
74
- /**
75
- * Get the current value of the store
76
- */
77
- getSnapshot(): T[] {
78
- return this.latest
79
- }
80
-
81
- /**
82
- * Add a call back function that is invoked when new Payloads are inserted
83
- *
84
- * @param {PayloadListener} onStoreChange
85
- */
86
- subscribe(onStoreChange: Listener) {
87
- this.listeners.push(onStoreChange)
88
- return () => {
89
- this.listeners = this.listeners.filter(l => l !== onStoreChange)
90
- }
91
- }
92
-
93
- private emitChange() {
94
- for (const listener of this.listeners) {
95
- listener()
96
- }
97
- }
98
-
99
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
100
- private removeListeners(listeners: WeakRef<(args: any) => void>[], eventName: string) {
101
- for (const listener of listeners) {
102
- const listenerRef = listener.deref()
103
- if (listenerRef) this.archivist.off(eventName, listenerRef)
104
- }
105
- }
106
- }
@@ -1,7 +0,0 @@
1
- import type { ExternalStore } from './ExternalStore.ts'
2
-
3
- export interface ResourceStore<Name extends string = string> {
4
- cleanupListeners: () => void
5
- subscriptions: Record<Name, ExternalStore['subscribe']>
6
- views: Record<Name, ExternalStore['getSnapshot']>
7
- }
package/src/lib/index.ts DELETED
@@ -1,11 +0,0 @@
1
- export * from './ExternalStore.ts'
2
- export * from './initializeXns.ts'
3
- export * from './isEqual.ts'
4
- export * from './isPayload.ts'
5
- export * from './Listener.ts'
6
- export * from './ModuleAccountPaths.ts'
7
- export * from './ModuleNames.ts'
8
- export * from './NameTransforms.ts'
9
- export * from './PayloadStore.ts'
10
- export * from './ResourceStores.ts'
11
- export * from './tokenPlacesSplit.ts'
@@ -1,16 +0,0 @@
1
- import { asDivinerInstance } from '@xyo-network/diviner-model'
2
- import { ResolveHelper } from '@xyo-network/module-model'
3
- import { NameRegistrarTransformer } from '@xyo-network/module-resolver'
4
- import type { NodeInstance } from '@xyo-network/node-model'
5
-
6
- export const initializeXns = async (xnsNode: NodeInstance) => {
7
- if (ResolveHelper.transformers.length === 0) {
8
- const registrarDiviner = asDivinerInstance(await xnsNode?.resolve('AddressRecords:AddressRecordIndexDiviner'))
9
- if (registrarDiviner) {
10
- const transformer = new NameRegistrarTransformer(registrarDiviner, 'xyo')
11
- ResolveHelper.transformers = [transformer]
12
- return true
13
- }
14
- }
15
- return false
16
- }
@@ -1,42 +0,0 @@
1
- import { isObject } from '@xylabs/object'
2
-
3
- export function isEqual(a: unknown, b: unknown): boolean {
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- if ((a as any) === (b as any)) return true
6
-
7
- if (typeof a !== typeof b) return false
8
-
9
- if (isObject(a) && isObject(b)) {
10
- const aKeys = Object.keys(a)
11
- const bKeys = Object.keys(b)
12
-
13
- if (aKeys.length !== bKeys.length) {
14
- return false
15
- }
16
-
17
- for (const key of aKeys) {
18
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
- if (!b.hasOwnProperty(key) || !isEqual((a as any)[key], (b as any)[key])) {
20
- return false
21
- }
22
- }
23
-
24
- return true
25
- }
26
-
27
- if (Array.isArray(a) && Array.isArray(b)) {
28
- if (a.length !== b.length) {
29
- return false
30
- }
31
-
32
- for (const [i, element] of a.entries()) {
33
- if (!isEqual(element, b[i])) {
34
- return false
35
- }
36
- }
37
-
38
- return true
39
- }
40
-
41
- return false
42
- }
@@ -1,24 +0,0 @@
1
- import { AsObjectFactory } from '@xylabs/object'
2
- import type { Payload, Schema } from '@xyo-network/payload-model'
3
-
4
- export const isObject = (x: unknown): x is Record<string | symbol | number, unknown> => {
5
- return typeof x === 'object' && !Array.isArray(x)
6
- }
7
-
8
- export const isAnyPayload = (obj: unknown): obj is Payload => {
9
- if (isObject(obj)) {
10
- return typeof obj.schema === 'string'
11
- }
12
- return false
13
- }
14
-
15
- export const isPayload
16
- = <T extends Payload>(schema: Schema[]) =>
17
- (obj: unknown): obj is T => {
18
- if (isAnyPayload(obj)) {
19
- return schema.includes(obj.schema)
20
- }
21
- return false
22
- }
23
-
24
- export const asPayload = <T extends Payload>(schema: Schema[]) => AsObjectFactory.create(isPayload<T>(schema))