@dxos/react-client 0.8.3 → 0.8.4-main.84f28bd

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 (179) hide show
  1. package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
  2. package/dist/lib/browser/{chunk-72QD3PXL.mjs → chunk-AAR7V3KL.mjs} +14 -14
  3. package/dist/lib/browser/{chunk-AL2CUQ46.mjs → chunk-O5SEVDJG.mjs} +4 -4
  4. package/dist/lib/browser/devtools/index.mjs +5 -5
  5. package/dist/lib/browser/echo/index.mjs +15 -15
  6. package/dist/lib/browser/echo/index.mjs.map +3 -3
  7. package/dist/lib/browser/halo/index.mjs +9 -9
  8. package/dist/lib/browser/index.mjs +2 -2
  9. package/dist/lib/browser/invitations/index.mjs +1 -1
  10. package/dist/lib/browser/mesh/index.mjs +3 -3
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/testing/index.mjs +6 -6
  13. package/dist/lib/browser/worker.mjs +1 -1
  14. package/dist/lib/node-esm/{chunk-UYJUBYMU.mjs → chunk-TU2JJLZK.mjs} +4 -4
  15. package/dist/lib/node-esm/{chunk-NBTZZNQ5.mjs → chunk-ZTD6HPV2.mjs} +14 -14
  16. package/dist/lib/node-esm/devtools/index.mjs +5 -5
  17. package/dist/lib/node-esm/echo/index.mjs +15 -15
  18. package/dist/lib/node-esm/echo/index.mjs.map +3 -3
  19. package/dist/lib/node-esm/halo/index.mjs +9 -9
  20. package/dist/lib/node-esm/index.mjs +2 -2
  21. package/dist/lib/node-esm/invitations/index.mjs +1 -1
  22. package/dist/lib/node-esm/mesh/index.mjs +3 -3
  23. package/dist/lib/node-esm/meta.json +1 -1
  24. package/dist/lib/node-esm/testing/index.mjs +6 -6
  25. package/dist/lib/node-esm/worker.mjs +1 -1
  26. package/dist/types/src/playwright/{playwright.config.d.cts → playwright.config.d.ts} +1 -1
  27. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
  28. package/dist/types/tsconfig.tsbuildinfo +1 -1
  29. package/moon.yml +19 -0
  30. package/package.json +25 -25
  31. package/src/echo/useSyncState.ts +2 -2
  32. package/src/playwright/playwright.config.ts +17 -0
  33. package/src/playwright/smoke.spec.ts +4 -6
  34. package/typedoc/assets/hierarchy.js +1 -1
  35. package/typedoc/assets/navigation.js +1 -1
  36. package/typedoc/assets/search.js +1 -1
  37. package/typedoc/classes/echo.PropertiesType.html +3 -3
  38. package/typedoc/classes/halo.KeyStore.html +2 -2
  39. package/typedoc/classes/index.AlreadyJoinedError.html +2 -2
  40. package/typedoc/classes/index.ApiError.html +2 -2
  41. package/typedoc/classes/index.CancelledError.html +2 -2
  42. package/typedoc/classes/index.Client.html +1 -1
  43. package/typedoc/classes/index.DataCorruptionError.html +2 -2
  44. package/typedoc/classes/index.DatabaseError.html +2 -2
  45. package/typedoc/classes/index.EntityNotFoundError.html +2 -2
  46. package/typedoc/classes/index.IdentityNotInitializedError.html +2 -2
  47. package/typedoc/classes/index.InvalidConfigError.html +2 -2
  48. package/typedoc/classes/index.InvalidInvitationError.html +2 -2
  49. package/typedoc/classes/index.InvalidInvitationExtensionRoleError.html +2 -2
  50. package/typedoc/classes/index.InvalidStorageVersionError.html +2 -2
  51. package/typedoc/classes/index.RemoteServiceConnectionError.html +2 -2
  52. package/typedoc/classes/index.RemoteServiceConnectionTimeout.html +2 -2
  53. package/typedoc/classes/index.RpcClosedError.html +2 -2
  54. package/typedoc/classes/index.RpcNotOpenError.html +2 -2
  55. package/typedoc/classes/index.SystemError.html +2 -2
  56. package/typedoc/classes/index.UnknownModelError.html +2 -2
  57. package/typedoc/classes/invitations.AuthenticatingInvitationObservable.html +1 -1
  58. package/typedoc/classes/invitations.CancellableInvitationObservable.html +1 -1
  59. package/typedoc/enums/devtools.KeyType.html +2 -2
  60. package/typedoc/enums/echo.HaloSpaceMember.Role.html +2 -2
  61. package/typedoc/enums/echo.IndexKind.Kind.html +2 -2
  62. package/typedoc/enums/echo.QueryOptions.DataLocation.html +2 -2
  63. package/typedoc/enums/echo.QueryOptions.ShowDeletedOption.html +2 -2
  64. package/typedoc/enums/echo.SpaceMember.PresenceState.html +2 -2
  65. package/typedoc/enums/echo.SpaceState.html +2 -2
  66. package/typedoc/enums/echo.TextKind.html +2 -2
  67. package/typedoc/enums/halo.Device.PresenceState.html +2 -2
  68. package/typedoc/enums/halo.DeviceKind.html +2 -2
  69. package/typedoc/enums/halo.DeviceType.html +2 -2
  70. package/typedoc/enums/index.ShellDisplay.html +2 -2
  71. package/typedoc/enums/index.ShellLayout.html +2 -2
  72. package/typedoc/enums/index.SystemStatus.html +2 -2
  73. package/typedoc/enums/invitations.Invitation.AuthMethod.html +2 -2
  74. package/typedoc/enums/invitations.Invitation.Kind.html +2 -2
  75. package/typedoc/enums/invitations.Invitation.State.html +2 -2
  76. package/typedoc/enums/invitations.Invitation.Type.html +2 -2
  77. package/typedoc/enums/mesh.ConnectionState.html +2 -2
  78. package/typedoc/functions/devtools.useDevtools.html +1 -1
  79. package/typedoc/functions/devtools.useStream.html +1 -1
  80. package/typedoc/functions/echo.useMembers.html +1 -1
  81. package/typedoc/functions/echo.useQueue.html +1 -1
  82. package/typedoc/functions/echo.useSchema.html +1 -1
  83. package/typedoc/functions/echo.useSpace.html +1 -1
  84. package/typedoc/functions/echo.useSpaceInvitation.html +1 -1
  85. package/typedoc/functions/echo.useSpaceInvitations.html +1 -1
  86. package/typedoc/functions/echo.useSpaceSyncState.html +1 -1
  87. package/typedoc/functions/echo.useSpaces.html +1 -1
  88. package/typedoc/functions/echo.useSubscription.html +1 -1
  89. package/typedoc/functions/echo.useSyncState.html +1 -1
  90. package/typedoc/functions/halo.useContacts.html +1 -1
  91. package/typedoc/functions/halo.useCredentials.html +1 -1
  92. package/typedoc/functions/halo.useDevices.html +1 -1
  93. package/typedoc/functions/halo.useHaloInvitation.html +1 -1
  94. package/typedoc/functions/halo.useHaloInvitations.html +1 -1
  95. package/typedoc/functions/halo.useIdentity.html +1 -1
  96. package/typedoc/functions/halo.useKeyStore.html +1 -1
  97. package/typedoc/functions/index.AgentHostingProvider.html +1 -1
  98. package/typedoc/functions/index.useAgentHostingClient.html +1 -1
  99. package/typedoc/functions/index.useClient.html +1 -1
  100. package/typedoc/functions/index.useClientStatus.html +1 -1
  101. package/typedoc/functions/index.useConfig.html +1 -1
  102. package/typedoc/functions/index.useShell.html +1 -1
  103. package/typedoc/functions/index.useShellDisplay.html +1 -1
  104. package/typedoc/functions/index.useStatus.html +1 -1
  105. package/typedoc/functions/invitations.useInvitationStatus.html +1 -1
  106. package/typedoc/functions/mesh.useNetworkStatus.html +1 -1
  107. package/typedoc/hierarchy.html +1 -1
  108. package/typedoc/interfaces/devtools.DevtoolsHost.html +2 -2
  109. package/typedoc/interfaces/echo.EchoDatabase.html +15 -10
  110. package/typedoc/interfaces/echo.Expando.html +1 -1
  111. package/typedoc/interfaces/echo.HaloSpaceMember.html +4 -4
  112. package/typedoc/interfaces/echo.IndexKind.html +2 -2
  113. package/typedoc/interfaces/echo.QueryOptions.html +8 -8
  114. package/typedoc/interfaces/echo.Space.html +11 -14
  115. package/typedoc/interfaces/echo.SpaceMember.html +2 -2
  116. package/typedoc/interfaces/echo.SpaceSyncState.PeerState.html +6 -6
  117. package/typedoc/interfaces/echo.SpaceSyncState.html +2 -2
  118. package/typedoc/interfaces/echo.TypedObject.html +3 -3
  119. package/typedoc/interfaces/halo.Contact.html +3 -3
  120. package/typedoc/interfaces/halo.Credential.html +5 -5
  121. package/typedoc/interfaces/halo.Device.html +3 -3
  122. package/typedoc/interfaces/halo.Identity.html +4 -4
  123. package/typedoc/interfaces/index.AppContextRequest.html +6 -6
  124. package/typedoc/interfaces/index.InvitationUrlRequest.html +4 -4
  125. package/typedoc/interfaces/index.LayoutRequest.html +6 -6
  126. package/typedoc/interfaces/invitations.Invitation.html +20 -20
  127. package/typedoc/interfaces/mesh.GossipMessage.html +3 -3
  128. package/typedoc/interfaces/mesh.NetworkStatus.Signal.html +2 -2
  129. package/typedoc/interfaces/mesh.NetworkStatus.html +2 -2
  130. package/typedoc/modules/echo.html +1 -1
  131. package/typedoc/types/echo.Live.html +1 -1
  132. package/typedoc/types/echo.UseQueueOptions.html +2 -2
  133. package/typedoc/types/echo.UseSpacesParams.html +2 -2
  134. package/typedoc/types/index.AgentHostingProviderProps.html +2 -2
  135. package/typedoc/types/index.ClientContextProps.html +2 -2
  136. package/typedoc/types/index.ClientProviderProps.html +1 -1
  137. package/typedoc/types/invitations.InvitationAction.html +1 -1
  138. package/typedoc/types/invitations.InvitationResult.html +2 -2
  139. package/typedoc/types/invitations.InvitationStatus.html +2 -2
  140. package/typedoc/variables/echo.RefArray.html +1 -1
  141. package/typedoc/variables/echo.internalDecodeReference.html +2 -1
  142. package/typedoc/variables/echo.isLiveObject.html +3 -2
  143. package/typedoc/variables/echo.useQuery.html +1 -1
  144. package/typedoc/variables/index.AgentHostingContext.html +1 -1
  145. package/typedoc/variables/index.ClientProvider.html +1 -1
  146. package/typedoc/variables/index.DXOS_VERSION.html +1 -1
  147. package/vitest.config.ts +1 -1
  148. package/README.yml +0 -33
  149. package/dist/lib/node/chunk-5RUIFUEC.cjs +0 -334
  150. package/dist/lib/node/chunk-5RUIFUEC.cjs.map +0 -7
  151. package/dist/lib/node/chunk-FYOAVV65.cjs +0 -188
  152. package/dist/lib/node/chunk-FYOAVV65.cjs.map +0 -7
  153. package/dist/lib/node/devtools/index.cjs +0 -62
  154. package/dist/lib/node/devtools/index.cjs.map +0 -7
  155. package/dist/lib/node/echo/index.cjs +0 -302
  156. package/dist/lib/node/echo/index.cjs.map +0 -7
  157. package/dist/lib/node/halo/index.cjs +0 -123
  158. package/dist/lib/node/halo/index.cjs.map +0 -7
  159. package/dist/lib/node/index.cjs +0 -55
  160. package/dist/lib/node/index.cjs.map +0 -7
  161. package/dist/lib/node/invitations/index.cjs +0 -39
  162. package/dist/lib/node/invitations/index.cjs.map +0 -7
  163. package/dist/lib/node/mesh/index.cjs +0 -37
  164. package/dist/lib/node/mesh/index.cjs.map +0 -7
  165. package/dist/lib/node/meta.json +0 -1
  166. package/dist/lib/node/testing/index.cjs +0 -278
  167. package/dist/lib/node/testing/index.cjs.map +0 -7
  168. package/dist/lib/node/worker.cjs +0 -23
  169. package/dist/lib/node/worker.cjs.map +0 -7
  170. package/dist/types/src/playwright/playwright.config.d.cts.map +0 -1
  171. package/project.json +0 -40
  172. package/src/playwright/playwright.config.cts +0 -18
  173. package/typedoc/enums/echo.ResultFormat.html +0 -10
  174. package/typedoc/variables/echo.makeRef.html +0 -2
  175. package/typedoc/variables/echo.refFromDXN.html +0 -2
  176. /package/dist/lib/browser/{chunk-72QD3PXL.mjs.map → chunk-AAR7V3KL.mjs.map} +0 -0
  177. /package/dist/lib/browser/{chunk-AL2CUQ46.mjs.map → chunk-O5SEVDJG.mjs.map} +0 -0
  178. /package/dist/lib/node-esm/{chunk-UYJUBYMU.mjs.map → chunk-TU2JJLZK.mjs.map} +0 -0
  179. /package/dist/lib/node-esm/{chunk-NBTZZNQ5.mjs.map → chunk-ZTD6HPV2.mjs.map} +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DXOS_VERSION | @dxos/react-client</title><meta name="description" content="Documentation for @dxos/react-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@dxos/react-client</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/index.html">index</a></li><li><a href="" aria-current="page">DXOS_VERSION</a></li></ul><h1>Variable DXOS_VERSION<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">DXOS_VERSION</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;0.8.3&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in packages/sdk/client/dist/types/src/version.d.ts:1</li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@dxos/react-client</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DXOS_VERSION | @dxos/react-client</title><meta name="description" content="Documentation for @dxos/react-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@dxos/react-client</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/index.html">index</a></li><li><a href="" aria-current="page">DXOS_VERSION</a></li></ul><h1>Variable DXOS_VERSION<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">DXOS_VERSION</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;0.8.4-main.84f28bd&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in packages/sdk/client/dist/types/src/version.d.ts:1</li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@dxos/react-client</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
package/vitest.config.ts CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { defineConfig, mergeConfig } from 'vitest/config';
6
6
 
7
- import { baseConfig } from '../../../vitest.shared';
7
+ import { baseConfig } from '../../../vitest.base.config';
8
8
 
9
9
  // TODO(wittjosiah): Factor out to shared config as an option.
10
10
  const specifiedEnv = (process.env.VITEST_ENV ?? 'node').toLowerCase();
package/README.yml DELETED
@@ -1,33 +0,0 @@
1
- usage: |
2
- The snippet below illustrates a self-contained DXOS application that uses providers to create the client and instantiate a user profile.
3
-
4
- ```javascript
5
-
6
- import React from 'react';
7
- import { useClient, ClientProvider } from '@dxos/react-client';
8
- import { createRoot } from 'react-dom/client';
9
-
10
- const App = () => {
11
- const client = useClient();
12
- const space = useSpaces();
13
- return (
14
- <pre>{JSON.stringify(client.info())}</pre>
15
- );
16
- };
17
-
18
- const Root = () => (
19
- <ClientProvider>
20
- <App />
21
- </ClientProvider>
22
- );
23
-
24
- createRoot(document.getElementById('root')!)
25
- .render(<Root/>);
26
-
27
- ```
28
- storybooks:
29
- - "The [HALO Invitation Story](./stories/halo-invitations.stories.tsx) demonstrates multiple clients (devices) joining the same HALO. [Demo video](https://user-images.githubusercontent.com/3523355/137532718-a21f1f27-9854-4c0b-831a-e9ff92feac49.mov)."
30
- - "The [Space Invitation Story](./stories/space-invitations.stories.tsx) demonstrates multiple clients creating and sharing spaces. [Demo video](https://user-images.githubusercontent.com/3523355/137532717-e77395dc-96f9-4e4b-8f67-e6bd026a3abe.mov)."
31
- quickStartUrl: https://docs.dxos.org/guide/quick-start
32
- guideUrl: https://docs.dxos.org/guide/echo/react
33
- apiReferenceUrl: true
@@ -1,334 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_5RUIFUEC_exports = {};
30
- __export(chunk_5RUIFUEC_exports, {
31
- AgentHostingContext: () => AgentHostingContext,
32
- AgentHostingProvider: () => AgentHostingProvider,
33
- ClientContext: () => ClientContext,
34
- ClientProvider: () => ClientProvider,
35
- useAgentHostingClient: () => useAgentHostingClient,
36
- useClient: () => useClient,
37
- useClientStatus: () => useClientStatus,
38
- useConfig: () => useConfig,
39
- useShell: () => useShell,
40
- useShellDisplay: () => useShellDisplay,
41
- useStatus: () => useStatus
42
- });
43
- module.exports = __toCommonJS(chunk_5RUIFUEC_exports);
44
- var import_react = __toESM(require("react"));
45
- var import_client = require("@dxos/client");
46
- var import_log = require("@dxos/log");
47
- var import_react2 = __toESM(require("react"));
48
- var import_client2 = require("@dxos/client");
49
- var import_react3 = require("@dxos/echo-signals/react");
50
- var import_log2 = require("@dxos/log");
51
- var import_react_hooks = require("@dxos/react-hooks");
52
- var import_util = require("@dxos/util");
53
- var import_react4 = require("react");
54
- var import_react5 = require("react");
55
- var import_debug = require("@dxos/debug");
56
- var import_react6 = require("react");
57
- var import_react7 = require("react");
58
- var import_debug2 = require("@dxos/debug");
59
- var import_react8 = require("react");
60
- var import_react9 = require("react");
61
- var import_debug3 = require("@dxos/debug");
62
- var ClientContext = (0, import_react4.createContext)(void 0);
63
- var BANNER = (client) => {
64
- const commitHash = client.config.get("runtime.app.build.commitHash");
65
- const hash = commitHash ? ` App Commit ${commitHash}
66
- ` : "";
67
- return `
68
- _/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\______/\\/\\/\\/\\/\\_
69
- _/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__/\\/\\_________
70
- _/\\/\\____/\\/\\______/\\/\\______/\\/\\____/\\/\\____/\\/\\/\\/\\___
71
- _/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__________/\\/\\_
72
- _/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\/\\/\\/\\___
73
-
74
- DXOS Client ${client.version}
75
- ${hash}`;
76
- };
77
- var bannerPrinted = false;
78
- var printBanner = (client) => {
79
- if (bannerPrinted || window.location.hostname === "localhost") {
80
- return;
81
- }
82
- bannerPrinted = true;
83
- console.log(`%c${BANNER(client)}`, "font-family: monospace;");
84
- };
85
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/client/ClientProvider.tsx";
86
- var ClientProvider = /* @__PURE__ */ (0, import_react2.forwardRef)(({ children, config: configProvider, client: clientProvider, services: servicesProvider, status: controlledStatus, fallback: Fallback = () => null, signalsRuntime = true, noBanner, onInitialized, ...options }, forwardedRef) => {
87
- (0, import_react2.useEffect)(() => {
88
- signalsRuntime && (0, import_react3.registerSignalsRuntime)();
89
- }, []);
90
- const [error, setError] = (0, import_react2.useState)();
91
- if (error) {
92
- throw error;
93
- }
94
- const [client, setClient] = (0, import_react2.useState)(clientProvider instanceof import_client2.Client ? clientProvider : void 0);
95
- (0, import_react2.useImperativeHandle)(forwardedRef, () => client, [
96
- client
97
- ]);
98
- const [status, setStatus] = (0, import_react_hooks.useControlledState)(controlledStatus);
99
- (0, import_react2.useEffect)(() => {
100
- if (!client) {
101
- return;
102
- }
103
- const subscription = client.status.subscribe((status2) => setStatus(status2));
104
- return () => subscription.unsubscribe();
105
- }, [
106
- client
107
- ]);
108
- (0, import_react2.useEffect)(() => {
109
- let disposed = false;
110
- const initialize = async (client3) => {
111
- if (!client3.initialized) {
112
- await client3.initialize().catch((err) => {
113
- if (!disposed) {
114
- setError(err);
115
- }
116
- });
117
- (0, import_log2.log)("client ready", void 0, {
118
- F: __dxlog_file,
119
- L: 137,
120
- S: void 0,
121
- C: (f, a) => f(...a)
122
- });
123
- await onInitialized?.(client3);
124
- (0, import_log2.log)("initialization complete", void 0, {
125
- F: __dxlog_file,
126
- L: 139,
127
- S: void 0,
128
- C: (f, a) => f(...a)
129
- });
130
- }
131
- setClient(client3);
132
- if (!noBanner) {
133
- printBanner(client3);
134
- }
135
- };
136
- let client2;
137
- const t = setTimeout(async () => {
138
- try {
139
- if (clientProvider) {
140
- client2 = await (0, import_util.getAsyncProviderValue)(clientProvider);
141
- await initialize(client2);
142
- } else {
143
- const config = await (0, import_util.getAsyncProviderValue)(configProvider);
144
- (0, import_log2.log)("resolved config", {
145
- config
146
- }, {
147
- F: __dxlog_file,
148
- L: 159,
149
- S: void 0,
150
- C: (f, a) => f(...a)
151
- });
152
- const services = await (0, import_util.getAsyncProviderValue)(servicesProvider, config);
153
- (0, import_log2.log)("created services", {
154
- services
155
- }, {
156
- F: __dxlog_file,
157
- L: 161,
158
- S: void 0,
159
- C: (f, a) => f(...a)
160
- });
161
- client2 = new import_client2.Client({
162
- config,
163
- services,
164
- ...options
165
- });
166
- (0, import_log2.log)("created client", void 0, {
167
- F: __dxlog_file,
168
- L: 163,
169
- S: void 0,
170
- C: (f, a) => f(...a)
171
- });
172
- await initialize(client2);
173
- }
174
- } catch (err) {
175
- if (!disposed) {
176
- import_log2.log.catch(err, void 0, {
177
- F: __dxlog_file,
178
- L: 168,
179
- S: void 0,
180
- C: (f, a) => f(...a)
181
- });
182
- }
183
- }
184
- });
185
- return () => {
186
- (0, import_log2.log)("clean up", void 0, {
187
- F: __dxlog_file,
188
- L: 174,
189
- S: void 0,
190
- C: (f, a) => f(...a)
191
- });
192
- disposed = true;
193
- clearTimeout(t);
194
- if (!clientProvider) {
195
- void client2?.destroy().then(() => {
196
- (0, import_log2.log)("destroyed", void 0, {
197
- F: __dxlog_file,
198
- L: 182,
199
- S: void 0,
200
- C: (f, a) => f(...a)
201
- });
202
- }).catch((err) => import_log2.log.catch(err, void 0, {
203
- F: __dxlog_file,
204
- L: 184,
205
- S: void 0,
206
- C: (f, a) => f(...a)
207
- }));
208
- }
209
- };
210
- }, [
211
- configProvider,
212
- clientProvider,
213
- servicesProvider,
214
- noBanner
215
- ]);
216
- if (!client?.initialized || status !== import_client2.SystemStatus.ACTIVE) {
217
- return /* @__PURE__ */ import_react2.default.createElement(Fallback, {
218
- client,
219
- status
220
- });
221
- }
222
- return /* @__PURE__ */ import_react2.default.createElement(ClientContext.Provider, {
223
- value: {
224
- client,
225
- status
226
- }
227
- }, children);
228
- });
229
- var useClient = () => {
230
- const { client } = (0, import_react5.useContext)(ClientContext) ?? (0, import_debug.raise)(new Error("Missing ClientContext."));
231
- return client;
232
- };
233
- var useClientStatus = (client) => {
234
- const [status, setStatus] = (0, import_react6.useState)();
235
- (0, import_react6.useEffect)(() => {
236
- if (!client) {
237
- return;
238
- }
239
- const subscription = client.status.subscribe((status2) => setStatus(status2));
240
- return () => subscription.unsubscribe();
241
- }, [
242
- client,
243
- setStatus
244
- ]);
245
- return status;
246
- };
247
- var useConfig = () => {
248
- const { client } = (0, import_react7.useContext)(ClientContext) ?? (0, import_debug2.raise)(new Error("Missing ClientContext."));
249
- return client.config;
250
- };
251
- var useShell = () => {
252
- const client = useClient();
253
- return client.shell;
254
- };
255
- var useShellDisplay = () => {
256
- const client = useClient();
257
- const [display, setDisplay] = (0, import_react8.useState)(client.shell.display);
258
- (0, import_react8.useEffect)(() => client.shell.onDisplayChange(setDisplay), [
259
- client
260
- ]);
261
- return display;
262
- };
263
- var useStatus = () => {
264
- const { status } = (0, import_react9.useContext)(ClientContext) ?? (0, import_debug3.raise)(new Error("Missing ClientContext."));
265
- return status;
266
- };
267
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/client/AgentHostingProvider.tsx";
268
- var AgentHostingContext = /* @__PURE__ */ (0, import_react.createContext)(null);
269
- var AgentHostingProvider = (props) => {
270
- const client = useClient();
271
- const [agentHostingProviderClient] = (0, import_react.useState)(makeClient(client));
272
- return /* @__PURE__ */ import_react.default.createElement(AgentHostingContext.Provider, {
273
- value: agentHostingProviderClient
274
- }, " ", props.children);
275
- };
276
- var useAgentHostingClient = () => {
277
- return (0, import_react.useContext)(AgentHostingContext);
278
- };
279
- var makeClient = ({ config, halo }) => {
280
- const agentHostingConfig = config.get("runtime.services.agentHosting");
281
- if (!agentHostingConfig) {
282
- (0, import_log.log)("no agent hosting configured", void 0, {
283
- F: __dxlog_file2,
284
- L: 39,
285
- S: void 0,
286
- C: (f, a) => f(...a)
287
- });
288
- return null;
289
- }
290
- let agentHostingProviderClient = null;
291
- switch (agentHostingConfig.type) {
292
- case "LOCAL_TESTING": {
293
- (0, import_log.log)("using FakeAgentHostingProvider", void 0, {
294
- F: __dxlog_file2,
295
- L: 47,
296
- S: void 0,
297
- C: (f, a) => f(...a)
298
- });
299
- return new import_client.FakeAgentHostingProvider();
300
- }
301
- case "AGENTHOSTING_API": {
302
- agentHostingProviderClient = new import_client.AgentManagerClient(config, halo);
303
- if (agentHostingProviderClient.init()) {
304
- return agentHostingProviderClient;
305
- } else {
306
- return null;
307
- }
308
- }
309
- default: {
310
- import_log.log.error("Unknown agent hosting provider type: " + agentHostingConfig.type, void 0, {
311
- F: __dxlog_file2,
312
- L: 62,
313
- S: void 0,
314
- C: (f, a) => f(...a)
315
- });
316
- return null;
317
- }
318
- }
319
- };
320
- // Annotate the CommonJS export names for ESM import in node:
321
- 0 && (module.exports = {
322
- AgentHostingContext,
323
- AgentHostingProvider,
324
- ClientContext,
325
- ClientProvider,
326
- useAgentHostingClient,
327
- useClient,
328
- useClientStatus,
329
- useConfig,
330
- useShell,
331
- useShellDisplay,
332
- useStatus
333
- });
334
- //# sourceMappingURL=chunk-5RUIFUEC.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/client/AgentHostingProvider.tsx", "../../../src/client/ClientProvider.tsx", "../../../src/client/context.ts", "../../../src/banner.ts", "../../../src/client/useClient.ts", "../../../src/client/useClientStatus.ts", "../../../src/client/useConfig.ts", "../../../src/client/useShell.ts", "../../../src/client/useStatus.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { createContext, type PropsWithChildren, useContext, useState } from 'react';\n\nimport { type AgentHostingProviderClient, AgentManagerClient, FakeAgentHostingProvider } from '@dxos/client';\nimport { type Halo } from '@dxos/client/halo';\nimport { type Config } from '@dxos/config';\nimport { log } from '@dxos/log';\n\nimport { useClient } from '../client';\n\nexport type AgentHostingProviderProps = { config: Config; halo: Halo };\n\nexport const AgentHostingContext = createContext<AgentHostingProviderClient | null>(null);\n\n/**\n * Experimental agent hosting provider.\n * @param props\n * @constructor\n * @deprecated\n */\nexport const AgentHostingProvider = (props: PropsWithChildren) => {\n const client = useClient();\n const [agentHostingProviderClient] = useState(makeClient(client));\n return (\n <AgentHostingContext.Provider value={agentHostingProviderClient}> {props.children}</AgentHostingContext.Provider>\n );\n};\n\nexport const useAgentHostingClient = () => {\n return useContext(AgentHostingContext);\n};\n\nconst makeClient = ({ config, halo }: AgentHostingProviderProps) => {\n const agentHostingConfig = config.get('runtime.services.agentHosting');\n if (!agentHostingConfig) {\n log('no agent hosting configured');\n return null;\n }\n\n // TODO(nf): Dynamically discover based on runtime config.\n let agentHostingProviderClient: AgentHostingProviderClient | null = null;\n switch (agentHostingConfig.type) {\n case 'LOCAL_TESTING': {\n log('using FakeAgentHostingProvider');\n return new FakeAgentHostingProvider();\n }\n\n case 'AGENTHOSTING_API': {\n agentHostingProviderClient = new AgentManagerClient(config, halo);\n if (agentHostingProviderClient.init()) {\n return agentHostingProviderClient;\n } else {\n // Not authorized or error initializing.\n return null;\n }\n }\n\n default: {\n log.error('Unknown agent hosting provider type: ' + agentHostingConfig.type);\n return null;\n }\n }\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type FunctionComponent,\n type PropsWithChildren,\n useEffect,\n useImperativeHandle,\n useState,\n} from 'react';\n\nimport { Client, type ClientOptions, type ClientServicesProvider, SystemStatus } from '@dxos/client';\nimport { type Config } from '@dxos/config';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { useControlledState } from '@dxos/react-hooks';\nimport { getAsyncProviderValue, type MaybePromise, type Provider } from '@dxos/util';\n\nimport { ClientContext, type ClientContextProps } from './context';\nimport { printBanner } from '../banner';\n\n/**\n * Properties for the ClientProvider.\n */\nexport type ClientProviderProps = Omit<ClientOptions, 'config' | 'services'> &\n Pick<ClientContextProps, 'status'> &\n PropsWithChildren<{\n /**\n * Client object or async provider to enable to caller to do custom initialization.\n *\n * NOTE: For advanced use cases only.\n */\n client?: Client | Provider<Promise<Client>>;\n\n /**\n * Config object or async provider.\n *\n * NOTE: If a `client` is provided then `config` is ignored.\n */\n // TODO(burdon): Reconcile with ClientOptions.\n config?: Config | Provider<Promise<Config>>;\n\n /**\n * Callback to enable the caller to create a custom ClientServicesProvider.\n *\n * NOTE: If a `client` is provided then `services` is ignored.\n */\n // TODO(burdon): Reconcile with ClientOptions.\n services?: ClientServicesProvider | ((config?: Config) => MaybePromise<ClientServicesProvider>);\n\n /**\n * ReactNode to display until the client is available.\n */\n fallback?: FunctionComponent<Partial<ClientContextProps>>;\n\n /**\n * Enable (by default) registration of Preact signals runtime for reactive ECHO objects.\n * @see https://www.npmjs.com/package/@preact/signals-react\n */\n signalsRuntime?: boolean;\n\n /**\n * Skip the DXOS banner.\n */\n noBanner?: boolean;\n\n /**\n * Post initialization hook to enable to caller to do custom initialization.\n */\n onInitialized?: (client: Client) => MaybePromise<void>;\n }>;\n\n/**\n * Root component that provides the DXOS client instance to child components.\n * To be used with the `useClient` hook.\n */\nexport const ClientProvider = forwardRef<Client | undefined, ClientProviderProps>(\n (\n {\n children,\n config: configProvider,\n client: clientProvider,\n services: servicesProvider,\n status: controlledStatus,\n fallback: Fallback = () => null,\n signalsRuntime = true,\n noBanner,\n onInitialized,\n ...options\n },\n forwardedRef,\n ) => {\n useEffect(() => {\n // TODO(wittjosiah): Ideally this should be imported asynchronously because it is optional.\n // Unfortunately, async import seemed to break signals React instrumentation.\n signalsRuntime && registerSignalsRuntime();\n }, []);\n\n // The client is initialized asynchronously.\n // If an error occurs during initialization, it is caught and the state is set.\n // This allows the error to be thrown in the render method.\n // The assumption is that a client initialization error is fatal to the app.\n // This error will be caught by the nearest error boundary.\n const [error, setError] = useState();\n if (error) {\n throw error;\n }\n\n const [client, setClient] = useState(clientProvider instanceof Client ? clientProvider : undefined);\n\n // Provide external access.\n useImperativeHandle(forwardedRef, () => client, [client]);\n\n // Client status subscription.\n const [status, setStatus] = useControlledState(controlledStatus);\n useEffect(() => {\n if (!client) {\n return;\n }\n\n const subscription = client.status.subscribe((status) => setStatus(status));\n return () => subscription.unsubscribe();\n }, [client]);\n\n // Create and/or initialize client.\n useEffect(() => {\n let disposed = false;\n const initialize = async (client: Client) => {\n if (!client.initialized) {\n await client.initialize().catch((err) => {\n if (!disposed) {\n setError(err);\n }\n });\n log('client ready');\n await onInitialized?.(client);\n log('initialization complete');\n }\n\n setClient(client);\n\n if (!noBanner) {\n printBanner(client);\n }\n };\n\n let client: Client;\n const t = setTimeout(async () => {\n try {\n if (clientProvider) {\n // Asynchronously request client.\n client = await getAsyncProviderValue(clientProvider);\n await initialize(client);\n } else {\n // Asynchronously construct client (config may be undefined).\n const config = await getAsyncProviderValue(configProvider);\n log('resolved config', { config });\n const services = await getAsyncProviderValue(servicesProvider, config);\n log('created services', { services });\n client = new Client({ config, services, ...options });\n log('created client');\n await initialize(client);\n }\n } catch (err) {\n if (!disposed) {\n log.catch(err);\n }\n }\n });\n\n return () => {\n log('clean up');\n disposed = true;\n clearTimeout(t);\n // Only destroy if the client is not provided by the parent.\n if (!clientProvider) {\n void client\n ?.destroy()\n .then(() => {\n log('destroyed');\n })\n .catch((err) => log.catch(err));\n }\n };\n }, [configProvider, clientProvider, servicesProvider, noBanner]);\n\n if (!client?.initialized || status !== SystemStatus.ACTIVE) {\n return <Fallback client={client} status={status} />;\n }\n\n return <ClientContext.Provider value={{ client, status }}>{children}</ClientContext.Provider>;\n },\n);\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nimport { type Client, type SystemStatus } from '@dxos/client';\n\nexport type ClientContextProps = {\n client: Client;\n status?: SystemStatus | null;\n};\n\n/**\n * @internal Use ClientProvider to create or initialize the Client.\n */\nexport const ClientContext: Context<ClientContextProps | undefined> = createContext<ClientContextProps | undefined>(\n undefined,\n);\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport { type Client } from '@dxos/client';\n\n// http://patorjk.com/software/taag/#p=testall&f=Patorjk-HeX&t=DXOS\nconst BANNER = (client: Client) => {\n const commitHash = client.config.get('runtime.app.build.commitHash');\n const hash = commitHash ? ` App Commit ${commitHash} \\n` : '';\n\n return (\n '\\n' +\n '_/\\\\/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\______/\\\\/\\\\/\\\\/\\\\/\\\\_\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\__/\\\\/\\\\_________\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\______/\\\\/\\\\______/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\___\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\__________/\\\\/\\\\_\\n' +\n '_/\\\\/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\/\\\\___\\n' +\n `\\n DXOS Client ${client.version} \\n${hash}`\n );\n};\n\nlet bannerPrinted = false;\n\nexport const printBanner = (client: Client) => {\n if (bannerPrinted || window.location.hostname === 'localhost') {\n return;\n }\n\n bannerPrinted = true;\n // eslint-disable-next-line no-console\n console.log(`%c${BANNER(client)}`, 'font-family: monospace;');\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ClientContext } from '../client/context';\n\n/**\n * Hook returning instance of DXOS client.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useClient = () => {\n const { client } = useContext(ClientContext) ?? raise(new Error('Missing ClientContext.'));\n return client;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Client, type SystemStatus } from '@dxos/client';\n\nexport const useClientStatus = (client: Client) => {\n const [status, setStatus] = useState<SystemStatus | null>();\n useEffect(() => {\n if (!client) {\n return;\n }\n\n const subscription = client.status.subscribe((status) => setStatus(status));\n return () => subscription.unsubscribe();\n }, [client, setStatus]);\n\n return status;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ClientContext } from './context';\n\n/**\n * Hook returning config object used to initialize the DXOS client instance.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useConfig = () => {\n const { client } = useContext(ClientContext) ?? raise(new Error('Missing ClientContext.'));\n return client.config;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Shell, type ShellDisplay } from '@dxos/client';\n\nimport { useClient } from './useClient';\n\n/**\n * Helper hook to access the shell.\n */\nexport const useShell = (): Shell => {\n const client = useClient();\n return client.shell;\n};\n\n/**\n * Hook to access the shell’s display state.\n */\nexport const useShellDisplay = (): ShellDisplay => {\n const client = useClient();\n const [display, setDisplay] = useState(client.shell.display);\n useEffect(() => client.shell.onDisplayChange(setDisplay), [client]);\n return display;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { type SystemStatus } from '@dxos/client';\nimport { raise } from '@dxos/debug';\n\nimport { ClientContext } from './context';\n\nexport const useStatus = (): SystemStatus | null | undefined => {\n const { status } = useContext(ClientContext) ?? raise(new Error('Missing ClientContext.'));\n return status;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAmF;AAEnF,oBAA8F;AAG9F,iBAAoB;ACLpB,IAAAA,gBAOO;AAEP,IAAAC,iBAAsF;AAEtF,IAAAD,gBAAuC;AACvC,IAAAE,cAAoB;AACpB,yBAAmC;AACnC,kBAAwE;ACdxE,IAAAF,gBAA4C;AEA5C,IAAAA,gBAA2B;AAE3B,mBAAsB;ACFtB,IAAAA,gBAAoC;ACApC,IAAAA,gBAA2B;AAE3B,IAAAG,gBAAsB;ACFtB,IAAAH,gBAAoC;ACApC,IAAAA,gBAA2B;AAG3B,IAAAG,gBAAsB;ANSf,IAAMC,oBAAyDC,6BACpEC,MAAAA;ACVF,IAAMC,SAAS,CAACC,WAAAA;AACd,QAAMC,aAAaD,OAAOE,OAAOC,IAAI,8BAAA;AACrC,QAAMC,OAAOH,aAAa,eAAeA,UAAAA;IAAk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AAIC,MAAM,wBAAA,CAAA;AAChE,SAAOzC;AACT;;ARCO,IAAMmD,sBAAsB1E,iCAAAA,eAAiD,IAAA;AAQ7E,IAAM2E,uBAAuB,CAACC,UAAAA;AACnC,QAAMzE,SAAS0D,UAAAA;AACf,QAAM,CAACgB,0BAAAA,QAA8BzC,aAAAA,UAAS0C,WAAW3E,MAAAA,CAAAA;AACzD,SACEuD,6BAAAA,QAAA,cAACgB,oBAAoBf,UAAQ;IAACC,OAAOiB;KAA4B,KAAED,MAAM1D,QAAQ;AAErF;AAEO,IAAM6D,wBAAwB,MAAA;AACnC,aAAOjB,aAAAA,YAAWY,mBAAAA;AACpB;AAEA,IAAMI,aAAa,CAAC,EAAEzE,QAAQ2E,KAAI,MAA6B;AAC7D,QAAMC,qBAAqB5E,OAAOC,IAAI,+BAAA;AACtC,MAAI,CAAC2E,oBAAoB;AACvBlE,mBAAAA,KAAI,+BAAA,QAAA;;;;;;AACJ,WAAO;EACT;AAGA,MAAI8D,6BAAgE;AACpE,UAAQI,mBAAmBC,MAAI;IAC7B,KAAK,iBAAiB;AACpBnE,qBAAAA,KAAI,kCAAA,QAAA;;;;;;AACJ,aAAO,IAAIoE,uCAAAA;IACb;IAEA,KAAK,oBAAoB;AACvBN,mCAA6B,IAAIO,iCAAmB/E,QAAQ2E,IAAAA;AAC5D,UAAIH,2BAA2BQ,KAAI,GAAI;AACrC,eAAOR;MACT,OAAO;AAEL,eAAO;MACT;IACF;IAEA,SAAS;AACP9D,iBAAAA,IAAImB,MAAM,0CAA0C+C,mBAAmBC,MAAI,QAAA;;;;;;AAC3E,aAAO;IACT;EACF;AACF;",
6
- "names": ["import_react", "import_client", "import_log", "import_debug", "ClientContext", "createContext", "undefined", "BANNER", "client", "commitHash", "config", "get", "hash", "version", "bannerPrinted", "printBanner", "window", "location", "hostname", "console", "log", "ClientProvider", "forwardRef", "children", "configProvider", "clientProvider", "services", "servicesProvider", "status", "controlledStatus", "fallback", "Fallback", "signalsRuntime", "noBanner", "onInitialized", "options", "forwardedRef", "useEffect", "registerSignalsRuntime", "error", "setError", "useState", "setClient", "Client", "useImperativeHandle", "setStatus", "useControlledState", "subscription", "subscribe", "unsubscribe", "disposed", "initialize", "initialized", "catch", "err", "t", "setTimeout", "getAsyncProviderValue", "clearTimeout", "destroy", "then", "SystemStatus", "ACTIVE", "React", "Provider", "value", "useClient", "useContext", "raise", "Error", "useClientStatus", "useConfig", "useShell", "shell", "useShellDisplay", "display", "setDisplay", "onDisplayChange", "useStatus", "AgentHostingContext", "AgentHostingProvider", "props", "agentHostingProviderClient", "makeClient", "useAgentHostingClient", "halo", "agentHostingConfig", "type", "FakeAgentHostingProvider", "AgentManagerClient", "init"]
7
- }
@@ -1,188 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_FYOAVV65_exports = {};
20
- __export(chunk_FYOAVV65_exports, {
21
- AuthenticatingInvitationObservable: () => import_invitations.AuthenticatingInvitationObservable,
22
- CancellableInvitationObservable: () => import_invitations.CancellableInvitationObservable,
23
- Invitation: () => import_invitations.Invitation,
24
- InvitationEncoder: () => import_invitations.InvitationEncoder,
25
- InvitationsProxy: () => import_invitations.InvitationsProxy,
26
- useInvitationStatus: () => useInvitationStatus
27
- });
28
- module.exports = __toCommonJS(chunk_FYOAVV65_exports);
29
- var import_invitations = require("@dxos/client/invitations");
30
- var import_react = require("react");
31
- var import_invitations2 = require("@dxos/client/invitations");
32
- var import_log = require("@dxos/log");
33
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/invitations/useInvitationStatus.ts";
34
- var isShareableInvitation = (invitation) => invitation.authMethod !== import_invitations2.Invitation.AuthMethod.KNOWN_PUBLIC_KEY || invitation.guestKeypair?.privateKey;
35
- var useInvitationStatus = (observable) => {
36
- const [state, dispatch] = (0, import_react.useReducer)((prev, action) => {
37
- (0, import_log.log)("useInvitationStatus", {
38
- action
39
- }, {
40
- F: __dxlog_file,
41
- L: 90,
42
- S: void 0,
43
- C: (f, a) => f(...a)
44
- });
45
- const invitationProps = "invitation" in action ? {
46
- id: action.invitation.invitationId,
47
- multiUse: action.invitation.multiUse,
48
- invitationCode: import_invitations2.InvitationEncoder.encode(action.invitation),
49
- authCode: action.invitation.authCode,
50
- authMethod: action.invitation.authMethod,
51
- shareable: isShareableInvitation(action.invitation),
52
- type: action.invitation.type
53
- } : {};
54
- return {
55
- ...prev,
56
- ...invitationProps,
57
- // TODO(burdon): State.
58
- status: action.status,
59
- // `invitationObservable`, `secret`, and `result` is persisted between the status-actions that set them.
60
- result: action.status === import_invitations2.Invitation.State.SUCCESS ? action.result : prev.result,
61
- // `error` gets set each time we enter the error state
62
- ...action.status === import_invitations2.Invitation.State.ERROR && {
63
- error: action.error
64
- },
65
- // `haltedAt` gets set on only the first error/cancelled/timeout action and reset on any others.
66
- ...(action.status === import_invitations2.Invitation.State.ERROR || action.status === import_invitations2.Invitation.State.CANCELLED || action.status === import_invitations2.Invitation.State.TIMEOUT) && {
67
- haltedAt: typeof prev.haltedAt === "undefined" ? action.haltedAt : prev.haltedAt
68
- }
69
- };
70
- }, null, (_arg) => {
71
- const invitation = observable?.get();
72
- return {
73
- status: import_invitations2.Invitation.State.INIT,
74
- result: {
75
- spaceKey: null,
76
- identityKey: null,
77
- swarmKey: null,
78
- target: null
79
- },
80
- id: invitation?.invitationId,
81
- multiUse: invitation?.multiUse,
82
- invitationCode: invitation ? import_invitations2.InvitationEncoder.encode(invitation) : void 0,
83
- authCode: invitation?.authCode,
84
- authMethod: invitation?.authMethod,
85
- shareable: invitation ? isShareableInvitation(invitation) : false,
86
- type: invitation?.type
87
- };
88
- });
89
- (0, import_react.useEffect)(() => {
90
- const update = (invitation) => {
91
- switch (invitation.state) {
92
- case import_invitations2.Invitation.State.INIT:
93
- case import_invitations2.Invitation.State.CONNECTED:
94
- case import_invitations2.Invitation.State.READY_FOR_AUTHENTICATION:
95
- case import_invitations2.Invitation.State.AUTHENTICATING: {
96
- dispatch({
97
- invitation,
98
- status: invitation.state
99
- });
100
- break;
101
- }
102
- case import_invitations2.Invitation.State.SUCCESS: {
103
- dispatch({
104
- invitation,
105
- status: invitation.state,
106
- result: {
107
- spaceKey: invitation.spaceKey || null,
108
- identityKey: invitation.identityKey || null,
109
- swarmKey: invitation.swarmKey || null,
110
- target: invitation.target || null
111
- }
112
- });
113
- break;
114
- }
115
- case import_invitations2.Invitation.State.CANCELLED:
116
- case import_invitations2.Invitation.State.TIMEOUT: {
117
- dispatch({
118
- invitation,
119
- status: invitation.state,
120
- haltedAt: state.status
121
- });
122
- break;
123
- }
124
- }
125
- };
126
- const subscription = observable?.subscribe(update, (err) => {
127
- dispatch({
128
- status: import_invitations2.Invitation.State.ERROR,
129
- error: err,
130
- haltedAt: state.status
131
- });
132
- });
133
- const currentState = observable?.get();
134
- if (currentState) {
135
- update(currentState);
136
- }
137
- return () => subscription?.unsubscribe();
138
- }, [
139
- observable,
140
- state.status
141
- ]);
142
- const connect = (0, import_react.useCallback)((observable2) => {
143
- dispatch({
144
- invitation: observable2.get(),
145
- status: import_invitations2.Invitation.State.CONNECTING,
146
- observable: observable2
147
- });
148
- }, []);
149
- const authenticate = (0, import_react.useCallback)((authCode) => {
150
- (0, import_log.log)("authenticating...", {
151
- authCode
152
- }, {
153
- F: __dxlog_file,
154
- L: 195,
155
- S: void 0,
156
- C: (f, a) => f(...a)
157
- });
158
- return observable.authenticate(authCode);
159
- }, [
160
- observable
161
- ]);
162
- const cancel = (0, import_react.useCallback)(async () => observable?.cancel(), [
163
- observable
164
- ]);
165
- return (0, import_react.useMemo)(() => {
166
- return {
167
- ...state,
168
- cancel,
169
- connect,
170
- authenticate
171
- };
172
- }, [
173
- state,
174
- cancel,
175
- connect,
176
- authenticate
177
- ]);
178
- };
179
- // Annotate the CommonJS export names for ESM import in node:
180
- 0 && (module.exports = {
181
- AuthenticatingInvitationObservable,
182
- CancellableInvitationObservable,
183
- Invitation,
184
- InvitationEncoder,
185
- InvitationsProxy,
186
- useInvitationStatus
187
- });
188
- //# sourceMappingURL=chunk-FYOAVV65.cjs.map