@dxos/react-client 0.6.11 → 0.6.12-main.5a87ad5

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 (82) hide show
  1. package/dist/lib/browser/{chunk-CL7JDETM.mjs → chunk-ESSNDYBJ.mjs} +70 -61
  2. package/dist/lib/browser/chunk-ESSNDYBJ.mjs.map +7 -0
  3. package/dist/lib/browser/devtools/index.mjs +1 -1
  4. package/dist/lib/browser/echo/index.mjs +6 -4
  5. package/dist/lib/browser/echo/index.mjs.map +3 -3
  6. package/dist/lib/browser/halo/index.mjs +1 -1
  7. package/dist/lib/browser/index.mjs +1 -3
  8. package/dist/lib/browser/index.mjs.map +1 -1
  9. package/dist/lib/browser/mesh/index.mjs +1 -1
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/testing/index.mjs +28 -21
  12. package/dist/lib/browser/testing/index.mjs.map +3 -3
  13. package/dist/lib/node/{chunk-C4EWAKPZ.cjs → chunk-N474KOAU.cjs} +71 -61
  14. package/dist/lib/node/chunk-N474KOAU.cjs.map +7 -0
  15. package/dist/lib/node/devtools/index.cjs +2 -2
  16. package/dist/lib/node/echo/index.cjs +7 -5
  17. package/dist/lib/node/echo/index.cjs.map +3 -3
  18. package/dist/lib/node/halo/index.cjs +5 -5
  19. package/dist/lib/node/index.cjs +12 -14
  20. package/dist/lib/node/index.cjs.map +1 -1
  21. package/dist/lib/node/mesh/index.cjs +2 -2
  22. package/dist/lib/node/meta.json +1 -1
  23. package/dist/lib/node/testing/index.cjs +30 -23
  24. package/dist/lib/node/testing/index.cjs.map +3 -3
  25. package/dist/lib/node-esm/chunk-ACLHQASD.mjs +302 -0
  26. package/dist/lib/node-esm/chunk-ACLHQASD.mjs.map +7 -0
  27. package/dist/lib/node-esm/chunk-UYJUBYMU.mjs +165 -0
  28. package/dist/lib/node-esm/chunk-UYJUBYMU.mjs.map +7 -0
  29. package/dist/lib/node-esm/devtools/index.mjs +44 -0
  30. package/dist/lib/node-esm/devtools/index.mjs.map +7 -0
  31. package/dist/lib/node-esm/echo/index.mjs +134 -0
  32. package/dist/lib/node-esm/echo/index.mjs.map +7 -0
  33. package/dist/lib/node-esm/halo/index.mjs +100 -0
  34. package/dist/lib/node-esm/halo/index.mjs.map +7 -0
  35. package/dist/lib/node-esm/index.mjs +33 -0
  36. package/dist/lib/node-esm/index.mjs.map +7 -0
  37. package/dist/lib/node-esm/invitations/index.mjs +18 -0
  38. package/dist/lib/node-esm/invitations/index.mjs.map +7 -0
  39. package/dist/lib/node-esm/mesh/index.mjs +18 -0
  40. package/dist/lib/node-esm/mesh/index.mjs.map +7 -0
  41. package/dist/lib/node-esm/meta.json +1 -0
  42. package/dist/lib/node-esm/testing/index.mjs +173 -0
  43. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  44. package/dist/lib/node-esm/worker.mjs +5 -0
  45. package/dist/lib/node-esm/worker.mjs.map +7 -0
  46. package/dist/types/src/client/ClientProvider.d.ts +65 -9
  47. package/dist/types/src/client/ClientProvider.d.ts.map +1 -1
  48. package/dist/types/src/client/context.d.ts +1 -4
  49. package/dist/types/src/client/context.d.ts.map +1 -1
  50. package/dist/types/src/client/index.d.ts +0 -1
  51. package/dist/types/src/client/index.d.ts.map +1 -1
  52. package/dist/types/src/echo/useQuery.d.ts.map +1 -1
  53. package/dist/types/src/playwright/playwright.config.d.ts +2 -2
  54. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -1
  55. package/dist/types/src/testing/util.d.ts +5 -3
  56. package/dist/types/src/testing/util.d.ts.map +1 -1
  57. package/dist/types/src/testing/withClientProvider.d.ts +4 -1
  58. package/dist/types/src/testing/withClientProvider.d.ts.map +1 -1
  59. package/dist/types/src/testing/withClientProvider.stories.d.ts +4 -3
  60. package/dist/types/src/testing/withClientProvider.stories.d.ts.map +1 -1
  61. package/package.json +47 -38
  62. package/project.json +3 -22
  63. package/src/client/ClientProvider.test.tsx +7 -4
  64. package/src/client/ClientProvider.tsx +130 -90
  65. package/src/client/context.ts +4 -4
  66. package/src/client/index.ts +0 -3
  67. package/src/client/useConfig.test.tsx +7 -11
  68. package/src/echo/useQuery.ts +3 -6
  69. package/src/echo/useSpaces.test.tsx +6 -8
  70. package/src/halo/useDevices.test.tsx +3 -5
  71. package/src/playwright/playwright.config.ts +13 -2
  72. package/src/playwright/smoke.spec.ts +5 -10
  73. package/src/testing/util.tsx +11 -6
  74. package/src/testing/withClientProvider.stories.tsx +19 -10
  75. package/src/testing/withClientProvider.tsx +22 -18
  76. package/tsconfig.json +4 -2
  77. package/vitest.config.ts +22 -0
  78. package/dist/lib/browser/chunk-CL7JDETM.mjs.map +0 -7
  79. package/dist/lib/node/chunk-C4EWAKPZ.cjs.map +0 -7
  80. package/dist/types/src/client/useClientServices.d.ts +0 -3
  81. package/dist/types/src/client/useClientServices.d.ts.map +0 -1
  82. package/src/client/useClientServices.ts +0 -15
@@ -1,12 +1,12 @@
1
1
  // packages/sdk/react-client/src/client/AgentHostingProvider.tsx
2
- import React2, { createContext as createContext2, useContext as useContext5, useState as useState4 } from "react";
2
+ import React2, { createContext as createContext2, useContext as useContext4, useState as useState4 } from "react";
3
3
  import { AgentManagerClient, FakeAgentHostingProvider } from "@dxos/client";
4
4
  import { log as log2 } from "@dxos/log";
5
5
 
6
6
  // packages/sdk/react-client/src/client/ClientProvider.tsx
7
- import React, { useEffect, useMemo, useState } from "react";
7
+ import React, { forwardRef, useEffect, useImperativeHandle, useState } from "react";
8
8
  import { Client, SystemStatus } from "@dxos/client";
9
- import { registerSignalFactory } from "@dxos/echo-signals/react";
9
+ import { registerSignalRuntime } from "@dxos/echo-signals/react";
10
10
  import { log } from "@dxos/log";
11
11
  import { useControlledValue } from "@dxos/react-hooks";
12
12
  import { getAsyncProviderValue } from "@dxos/util";
@@ -41,15 +41,20 @@ var printBanner = (client) => {
41
41
 
42
42
  // packages/sdk/react-client/src/client/ClientProvider.tsx
43
43
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/client/ClientProvider.tsx";
44
- var ClientProvider = ({ children, config: configProvider, client: clientProvider, services: servicesProvider, types, status: controlledStatus, fallback: Fallback = () => null, registerSignalFactory: _registerSignalFactory = true, onInitialized, ...options }) => {
45
- useMemo(() => {
46
- _registerSignalFactory && registerSignalFactory();
47
- }, []);
48
- const [client, setClient] = useState(clientProvider instanceof Client ? clientProvider : void 0);
44
+ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvider, client: clientProvider, services: servicesProvider, types, status: controlledStatus, fallback: Fallback = () => null, registerSignalRuntime: _registerSignalRuntime = true, disableBanner, onInitialized, ...options }, forwardedRef) => {
45
+ useEffect(() => {
46
+ _registerSignalRuntime && registerSignalRuntime();
47
+ }, [
48
+ _registerSignalRuntime
49
+ ]);
49
50
  const [error, setError] = useState();
50
51
  if (error) {
51
52
  throw error;
52
53
  }
54
+ const [client, setClient] = useState(clientProvider instanceof Client ? clientProvider : void 0);
55
+ useImperativeHandle(forwardedRef, () => client, [
56
+ client
57
+ ]);
53
58
  const [status, setStatus] = useControlledValue(controlledStatus);
54
59
  useEffect(() => {
55
60
  if (!client) {
@@ -58,43 +63,48 @@ var ClientProvider = ({ children, config: configProvider, client: clientProvider
58
63
  const subscription = client.status.subscribe((status2) => setStatus(status2));
59
64
  return () => subscription.unsubscribe();
60
65
  }, [
61
- client,
62
- setStatus
66
+ client
63
67
  ]);
64
68
  useEffect(() => {
65
- const done = async (client2) => {
66
- await client2.initialize().catch(setError);
67
- log("client ready", void 0, {
68
- F: __dxlog_file,
69
- L: 115,
70
- S: void 0,
71
- C: (f, a) => f(...a)
72
- });
73
- await onInitialized?.(client2);
74
- log("initialization complete", void 0, {
75
- F: __dxlog_file,
76
- L: 117,
77
- S: void 0,
78
- C: (f, a) => f(...a)
79
- });
80
- if (types) {
81
- client2.addTypes(types);
69
+ const initialize = async (client3) => {
70
+ if (!client3.initialized) {
71
+ await client3.initialize().catch(setError);
72
+ log("client ready", void 0, {
73
+ F: __dxlog_file,
74
+ L: 143,
75
+ S: void 0,
76
+ C: (f, a) => f(...a)
77
+ });
78
+ if (types) {
79
+ client3.addTypes(types);
80
+ }
81
+ await onInitialized?.(client3);
82
+ log("initialization complete", void 0, {
83
+ F: __dxlog_file,
84
+ L: 148,
85
+ S: void 0,
86
+ C: (f, a) => f(...a)
87
+ });
88
+ } else if (types) {
89
+ client3.addTypes(types);
90
+ }
91
+ setClient(client3);
92
+ if (!disableBanner) {
93
+ printBanner(client3);
82
94
  }
83
- setClient(client2);
84
- setStatus(client2.status.get() ?? SystemStatus.ACTIVE);
85
- printBanner(client2);
86
95
  };
96
+ let client2;
87
97
  const t = setTimeout(async () => {
88
98
  if (clientProvider) {
89
- const client2 = await getAsyncProviderValue(clientProvider);
90
- await done(client2);
99
+ client2 = await getAsyncProviderValue(clientProvider);
100
+ await initialize(client2);
91
101
  } else {
92
102
  const config = await getAsyncProviderValue(configProvider);
93
103
  log("resolved config", {
94
104
  config
95
105
  }, {
96
106
  F: __dxlog_file,
97
- L: 135,
107
+ L: 169,
98
108
  S: void 0,
99
109
  C: (f, a) => f(...a)
100
110
  });
@@ -103,45 +113,53 @@ var ClientProvider = ({ children, config: configProvider, client: clientProvider
103
113
  services
104
114
  }, {
105
115
  F: __dxlog_file,
106
- L: 137,
116
+ L: 171,
107
117
  S: void 0,
108
118
  C: (f, a) => f(...a)
109
119
  });
110
- const client2 = new Client({
120
+ client2 = new Client({
111
121
  config,
112
122
  services,
113
123
  ...options
114
124
  });
115
125
  log("created client", void 0, {
116
126
  F: __dxlog_file,
117
- L: 139,
127
+ L: 173,
118
128
  S: void 0,
119
129
  C: (f, a) => f(...a)
120
130
  });
121
- await done(client2);
131
+ await initialize(client2);
122
132
  }
123
133
  });
124
134
  return () => {
125
135
  log("clean up", void 0, {
126
136
  F: __dxlog_file,
127
- L: 145,
137
+ L: 179,
128
138
  S: void 0,
129
139
  C: (f, a) => f(...a)
130
140
  });
131
141
  clearTimeout(t);
132
- void client?.destroy().catch((err) => log.catch(err, void 0, {
142
+ void client2?.destroy().then(() => {
143
+ log("destroyed", void 0, {
144
+ F: __dxlog_file,
145
+ L: 184,
146
+ S: void 0,
147
+ C: (f, a) => f(...a)
148
+ });
149
+ }).catch((err) => log.catch(err, void 0, {
133
150
  F: __dxlog_file,
134
- L: 147,
151
+ L: 186,
135
152
  S: void 0,
136
153
  C: (f, a) => f(...a)
137
154
  }));
138
155
  };
139
156
  }, [
140
- clientProvider,
141
157
  configProvider,
142
- servicesProvider
158
+ clientProvider,
159
+ servicesProvider,
160
+ disableBanner
143
161
  ]);
144
- if (!client || status !== SystemStatus.ACTIVE) {
162
+ if (!client?.initialized || status !== SystemStatus.ACTIVE) {
145
163
  return /* @__PURE__ */ React.createElement(Fallback, {
146
164
  client,
147
165
  status
@@ -153,7 +171,7 @@ var ClientProvider = ({ children, config: configProvider, client: clientProvider
153
171
  status
154
172
  }
155
173
  }, children);
156
- };
174
+ });
157
175
 
158
176
  // packages/sdk/react-client/src/client/useClient.ts
159
177
  import { useContext } from "react";
@@ -163,14 +181,6 @@ var useClient = () => {
163
181
  return client;
164
182
  };
165
183
 
166
- // packages/sdk/react-client/src/client/useClientServices.ts
167
- import { useContext as useContext2 } from "react";
168
- import { raise as raise2 } from "@dxos/debug";
169
- var useClientServices = () => {
170
- const { services } = useContext2(ClientContext) ?? raise2(new Error("Missing ClientContext."));
171
- return services;
172
- };
173
-
174
184
  // packages/sdk/react-client/src/client/useClientStatus.ts
175
185
  import { useEffect as useEffect2, useState as useState2 } from "react";
176
186
  var useClientStatus = (client) => {
@@ -189,10 +199,10 @@ var useClientStatus = (client) => {
189
199
  };
190
200
 
191
201
  // packages/sdk/react-client/src/client/useConfig.ts
192
- import { useContext as useContext3 } from "react";
193
- import { raise as raise3 } from "@dxos/debug";
202
+ import { useContext as useContext2 } from "react";
203
+ import { raise as raise2 } from "@dxos/debug";
194
204
  var useConfig = () => {
195
- const { client } = useContext3(ClientContext) ?? raise3(new Error("Missing ClientContext."));
205
+ const { client } = useContext2(ClientContext) ?? raise2(new Error("Missing ClientContext."));
196
206
  return client.config;
197
207
  };
198
208
 
@@ -212,10 +222,10 @@ var useShellDisplay = () => {
212
222
  };
213
223
 
214
224
  // packages/sdk/react-client/src/client/useStatus.ts
215
- import { useContext as useContext4 } from "react";
216
- import { raise as raise4 } from "@dxos/debug";
225
+ import { useContext as useContext3 } from "react";
226
+ import { raise as raise3 } from "@dxos/debug";
217
227
  var useStatus = () => {
218
- const { status } = useContext4(ClientContext) ?? raise4(new Error("Missing ClientContext."));
228
+ const { status } = useContext3(ClientContext) ?? raise3(new Error("Missing ClientContext."));
219
229
  return status;
220
230
  };
221
231
 
@@ -230,7 +240,7 @@ var AgentHostingProvider = (props) => {
230
240
  }, " ", props.children);
231
241
  };
232
242
  var useAgentHostingClient = () => {
233
- return useContext5(AgentHostingContext);
243
+ return useContext4(AgentHostingContext);
234
244
  };
235
245
  var makeClient = ({ config, halo }) => {
236
246
  const agentHostingConfig = config.get("runtime.services.agentHosting");
@@ -281,11 +291,10 @@ export {
281
291
  ClientContext,
282
292
  ClientProvider,
283
293
  useClient,
284
- useClientServices,
285
294
  useClientStatus,
286
295
  useConfig,
287
296
  useShell,
288
297
  useShellDisplay,
289
298
  useStatus
290
299
  };
291
- //# sourceMappingURL=chunk-CL7JDETM.mjs.map
300
+ //# sourceMappingURL=chunk-ESSNDYBJ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/client/AgentHostingProvider.tsx", "../../../src/client/ClientProvider.tsx", "../../../src/client/context.ts", "../../../src/banner.ts", "../../../src/client/useClient.ts", "../../../src/client/useClientStatus.ts", "../../../src/client/useConfig.ts", "../../../src/client/useShell.ts", "../../../src/client/useStatus.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { createContext, type PropsWithChildren, useContext, useState } from 'react';\n\nimport { type AgentHostingProviderClient, AgentManagerClient, FakeAgentHostingProvider } from '@dxos/client';\nimport { type Halo } from '@dxos/client/halo';\nimport { type Config } from '@dxos/config';\nimport { log } from '@dxos/log';\n\nimport { useClient } from '../client';\n\nexport type AgentHostingProviderProps = { config: Config; halo: Halo };\n\nexport const AgentHostingContext = createContext<AgentHostingProviderClient | null>(null);\n\n/**\n * Experimental agent hosting provider.\n * @param props\n * @constructor\n * @deprecated\n */\nexport const AgentHostingProvider = (props: PropsWithChildren<{}>) => {\n const client = useClient();\n const [agentHostingProviderClient] = useState(makeClient(client));\n return (\n <AgentHostingContext.Provider value={agentHostingProviderClient}> {props.children}</AgentHostingContext.Provider>\n );\n};\n\nexport const useAgentHostingClient = () => {\n return useContext(AgentHostingContext);\n};\n\nconst makeClient = ({ config, halo }: AgentHostingProviderProps) => {\n const agentHostingConfig = config.get('runtime.services.agentHosting');\n if (!agentHostingConfig) {\n log('no agent hosting configured');\n return null;\n }\n\n // TODO(nf): Dynamically discover based on runtime config.\n let agentHostingProviderClient: AgentHostingProviderClient | null = null;\n switch (agentHostingConfig.type) {\n case 'LOCAL_TESTING': {\n log('using FakeAgentHostingProvider');\n return new FakeAgentHostingProvider();\n }\n\n case 'AGENTHOSTING_API': {\n agentHostingProviderClient = new AgentManagerClient(config, halo);\n if (agentHostingProviderClient.init()) {\n return agentHostingProviderClient;\n } else {\n // Not authorized or error initializing.\n return null;\n }\n }\n\n default: {\n log.error('Unknown agent hosting provider type: ' + agentHostingConfig.type);\n return null;\n }\n }\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type FunctionComponent,\n type ReactNode,\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 { type S } from '@dxos/echo-schema';\nimport { registerSignalRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { useControlledValue } from '@dxos/react-hooks';\nimport { getAsyncProviderValue, type MaybePromise, type Provider } from '@dxos/util';\n\nimport { ClientContext, type ClientContextProps } from './context';\nimport { printBanner } from '../banner';\n\n/**\n * Properties for the ClientProvider.\n */\nexport type ClientProviderProps = Pick<ClientContextProps, 'status'> &\n Omit<ClientOptions, 'config' | 'services'> & {\n children?: ReactNode;\n\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 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 services?: ClientServicesProvider | ((config?: Config) => MaybePromise<ClientServicesProvider>);\n\n /**\n * List of schema to register.\n *\n * NOTE: If a `client` is provided then `types` will not be added until after the children are first rendered.\n */\n types?: S.Schema<any>[];\n\n /**\n * ReactNode to display until the client is available.\n */\n fallback?: FunctionComponent<Partial<ClientContextProps>>;\n\n /**\n * Set to false to stop default signal runtime from being registered.\n *\n * The signals runtime is used to provide reactive updates to ECHO objects.\n */\n registerSignalRuntime?: boolean;\n\n /**\n * Skip the DXOS banner print.\n */\n disableBanner?: boolean;\n\n /**\n * Post initialization hook to enable to caller to do custom initialization.\n *\n * @param Client\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 types,\n status: controlledStatus,\n fallback: Fallback = () => null,\n registerSignalRuntime: _registerSignalRuntime = true,\n disableBanner,\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 _registerSignalRuntime && registerSignalRuntime();\n }, [_registerSignalRuntime]);\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] = useControlledValue(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 const initialize = async (client: Client) => {\n if (!client.initialized) {\n await client.initialize().catch(setError);\n log('client ready');\n if (types) {\n client.addTypes(types);\n }\n await onInitialized?.(client);\n log('initialization complete');\n } else if (types) {\n client.addTypes(types);\n }\n\n setClient(client);\n\n if (!disableBanner) {\n printBanner(client);\n }\n };\n\n let client: Client;\n const t = setTimeout(async () => {\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 });\n\n return () => {\n log('clean up');\n clearTimeout(t);\n void client\n ?.destroy()\n .then(() => {\n log('destroyed');\n })\n .catch((err) => log.catch(err));\n };\n }, [configProvider, clientProvider, servicesProvider, disableBanner]);\n\n if (!client?.initialized || status !== SystemStatus.ACTIVE) {\n return <Fallback client={client} status={status} />;\n }\n\n return <ClientContext.Provider value={{ client, status }}>{children}</ClientContext.Provider>;\n },\n);\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nimport { type Client, type SystemStatus } from '@dxos/client';\n\nexport type ClientContextProps = {\n client: Client;\n\n status?: SystemStatus | null;\n};\n\n/**\n * @internal Use ClientProvider to create or initialize the Client.\n */\nexport const ClientContext: Context<ClientContextProps | undefined> = createContext<ClientContextProps | undefined>(\n undefined,\n);\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport { type Client } from '@dxos/client';\n\n// http://patorjk.com/software/taag/#p=testall&f=Patorjk-HeX&t=DXOS\nconst BANNER = (client: Client) => {\n const commitHash = client.config.get('runtime.app.build.commitHash');\n const hash = commitHash ? ` App Commit ${commitHash} \\n` : '';\n\n return (\n '\\n' +\n '_/\\\\/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\______/\\\\/\\\\/\\\\/\\\\/\\\\_\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\__/\\\\/\\\\_________\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\______/\\\\/\\\\______/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\___\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\__________/\\\\/\\\\_\\n' +\n '_/\\\\/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\/\\\\___\\n' +\n `\\n DXOS Client ${client.version} \\n${hash}`\n );\n};\n\nlet bannerPrinted = false;\n\nexport const printBanner = (client: Client) => {\n if (bannerPrinted) {\n return;\n }\n\n bannerPrinted = true;\n // eslint-disable-next-line no-console\n console.log(`%c${BANNER(client)}`, 'font-family: monospace;');\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ClientContext } from '../client/context';\n\n/**\n * Hook returning instance of DXOS client.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useClient = () => {\n const { client } = useContext(ClientContext) ?? raise(new Error('Missing ClientContext.'));\n return client;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Client, type SystemStatus } from '@dxos/client';\n\nexport const useClientStatus = (client: Client) => {\n const [status, setStatus] = useState<SystemStatus | null>();\n useEffect(() => {\n if (!client) {\n return;\n }\n\n const subscription = client.status.subscribe((status) => setStatus(status));\n return () => subscription.unsubscribe();\n }, [client, setStatus]);\n\n return status;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ClientContext } from './context';\n\n/**\n * Hook returning config object used to initialize the DXOS client instance.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useConfig = () => {\n const { client } = useContext(ClientContext) ?? raise(new Error('Missing ClientContext.'));\n return client.config;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Shell, type ShellDisplay } from '@dxos/client';\n\nimport { useClient } from './useClient';\n\n/**\n * Helper hook to access the shell.\n */\nexport const useShell = (): Shell => {\n const client = useClient();\n return client.shell;\n};\n\n/**\n * Hook to access the shell’s display state.\n */\nexport const useShellDisplay = (): ShellDisplay => {\n const client = useClient();\n const [display, setDisplay] = useState(client.shell.display);\n useEffect(() => client.shell.onDisplayChange(setDisplay), [client]);\n return display;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { type SystemStatus } from '@dxos/client';\nimport { raise } from '@dxos/debug';\n\nimport { ClientContext } from './context';\n\nexport const useStatus = (): SystemStatus | null | undefined => {\n const { status } = useContext(ClientContext) ?? raise(new Error('Missing ClientContext.'));\n return status;\n};\n"],
5
+ "mappings": ";AAIA,OAAOA,UAASC,iBAAAA,gBAAuCC,cAAAA,aAAYC,YAAAA,iBAAgB;AAEnF,SAA0CC,oBAAoBC,gCAAgC;AAG9F,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CP,mBAAmBG,MAAI,QAAA;;;;;;AAC3E,aAAO;IACT;EACF;AACF;",
6
+ "names": ["React", "createContext", "useContext", "useState", "AgentManagerClient", "FakeAgentHostingProvider", "log", "React", "forwardRef", "useEffect", "useImperativeHandle", "useState", "Client", "SystemStatus", "registerSignalRuntime", "log", "useControlledValue", "getAsyncProviderValue", "createContext", "ClientContext", "createContext", "undefined", "BANNER", "client", "commitHash", "config", "get", "hash", "version", "bannerPrinted", "printBanner", "console", "log", "ClientProvider", "forwardRef", "children", "config", "configProvider", "client", "clientProvider", "services", "servicesProvider", "types", "status", "controlledStatus", "fallback", "Fallback", "registerSignalRuntime", "_registerSignalRuntime", "disableBanner", "onInitialized", "options", "forwardedRef", "useEffect", "error", "setError", "useState", "setClient", "Client", "undefined", "useImperativeHandle", "setStatus", "useControlledValue", "subscription", "subscribe", "unsubscribe", "initialize", "initialized", "catch", "log", "addTypes", "printBanner", "t", "setTimeout", "getAsyncProviderValue", "clearTimeout", "destroy", "then", "err", "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,6 +1,6 @@
1
1
  import {
2
2
  useClient
3
- } from "../chunk-CL7JDETM.mjs";
3
+ } from "../chunk-ESSNDYBJ.mjs";
4
4
 
5
5
  // packages/sdk/react-client/src/devtools/index.ts
6
6
  export * from "@dxos/client/devtools";
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-AL2CUQ46.mjs";
4
4
  import {
5
5
  useClient
6
- } from "../chunk-CL7JDETM.mjs";
6
+ } from "../chunk-ESSNDYBJ.mjs";
7
7
 
8
8
  // packages/sdk/react-client/src/echo/index.ts
9
9
  export * from "@dxos/client/echo";
@@ -59,7 +59,7 @@ var useMembers = (spaceKey) => {
59
59
 
60
60
  // packages/sdk/react-client/src/echo/useQuery.ts
61
61
  import { useMemo, useSyncExternalStore } from "react";
62
- import { isSpace } from "@dxos/client/echo";
62
+ import { Filter, isSpace } from "@dxos/client/echo";
63
63
  var useQuery = (spaceOrEcho, filter, options, deps) => {
64
64
  const { subscribe, getObjects } = useMemo(() => {
65
65
  const query = isSpace(spaceOrEcho) ? spaceOrEcho.db.query(filter, options) : spaceOrEcho?.query(filter, options);
@@ -77,12 +77,14 @@ var useQuery = (spaceOrEcho, filter, options, deps) => {
77
77
  };
78
78
  }, [
79
79
  spaceOrEcho,
80
- ...typeof filter === "function" ? [] : filterToDepsArray(filter),
80
+ ...filterToDepsArray(filter),
81
81
  ...deps ?? []
82
82
  ]);
83
83
  return useSyncExternalStore(subscribe, getObjects) ?? [];
84
84
  };
85
- var filterToDepsArray = (filter) => Object.entries(filter ?? {}).flat(10).map((x) => typeof x === "function" || typeof x === "object" ? null : x);
85
+ var filterToDepsArray = (filter) => [
86
+ JSON.stringify(Filter.from(filter).toProto())
87
+ ];
86
88
  var noop = () => {
87
89
  };
88
90
  var EMPTY_ARRAY = [];
@@ -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/useSpaceInvitations.ts", "../../../../src/echo/useSubscription.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\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.isReady.wait();\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 {\n isSpace,\n type Echo,\n type EchoReactiveObject,\n type FilterSource,\n type Query,\n type QueryOptions,\n type Space,\n} from '@dxos/client/echo';\n\n/**\n * Create subscription.\n */\n// TODO(burdon): Support typed operator filters (e.g., Note.filter(note => ...)).\nexport const useQuery = <T extends EchoReactiveObject<any>>(\n spaceOrEcho?: Space | Echo,\n filter?: FilterSource<T>,\n options?: QueryOptions,\n deps?: any[],\n): T[] => {\n const { subscribe, getObjects } = useMemo(() => {\n const query = isSpace(spaceOrEcho)\n ? spaceOrEcho.db.query(filter, options)\n : (spaceOrEcho?.query(filter, options) as Query<T> | undefined);\n let subscribed = false;\n\n return {\n subscribe: (cb: () => void) => {\n subscribed = true;\n const unsubscribe = query?.subscribe(cb) ?? noop;\n return () => {\n unsubscribe?.();\n subscribed = false;\n };\n },\n getObjects: () => (subscribed && query ? query.objects : EMPTY_ARRAY),\n };\n }, [spaceOrEcho, ...(typeof filter === 'function' ? [] : filterToDepsArray(filter)), ...(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 return useSyncExternalStore<T[] | undefined>(subscribe, getObjects) ?? [];\n};\n\n// TODO(dmaretskyi): Serialize the filter here instead.\nconst filterToDepsArray = (filter?: FilterSource<any>) =>\n Object.entries(filter ?? {})\n .flat(10)\n .map((x) => (typeof x === 'function' || typeof x === 'object' ? null : x));\n\nconst noop = () => {};\n\nconst EMPTY_ARRAY: never[] = [];\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"],
5
- "mappings": ";;;;;;;;AAIA,cAAc;;;ACAd,SAASA,2BAA2B;AAEpC,SAASC,uBAAyC;AAClD,SAASC,0B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QAAAA;AACxC,QAAMS,aAAaC,SACjB,MAAMN,YAAYO,KAAK,CAACF,gBAAeA,YAAWG,IAAG,EAAGJ,iBAAiBA,YAAAA,GACzE;IAACJ;GAAY;AAEf,SAAOS,oBAAoBJ,UAAAA;AAC7B;;;ACrBA,SAASK,aAAAA,YAAWC,cAAc;AAElC,SAAkDC,0BAA0B;AAOrE,IAAMC,kBAAkB,CAACC,IAAgBC,cAAAA;AAI9C,QAAMC,cAAcC,OAAOH,EAAAA;AAC3BE,cAAYE,UAAUJ;AAEtB,QAAMK,kBAAkBF,OAAAA;AAExBG,EAAAA,WAAU,MAAA;AACRD,oBAAgBD,UAAUG,mBAAmB,MAAA;AAC3CL,kBAAYE,QAAO;IACrB,CAAA;AAEA,WAAO,MAAMC,gBAAgBD,SAASI,YAAAA;EACxC,GAAG,CAAA,CAAE;AAELH,kBAAgBD,SAASK,OAAOR,SAAAA;AAChC,SAAOI,gBAAgBD;AACzB;",
6
- "names": ["MulticastObservable", "HaloSpaceMember", "useMulticastObservable", "useEffect", "useState", "SpaceState", "useMulticastObservable", "useSpace", "spaceKeyLike", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useEffect", "timeout", "setTimeout", "isReady", "wait", "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", "isSpace", "useQuery", "spaceOrEcho", "filter", "options", "deps", "subscribe", "getObjects", "useMemo", "query", "isSpace", "db", "subscribed", "cb", "unsubscribe", "noop", "objects", "EMPTY_ARRAY", "filterToDepsArray", "useSyncExternalStore", "Object", "entries", "flat", "map", "x", "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"]
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\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.isReady.wait();\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 {\n Filter,\n isSpace,\n type Echo,\n type EchoReactiveObject,\n type FilterSource,\n type Query,\n type QueryOptions,\n type Space,\n} from '@dxos/client/echo';\n\n/**\n * Create subscription.\n */\n// TODO(burdon): Support typed operator filters (e.g., Note.filter(note => ...)).\nexport const useQuery = <T extends EchoReactiveObject<any>>(\n spaceOrEcho?: Space | Echo,\n filter?: FilterSource<T>,\n options?: QueryOptions,\n deps?: any[],\n): T[] => {\n const { subscribe, getObjects } = useMemo(() => {\n const query = isSpace(spaceOrEcho)\n ? spaceOrEcho.db.query(filter, options)\n : (spaceOrEcho?.query(filter, options) as Query<T> | undefined);\n let subscribed = false;\n\n return {\n subscribe: (cb: () => void) => {\n subscribed = true;\n const unsubscribe = query?.subscribe(cb) ?? noop;\n return () => {\n unsubscribe?.();\n subscribed = false;\n };\n },\n getObjects: () => (subscribed && query ? query.objects : EMPTY_ARRAY),\n };\n }, [spaceOrEcho, ...filterToDepsArray(filter), ...(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 return useSyncExternalStore<T[] | undefined>(subscribe, getObjects) ?? [];\n};\n\nconst filterToDepsArray = (filter?: FilterSource<any>) => [JSON.stringify(Filter.from(filter).toProto())];\n\nconst noop = () => {};\n\nconst EMPTY_ARRAY: never[] = [];\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 subscri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,iBAAAA;AACvD,QAAMJ,cAAcL,oBAAoBC,QAAAA;AACxC,QAAMS,aAAaC,SACjB,MAAMN,YAAYO,KAAK,CAACF,gBAAeA,YAAWG,IAAG,EAAGJ,iBAAiBA,YAAAA,GACzE;IAACJ;GAAY;AAEf,SAAOS,oBAAoBJ,UAAAA;AAC7B;;;ACrBA,SAASK,aAAAA,YAAWC,cAAc;AAElC,SAAkDC,0BAA0B;AAOrE,IAAMC,kBAAkB,CAACC,IAAgBC,cAAAA;AAI9C,QAAMC,cAAcC,OAAOH,EAAAA;AAC3BE,cAAYE,UAAUJ;AAEtB,QAAMK,kBAAkBF,OAAAA;AAExBG,EAAAA,WAAU,MAAA;AACRD,oBAAgBD,UAAUG,mBAAmB,MAAA;AAC3CL,kBAAYE,QAAO;IACrB,CAAA;AAEA,WAAO,MAAMC,gBAAgBD,SAASI,YAAAA;EACxC,GAAG,CAAA,CAAE;AAELH,kBAAgBD,SAASK,OAAOR,SAAAA;AAChC,SAAOI,gBAAgBD;AACzB;",
6
+ "names": ["MulticastObservable", "HaloSpaceMember", "useMulticastObservable", "useEffect", "useState", "SpaceState", "useMulticastObservable", "useSpace", "spaceKeyLike", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useEffect", "timeout", "setTimeout", "isReady", "wait", "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", "isSpace", "useQuery", "spaceOrEcho", "filter", "options", "deps", "subscribe", "getObjects", "useMemo", "query", "isSpace", "db", "subscribed", "cb", "unsubscribe", "noop", "objects", "EMPTY_ARRAY", "filterToDepsArray", "useSyncExternalStore", "JSON", "stringify", "Filter", "from", "toProto", "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"]
7
7
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-AL2CUQ46.mjs";
4
4
  import {
5
5
  useClient
6
- } from "../chunk-CL7JDETM.mjs";
6
+ } from "../chunk-ESSNDYBJ.mjs";
7
7
 
8
8
  // packages/sdk/react-client/src/halo/index.ts
9
9
  import { Device, DeviceKind, DeviceType } from "@dxos/client/halo";
@@ -5,13 +5,12 @@ import {
5
5
  ClientProvider,
6
6
  useAgentHostingClient,
7
7
  useClient,
8
- useClientServices,
9
8
  useClientStatus,
10
9
  useConfig,
11
10
  useShell,
12
11
  useShellDisplay,
13
12
  useStatus
14
- } from "./chunk-CL7JDETM.mjs";
13
+ } from "./chunk-ESSNDYBJ.mjs";
15
14
 
16
15
  // packages/sdk/react-client/src/index.ts
17
16
  export * from "@dxos/client";
@@ -23,7 +22,6 @@ export {
23
22
  ClientProvider,
24
23
  useAgentHostingClient,
25
24
  useClient,
26
- useClientServices,
27
25
  useClientStatus,
28
26
  useConfig,
29
27
  useMulticastObservable,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/index.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client';\nexport { useMulticastObservable } from '@dxos/react-hooks';\n\nexport * from './client';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAIA,cAAc;AACd,SAASA,8BAA8B;",
5
+ "mappings": ";;;;;;;;;;;;;;;AAIA,cAAc;AACd,SAASA,8BAA8B;",
6
6
  "names": ["useMulticastObservable"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useClient
3
- } from "../chunk-CL7JDETM.mjs";
3
+ } from "../chunk-ESSNDYBJ.mjs";
4
4
 
5
5
  // packages/sdk/react-client/src/mesh/index.ts
6
6
  export * from "@dxos/client/mesh";