@dxos/react-client 0.8.3 → 0.8.4-main.28f8d3d

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 (361) hide show
  1. package/.swc/plugins/v7_linux_x86_64_13.0.0/c614d7475354583212fbd7669acbae95b9832c305bf51bdaabe2e6de05abb6bf +0 -0
  2. package/dist/lib/browser/{chunk-AL2CUQ46.mjs → chunk-BXOLJYAY.mjs} +5 -5
  3. package/dist/lib/{node-esm/chunk-UYJUBYMU.mjs.map → browser/chunk-BXOLJYAY.mjs.map} +3 -3
  4. package/dist/lib/browser/{chunk-72QD3PXL.mjs → chunk-FQAPI3I4.mjs} +26 -26
  5. package/dist/lib/browser/chunk-FQAPI3I4.mjs.map +7 -0
  6. package/dist/lib/browser/devtools/index.mjs +6 -6
  7. package/dist/lib/browser/devtools/index.mjs.map +3 -3
  8. package/dist/lib/browser/echo/index.mjs +15 -15
  9. package/dist/lib/browser/echo/index.mjs.map +3 -3
  10. package/dist/lib/browser/halo/index.mjs +11 -9
  11. package/dist/lib/browser/halo/index.mjs.map +3 -3
  12. package/dist/lib/browser/index.mjs +2 -2
  13. package/dist/lib/browser/invitations/index.mjs +1 -1
  14. package/dist/lib/browser/mesh/index.mjs +3 -3
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/testing/index.mjs +11 -11
  17. package/dist/lib/browser/testing/index.mjs.map +3 -3
  18. package/dist/lib/browser/worker.mjs +1 -1
  19. package/dist/lib/node-esm/{chunk-UYJUBYMU.mjs → chunk-256IHY6F.mjs} +5 -5
  20. package/dist/lib/{browser/chunk-AL2CUQ46.mjs.map → node-esm/chunk-256IHY6F.mjs.map} +3 -3
  21. package/dist/lib/node-esm/{chunk-NBTZZNQ5.mjs → chunk-MNTJNI2M.mjs} +26 -26
  22. package/dist/lib/node-esm/chunk-MNTJNI2M.mjs.map +7 -0
  23. package/dist/lib/node-esm/devtools/index.mjs +6 -6
  24. package/dist/lib/node-esm/devtools/index.mjs.map +3 -3
  25. package/dist/lib/node-esm/echo/index.mjs +15 -15
  26. package/dist/lib/node-esm/echo/index.mjs.map +3 -3
  27. package/dist/lib/node-esm/halo/index.mjs +11 -9
  28. package/dist/lib/node-esm/halo/index.mjs.map +3 -3
  29. package/dist/lib/node-esm/index.mjs +2 -2
  30. package/dist/lib/node-esm/invitations/index.mjs +1 -1
  31. package/dist/lib/node-esm/mesh/index.mjs +3 -3
  32. package/dist/lib/node-esm/meta.json +1 -1
  33. package/dist/lib/node-esm/testing/index.mjs +11 -11
  34. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  35. package/dist/lib/node-esm/worker.mjs +1 -1
  36. package/dist/types/src/client/AgentHostingProvider.d.ts.map +1 -1
  37. package/dist/types/src/client/ClientProvider.d.ts.map +1 -1
  38. package/dist/types/src/echo/useSpaceInvitations.d.ts.map +1 -1
  39. package/dist/types/src/echo/useSyncState.d.ts +1 -1
  40. package/dist/types/src/echo/useSyncState.d.ts.map +1 -1
  41. package/dist/types/src/halo/Passkey.stories.d.ts.map +1 -1
  42. package/dist/types/src/halo/useHaloInvitations.d.ts.map +1 -1
  43. package/dist/types/src/playwright/{playwright.config.d.cts → playwright.config.d.ts} +1 -1
  44. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
  45. package/dist/types/src/testing/ClientRepeater.d.ts.map +1 -1
  46. package/dist/types/src/testing/ClientRepeater.stories.d.ts.map +1 -1
  47. package/dist/types/src/testing/withClientProvider.d.ts +1 -1
  48. package/dist/types/src/testing/withClientProvider.d.ts.map +1 -1
  49. package/dist/types/src/testing/withClientProvider.stories.d.ts.map +1 -1
  50. package/dist/types/tsconfig.tsbuildinfo +1 -1
  51. package/moon.yml +19 -0
  52. package/package.json +33 -25
  53. package/src/client/AgentHostingProvider.tsx +1 -1
  54. package/src/client/ClientProvider.test.tsx +3 -2
  55. package/src/client/ClientProvider.tsx +4 -3
  56. package/src/client/useConfig.test.tsx +2 -1
  57. package/src/devtools/useStream.ts +1 -1
  58. package/src/echo/useQuery.test.tsx +2 -1
  59. package/src/echo/useSpaceInvitations.ts +2 -1
  60. package/src/echo/useSpaces.test.tsx +2 -1
  61. package/src/echo/useSyncState.ts +3 -3
  62. package/src/halo/Passkey.stories.tsx +4 -3
  63. package/src/halo/useDevices.test.tsx +2 -1
  64. package/src/halo/useHaloInvitations.ts +1 -1
  65. package/src/invitations/useInvitationStatus.ts +1 -1
  66. package/src/playwright/playwright.config.ts +17 -0
  67. package/src/playwright/smoke.spec.ts +4 -6
  68. package/src/testing/ClientRepeater.stories.tsx +2 -1
  69. package/src/testing/ClientRepeater.tsx +3 -2
  70. package/src/testing/withClientProvider.stories.tsx +2 -1
  71. package/src/testing/withClientProvider.tsx +5 -4
  72. package/vitest.config.ts +1 -1
  73. package/.eslintrc.cjs +0 -12
  74. package/README.yml +0 -33
  75. package/dist/lib/browser/chunk-72QD3PXL.mjs.map +0 -7
  76. package/dist/lib/node/chunk-5RUIFUEC.cjs +0 -334
  77. package/dist/lib/node/chunk-5RUIFUEC.cjs.map +0 -7
  78. package/dist/lib/node/chunk-FYOAVV65.cjs +0 -188
  79. package/dist/lib/node/chunk-FYOAVV65.cjs.map +0 -7
  80. package/dist/lib/node/devtools/index.cjs +0 -62
  81. package/dist/lib/node/devtools/index.cjs.map +0 -7
  82. package/dist/lib/node/echo/index.cjs +0 -302
  83. package/dist/lib/node/echo/index.cjs.map +0 -7
  84. package/dist/lib/node/halo/index.cjs +0 -123
  85. package/dist/lib/node/halo/index.cjs.map +0 -7
  86. package/dist/lib/node/index.cjs +0 -55
  87. package/dist/lib/node/index.cjs.map +0 -7
  88. package/dist/lib/node/invitations/index.cjs +0 -39
  89. package/dist/lib/node/invitations/index.cjs.map +0 -7
  90. package/dist/lib/node/mesh/index.cjs +0 -37
  91. package/dist/lib/node/mesh/index.cjs.map +0 -7
  92. package/dist/lib/node/meta.json +0 -1
  93. package/dist/lib/node/testing/index.cjs +0 -278
  94. package/dist/lib/node/testing/index.cjs.map +0 -7
  95. package/dist/lib/node/worker.cjs +0 -23
  96. package/dist/lib/node/worker.cjs.map +0 -7
  97. package/dist/lib/node-esm/chunk-NBTZZNQ5.mjs.map +0 -7
  98. package/dist/types/src/playwright/playwright.config.d.cts.map +0 -1
  99. package/project.json +0 -40
  100. package/src/playwright/playwright.config.cts +0 -18
  101. package/typedoc/.nojekyll +0 -1
  102. package/typedoc/assets/hierarchy.js +0 -1
  103. package/typedoc/assets/highlight.css +0 -99
  104. package/typedoc/assets/icons.js +0 -18
  105. package/typedoc/assets/icons.svg +0 -1
  106. package/typedoc/assets/main.js +0 -60
  107. package/typedoc/assets/navigation.js +0 -1
  108. package/typedoc/assets/search.js +0 -1
  109. package/typedoc/assets/style.css +0 -1640
  110. package/typedoc/classes/echo.Hypergraph.html +0 -17
  111. package/typedoc/classes/echo.PropertiesType.html +0 -19
  112. package/typedoc/classes/echo.QueryResult.html +0 -18
  113. package/typedoc/classes/halo.KeyStore.html +0 -6
  114. package/typedoc/classes/index.AgentClientServiceProvider.html +0 -10
  115. package/typedoc/classes/index.AgentManagerClient.html +0 -22
  116. package/typedoc/classes/index.AlreadyJoinedError.html +0 -15
  117. package/typedoc/classes/index.ApiError.html +0 -16
  118. package/typedoc/classes/index.CancelledError.html +0 -16
  119. package/typedoc/classes/index.Client.html +0 -51
  120. package/typedoc/classes/index.ClientServicesProxy.html +0 -12
  121. package/typedoc/classes/index.Config.html +0 -17
  122. package/typedoc/classes/index.DataCorruptionError.html +0 -16
  123. package/typedoc/classes/index.DatabaseError.html +0 -15
  124. package/typedoc/classes/index.EntityNotFoundError.html +0 -15
  125. package/typedoc/classes/index.FakeAgentHostingProvider.html +0 -7
  126. package/typedoc/classes/index.IFrameManager.html +0 -6
  127. package/typedoc/classes/index.IdentityNotInitializedError.html +0 -15
  128. package/typedoc/classes/index.InvalidConfigError.html +0 -16
  129. package/typedoc/classes/index.InvalidInvitationError.html +0 -15
  130. package/typedoc/classes/index.InvalidInvitationExtensionRoleError.html +0 -16
  131. package/typedoc/classes/index.InvalidStorageVersionError.html +0 -15
  132. package/typedoc/classes/index.LocalClientServices.html +0 -12
  133. package/typedoc/classes/index.PublicKey.html +0 -55
  134. package/typedoc/classes/index.RemoteServiceConnectionError.html +0 -15
  135. package/typedoc/classes/index.RemoteServiceConnectionTimeout.html +0 -15
  136. package/typedoc/classes/index.RpcClosedError.html +0 -15
  137. package/typedoc/classes/index.RpcNotOpenError.html +0 -15
  138. package/typedoc/classes/index.SharedWorkerConnection.html +0 -5
  139. package/typedoc/classes/index.Shell.html +0 -35
  140. package/typedoc/classes/index.ShellManager.html +0 -9
  141. package/typedoc/classes/index.SystemError.html +0 -16
  142. package/typedoc/classes/index.UnknownModelError.html +0 -15
  143. package/typedoc/classes/index.WorkerClientServices.html +0 -12
  144. package/typedoc/classes/invitations.AuthenticatingInvitationObservable.html +0 -30
  145. package/typedoc/classes/invitations.CancellableInvitationObservable.html +0 -29
  146. package/typedoc/classes/invitations.InvitationEncoder.html +0 -5
  147. package/typedoc/classes/invitations.InvitationsProxy.html +0 -12
  148. package/typedoc/enums/devtools.KeyType.html +0 -9
  149. package/typedoc/enums/echo.HaloSpaceMember.Role.html +0 -9
  150. package/typedoc/enums/echo.IndexKind.Kind.html +0 -8
  151. package/typedoc/enums/echo.QueryOptions.DataLocation.html +0 -6
  152. package/typedoc/enums/echo.QueryOptions.ShowDeletedOption.html +0 -6
  153. package/typedoc/enums/echo.ResultFormat.html +0 -10
  154. package/typedoc/enums/echo.SpaceMember.PresenceState.html +0 -5
  155. package/typedoc/enums/echo.SpaceState.html +0 -13
  156. package/typedoc/enums/echo.TextKind.html +0 -5
  157. package/typedoc/enums/halo.Device.PresenceState.html +0 -6
  158. package/typedoc/enums/halo.DeviceKind.html +0 -5
  159. package/typedoc/enums/halo.DeviceType.html +0 -9
  160. package/typedoc/enums/index.ShellDisplay.html +0 -5
  161. package/typedoc/enums/index.ShellLayout.html +0 -13
  162. package/typedoc/enums/index.SystemStatus.html +0 -5
  163. package/typedoc/enums/invitations.Invitation.AuthMethod.html +0 -6
  164. package/typedoc/enums/invitations.Invitation.Kind.html +0 -5
  165. package/typedoc/enums/invitations.Invitation.State.html +0 -13
  166. package/typedoc/enums/invitations.Invitation.Type.html +0 -6
  167. package/typedoc/enums/mesh.ConnectionState.html +0 -5
  168. package/typedoc/functions/devtools.useDevtools.html +0 -1
  169. package/typedoc/functions/devtools.useStream.html +0 -2
  170. package/typedoc/functions/echo.useMembers.html +0 -1
  171. package/typedoc/functions/echo.useQueue.html +0 -2
  172. package/typedoc/functions/echo.useSchema.html +0 -2
  173. package/typedoc/functions/echo.useSpace.html +0 -6
  174. package/typedoc/functions/echo.useSpaceInvitation.html +0 -1
  175. package/typedoc/functions/echo.useSpaceInvitations.html +0 -1
  176. package/typedoc/functions/echo.useSpaceSyncState.html +0 -2
  177. package/typedoc/functions/echo.useSpaces.html +0 -5
  178. package/typedoc/functions/echo.useSubscription.html +0 -3
  179. package/typedoc/functions/echo.useSyncState.html +0 -2
  180. package/typedoc/functions/halo.useContacts.html +0 -4
  181. package/typedoc/functions/halo.useCredentials.html +0 -1
  182. package/typedoc/functions/halo.useDevices.html +0 -1
  183. package/typedoc/functions/halo.useHaloInvitation.html +0 -1
  184. package/typedoc/functions/halo.useHaloInvitations.html +0 -1
  185. package/typedoc/functions/halo.useIdentity.html +0 -3
  186. package/typedoc/functions/halo.useKeyStore.html +0 -3
  187. package/typedoc/functions/index.AgentHostingProvider.html +0 -2
  188. package/typedoc/functions/index.useAgentHostingClient.html +0 -1
  189. package/typedoc/functions/index.useClient.html +0 -3
  190. package/typedoc/functions/index.useClientStatus.html +0 -1
  191. package/typedoc/functions/index.useConfig.html +0 -3
  192. package/typedoc/functions/index.useShell.html +0 -2
  193. package/typedoc/functions/index.useShellDisplay.html +0 -2
  194. package/typedoc/functions/index.useStatus.html +0 -1
  195. package/typedoc/functions/invitations.useInvitationStatus.html +0 -1
  196. package/typedoc/functions/mesh.useNetworkStatus.html +0 -2
  197. package/typedoc/hierarchy.html +0 -1
  198. package/typedoc/index.html +0 -23
  199. package/typedoc/interfaces/devtools.DevtoolsHook.html +0 -22
  200. package/typedoc/interfaces/devtools.DevtoolsHost.html +0 -26
  201. package/typedoc/interfaces/echo.DocAccessor.html +0 -3
  202. package/typedoc/interfaces/echo.Echo.html +0 -39
  203. package/typedoc/interfaces/echo.EchoDatabase.html +0 -25
  204. package/typedoc/interfaces/echo.Expando.html +0 -3
  205. package/typedoc/interfaces/echo.Filter.html +0 -3
  206. package/typedoc/interfaces/echo.HaloSpaceMember.html +0 -18
  207. package/typedoc/interfaces/echo.IDocHandle.html +0 -6
  208. package/typedoc/interfaces/echo.IndexKind.html +0 -9
  209. package/typedoc/interfaces/echo.Query.html +0 -34
  210. package/typedoc/interfaces/echo.QueryOptions.html +0 -39
  211. package/typedoc/interfaces/echo.Queue.html +0 -17
  212. package/typedoc/interfaces/echo.Ref.html +0 -32
  213. package/typedoc/interfaces/echo.Space.html +0 -39
  214. package/typedoc/interfaces/echo.SpaceMember.html +0 -7
  215. package/typedoc/interfaces/echo.SpaceSyncState.PeerState.html +0 -14
  216. package/typedoc/interfaces/echo.SpaceSyncState.html +0 -4
  217. package/typedoc/interfaces/echo.SubscriptionHandle.html +0 -5
  218. package/typedoc/interfaces/echo.TypedObject.html +0 -16
  219. package/typedoc/interfaces/halo.Contact.html +0 -10
  220. package/typedoc/interfaces/halo.Credential.html +0 -27
  221. package/typedoc/interfaces/halo.Device.html +0 -11
  222. package/typedoc/interfaces/halo.Halo.html +0 -16
  223. package/typedoc/interfaces/halo.Identity.html +0 -15
  224. package/typedoc/interfaces/index.AgentHostingProviderClient.html +0 -6
  225. package/typedoc/interfaces/index.AppContextRequest.html +0 -33
  226. package/typedoc/interfaces/index.ClientServicesProvider.html +0 -9
  227. package/typedoc/interfaces/index.InvitationUrlRequest.html +0 -9
  228. package/typedoc/interfaces/index.LayoutRequest.html +0 -29
  229. package/typedoc/interfaces/index.ShellRuntime.html +0 -15
  230. package/typedoc/interfaces/invitations.Invitation.html +0 -92
  231. package/typedoc/interfaces/invitations.Invitations.html +0 -5
  232. package/typedoc/interfaces/mesh.GossipMessage.html +0 -10
  233. package/typedoc/interfaces/mesh.NetworkStatus.Signal.html +0 -5
  234. package/typedoc/interfaces/mesh.NetworkStatus.html +0 -6
  235. package/typedoc/media/LICENSE +0 -8
  236. package/typedoc/modules/devtools.html +0 -1
  237. package/typedoc/modules/echo.Filter.html +0 -1
  238. package/typedoc/modules/echo.HaloSpaceMember.html +0 -1
  239. package/typedoc/modules/echo.IndexKind.html +0 -1
  240. package/typedoc/modules/echo.Query.html +0 -1
  241. package/typedoc/modules/echo.QueryOptions.html +0 -1
  242. package/typedoc/modules/echo.Ref.html +0 -2
  243. package/typedoc/modules/echo.SpaceMember.html +0 -1
  244. package/typedoc/modules/echo.SpaceSyncState.html +0 -1
  245. package/typedoc/modules/echo.html +0 -1
  246. package/typedoc/modules/halo.Device.html +0 -1
  247. package/typedoc/modules/halo.html +0 -1
  248. package/typedoc/modules/index.html +0 -1
  249. package/typedoc/modules/invitations.Invitation.html +0 -1
  250. package/typedoc/modules/invitations.html +0 -1
  251. package/typedoc/modules/mesh.NetworkStatus.html +0 -1
  252. package/typedoc/modules/mesh.html +0 -1
  253. package/typedoc/modules/worker.html +0 -1
  254. package/typedoc/modules.html +0 -1
  255. package/typedoc/types/devtools.MountOptions.html +0 -3
  256. package/typedoc/types/echo.AnyLiveObject.html +0 -2
  257. package/typedoc/types/echo.Filter.And.html +0 -1
  258. package/typedoc/types/echo.Filter.Any.html +0 -1
  259. package/typedoc/types/echo.Filter.Or.html +0 -1
  260. package/typedoc/types/echo.Filter.Props.html +0 -1
  261. package/typedoc/types/echo.Filter.Type.html +0 -1
  262. package/typedoc/types/echo.Live.html +0 -5
  263. package/typedoc/types/echo.ObjectMeta.html +0 -1
  264. package/typedoc/types/echo.ObjectMigration.html +0 -7
  265. package/typedoc/types/echo.ObjectVersion.html +0 -2
  266. package/typedoc/types/echo.PeerSyncState.html +0 -1
  267. package/typedoc/types/echo.Progress.html +0 -3
  268. package/typedoc/types/echo.PropertiesTypeProps.html +0 -1
  269. package/typedoc/types/echo.Query.Any.html +0 -1
  270. package/typedoc/types/echo.Query.TextSearchOptions.html +0 -2
  271. package/typedoc/types/echo.Query.Type.html +0 -1
  272. package/typedoc/types/echo.Ref.Target.html +0 -2
  273. package/typedoc/types/echo.Selection.html +0 -1
  274. package/typedoc/types/echo.SpaceId.html +0 -6
  275. package/typedoc/types/echo.SpaceSyncStateMap.html +0 -1
  276. package/typedoc/types/echo.UseQueueOptions.html +0 -2
  277. package/typedoc/types/echo.UseSpacesParams.html +0 -3
  278. package/typedoc/types/index.AgentHostingProviderProps.html +0 -3
  279. package/typedoc/types/index.ClientContextProps.html +0 -3
  280. package/typedoc/types/index.ClientOptions.html +0 -12
  281. package/typedoc/types/index.ClientProviderProps.html +0 -2
  282. package/typedoc/types/index.ClientServices.html +0 -15
  283. package/typedoc/types/index.FromAgentOptions.html +0 -2
  284. package/typedoc/types/index.PublicKeyLike.html +0 -2
  285. package/typedoc/types/invitations.InvitationAction.html +0 -1
  286. package/typedoc/types/invitations.InvitationResult.html +0 -5
  287. package/typedoc/types/invitations.InvitationStatus.html +0 -15
  288. package/typedoc/variables/devtools.mountDevtoolsHooks.html +0 -1
  289. package/typedoc/variables/devtools.unmountDevtoolsHooks.html +0 -1
  290. package/typedoc/variables/echo.DocAccessor.html +0 -1
  291. package/typedoc/variables/echo.EchoObjectSchema.html +0 -1
  292. package/typedoc/variables/echo.Expando.html +0 -1
  293. package/typedoc/variables/echo.FQ_ID_LENGTH.html +0 -1
  294. package/typedoc/variables/echo.Filter.html +0 -1
  295. package/typedoc/variables/echo.OBJECT_ID_LENGTH.html +0 -1
  296. package/typedoc/variables/echo.ObjectVersion.html +0 -1
  297. package/typedoc/variables/echo.Query.html +0 -1
  298. package/typedoc/variables/echo.Queue.html +0 -1
  299. package/typedoc/variables/echo.ReactiveObjectSchema.html +0 -1
  300. package/typedoc/variables/echo.Ref.html +0 -2
  301. package/typedoc/variables/echo.RefArray.html +0 -2
  302. package/typedoc/variables/echo.SPACE_ID_LENGTH.html +0 -1
  303. package/typedoc/variables/echo.SpaceId.html +0 -1
  304. package/typedoc/variables/echo.SpaceSchema.html +0 -1
  305. package/typedoc/variables/echo.TypedObject.html +0 -3
  306. package/typedoc/variables/echo.compareForeignKeys.html +0 -1
  307. package/typedoc/variables/echo.createDocAccessor.html +0 -1
  308. package/typedoc/variables/echo.createEmptyEdgeSyncState.html +0 -1
  309. package/typedoc/variables/echo.createObject.html +0 -1
  310. package/typedoc/variables/echo.createQueueDXN.html +0 -2
  311. package/typedoc/variables/echo.createSubscription.html +0 -5
  312. package/typedoc/variables/echo.defineObjectMigration.html +0 -1
  313. package/typedoc/variables/echo.fromCursor.html +0 -1
  314. package/typedoc/variables/echo.fullyQualifiedId.html +0 -4
  315. package/typedoc/variables/echo.getMeta.html +0 -1
  316. package/typedoc/variables/echo.getObjectCore.html +0 -1
  317. package/typedoc/variables/echo.getRangeFromCursor.html +0 -1
  318. package/typedoc/variables/echo.getSchema.html +0 -2
  319. package/typedoc/variables/echo.getSource.html +0 -4
  320. package/typedoc/variables/echo.getSpace.html +0 -1
  321. package/typedoc/variables/echo.getSyncSummary.html +0 -1
  322. package/typedoc/variables/echo.getTarget.html +0 -4
  323. package/typedoc/variables/echo.getTextInRange.html +0 -2
  324. package/typedoc/variables/echo.getType.html +0 -5
  325. package/typedoc/variables/echo.getTypename.html +0 -6
  326. package/typedoc/variables/echo.getVersion.html +0 -3
  327. package/typedoc/variables/echo.importSpace.html +0 -1
  328. package/typedoc/variables/echo.internalDecodeReference.html +0 -1
  329. package/typedoc/variables/echo.isEchoObject.html +0 -2
  330. package/typedoc/variables/echo.isLiveObject.html +0 -2
  331. package/typedoc/variables/echo.isRelation.html +0 -2
  332. package/typedoc/variables/echo.isSpace.html +0 -1
  333. package/typedoc/variables/echo.live.html +0 -3
  334. package/typedoc/variables/echo.loadObjectReferences.html +0 -7
  335. package/typedoc/variables/echo.makeRef.html +0 -2
  336. package/typedoc/variables/echo.parseFullyQualifiedId.html +0 -2
  337. package/typedoc/variables/echo.parseId.html +0 -1
  338. package/typedoc/variables/echo.refFromDXN.html +0 -2
  339. package/typedoc/variables/echo.toCursor.html +0 -1
  340. package/typedoc/variables/echo.toCursorRange.html +0 -1
  341. package/typedoc/variables/echo.updateText.html +0 -6
  342. package/typedoc/variables/echo.useQuery.html +0 -2
  343. package/typedoc/variables/index.AgentHostingContext.html +0 -1
  344. package/typedoc/variables/index.ClientProvider.html +0 -3
  345. package/typedoc/variables/index.DXOS_VERSION.html +0 -1
  346. package/typedoc/variables/index.Defaults.html +0 -2
  347. package/typedoc/variables/index.Dynamics.html +0 -2
  348. package/typedoc/variables/index.Envs.html +0 -2
  349. package/typedoc/variables/index.Local.html +0 -2
  350. package/typedoc/variables/index.Remote.html +0 -1
  351. package/typedoc/variables/index.Storage.html +0 -2
  352. package/typedoc/variables/index.createClientServices.html +0 -4
  353. package/typedoc/variables/index.fromAgent.html +0 -2
  354. package/typedoc/variables/index.fromHost.html +0 -2
  355. package/typedoc/variables/index.fromSocket.html +0 -2
  356. package/typedoc/variables/index.fromWorker.html +0 -2
  357. package/typedoc/variables/index.getUnixSocket.html +0 -1
  358. package/typedoc/variables/index.resolveRef.html +0 -1
  359. package/typedoc/variables/index.useMulticastObservable.html +0 -3
  360. package/typedoc/variables/worker.getWorkerServiceHost.html +0 -1
  361. package/typedoc/variables/worker.onconnect.html +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/invitations/index.ts", "../../../src/invitations/useInvitationStatus.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n AuthenticatingInvitationObservable,\n CancellableInvitationObservable,\n InvitationEncoder,\n Invitation,\n type Invitations,\n InvitationsProxy,\n} from '@dxos/client/invitations';\n\nexport * from './useInvitationStatus';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useReducer, type Reducer, useMemo, useCallback, useEffect } from 'react';\n\nimport { type PublicKey } from '@dxos/client';\nimport {\n type AuthenticatingInvitationObservable,\n type CancellableInvitationObservable,\n Invitation,\n InvitationEncoder,\n} from '@dxos/client/invitations';\nimport { log } from '@dxos/log';\n\nexport type InvitationResult = {\n spaceKey: PublicKey | null;\n identityKey: PublicKey | null;\n swarmKey: PublicKey | null;\n target: string | null;\n};\n\ninterface InvitationReducerState {\n status: Invitation.State; // TODO(burdon): Rename state.\n haltedAt?: Invitation.State;\n result: InvitationResult;\n error?: number;\n id?: string;\n multiUse?: boolean;\n invitationCode?: string;\n authCode?: string;\n authMethod?: Invitation.AuthMethod;\n type?: Invitation.Type;\n}\n\ntype InvitationPayload = { invitation: Invitation };\n\nexport type InvitationAction =\n | ({\n status:\n | Invitation.State.INIT\n | Invitation.State.CONNECTED\n | Invitation.State.READY_FOR_AUTHENTICATION\n | Invitation.State.AUTHENTICATING;\n } & InvitationPayload)\n | ({\n status: Invitation.State.CONNECTING;\n observable: CancellableInvitationObservable;\n } & InvitationPayload)\n | ({\n status: Invitation.State.SUCCESS;\n result: InvitationResult;\n } & InvitationPayload)\n | ({\n status: Invitation.State.CANCELLED | Invitation.State.TIMEOUT;\n haltedAt: Invitation.State;\n } & InvitationPayload)\n | {\n status: Invitation.State.ERROR;\n error?: Error;\n haltedAt: Invitation.State;\n };\n\nexport type InvitationStatus = {\n id?: string;\n invitationCode?: string;\n authCode?: string;\n authMethod?: Invitation.AuthMethod;\n type?: Invitation.Type;\n status: Invitation.State;\n haltedAt?: Invitation.State;\n multiUse?: boolean;\n shareable?: boolean;\n result: InvitationResult;\n error?: number;\n cancel(): void;\n // TODO(wittjosiah): Remove?\n connect(observable: CancellableInvitationObservable): void;\n authenticate(authCode: string): Promise<void>;\n};\n\n// Without private key, the invitation code cannot be created.\n// These invitations are only available to be accepted but not shared.\nconst isShareableInvitation = (invitation: Invitation) =>\n invitation.authMethod !== Invitation.AuthMethod.KNOWN_PUBLIC_KEY || invitation.guestKeypair?.privateKey;\n\nexport const useInvitationStatus = (observable?: CancellableInvitationObservable): InvitationStatus => {\n const [state, dispatch] = useReducer<Reducer<InvitationReducerState, InvitationAction>, null>(\n (prev, action) => {\n log('useInvitationStatus', { action });\n const invitationProps =\n 'invitation' in action\n ? {\n id: action.invitation.invitationId,\n multiUse: action.invitation.multiUse,\n invitationCode: InvitationEncoder.encode(action.invitation),\n authCode: action.invitation.authCode,\n authMethod: action.invitation.authMethod,\n shareable: isShareableInvitation(action.invitation),\n type: action.invitation.type,\n }\n : {};\n return {\n ...prev,\n ...invitationProps,\n // TODO(burdon): State.\n status: action.status,\n // `invitationObservable`, `secret`, and `result` is persisted between the status-actions that set them.\n result: action.status === Invitation.State.SUCCESS ? action.result : prev.result,\n // `error` gets set each time we enter the error state\n ...(action.status === Invitation.State.ERROR && { error: action.error }),\n // `haltedAt` gets set on only the first error/cancelled/timeout action and reset on any others.\n ...((action.status === Invitation.State.ERROR ||\n action.status === Invitation.State.CANCELLED ||\n action.status === Invitation.State.TIMEOUT) && {\n haltedAt: typeof prev.haltedAt === 'undefined' ? action.haltedAt : prev.haltedAt,\n }),\n } as InvitationReducerState;\n },\n null,\n (_arg: null) => {\n const invitation = observable?.get();\n return {\n status: Invitation.State.INIT,\n result: { spaceKey: null, identityKey: null, swarmKey: null, target: null },\n id: invitation?.invitationId,\n multiUse: invitation?.multiUse,\n invitationCode: invitation ? InvitationEncoder.encode(invitation) : undefined,\n authCode: invitation?.authCode,\n authMethod: invitation?.authMethod,\n shareable: invitation ? isShareableInvitation(invitation) : false,\n type: invitation?.type,\n };\n },\n );\n\n // Handle unmount.\n\n useEffect(() => {\n const update = (invitation: Invitation) => {\n switch (invitation.state) {\n case Invitation.State.INIT:\n case Invitation.State.CONNECTED:\n case Invitation.State.READY_FOR_AUTHENTICATION:\n case Invitation.State.AUTHENTICATING: {\n dispatch({\n invitation,\n status: invitation.state,\n });\n break;\n }\n\n case Invitation.State.SUCCESS: {\n dispatch({\n invitation,\n status: invitation.state,\n result: {\n spaceKey: invitation.spaceKey || null,\n identityKey: invitation.identityKey || null,\n swarmKey: invitation.swarmKey || null,\n target: invitation.target || null,\n },\n });\n break;\n }\n\n case Invitation.State.CANCELLED:\n case Invitation.State.TIMEOUT: {\n dispatch({ invitation, status: invitation.state, haltedAt: state.status });\n break;\n }\n }\n };\n\n const subscription = observable?.subscribe(update, (err: Error) => {\n dispatch({ status: Invitation.State.ERROR, error: err, haltedAt: state.status });\n });\n\n const currentState = observable?.get();\n if (currentState) {\n update(currentState);\n }\n\n return () => subscription?.unsubscribe();\n }, [observable, state.status]);\n\n // Return memoized callbacks & values.\n\n const connect = useCallback((observable: CancellableInvitationObservable) => {\n dispatch({ invitation: observable.get(), status: Invitation.State.CONNECTING, observable });\n }, []);\n\n const authenticate = useCallback(\n (authCode: string) => {\n log('authenticating...', { authCode });\n return (observable as AuthenticatingInvitationObservable).authenticate(authCode);\n },\n [observable],\n );\n\n const cancel = useCallback(async () => observable?.cancel(), [observable]);\n\n return useMemo(() => {\n return {\n ...state,\n cancel,\n connect,\n authenticate,\n };\n }, [state, cancel, connect, authenticate]);\n};\n"],
5
- "mappings": ";AAKA,SACEA,oCACAC,iCACAC,qBAAAA,oBACAC,cAAAA,aAEAC,wBACK;;;ACRP,SAASC,YAA0BC,SAASC,aAAaC,iBAAiB;AAG1E,SAGEC,YACAC,yBACK;AACP,SAASC,WAAW;;AAsEpB,IAAMC,wBAAwB,CAACC,eAC7BA,WAAWC,eAAeL,WAAWM,WAAWC,oBAAoBH,WAAWI,cAAcC;AAExF,IAAMC,sBAAsB,CAACC,eAAAA;AAClC,QAAM,CAACC,OAAOC,QAAAA,IAAYjB,WACxB,CAACkB,MAAMC,WAAAA;AACLb,QAAI,uBAAuB;MAAEa;IAAO,GAAA;;;;;;AACpC,UAAMC,kBACJ,gBAAgBD,SACZ;MACEE,IAAIF,OAA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Ya,YAAY2C,OAAAA,GAAU;IAAC3C;GAAW;AAEzE,SAAOd,QAAQ,MAAA;AACb,WAAO;MACL,GAAGe;MACH0C;MACAH;MACAE;IACF;EACF,GAAG;IAACzC;IAAO0C;IAAQH;IAASE;GAAa;AAC3C;",
6
- "names": ["AuthenticatingInvitationObservable", "CancellableInvitationObservable", "InvitationEncoder", "Invitation", "InvitationsProxy", "useReducer", "useMemo", "useCallback", "useEffect", "Invitation", "InvitationEncoder", "log", "isShareableInvitation", "invitation", "authMethod", "AuthMethod", "KNOWN_PUBLIC_KEY", "guestKeypair", "privateKey", "useInvitationStatus", "observable", "state", "dispatch", "prev", "action", "invitationProps", "id", "invitationId", "multiUse", "invitationCode", "encode", "authCode", "shareable", "type", "status", "result", "State", "SUCCESS", "ERROR", "error", "CANCELLED", "TIMEOUT", "haltedAt", "_arg", "get", "INIT", "spaceKey", "identityKey", "swarmKey", "target", "undefined", "update", "CONNECTED", "READY_FOR_AUTHENTICATION", "AUTHENTICATING", "subscription", "subscribe", "err", "currentState", "unsubscribe", "connect", "CONNECTING", "authenticate", "cancel"]
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n AuthenticatingInvitationObservable,\n CancellableInvitationObservable,\n InvitationEncoder,\n Invitation,\n type Invitations,\n InvitationsProxy,\n} from '@dxos/client/invitations';\n\nexport * from './useInvitationStatus';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Reducer, useCallback, useEffect, useMemo, useReducer } from 'react';\n\nimport { type PublicKey } from '@dxos/client';\nimport {\n type AuthenticatingInvitationObservable,\n type CancellableInvitationObservable,\n Invitation,\n InvitationEncoder,\n} from '@dxos/client/invitations';\nimport { log } from '@dxos/log';\n\nexport type InvitationResult = {\n spaceKey: PublicKey | null;\n identityKey: PublicKey | null;\n swarmKey: PublicKey | null;\n target: string | null;\n};\n\ninterface InvitationReducerState {\n status: Invitation.State; // TODO(burdon): Rename state.\n haltedAt?: Invitation.State;\n result: InvitationResult;\n error?: number;\n id?: string;\n multiUse?: boolean;\n invitationCode?: string;\n authCode?: string;\n authMethod?: Invitation.AuthMethod;\n type?: Invitation.Type;\n}\n\ntype InvitationPayload = { invitation: Invitation };\n\nexport type InvitationAction =\n | ({\n status:\n | Invitation.State.INIT\n | Invitation.State.CONNECTED\n | Invitation.State.READY_FOR_AUTHENTICATION\n | Invitation.State.AUTHENTICATING;\n } & InvitationPayload)\n | ({\n status: Invitation.State.CONNECTING;\n observable: CancellableInvitationObservable;\n } & InvitationPayload)\n | ({\n status: Invitation.State.SUCCESS;\n result: InvitationResult;\n } & InvitationPayload)\n | ({\n status: Invitation.State.CANCELLED | Invitation.State.TIMEOUT;\n haltedAt: Invitation.State;\n } & InvitationPayload)\n | {\n status: Invitation.State.ERROR;\n error?: Error;\n haltedAt: Invitation.State;\n };\n\nexport type InvitationStatus = {\n id?: string;\n invitationCode?: string;\n authCode?: string;\n authMethod?: Invitation.AuthMethod;\n type?: Invitation.Type;\n status: Invitation.State;\n haltedAt?: Invitation.State;\n multiUse?: boolean;\n shareable?: boolean;\n result: InvitationResult;\n error?: number;\n cancel(): void;\n // TODO(wittjosiah): Remove?\n connect(observable: CancellableInvitationObservable): void;\n authenticate(authCode: string): Promise<void>;\n};\n\n// Without private key, the invitation code cannot be created.\n// These invitations are only available to be accepted but not shared.\nconst isShareableInvitation = (invitation: Invitation) =>\n invitation.authMethod !== Invitation.AuthMethod.KNOWN_PUBLIC_KEY || invitation.guestKeypair?.privateKey;\n\nexport const useInvitationStatus = (observable?: CancellableInvitationObservable): InvitationStatus => {\n const [state, dispatch] = useReducer<Reducer<InvitationReducerState, InvitationAction>, null>(\n (prev, action) => {\n log('useInvitationStatus', { action });\n const invitationProps =\n 'invitation' in action\n ? {\n id: action.invitation.invitationId,\n multiUse: action.invitation.multiUse,\n invitationCode: InvitationEncoder.encode(action.invitation),\n authCode: action.invitation.authCode,\n authMethod: action.invitation.authMethod,\n shareable: isShareableInvitation(action.invitation),\n type: action.invitation.type,\n }\n : {};\n return {\n ...prev,\n ...invitationProps,\n // TODO(burdon): State.\n status: action.status,\n // `invitationObservable`, `secret`, and `result` is persisted between the status-actions that set them.\n result: action.status === Invitation.State.SUCCESS ? action.result : prev.result,\n // `error` gets set each time we enter the error state\n ...(action.status === Invitation.State.ERROR && { error: action.error }),\n // `haltedAt` gets set on only the first error/cancelled/timeout action and reset on any others.\n ...((action.status === Invitation.State.ERROR ||\n action.status === Invitation.State.CANCELLED ||\n action.status === Invitation.State.TIMEOUT) && {\n haltedAt: typeof prev.haltedAt === 'undefined' ? action.haltedAt : prev.haltedAt,\n }),\n } as InvitationReducerState;\n },\n null,\n (_arg: null) => {\n const invitation = observable?.get();\n return {\n status: Invitation.State.INIT,\n result: { spaceKey: null, identityKey: null, swarmKey: null, target: null },\n id: invitation?.invitationId,\n multiUse: invitation?.multiUse,\n invitationCode: invitation ? InvitationEncoder.encode(invitation) : undefined,\n authCode: invitation?.authCode,\n authMethod: invitation?.authMethod,\n shareable: invitation ? isShareableInvitation(invitation) : false,\n type: invitation?.type,\n };\n },\n );\n\n // Handle unmount.\n\n useEffect(() => {\n const update = (invitation: Invitation) => {\n switch (invitation.state) {\n case Invitation.State.INIT:\n case Invitation.State.CONNECTED:\n case Invitation.State.READY_FOR_AUTHENTICATION:\n case Invitation.State.AUTHENTICATING: {\n dispatch({\n invitation,\n status: invitation.state,\n });\n break;\n }\n\n case Invitation.State.SUCCESS: {\n dispatch({\n invitation,\n status: invitation.state,\n result: {\n spaceKey: invitation.spaceKey || null,\n identityKey: invitation.identityKey || null,\n swarmKey: invitation.swarmKey || null,\n target: invitation.target || null,\n },\n });\n break;\n }\n\n case Invitation.State.CANCELLED:\n case Invitation.State.TIMEOUT: {\n dispatch({ invitation, status: invitation.state, haltedAt: state.status });\n break;\n }\n }\n };\n\n const subscription = observable?.subscribe(update, (err: Error) => {\n dispatch({ status: Invitation.State.ERROR, error: err, haltedAt: state.status });\n });\n\n const currentState = observable?.get();\n if (currentState) {\n update(currentState);\n }\n\n return () => subscription?.unsubscribe();\n }, [observable, state.status]);\n\n // Return memoized callbacks & values.\n\n const connect = useCallback((observable: CancellableInvitationObservable) => {\n dispatch({ invitation: observable.get(), status: Invitation.State.CONNECTING, observable });\n }, []);\n\n const authenticate = useCallback(\n (authCode: string) => {\n log('authenticating...', { authCode });\n return (observable as AuthenticatingInvitationObservable).authenticate(authCode);\n },\n [observable],\n );\n\n const cancel = useCallback(async () => observable?.cancel(), [observable]);\n\n return useMemo(() => {\n return {\n ...state,\n cancel,\n connect,\n authenticate,\n };\n }, [state, cancel, connect, authenticate]);\n};\n"],
5
+ "mappings": ";;;AAKA,SACEA,oCACAC,iCACAC,qBAAAA,oBACAC,cAAAA,aAEAC,wBACK;;;ACRP,SAAuBC,aAAaC,WAAWC,SAASC,kBAAkB;AAG1E,SAGEC,YACAC,yBACK;AACP,SAASC,WAAW;;AAsEpB,IAAMC,wBAAwB,CAACC,eAC7BA,WAAWC,eAAeL,WAAWM,WAAWC,oBAAoBH,WAAWI,cAAcC;AAExF,IAAMC,sBAAsB,CAACC,eAAAA;AAClC,QAAM,CAACC,OAAOC,QAAAA,IAAYd,WACxB,CAACe,MAAMC,WAAAA;AACLb,QAAI,uBAAuB;MAAEa;IAAO,GAAA;;;;;;AACpC,UAAMC,kBACJ,gBAAgBD,SACZ;MACEE,IAAIF,OAAOX,WAAWc;MACtBC,UAAUJ,OAAOX,WAAWe;MAC5BC,gBAAgBnB,kBAAkBoB,OAAON,OAAOX,UAAU;MAC1DkB,UAAUP,OAAOX,WAAWkB;MAC5BjB,YAAYU,OAAOX,WAAWC;MAC9BkB,WAAWpB,sBAAsBY,OAAOX,UAAU;MAClDoB,MAAMT,OAAOX,WAAWoB;IAC1B,IACA,CAAC;AACP,WAAO;MACL,GAAGV;MACH,GAAGE;;MAEHS,QAAQV,OAAOU;;MAEfC,QAAQX,OAAOU,WAAWzB,WAAW2B,MAAMC,UAAUb,OAAOW,SAASZ,K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A;AACA;QACF;QAEA,KAAKxC,WAAW2B,MAAMI;QACtB,KAAK/B,WAAW2B,MAAMK,SAAS;AAC7BnB,mBAAS;YAAET;YAAYqB,QAAQrB,WAAWQ;YAAOqB,UAAUrB,MAAMa;UAAO,CAAA;AACxE;QACF;MACF;IACF;AAEA,UAAMqB,eAAenC,YAAYoC,UAAUL,QAAQ,CAACM,QAAAA;AAClDnC,eAAS;QAAEY,QAAQzB,WAAW2B,MAAME;QAAOC,OAAOkB;QAAKf,UAAUrB,MAAMa;MAAO,CAAA;IAChF,CAAA;AAEA,UAAMwB,eAAetC,YAAYwB,IAAAA;AACjC,QAAIc,cAAc;AAChBP,aAAOO,YAAAA;IACT;AAEA,WAAO,MAAMH,cAAcI,YAAAA;EAC7B,GAAG;IAACvC;IAAYC,MAAMa;GAAO;AAI7B,QAAM0B,UAAUvD,YAAY,CAACe,gBAAAA;AAC3BE,aAAS;MAAET,YAAYO,YAAWwB,IAAG;MAAIV,QAAQzB,WAAW2B,MAAMyB;MAAYzC,YAAAA;IAAW,CAAA;EAC3F,GAAG,CAAA,CAAE;AAEL,QAAM0C,eAAezD,YACnB,CAAC0B,aAAAA;AACCpB,QAAI,qBAAqB;MAAEoB;IAAS,GAAA;;;;;;AACpC,WAAQX,WAAkD0C,aAAa/B,QAAAA;EACzE,GACA;IAACX;GAAW;AAGd,QAAM2C,SAAS1D,YAAY,YAAYe,YAAY2C,OAAAA,GAAU;IAAC3C;GAAW;AAEzE,SAAOb,QAAQ,MAAA;AACb,WAAO;MACL,GAAGc;MACH0C;MACAH;MACAE;IACF;EACF,GAAG;IAACzC;IAAO0C;IAAQH;IAASE;GAAa;AAC3C;",
6
+ "names": ["AuthenticatingInvitationObservable", "CancellableInvitationObservable", "InvitationEncoder", "Invitation", "InvitationsProxy", "useCallback", "useEffect", "useMemo", "useReducer", "Invitation", "InvitationEncoder", "log", "isShareableInvitation", "invitation", "authMethod", "AuthMethod", "KNOWN_PUBLIC_KEY", "guestKeypair", "privateKey", "useInvitationStatus", "observable", "state", "dispatch", "prev", "action", "invitationProps", "id", "invitationId", "multiUse", "invitationCode", "encode", "authCode", "shareable", "type", "status", "result", "State", "SUCCESS", "ERROR", "error", "CANCELLED", "TIMEOUT", "haltedAt", "_arg", "get", "INIT", "spaceKey", "identityKey", "swarmKey", "target", "undefined", "update", "CONNECTED", "READY_FOR_AUTHENTICATION", "AUTHENTICATING", "subscription", "subscribe", "err", "currentState", "unsubscribe", "connect", "CONNECTING", "authenticate", "cancel"]
7
7
  }
@@ -1,11 +1,11 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
 
3
- // packages/sdk/react-client/src/client/AgentHostingProvider.tsx
3
+ // src/client/AgentHostingProvider.tsx
4
4
  import React2, { createContext as createContext2, useContext as useContext4, useState as useState4 } from "react";
5
5
  import { AgentManagerClient, FakeAgentHostingProvider } from "@dxos/client";
6
6
  import { log as log2 } from "@dxos/log";
7
7
 
8
- // packages/sdk/react-client/src/client/ClientProvider.tsx
8
+ // src/client/ClientProvider.tsx
9
9
  import React, { forwardRef, useEffect, useImperativeHandle, useState } from "react";
10
10
  import { Client, SystemStatus } from "@dxos/client";
11
11
  import { registerSignalsRuntime } from "@dxos/echo-signals/react";
@@ -13,11 +13,7 @@ import { log } from "@dxos/log";
13
13
  import { useControlledState } from "@dxos/react-hooks";
14
14
  import { getAsyncProviderValue } from "@dxos/util";
15
15
 
16
- // packages/sdk/react-client/src/client/context.ts
17
- import { createContext } from "react";
18
- var ClientContext = createContext(void 0);
19
-
20
- // packages/sdk/react-client/src/banner.ts
16
+ // src/banner.ts
21
17
  var BANNER = (client) => {
22
18
  const commitHash = client.config.get("runtime.app.build.commitHash");
23
19
  const hash = commitHash ? ` App Commit ${commitHash}
@@ -41,8 +37,12 @@ var printBanner = (client) => {
41
37
  console.log(`%c${BANNER(client)}`, "font-family: monospace;");
42
38
  };
43
39
 
44
- // packages/sdk/react-client/src/client/ClientProvider.tsx
45
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/client/ClientProvider.tsx";
40
+ // src/client/context.ts
41
+ import { createContext } from "react";
42
+ var ClientContext = createContext(void 0);
43
+
44
+ // src/client/ClientProvider.tsx
45
+ var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/client/ClientProvider.tsx";
46
46
  var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvider, client: clientProvider, services: servicesProvider, status: controlledStatus, fallback: Fallback = () => null, signalsRuntime = true, noBanner, onInitialized, ...options }, forwardedRef) => {
47
47
  useEffect(() => {
48
48
  signalsRuntime && registerSignalsRuntime();
@@ -76,14 +76,14 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
76
76
  });
77
77
  log("client ready", void 0, {
78
78
  F: __dxlog_file,
79
- L: 137,
79
+ L: 138,
80
80
  S: void 0,
81
81
  C: (f, a) => f(...a)
82
82
  });
83
83
  await onInitialized?.(client3);
84
84
  log("initialization complete", void 0, {
85
85
  F: __dxlog_file,
86
- L: 139,
86
+ L: 140,
87
87
  S: void 0,
88
88
  C: (f, a) => f(...a)
89
89
  });
@@ -105,7 +105,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
105
105
  config
106
106
  }, {
107
107
  F: __dxlog_file,
108
- L: 159,
108
+ L: 160,
109
109
  S: void 0,
110
110
  C: (f, a) => f(...a)
111
111
  });
@@ -114,7 +114,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
114
114
  services
115
115
  }, {
116
116
  F: __dxlog_file,
117
- L: 161,
117
+ L: 162,
118
118
  S: void 0,
119
119
  C: (f, a) => f(...a)
120
120
  });
@@ -125,7 +125,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
125
125
  });
126
126
  log("created client", void 0, {
127
127
  F: __dxlog_file,
128
- L: 163,
128
+ L: 164,
129
129
  S: void 0,
130
130
  C: (f, a) => f(...a)
131
131
  });
@@ -135,7 +135,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
135
135
  if (!disposed) {
136
136
  log.catch(err, void 0, {
137
137
  F: __dxlog_file,
138
- L: 168,
138
+ L: 169,
139
139
  S: void 0,
140
140
  C: (f, a) => f(...a)
141
141
  });
@@ -145,7 +145,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
145
145
  return () => {
146
146
  log("clean up", void 0, {
147
147
  F: __dxlog_file,
148
- L: 174,
148
+ L: 175,
149
149
  S: void 0,
150
150
  C: (f, a) => f(...a)
151
151
  });
@@ -155,13 +155,13 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
155
155
  void client2?.destroy().then(() => {
156
156
  log("destroyed", void 0, {
157
157
  F: __dxlog_file,
158
- L: 182,
158
+ L: 183,
159
159
  S: void 0,
160
160
  C: (f, a) => f(...a)
161
161
  });
162
162
  }).catch((err) => log.catch(err, void 0, {
163
163
  F: __dxlog_file,
164
- L: 184,
164
+ L: 185,
165
165
  S: void 0,
166
166
  C: (f, a) => f(...a)
167
167
  }));
@@ -187,7 +187,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvi
187
187
  }, children);
188
188
  });
189
189
 
190
- // packages/sdk/react-client/src/client/useClient.ts
190
+ // src/client/useClient.ts
191
191
  import { useContext } from "react";
192
192
  import { raise } from "@dxos/debug";
193
193
  var useClient = () => {
@@ -195,7 +195,7 @@ var useClient = () => {
195
195
  return client;
196
196
  };
197
197
 
198
- // packages/sdk/react-client/src/client/useClientStatus.ts
198
+ // src/client/useClientStatus.ts
199
199
  import { useEffect as useEffect2, useState as useState2 } from "react";
200
200
  var useClientStatus = (client) => {
201
201
  const [status, setStatus] = useState2();
@@ -212,7 +212,7 @@ var useClientStatus = (client) => {
212
212
  return status;
213
213
  };
214
214
 
215
- // packages/sdk/react-client/src/client/useConfig.ts
215
+ // src/client/useConfig.ts
216
216
  import { useContext as useContext2 } from "react";
217
217
  import { raise as raise2 } from "@dxos/debug";
218
218
  var useConfig = () => {
@@ -220,7 +220,7 @@ var useConfig = () => {
220
220
  return client.config;
221
221
  };
222
222
 
223
- // packages/sdk/react-client/src/client/useShell.ts
223
+ // src/client/useShell.ts
224
224
  import { useEffect as useEffect3, useState as useState3 } from "react";
225
225
  var useShell = () => {
226
226
  const client = useClient();
@@ -235,7 +235,7 @@ var useShellDisplay = () => {
235
235
  return display;
236
236
  };
237
237
 
238
- // packages/sdk/react-client/src/client/useStatus.ts
238
+ // src/client/useStatus.ts
239
239
  import { useContext as useContext3 } from "react";
240
240
  import { raise as raise3 } from "@dxos/debug";
241
241
  var useStatus = () => {
@@ -243,8 +243,8 @@ var useStatus = () => {
243
243
  return status;
244
244
  };
245
245
 
246
- // packages/sdk/react-client/src/client/AgentHostingProvider.tsx
247
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/client/AgentHostingProvider.tsx";
246
+ // src/client/AgentHostingProvider.tsx
247
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/react-client/src/client/AgentHostingProvider.tsx";
248
248
  var AgentHostingContext = /* @__PURE__ */ createContext2(null);
249
249
  var AgentHostingProvider = (props) => {
250
250
  const client = useClient();
@@ -311,4 +311,4 @@ export {
311
311
  useShellDisplay,
312
312
  useStatus
313
313
  };
314
- //# sourceMappingURL=chunk-NBTZZNQ5.mjs.map
314
+ //# sourceMappingURL=chunk-MNTJNI2M.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/client/AgentHostingProvider.tsx", "../../../src/client/ClientProvider.tsx", "../../../src/banner.ts", "../../../src/client/context.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, { type PropsWithChildren, createContext, 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 type FunctionComponent,\n type PropsWithChildren,\n forwardRef,\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 { type MaybePromise, type Provider, getAsyncProviderValue } from '@dxos/util';\n\nimport { printBanner } from '../banner';\n\nimport { ClientContext, type ClientContextProps } from './context';\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 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 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 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,OAAOA,UAAiCC,iBAAAA,gBAAeC,cAAAA,aAAYC,YAAAA,iBAAgB;AAEnF,SA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IAAIgB,mBAAmBP,QAAQC,IAAAA;AAC5D,UAAIV,2BAA2BiB,KAAI,GAAI;AACrC,eAAOjB;MACT,OAAO;AAEL,eAAO;MACT;IACF;IAEA,SAAS;AACPa,MAAAA,KAAIK,MAAM,0CAA0CP,mBAAmBG,MAAI,QAAA;;;;;;AAC3E,aAAO;IACT;EACF;AACF;",
6
+ "names": ["React", "createContext", "useContext", "useState", "AgentManagerClient", "FakeAgentHostingProvider", "log", "React", "forwardRef", "useEffect", "useImperativeHandle", "useState", "Client", "SystemStatus", "registerSignalsRuntime", "log", "useControlledState", "getAsyncProviderValue", "BANNER", "client", "commitHash", "config", "get", "hash", "version", "bannerPrinted", "printBanner", "window", "location", "hostname", "console", "log", "createContext", "ClientContext", "createContext", "undefined", "ClientProvider", "forwardRef", "children", "config", "configProvider", "client", "clientProvider", "services", "servicesProvider", "status", "controlledStatus", "fallback", "Fallback", "signalsRuntime", "noBanner", "onInitialized", "options", "forwardedRef", "useEffect", "registerSignalsRuntime", "error", "setError", "useState", "setClient", "Client", "undefined", "useImperativeHandle", "setStatus", "useControlledState", "subscription", "subscribe", "unsubscribe", "disposed", "initialize", "initialized", "catch", "err", "log", "printBanner", "t", "setTimeout", "getAsyncProviderValue", "clearTimeout", "destroy", "then", "SystemStatus", "ACTIVE", "ClientContext", "Provider", "value", "useContext", "raise", "useClient", "client", "useContext", "ClientContext", "raise", "Error", "useEffect", "useState", "useClientStatus", "client", "status", "setStatus", "useState", "useEffect", "subscription", "subscribe", "unsubscribe", "useContext", "raise", "useConfig", "client", "useContext", "ClientContext", "raise", "Error", "config", "useEffect", "useState", "useShell", "client", "useClient", "shell", "useShellDisplay", "display", "setDisplay", "useState", "useEffect", "onDisplayChange", "useContext", "raise", "useStatus", "status", "useContext", "ClientContext", "raise", "Error", "AgentHostingContext", "createContext", "AgentHostingProvider", "props", "client", "useClient", "agentHostingProviderClient", "useState", "makeClient", "React", "Provider", "value", "children", "useAgentHostingClient", "useContext", "config", "halo", "agentHostingConfig", "get", "log", "type", "FakeAgentHostingProvider", "AgentManagerClient", "init", "error"]
7
+ }
@@ -1,22 +1,22 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  useClient
4
- } from "../chunk-NBTZZNQ5.mjs";
4
+ } from "../chunk-MNTJNI2M.mjs";
5
5
 
6
- // packages/sdk/react-client/src/devtools/index.ts
6
+ // src/devtools/index.ts
7
7
  export * from "@dxos/client/devtools";
8
8
 
9
- // packages/sdk/react-client/src/devtools/useDevtools.ts
9
+ // src/devtools/useDevtools.ts
10
10
  import { raise } from "@dxos/debug";
11
11
  var useDevtools = () => {
12
12
  const client = useClient();
13
13
  return client.services.services.DevtoolsHost ?? raise(new Error("DevtoolsHost not available."));
14
14
  };
15
15
 
16
- // packages/sdk/react-client/src/devtools/useStream.ts
17
- import { useState, useEffect } from "react";
16
+ // src/devtools/useStream.ts
17
+ import { useEffect, useState } from "react";
18
18
  import { log } from "@dxos/log";
19
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/devtools/useStream.ts";
19
+ var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/devtools/useStream.ts";
20
20
  var useStream = (streamFactory, defaultValue, deps = []) => {
21
21
  const [value, setValue] = useState(defaultValue);
22
22
  useEffect(() => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/devtools/index.ts", "../../../../src/devtools/useDevtools.ts", "../../../../src/devtools/useStream.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/client/devtools';\n\nexport * from './useDevtools';\nexport * from './useStream';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type DevtoolsHost } from '@dxos/client/devtools';\nimport { raise } from '@dxos/debug';\n\nimport { useClient } from '../client';\n\nexport const useDevtools = (): DevtoolsHost => {\n const client = useClient();\n return client.services.services.DevtoolsHost ?? raise(new Error('DevtoolsHost not available.'));\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport { type DependencyList, useState, useEffect } from 'react';\n\nimport { type Stream } from '@dxos/codec-protobuf/stream';\nimport { log } from '@dxos/log';\n\n/**\n * Subscribe to service API streams.\n */\nexport const useStream = <T>(streamFactory: () => Stream<T>, defaultValue: T, deps: DependencyList = []): T => {\n const [value, setValue] = useState<T | undefined>(defaultValue);\n useEffect(() => {\n const stream = streamFactory();\n stream.subscribe(\n (response: T) => setValue(response),\n (err) => {\n if (err) {\n log.catch(err);\n }\n },\n );\n\n return () => {\n void stream.close();\n };\n }, deps);\n\n return value ?? defaultValue;\n};\n"],
5
- "mappings": ";;;;;;AAIA,cAAc;;;ACCd,SAASA,aAAa;AAIf,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOD,OAAOE,SAASA,SAASC,gBAAgBC,MAAM,IAAIC,MAAM,6BAAA,CAAA;AAClE;;;ACRA,SAA8BC,UAAUC,iBAAiB;AAGzD,SAASC,WAAW;;AAKb,IAAMC,YAAY,CAAIC,eAAgCC,cAAiBC,OAAuB,CAAA,MAAE;AACrG,QAAM,CAACC,OAAOC,QAAAA,IAAYR,SAAwBK,YAAAA;AAClDJ,YAAU,MAAA;AACR,UAAMQ,SAASL,cAAAA;AACfK,WAAOC,UACL,CAACC,aAAgBH,SAASG,QAAAA,GAC1B,CAACC,QAAAA;AACC,UAAIA,KAAK;AACPV,YAAIW,MAAMD,KAAAA,QAAAA;;;;;;MACZ;IACF,CAAA;AAGF,WAAO,MAAA;AACL,WAAKH,OAAOK,MAAK;IACnB;EACF,GAAGR,IAAAA;AAEH,SAAOC,SAASF;AAClB;",
6
- "names": ["raise", "useDevtools", "client", "useClient", "services", "DevtoolsHost", "raise", "Error", "useState", "useEffect", "log", "useStream", "streamFactory", "defaultValue", "deps", "value", "setValue", "stream", "subscribe", "response", "err", "catch", "close"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/client/devtools';\n\nexport * from './useDevtools';\nexport * from './useStream';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type DevtoolsHost } from '@dxos/client/devtools';\nimport { raise } from '@dxos/debug';\n\nimport { useClient } from '../client';\n\nexport const useDevtools = (): DevtoolsHost => {\n const client = useClient();\n return client.services.services.DevtoolsHost ?? raise(new Error('DevtoolsHost not available.'));\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport { type DependencyList, useEffect, useState } from 'react';\n\nimport { type Stream } from '@dxos/codec-protobuf/stream';\nimport { log } from '@dxos/log';\n\n/**\n * Subscribe to service API streams.\n */\nexport const useStream = <T>(streamFactory: () => Stream<T>, defaultValue: T, deps: DependencyList = []): T => {\n const [value, setValue] = useState<T | undefined>(defaultValue);\n useEffect(() => {\n const stream = streamFactory();\n stream.subscribe(\n (response: T) => setValue(response),\n (err) => {\n if (err) {\n log.catch(err);\n }\n },\n );\n\n return () => {\n void stream.close();\n };\n }, deps);\n\n return value ?? defaultValue;\n};\n"],
5
+ "mappings": ";;;;;;AAIA,cAAc;;;ACCd,SAASA,aAAa;AAIf,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOD,OAAOE,SAASA,SAASC,gBAAgBC,MAAM,IAAIC,MAAM,6BAAA,CAAA;AAClE;;;ACRA,SAA8BC,WAAWC,gBAAgB;AAGzD,SAASC,WAAW;;AAKb,IAAMC,YAAY,CAAIC,eAAgCC,cAAiBC,OAAuB,CAAA,MAAE;AACrG,QAAM,CAACC,OAAOC,QAAAA,IAAYP,SAAwBI,YAAAA;AAClDL,YAAU,MAAA;AACR,UAAMS,SAASL,cAAAA;AACfK,WAAOC,UACL,CAACC,aAAgBH,SAASG,QAAAA,GAC1B,CAACC,QAAAA;AACC,UAAIA,KAAK;AACPV,YAAIW,MAAMD,KAAAA,QAAAA;;;;;;MACZ;IACF,CAAA;AAGF,WAAO,MAAA;AACL,WAAKH,OAAOK,MAAK;IACnB;EACF,GAAGR,IAAAA;AAEH,SAAOC,SAASF;AAClB;",
6
+ "names": ["raise", "useDevtools", "client", "useClient", "services", "DevtoolsHost", "raise", "Error", "useEffect", "useState", "log", "useStream", "streamFactory", "defaultValue", "deps", "value", "setValue", "stream", "subscribe", "response", "err", "catch", "close"]
7
7
  }
@@ -1,20 +1,20 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  useInvitationStatus
4
- } from "../chunk-UYJUBYMU.mjs";
4
+ } from "../chunk-256IHY6F.mjs";
5
5
  import {
6
6
  useClient
7
- } from "../chunk-NBTZZNQ5.mjs";
7
+ } from "../chunk-MNTJNI2M.mjs";
8
8
 
9
- // packages/sdk/react-client/src/echo/index.ts
9
+ // src/echo/index.ts
10
10
  export * from "@dxos/client/echo";
11
11
 
12
- // packages/sdk/react-client/src/echo/useMembers.ts
12
+ // src/echo/useMembers.ts
13
13
  import { MulticastObservable } from "@dxos/async";
14
14
  import { HaloSpaceMember } from "@dxos/client/echo";
15
15
  import { useMulticastObservable as useMulticastObservable2 } from "@dxos/react-hooks";
16
16
 
17
- // packages/sdk/react-client/src/echo/useSpaces.ts
17
+ // src/echo/useSpaces.ts
18
18
  import { useEffect, useState } from "react";
19
19
  import { SpaceState } from "@dxos/client/echo";
20
20
  import { useMulticastObservable } from "@dxos/react-hooks";
@@ -48,7 +48,7 @@ var useSpaces = ({ all = false } = {}) => {
48
48
  return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);
49
49
  };
50
50
 
51
- // packages/sdk/react-client/src/echo/useMembers.ts
51
+ // src/echo/useMembers.ts
52
52
  var useMembers = (spaceKey) => {
53
53
  const spaces = useSpaces({
54
54
  all: true
@@ -58,7 +58,7 @@ var useMembers = (spaceKey) => {
58
58
  return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);
59
59
  };
60
60
 
61
- // packages/sdk/react-client/src/echo/useQuery.ts
61
+ // src/echo/useQuery.ts
62
62
  import { useMemo, useSyncExternalStore } from "react";
63
63
  import { Filter, Query, isSpace } from "@dxos/client/echo";
64
64
  var EMPTY_ARRAY = [];
@@ -89,7 +89,7 @@ var useQuery = (spaceOrEcho, queryOrFilter, deps) => {
89
89
  return objects ?? [];
90
90
  };
91
91
 
92
- // packages/sdk/react-client/src/echo/useQueue.ts
92
+ // src/echo/useQueue.ts
93
93
  import { useEffect as useEffect2, useMemo as useMemo2, useRef } from "react";
94
94
  import { raise } from "@dxos/debug";
95
95
  var MIN_POLL_INTERVAL = 1e3;
@@ -138,7 +138,7 @@ var useQueue = (queueDxn, options = {}) => {
138
138
  return queue;
139
139
  };
140
140
 
141
- // packages/sdk/react-client/src/echo/useSchema.ts
141
+ // src/echo/useSchema.ts
142
142
  import { useMemo as useMemo3, useSyncExternalStore as useSyncExternalStore2 } from "react";
143
143
  var useSchema = (client, space, typename) => {
144
144
  const { subscribe, getSchema } = useMemo3(() => {
@@ -179,7 +179,7 @@ var useSchema = (client, space, typename) => {
179
179
  return useSyncExternalStore2(subscribe, getSchema);
180
180
  };
181
181
 
182
- // packages/sdk/react-client/src/echo/useSpaceInvitations.ts
182
+ // src/echo/useSpaceInvitations.ts
183
183
  import { useMemo as useMemo4 } from "react";
184
184
  import { MulticastObservable as MulticastObservable2 } from "@dxos/async";
185
185
  import { useMulticastObservable as useMulticastObservable3 } from "@dxos/react-hooks";
@@ -195,7 +195,7 @@ var useSpaceInvitation = (spaceKey, invitationId) => {
195
195
  return useInvitationStatus(invitation);
196
196
  };
197
197
 
198
- // packages/sdk/react-client/src/echo/useSubscription.ts
198
+ // src/echo/useSubscription.ts
199
199
  import { useEffect as useEffect3, useRef as useRef2 } from "react";
200
200
  import { createSubscription } from "@dxos/client/echo";
201
201
  var useSubscription = (cb, selection) => {
@@ -212,11 +212,11 @@ var useSubscription = (cb, selection) => {
212
212
  return subscriptionRef.current;
213
213
  };
214
214
 
215
- // packages/sdk/react-client/src/echo/useSyncState.ts
215
+ // src/echo/useSyncState.ts
216
216
  import { useEffect as useEffect4, useState as useState2 } from "react";
217
217
  import { Context } from "@dxos/context";
218
218
  import { EdgeService } from "@dxos/protocols";
219
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/echo/useSyncState.ts";
219
+ var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/echo/useSyncState.ts";
220
220
  var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
221
221
  var useSyncState = () => {
222
222
  const client = useClient();
@@ -231,7 +231,7 @@ var useSyncState = () => {
231
231
  if (spaceState[space.id]) {
232
232
  continue;
233
233
  }
234
- ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
234
+ ctx.onDispose(space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {
235
235
  const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
236
236
  if (syncState) {
237
237
  setSpaceState((spaceState2) => ({
@@ -261,7 +261,7 @@ var useSpaceSyncState = (space) => {
261
261
  F: __dxlog_file,
262
262
  L: 64
263
263
  });
264
- space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
264
+ space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {
265
265
  const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
266
266
  if (syncState) {
267
267
  setSpaceState(syncState);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useQuery.ts", "../../../../src/echo/useQueue.ts", "../../../../src/echo/useSchema.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useQueue';\nexport * from './useSchema';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\nexport * from './useSyncState';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { HaloSpaceMember, type SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpaces } from './useSpaces';\n\nexport const useMembers = (spaceKey: PublicKey | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey ? spaces.find((space) => space.key.equals(spaceKey)) : undefined;\n\n // EMPTY_OBSERVABLE needs to be a stable reference to avoid re-subscribing on every render.\n const members = useMulticastObservable(space?.members ?? MulticastObservable.empty()) ?? [];\n return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PublicKeyLike } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its key.\n * The space is not guaranteed to be in the ready state.\n * Returns the default space if no key is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceKeyLike the key of the space to look for\n */\nexport const useSpace = (spaceKeyLike?: PublicKeyLike): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n // Only wait for ready if looking for the default space.\n if (spaceKeyLike) {\n return;\n }\n\n const timeout = setTimeout(async () => {\n await client.spaces.waitUntilReady();\n setReady(true);\n });\n\n return () => clearTimeout(timeout);\n }, [client, spaceKeyLike]);\n\n if (spaceKeyLike) {\n return spaces.find((space) => space.key.equals(spaceKeyLike) || space.id === spaceKeyLike);\n }\n\n if (ready && client.halo.identity.get()) {\n return client.spaces.default;\n }\n};\n\nexport type UseSpacesParams = {\n /**\n * Return uninitialized spaces as well.\n */\n all?: boolean;\n};\n\n/**\n * Get all Spaces available to current user.\n * Requires a ClientProvider somewhere in the parent tree.\n * By default, only ready spaces are returned.\n * @returns an array of Spaces\n */\nexport const useSpaces = ({ all = false }: UseSpacesParams = {}): Space[] => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n\n // TODO(dmaretskyi): Array reference equality.\n return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Echo, Filter, type Live, Query, type Space, isSpace } from '@dxos/client/echo';\n\nconst EMPTY_ARRAY: never[] = [];\n\nconst noop = () => {};\n\n// TODO(dmaretskyi): Queries are fully serializable, so we can remove `deps` argument.\ninterface UseQueryFn {\n <Q extends Query.Any>(spaceOrEcho: Space | Echo | undefined, query: Q, deps?: any[]): Live<Query.Type<Q>>[];\n\n <F extends Filter.Any>(spaceOrEcho: Space | Echo | undefined, filter: F, deps?: any[]): Live<Filter.Type<F>>[];\n}\n\n/**\n * Create subscription.\n */\nexport const useQuery: UseQueryFn = (\n spaceOrEcho: Space | Echo | undefined,\n queryOrFilter: Query.Any | Filter.Any,\n deps?: any[],\n): Live<unknown>[] => {\n const query = Filter.is(queryOrFilter) ? Query.select(queryOrFilter) : queryOrFilter;\n\n const { getObjects, subscribe } = useMemo(() => {\n let subscribed = false;\n const queryResult =\n spaceOrEcho === undefined\n ? undefined\n : isSpace(spaceOrEcho)\n ? spaceOrEcho.db.query(query)\n : spaceOrEcho.query(query);\n\n return {\n getObjects: () => (subscribed && queryResult ? queryResult.objects : EMPTY_ARRAY),\n subscribe: (cb: () => void) => {\n subscribed = true;\n const unsubscribe = queryResult?.subscribe(cb) ?? noop;\n return () => {\n unsubscribe?.();\n subscribed = false;\n };\n },\n };\n }, [spaceOrEcho, JSON.stringify(query.ast), ...(deps ?? [])]);\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n // NOTE: This hook will resubscribe whenever the callback passed to the first argument changes; make sure it is stable.\n const objects = useSyncExternalStore<Live<unknown>[] | undefined>(subscribe, getObjects);\n return objects ?? [];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { type Queue } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type Obj, type Relation } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst MIN_POLL_INTERVAL = 1_000;\n\nexport type UseQueueOptions = {\n pollInterval?: number;\n};\n\n/**\n * Polls the given Edge queue.\n */\n// TODO(burdon): Replace polling with socket?\n// TODO(dmaretskyi): Move into client package.\n// TODO(dmaretskyi): Consider passing the space into the hook to support queue DXNs without space id.\n// TODO(ZaymonFC): If queue is unchanged returned object should be refferentially stable on poll.\nexport const useQueue = <T extends Obj.Any | Relation.Any>(\n queueDxn?: DXN,\n options: UseQueueOptions = {},\n): Queue<T> | undefined => {\n const client = useClient();\n const mountedRef = useRef(true);\n\n const queue = useMemo<Queue<T> | undefined>(() => {\n if (!queueDxn) {\n return undefined;\n }\n\n const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError('Invalid queue DXN'));\n return client.spaces.get(spaceId)?.queues.get<T>(queueDxn);\n }, [client, queueDxn?.toString()]);\n\n useEffect(() => {\n void queue?.refresh();\n }, [queue]);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n mountedRef.current = true;\n\n const poll = () => {\n if (!mountedRef.current) {\n return;\n }\n\n void queue?.refresh().finally(() => {\n if (mountedRef.current && options.pollInterval) {\n timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));\n }\n });\n };\n\n if (options.pollInterval) {\n poll();\n }\n\n return () => {\n mountedRef.current = false;\n clearTimeout(timeout);\n };\n }, [queue, options.pollInterval]);\n\n return queue;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { type BaseSchema } from '@dxos/echo-schema';\n\n/**\n * Subscribe to and retrieve schema changes from a space's schema registry.\n */\nexport const useSchema = (\n client: Client,\n space: Space | undefined,\n typename: string | undefined,\n): Schema.Schema.AnyNoContext | undefined => {\n const { subscribe, getSchema } = useMemo(() => {\n if (!typename || !space) {\n return {\n subscribe: () => () => {},\n getSchema: () => undefined,\n };\n }\n\n const staticSchema = client.graph.schemaRegistry.getSchema(typename);\n if (staticSchema) {\n return {\n subscribe: () => () => {},\n getSchema: () => staticSchema,\n };\n }\n\n const query = space.db.schemaRegistry.query({ typename });\n const initialResult: BaseSchema = query.runSync()[0];\n let currentSchema = initialResult;\n\n return {\n subscribe: (onStoreChange: () => void) => {\n const unsubscribe = query.subscribe(() => {\n currentSchema = query.results[0];\n onStoreChange();\n });\n\n return unsubscribe;\n },\n getSchema: () => currentSchema,\n };\n }, [typename, space]);\n\n return useSyncExternalStore(subscribe, getSchema);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpace } from './useSpaces';\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceKey);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\nexport const useSpaceInvitation = (spaceKey?: PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceKey);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useRef } from 'react';\n\nimport { type Selection, type SubscriptionHandle, createSubscription } from '@dxos/client/echo';\n\n/**\n * Create reactive selection.\n * Calls the callback when the selection changes and during the first render.\n */\n// TODO(wittjosiah): Is this still needed with signals reactivity? If not, remove or update jsdoc with usage info.\nexport const useSubscription = (cb: () => void, selection: Selection) => {\n // Make sure that the callback is always the one from the latest render.\n // Without this, we would always call the callback from the initial render,\n // which might contain stale data.\n const callbackRef = useRef(cb);\n callbackRef.current = cb;\n\n const subscriptionRef = useRef<SubscriptionHandle>();\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type SpaceSyncStateMap, type Space } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\n\nimport { useClient } from '../client';\n\nconst isEdgePeerId = (peerId: string, spaceId: SpaceId) =>\n peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n"],
5
- "mappings": ";;;;;;;;;AAIA,cAAc;;;ACAd,SAASA,2BAA2B;AAEpC,SAASC,uBAAyC;AAClD,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,WAAWC,gBAAgB;AAGpC,SAAqBC,kBAAkB;AACvC,SAASC,8BAA8B;AAYhC,IAAMC,WAAW,CAACC,iBAAAA;AACvB,QAAMC,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAOE,MAAM;AAC5D,QAAM,CAACE,OAAOC,QAAAA,IAAYC,SAAS,KAAA;AAEnCC,YAAU,MAAA;AAER,QAAIR,cAAc;AAChB;IACF;AAEA,UAAMS,UAAUC,WAAW,YAAA;AACzB,YAAMT,OAAOE,OAAOQ,eAAc;AAClCL,eAAS,IAAA;IACX,CAAA;AAEA,WAAO,MAAMM,aAAaH,OAAAA;EAC5B,GAAG;IAACR;IAAQD;GAAa;AAEzB,MAAIA,cAAc;AAChB,WAAOG,OAAOU,KAAK,CAACC,UAAUA,MAAMC,IAAIC,OAAOhB,YAAAA,KAAiBc,MAAMG,OAAOjB,YAAAA;EAC/E;AAEA,MAAIK,SAASJ,OAAOiB,KAAKC,SAASC,IAAG,GAAI;AACvC,WAAOnB,OAAOE,OAAOkB;EACvB;AACF;AAeO,IAAMC,YAAY,CAAC,EAAEC,MAAM,MAAK,IAAsB,CAAC,MAAC;AAC7D,QAAMtB,SAASC,UAAAA;AACf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AOU,IAAG,CAAA;AACrCnB,WAAOS,OAAOW,UAAU,CAACX,WAAAA;AACvBD,0BAAoBC,MAAAA;IACtB,CAAA;AAEA,WAAO,MAAA;AACL,WAAKH,IAAIe,QAAO;IAClB;EACF,GAAG;IAACrB;GAAO;AAEX,SAAOE;AACT;AAMO,IAAMoB,oBAAoB,CAACZ,UAAAA;AAChC,QAAM,CAACR,YAAYC,aAAAA,IAAiBC,UAAAA;AAEpCC,EAAAA,WAAU,MAAA;AACR,UAAMC,MAAM,IAAIC,QAAAA,QAAAA;;;;AAChBG,UAAMG,KAAKC,qBAAqBR,KAAK,CAAC,EAAES,QAAQ,CAAA,EAAE,MAAE;AAClD,YAAMC,YAAYD,MAAME,KAAK,CAACC,UAAUzB,aAAayB,MAAMxB,QAAQgB,MAAMC,EAAE,CAAA;AAC3E,UAAIK,WAAW;AACbb,sBAAca,SAAAA;MAChB;IACF,CAAA;AAEA,WAAO,MAAA;AACL,WAAKV,IAAIe,QAAO;IAClB;EACF,GAAG;IAACX;GAAM;AAEV,SAAOR;AACT;",
6
- "names": ["MulticastObservable", "HaloSpaceMember", "useMulticastObservable", "useEffect", "useState", "SpaceState", "useMulticastObservable", "useSpace", "spaceKeyLike", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useEffect", "timeout", "setTimeout", "waitUntilReady", "clearTimeout", "find", "space", "key", "equals", "id", "halo", "identity", "get", "default", "useSpaces", "all", "filter", "state", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "key", "equals", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "useSyncExternalStore", "Filter", "Query", "isSpace", "EMPTY_ARRAY", "noop", "useQuery", "spaceOrEcho", "queryOrFilter", "deps", "query", "Filter", "is", "Query", "select", "getObjects", "subscribe", "useMemo", "subscribed", "queryResult", "undefined", "isSpace", "db", "objects", "cb", "unsubscribe", "JSON", "stringify", "ast", "useSyncExternalStore", "useEffect", "useMemo", "useRef", "raise", "MIN_POLL_INTERVAL", "useQueue", "queueDxn", "options", "client", "useClient", "mountedRef", "useRef", "queue", "useMemo", "undefined", "spaceId", "asQueueDXN", "raise", "TypeError", "spaces", "get", "queues", "toString", "useEffect", "refresh", "timeout", "current", "poll", "finally", "pollInterval", "setTimeout", "Math", "max", "clearTimeout", "useMemo", "useSyncExternalStore", "useSchema", "client", "space", "typename", "subscribe", "getSchema", "useMemo", "undefined", "staticSchema", "graph", "schemaRegistry", "query", "db", "initialResult", "runSync", "currentSchema", "onStoreChange", "unsubscribe", "results", "useSyncExternalStore", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceKey", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "useRef", "current", "subscriptionRef", "useEffect", "createSubscription", "unsubscribe", "update", "useEffect", "useState", "Context", "EdgeService", "isEdgePeerId", "peerId", "spaceId", "startsWith", "EdgeService", "AUTOMERGE_REPLICATOR", "useSyncState", "client", "useClient", "spaceState", "setSpaceState", "useState", "useEffect", "ctx", "Context", "createSubscriptions", "spaces", "space", "id", "onDispose", "crud", "subscribeToSyncState", "peers", "syncState", "find", "state", "get", "subscribe", "dispose", "useSpaceSyncState"]
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useQueue';\nexport * from './useSchema';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\nexport * from './useSyncState';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { HaloSpaceMember, type SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpaces } from './useSpaces';\n\nexport const useMembers = (spaceKey: PublicKey | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey ? spaces.find((space) => space.key.equals(spaceKey)) : undefined;\n\n // EMPTY_OBSERVABLE needs to be a stable reference to avoid re-subscribing on every render.\n const members = useMulticastObservable(space?.members ?? MulticastObservable.empty()) ?? [];\n return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PublicKeyLike } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its key.\n * The space is not guaranteed to be in the ready state.\n * Returns the default space if no key is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceKeyLike the key of the space to look for\n */\nexport const useSpace = (spaceKeyLike?: PublicKeyLike): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n // Only wait for ready if looking for the default space.\n if (spaceKeyLike) {\n return;\n }\n\n const timeout = setTimeout(async () => {\n await client.spaces.waitUntilReady();\n setReady(true);\n });\n\n return () => clearTimeout(timeout);\n }, [client, spaceKeyLike]);\n\n if (spaceKeyLike) {\n return spaces.find((space) => space.key.equals(spaceKeyLike) || space.id === spaceKeyLike);\n }\n\n if (ready && client.halo.identity.get()) {\n return client.spaces.default;\n }\n};\n\nexport type UseSpacesParams = {\n /**\n * Return uninitialized spaces as well.\n */\n all?: boolean;\n};\n\n/**\n * Get all Spaces available to current user.\n * Requires a ClientProvider somewhere in the parent tree.\n * By default, only ready spaces are returned.\n * @returns an array of Spaces\n */\nexport const useSpaces = ({ all = false }: UseSpacesParams = {}): Space[] => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n\n // TODO(dmaretskyi): Array reference equality.\n return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Echo, Filter, type Live, Query, type Space, isSpace } from '@dxos/client/echo';\n\nconst EMPTY_ARRAY: never[] = [];\n\nconst noop = () => {};\n\n// TODO(dmaretskyi): Queries are fully serializable, so we can remove `deps` argument.\ninterface UseQueryFn {\n <Q extends Query.Any>(spaceOrEcho: Space | Echo | undefined, query: Q, deps?: any[]): Live<Query.Type<Q>>[];\n\n <F extends Filter.Any>(spaceOrEcho: Space | Echo | undefined, filter: F, deps?: any[]): Live<Filter.Type<F>>[];\n}\n\n/**\n * Create subscription.\n */\nexport const useQuery: UseQueryFn = (\n spaceOrEcho: Space | Echo | undefined,\n queryOrFilter: Query.Any | Filter.Any,\n deps?: any[],\n): Live<unknown>[] => {\n const query = Filter.is(queryOrFilter) ? Query.select(queryOrFilter) : queryOrFilter;\n\n const { getObjects, subscribe } = useMemo(() => {\n let subscribed = false;\n const queryResult =\n spaceOrEcho === undefined\n ? undefined\n : isSpace(spaceOrEcho)\n ? spaceOrEcho.db.query(query)\n : spaceOrEcho.query(query);\n\n return {\n getObjects: () => (subscribed && queryResult ? queryResult.objects : EMPTY_ARRAY),\n subscribe: (cb: () => void) => {\n subscribed = true;\n const unsubscribe = queryResult?.subscribe(cb) ?? noop;\n return () => {\n unsubscribe?.();\n subscribed = false;\n };\n },\n };\n }, [spaceOrEcho, JSON.stringify(query.ast), ...(deps ?? [])]);\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n // NOTE: This hook will resubscribe whenever the callback passed to the first argument changes; make sure it is stable.\n const objects = useSyncExternalStore<Live<unknown>[] | undefined>(subscribe, getObjects);\n return objects ?? [];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { type Queue } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type Obj, type Relation } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst MIN_POLL_INTERVAL = 1_000;\n\nexport type UseQueueOptions = {\n pollInterval?: number;\n};\n\n/**\n * Polls the given Edge queue.\n */\n// TODO(burdon): Replace polling with socket?\n// TODO(dmaretskyi): Move into client package.\n// TODO(dmaretskyi): Consider passing the space into the hook to support queue DXNs without space id.\n// TODO(ZaymonFC): If queue is unchanged returned object should be refferentially stable on poll.\nexport const useQueue = <T extends Obj.Any | Relation.Any>(\n queueDxn?: DXN,\n options: UseQueueOptions = {},\n): Queue<T> | undefined => {\n const client = useClient();\n const mountedRef = useRef(true);\n\n const queue = useMemo<Queue<T> | undefined>(() => {\n if (!queueDxn) {\n return undefined;\n }\n\n const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError('Invalid queue DXN'));\n return client.spaces.get(spaceId)?.queues.get<T>(queueDxn);\n }, [client, queueDxn?.toString()]);\n\n useEffect(() => {\n void queue?.refresh();\n }, [queue]);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n mountedRef.current = true;\n\n const poll = () => {\n if (!mountedRef.current) {\n return;\n }\n\n void queue?.refresh().finally(() => {\n if (mountedRef.current && options.pollInterval) {\n timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));\n }\n });\n };\n\n if (options.pollInterval) {\n poll();\n }\n\n return () => {\n mountedRef.current = false;\n clearTimeout(timeout);\n };\n }, [queue, options.pollInterval]);\n\n return queue;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { type BaseSchema } from '@dxos/echo-schema';\n\n/**\n * Subscribe to and retrieve schema changes from a space's schema registry.\n */\nexport const useSchema = (\n client: Client,\n space: Space | undefined,\n typename: string | undefined,\n): Schema.Schema.AnyNoContext | undefined => {\n const { subscribe, getSchema } = useMemo(() => {\n if (!typename || !space) {\n return {\n subscribe: () => () => {},\n getSchema: () => undefined,\n };\n }\n\n const staticSchema = client.graph.schemaRegistry.getSchema(typename);\n if (staticSchema) {\n return {\n subscribe: () => () => {},\n getSchema: () => staticSchema,\n };\n }\n\n const query = space.db.schemaRegistry.query({ typename });\n const initialResult: BaseSchema = query.runSync()[0];\n let currentSchema = initialResult;\n\n return {\n subscribe: (onStoreChange: () => void) => {\n const unsubscribe = query.subscribe(() => {\n currentSchema = query.results[0];\n onStoreChange();\n });\n\n return unsubscribe;\n },\n getSchema: () => currentSchema,\n };\n }, [typename, space]);\n\n return useSyncExternalStore(subscribe, getSchema);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\n\nimport { useSpace } from './useSpaces';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceKey);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\nexport const useSpaceInvitation = (spaceKey?: PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceKey);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useRef } from 'react';\n\nimport { type Selection, type SubscriptionHandle, createSubscription } from '@dxos/client/echo';\n\n/**\n * Create reactive selection.\n * Calls the callback when the selection changes and during the first render.\n */\n// TODO(wittjosiah): Is this still needed with signals reactivity? If not, remove or update jsdoc with usage info.\nexport const useSubscription = (cb: () => void, selection: Selection) => {\n // Make sure that the callback is always the one from the latest render.\n // Without this, we would always call the callback from the initial render,\n // which might contain stale data.\n const callbackRef = useRef(cb);\n callbackRef.current = cb;\n\n const subscriptionRef = useRef<SubscriptionHandle>();\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\n\nimport { useClient } from '../client';\n\nconst isEdgePeerId = (peerId: string, spaceId: SpaceId) =>\n peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n"],
5
+ "mappings": ";;;;;;;;;AAIA,cAAc;;;ACAd,SAASA,2BAA2B;AAEpC,SAASC,uBAAyC;AAClD,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,WAAWC,gBAAgB;AAGpC,SAAqBC,kBAAkB;AACvC,SAASC,8BAA8B;AAYhC,IAAMC,WAAW,CAACC,iBAAAA;AACvB,QAAMC,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAOE,MAAM;AAC5D,QAAM,CAACE,OAAOC,QAAAA,IAAYC,SAAS,KAAA;AAEnCC,YAAU,MAAA;AAER,QAAIR,cAAc;AAChB;IACF;AAEA,UAAMS,UAAUC,WAAW,YAAA;AACzB,YAAMT,OAAOE,OAAOQ,eAAc;AAClCL,eAAS,IAAA;IACX,CAAA;AAEA,WAAO,MAAMM,aAAaH,OAAAA;EAC5B,GAAG;IAACR;IAAQD;GAAa;AAEzB,MAAIA,cAAc;AAChB,WAAOG,OAAOU,KAAK,CAACC,UAAUA,MAAMC,IAAIC,OAAOhB,YAAAA,KAAiBc,MAAMG,OAAOjB,YAAAA;EAC/E;AAEA,MAAIK,SAASJ,OAAOiB,KAAKC,SAASC,IAAG,GAAI;AACvC,WAAOnB,OAAOE,OAAOkB;EACvB;AACF;AAeO,IAAMC,YAAY,CAAC,EAAEC,MAAM,MAAK,IAAsB,CAAC,MAAC;AAC7D,QAAMtB,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAOE,MAAM;AAG5D,SAAOA,OAAOqB,OAAO,CAACV,UAAUS,OAAOT,MAAMW,MAAML,IAAG,MAAOM,WAAWC,WAAW;AACrF;;;ADxDO,IAAMC,aAAa,CAACC,aAAAA;AAEzB,QAAMC,SAASC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AMO,IAAMoB,oBAAoB,CAACZ,UAAAA;AAChC,QAAM,CAACR,YAAYC,aAAAA,IAAiBC,UAAAA;AAEpCC,EAAAA,WAAU,MAAA;AACR,UAAMC,MAAM,IAAIC,QAAAA,QAAAA;;;;AAChBG,UAAMG,GAAGC,qBAAqBR,KAAK,CAAC,EAAES,QAAQ,CAAA,EAAE,MAAE;AAChD,YAAMC,YAAYD,MAAME,KAAK,CAACC,UAAUzB,aAAayB,MAAMxB,QAAQgB,MAAMC,EAAE,CAAA;AAC3E,UAAIK,WAAW;AACbb,sBAAca,SAAAA;MAChB;IACF,CAAA;AAEA,WAAO,MAAA;AACL,WAAKV,IAAIe,QAAO;IAClB;EACF,GAAG;IAACX;GAAM;AAEV,SAAOR;AACT;",
6
+ "names": ["MulticastObservable", "HaloSpaceMember", "useMulticastObservable", "useEffect", "useState", "SpaceState", "useMulticastObservable", "useSpace", "spaceKeyLike", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useEffect", "timeout", "setTimeout", "waitUntilReady", "clearTimeout", "find", "space", "key", "equals", "id", "halo", "identity", "get", "default", "useSpaces", "all", "filter", "state", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "key", "equals", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "useSyncExternalStore", "Filter", "Query", "isSpace", "EMPTY_ARRAY", "noop", "useQuery", "spaceOrEcho", "queryOrFilter", "deps", "query", "Filter", "is", "Query", "select", "getObjects", "subscribe", "useMemo", "subscribed", "queryResult", "undefined", "isSpace", "db", "objects", "cb", "unsubscribe", "JSON", "stringify", "ast", "useSyncExternalStore", "useEffect", "useMemo", "useRef", "raise", "MIN_POLL_INTERVAL", "useQueue", "queueDxn", "options", "client", "useClient", "mountedRef", "useRef", "queue", "useMemo", "undefined", "spaceId", "asQueueDXN", "raise", "TypeError", "spaces", "get", "queues", "toString", "useEffect", "refresh", "timeout", "current", "poll", "finally", "pollInterval", "setTimeout", "Math", "max", "clearTimeout", "useMemo", "useSyncExternalStore", "useSchema", "client", "space", "typename", "subscribe", "getSchema", "useMemo", "undefined", "staticSchema", "graph", "schemaRegistry", "query", "db", "initialResult", "runSync", "currentSchema", "onStoreChange", "unsubscribe", "results", "useSyncExternalStore", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceKey", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "useRef", "current", "subscriptionRef", "useEffect", "createSubscription", "unsubscribe", "update", "useEffect", "useState", "Context", "EdgeService", "isEdgePeerId", "peerId", "spaceId", "startsWith", "EdgeService", "AUTOMERGE_REPLICATOR", "useSyncState", "client", "useClient", "spaceState", "setSpaceState", "useState", "useEffect", "ctx", "Context", "createSubscriptions", "spaces", "space", "id", "onDispose", "db", "subscribeToSyncState", "peers", "syncState", "find", "state", "get", "subscribe", "dispose", "useSpaceSyncState"]
7
7
  }