@dxos/react-client 0.6.13 → 0.6.14-main.2b6a0f3

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 (110) hide show
  1. package/dist/lib/browser/chunk-DXE5O7SV.mjs +8 -0
  2. package/dist/lib/browser/chunk-DXE5O7SV.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-KX3DKZQL.mjs +16 -0
  4. package/dist/lib/browser/chunk-KX3DKZQL.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-OFVJLJ3V.mjs +167 -0
  6. package/dist/lib/browser/chunk-OFVJLJ3V.mjs.map +7 -0
  7. package/dist/lib/browser/devtools/index.mjs +2 -1
  8. package/dist/lib/browser/devtools/index.mjs.map +1 -1
  9. package/dist/lib/browser/echo/index.mjs +8 -5
  10. package/dist/lib/browser/echo/index.mjs.map +3 -3
  11. package/dist/lib/browser/halo/index.mjs +2 -1
  12. package/dist/lib/browser/halo/index.mjs.map +1 -1
  13. package/dist/lib/browser/index.mjs +114 -14
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/mesh/index.mjs +2 -1
  16. package/dist/lib/browser/mesh/index.mjs.map +1 -1
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/testing/index.mjs +92 -39
  19. package/dist/lib/browser/testing/index.mjs.map +3 -3
  20. package/dist/lib/node/chunk-DVAPCZTK.cjs +35 -0
  21. package/dist/lib/node/chunk-DVAPCZTK.cjs.map +7 -0
  22. package/dist/lib/node/chunk-VIZOXSRY.cjs +30 -0
  23. package/dist/lib/node/chunk-VIZOXSRY.cjs.map +7 -0
  24. package/dist/lib/node/chunk-ZUY26MIE.cjs +192 -0
  25. package/dist/lib/node/chunk-ZUY26MIE.cjs.map +7 -0
  26. package/dist/lib/node/devtools/index.cjs +3 -2
  27. package/dist/lib/node/devtools/index.cjs.map +1 -1
  28. package/dist/lib/node/echo/index.cjs +9 -6
  29. package/dist/lib/node/echo/index.cjs.map +3 -3
  30. package/dist/lib/node/halo/index.cjs +6 -5
  31. package/dist/lib/node/halo/index.cjs.map +1 -1
  32. package/dist/lib/node/index.cjs +120 -14
  33. package/dist/lib/node/index.cjs.map +4 -4
  34. package/dist/lib/node/mesh/index.cjs +3 -2
  35. package/dist/lib/node/mesh/index.cjs.map +1 -1
  36. package/dist/lib/node/meta.json +1 -1
  37. package/dist/lib/node/testing/index.cjs +90 -37
  38. package/dist/lib/node/testing/index.cjs.map +3 -3
  39. package/dist/lib/node-esm/chunk-KVEEO6SV.mjs +168 -0
  40. package/dist/lib/node-esm/chunk-KVEEO6SV.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-QNHFZM3T.mjs +17 -0
  42. package/dist/lib/node-esm/chunk-QNHFZM3T.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-UPS353EF.mjs +10 -0
  44. package/dist/lib/node-esm/chunk-UPS353EF.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-UYJUBYMU.mjs +165 -0
  46. package/dist/lib/node-esm/chunk-UYJUBYMU.mjs.map +7 -0
  47. package/dist/lib/node-esm/devtools/index.mjs +45 -0
  48. package/dist/lib/node-esm/devtools/index.mjs.map +7 -0
  49. package/dist/lib/node-esm/echo/index.mjs +135 -0
  50. package/dist/lib/node-esm/echo/index.mjs.map +7 -0
  51. package/dist/lib/node-esm/halo/index.mjs +101 -0
  52. package/dist/lib/node-esm/halo/index.mjs.map +7 -0
  53. package/dist/lib/node-esm/index.mjs +135 -0
  54. package/dist/lib/node-esm/index.mjs.map +7 -0
  55. package/dist/lib/node-esm/invitations/index.mjs +18 -0
  56. package/dist/lib/node-esm/invitations/index.mjs.map +7 -0
  57. package/dist/lib/node-esm/mesh/index.mjs +19 -0
  58. package/dist/lib/node-esm/mesh/index.mjs.map +7 -0
  59. package/dist/lib/node-esm/meta.json +1 -0
  60. package/dist/lib/node-esm/testing/index.mjs +219 -0
  61. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  62. package/dist/lib/node-esm/worker.mjs +5 -0
  63. package/dist/lib/node-esm/worker.mjs.map +7 -0
  64. package/dist/types/src/client/AgentHostingProvider.d.ts +1 -1
  65. package/dist/types/src/client/AgentHostingProvider.d.ts.map +1 -1
  66. package/dist/types/src/client/ClientProvider.d.ts +59 -18
  67. package/dist/types/src/client/ClientProvider.d.ts.map +1 -1
  68. package/dist/types/src/client/context.d.ts +1 -4
  69. package/dist/types/src/client/context.d.ts.map +1 -1
  70. package/dist/types/src/client/index.d.ts +0 -1
  71. package/dist/types/src/client/index.d.ts.map +1 -1
  72. package/dist/types/src/echo/useQuery.d.ts.map +1 -1
  73. package/dist/types/src/playwright/playwright.config.d.ts +2 -2
  74. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -1
  75. package/dist/types/src/testing/ClientRepeater.d.ts +9 -12
  76. package/dist/types/src/testing/ClientRepeater.d.ts.map +1 -1
  77. package/dist/types/src/testing/util.d.ts +5 -3
  78. package/dist/types/src/testing/util.d.ts.map +1 -1
  79. package/dist/types/src/testing/withClientProvider.d.ts +4 -1
  80. package/dist/types/src/testing/withClientProvider.d.ts.map +1 -1
  81. package/dist/types/src/testing/withClientProvider.stories.d.ts +4 -3
  82. package/dist/types/src/testing/withClientProvider.stories.d.ts.map +1 -1
  83. package/package.json +48 -41
  84. package/project.json +3 -22
  85. package/src/client/AgentHostingProvider.tsx +1 -1
  86. package/src/client/ClientProvider.test.tsx +7 -4
  87. package/src/client/ClientProvider.tsx +126 -100
  88. package/src/client/context.ts +4 -5
  89. package/src/client/index.ts +0 -3
  90. package/src/client/useConfig.test.tsx +10 -12
  91. package/src/echo/useQuery.ts +3 -6
  92. package/src/echo/useSpaces.test.tsx +7 -9
  93. package/src/echo/useSpaces.ts +1 -1
  94. package/src/halo/useDevices.test.tsx +3 -5
  95. package/src/playwright/playwright.config.ts +13 -2
  96. package/src/playwright/smoke.spec.ts +5 -10
  97. package/src/testing/ClientRepeater.stories.tsx +1 -1
  98. package/src/testing/ClientRepeater.tsx +19 -20
  99. package/src/testing/util.tsx +12 -7
  100. package/src/testing/withClientProvider.stories.tsx +20 -11
  101. package/src/testing/withClientProvider.tsx +56 -30
  102. package/tsconfig.json +2 -58
  103. package/vitest.config.ts +22 -0
  104. package/dist/lib/browser/chunk-CL7JDETM.mjs +0 -291
  105. package/dist/lib/browser/chunk-CL7JDETM.mjs.map +0 -7
  106. package/dist/lib/node/chunk-C4EWAKPZ.cjs +0 -312
  107. package/dist/lib/node/chunk-C4EWAKPZ.cjs.map +0 -7
  108. package/dist/types/src/client/useClientServices.d.ts +0 -3
  109. package/dist/types/src/client/useClientServices.d.ts.map +0 -1
  110. package/src/client/useClientServices.ts +0 -15
@@ -0,0 +1,8 @@
1
+ // packages/sdk/react-client/src/client/context.ts
2
+ import { createContext } from "react";
3
+ var ClientContext = createContext(void 0);
4
+
5
+ export {
6
+ ClientContext
7
+ };
8
+ //# sourceMappingURL=chunk-DXE5O7SV.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/client/context.ts"],
4
+ "sourcesContent": ["//\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"],
5
+ "mappings": ";AAIA,SAAuBA,qBAAqB;AAYrC,IAAMC,gBAAyDC,cACpEC,MAAAA;",
6
+ "names": ["createContext", "ClientContext", "createContext", "undefined"]
7
+ }
@@ -0,0 +1,16 @@
1
+ import {
2
+ ClientContext
3
+ } from "./chunk-DXE5O7SV.mjs";
4
+
5
+ // packages/sdk/react-client/src/client/useClient.ts
6
+ import { useContext } from "react";
7
+ import { raise } from "@dxos/debug";
8
+ var useClient = () => {
9
+ const { client } = useContext(ClientContext) ?? raise(new Error("Missing ClientContext."));
10
+ return client;
11
+ };
12
+
13
+ export {
14
+ useClient
15
+ };
16
+ //# sourceMappingURL=chunk-KX3DKZQL.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/client/useClient.ts"],
4
+ "sourcesContent": ["//\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"],
5
+ "mappings": ";;;;;AAIA,SAASA,kBAAkB;AAE3B,SAASC,aAAa;AAQf,IAAMC,YAAY,MAAA;AACvB,QAAM,EAAEC,OAAM,IAAKC,WAAWC,aAAAA,KAAkBC,MAAM,IAAIC,MAAM,wBAAA,CAAA;AAChE,SAAOJ;AACT;",
6
+ "names": ["useContext", "raise", "useClient", "client", "useContext", "ClientContext", "raise", "Error"]
7
+ }
@@ -0,0 +1,167 @@
1
+ import {
2
+ ClientContext
3
+ } from "./chunk-DXE5O7SV.mjs";
4
+
5
+ // packages/sdk/react-client/src/client/ClientProvider.tsx
6
+ import React, { forwardRef, useEffect, useImperativeHandle, useState } from "react";
7
+ import { Client, SystemStatus } from "@dxos/client";
8
+ import { registerSignalsRuntime } from "@dxos/echo-signals/react";
9
+ import { log } from "@dxos/log";
10
+ import { useControlledValue } from "@dxos/react-hooks";
11
+ import { getAsyncProviderValue } from "@dxos/util";
12
+
13
+ // packages/sdk/react-client/src/banner.ts
14
+ var BANNER = (client) => {
15
+ const commitHash = client.config.get("runtime.app.build.commitHash");
16
+ const hash = commitHash ? ` App Commit ${commitHash}
17
+ ` : "";
18
+ return `
19
+ _/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\______/\\/\\/\\/\\/\\_
20
+ _/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__/\\/\\_________
21
+ _/\\/\\____/\\/\\______/\\/\\______/\\/\\____/\\/\\____/\\/\\/\\/\\___
22
+ _/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__________/\\/\\_
23
+ _/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\/\\/\\/\\___
24
+
25
+ DXOS Client ${client.version}
26
+ ${hash}`;
27
+ };
28
+ var bannerPrinted = false;
29
+ var printBanner = (client) => {
30
+ if (bannerPrinted) {
31
+ return;
32
+ }
33
+ bannerPrinted = true;
34
+ console.log(`%c${BANNER(client)}`, "font-family: monospace;");
35
+ };
36
+
37
+ // packages/sdk/react-client/src/client/ClientProvider.tsx
38
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/client/ClientProvider.tsx";
39
+ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProvider, client: clientProvider, services: servicesProvider, status: controlledStatus, fallback: Fallback = () => null, signalsRuntime = true, noBanner, onInitialized, ...options }, forwardedRef) => {
40
+ useEffect(() => {
41
+ signalsRuntime && registerSignalsRuntime();
42
+ }, []);
43
+ const [error, setError] = useState();
44
+ if (error) {
45
+ throw error;
46
+ }
47
+ const [client, setClient] = useState(clientProvider instanceof Client ? clientProvider : void 0);
48
+ useImperativeHandle(forwardedRef, () => client, [
49
+ client
50
+ ]);
51
+ const [status, setStatus] = useControlledValue(controlledStatus);
52
+ useEffect(() => {
53
+ if (!client) {
54
+ return;
55
+ }
56
+ const subscription = client.status.subscribe((status2) => setStatus(status2));
57
+ return () => subscription.unsubscribe();
58
+ }, [
59
+ client
60
+ ]);
61
+ useEffect(() => {
62
+ const initialize = async (client3) => {
63
+ if (!client3.initialized) {
64
+ await client3.initialize().catch(setError);
65
+ log("client ready", void 0, {
66
+ F: __dxlog_file,
67
+ L: 134,
68
+ S: void 0,
69
+ C: (f, a) => f(...a)
70
+ });
71
+ await onInitialized?.(client3);
72
+ log("initialization complete", void 0, {
73
+ F: __dxlog_file,
74
+ L: 136,
75
+ S: void 0,
76
+ C: (f, a) => f(...a)
77
+ });
78
+ }
79
+ setClient(client3);
80
+ if (!noBanner) {
81
+ printBanner(client3);
82
+ }
83
+ };
84
+ let client2;
85
+ const t = setTimeout(async () => {
86
+ if (clientProvider) {
87
+ client2 = await getAsyncProviderValue(clientProvider);
88
+ await initialize(client2);
89
+ } else {
90
+ const config = await getAsyncProviderValue(configProvider);
91
+ log("resolved config", {
92
+ config
93
+ }, {
94
+ F: __dxlog_file,
95
+ L: 155,
96
+ S: void 0,
97
+ C: (f, a) => f(...a)
98
+ });
99
+ const services = await getAsyncProviderValue(servicesProvider, config);
100
+ log("created services", {
101
+ services
102
+ }, {
103
+ F: __dxlog_file,
104
+ L: 157,
105
+ S: void 0,
106
+ C: (f, a) => f(...a)
107
+ });
108
+ client2 = new Client({
109
+ config,
110
+ services,
111
+ ...options
112
+ });
113
+ log("created client", void 0, {
114
+ F: __dxlog_file,
115
+ L: 159,
116
+ S: void 0,
117
+ C: (f, a) => f(...a)
118
+ });
119
+ await initialize(client2);
120
+ }
121
+ });
122
+ return () => {
123
+ log("clean up", void 0, {
124
+ F: __dxlog_file,
125
+ L: 165,
126
+ S: void 0,
127
+ C: (f, a) => f(...a)
128
+ });
129
+ clearTimeout(t);
130
+ void client2?.destroy().then(() => {
131
+ log("destroyed", void 0, {
132
+ F: __dxlog_file,
133
+ L: 170,
134
+ S: void 0,
135
+ C: (f, a) => f(...a)
136
+ });
137
+ }).catch((err) => log.catch(err, void 0, {
138
+ F: __dxlog_file,
139
+ L: 172,
140
+ S: void 0,
141
+ C: (f, a) => f(...a)
142
+ }));
143
+ };
144
+ }, [
145
+ configProvider,
146
+ clientProvider,
147
+ servicesProvider,
148
+ noBanner
149
+ ]);
150
+ if (!client?.initialized || status !== SystemStatus.ACTIVE) {
151
+ return /* @__PURE__ */ React.createElement(Fallback, {
152
+ client,
153
+ status
154
+ });
155
+ }
156
+ return /* @__PURE__ */ React.createElement(ClientContext.Provider, {
157
+ value: {
158
+ client,
159
+ status
160
+ }
161
+ }, children);
162
+ });
163
+
164
+ export {
165
+ ClientProvider
166
+ };
167
+ //# sourceMappingURL=chunk-OFVJLJ3V.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/client/ClientProvider.tsx", "../../../src/banner.ts"],
4
+ "sourcesContent": ["//\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 { 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 = 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 * @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 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] = 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 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 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, 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) {\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"],
5
+ "mappings": ";;;;;AAIA,OAAOA,SAGLC,YACAC,WACAC,qBACAC,gBACK;AAEP,SAASC,QAAyDC,oBAAoB;AAEtF,SAASC,8BAA8B;AACvC,SAASC,WAAW;AACpB,SAASC,0BAA0B;AACnC,SAASC,6BAA+D;;;ACXxE,IAAMC,SAAS,CAACC,WAAAA;AACd,QAAMC,aAAaD,OAAOE,OAAOC,IAAI,8BAAA;AACrC,QAAMC,OAAOH,aAAa,eAAeA,UAAAA;IAAkB;AAE3D,SACE;;;;;;;eAMkBD,OAAOK,OAAO;EAAMD,IAAAA;AAE1C;AAEA,IAAIE,gBAAgB;AAEb,IAAMC,cAAc,CAACP,WAAAA;AAC1B,MAAIM,eAAe;AACjB;EACF;AAEAA,kBAAgB;AAEhBE,UAAQC,IAAI,KAAKV,OAAOC,MAAAA,CAAAA,IAAW,yBAAA;AACrC;;;;ADgDO,IAAMU,iBAAiBC,2BAC5B,CACE,EACEC,UACAC,QAAQC,gBACRC,QAAQC,gBACRC,UAAUC,kBACVC,QAAQC,kBACRC,UAAUC,WAAW,MAAM,MAC3BC,iBAAiB,MACjBC,UACAC,eACA,GAAGC,QAAAA,GAELC,iBAAAA;AAEAC,YAAU,MAAA;AAGRL,sBAAkBM,uBAAAA;EACpB,GAAG,CAAA,CAAE;AAOL,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAAA;AAC1B,MAAIF,OAAO;AACT,UAAMA;EACR;AAEA,QAAM,CAACf,QAAQkB,SAAAA,IAAaD,SAAShB,0BAA0BkB,SAASlB,iBAAiBmB,MAAAA;AAGzFC,sBAAoBT,cAAc,MAAMZ,QAAQ;IAACA;GAAO;AAGxD,QAAM,CAACI,QAAQkB,SAAAA,IAAaC,mBAAmBlB,gBAAAA;AAC/CQ,YAAU,MAAA;AACR,QAAI,CAACb,QAAQ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IAAgBE;IAAgBE;IAAkBM;GAAS;AAE/D,MAAI,CAACT,QAAQ4B,eAAexB,WAAWmC,aAAaC,QAAQ;AAC1D,WAAO,sBAAA,cAACjC,UAAAA;MAASP;MAAgBI;;EACnC;AAEA,SAAO,sBAAA,cAACqC,cAAcC,UAAQ;IAACC,OAAO;MAAE3C;MAAQI;IAAO;KAAIP,QAAAA;AAC7D,CAAA;",
6
+ "names": ["React", "forwardRef", "useEffect", "useImperativeHandle", "useState", "Client", "SystemStatus", "registerSignalsRuntime", "log", "useControlledValue", "getAsyncProviderValue", "BANNER", "client", "commitHash", "config", "get", "hash", "version", "bannerPrinted", "printBanner", "console", "log", "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", "useControlledValue", "subscription", "subscribe", "unsubscribe", "initialize", "initialized", "catch", "log", "printBanner", "t", "setTimeout", "getAsyncProviderValue", "clearTimeout", "destroy", "then", "err", "SystemStatus", "ACTIVE", "ClientContext", "Provider", "value"]
7
+ }
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  useClient
3
- } from "../chunk-CL7JDETM.mjs";
3
+ } from "../chunk-KX3DKZQL.mjs";
4
+ import "../chunk-DXE5O7SV.mjs";
4
5
 
5
6
  // packages/sdk/react-client/src/devtools/index.ts
6
7
  export * from "@dxos/client/devtools";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/devtools/index.ts", "../../../../src/devtools/useDevtools.ts", "../../../../src/devtools/useStream.ts"],
4
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';\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;",
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
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"]
7
7
  }
@@ -3,7 +3,8 @@ import {
3
3
  } from "../chunk-AL2CUQ46.mjs";
4
4
  import {
5
5
  useClient
6
- } from "../chunk-CL7JDETM.mjs";
6
+ } from "../chunk-KX3DKZQL.mjs";
7
+ import "../chunk-DXE5O7SV.mjs";
7
8
 
8
9
  // packages/sdk/react-client/src/echo/index.ts
9
10
  export * from "@dxos/client/echo";
@@ -26,7 +27,7 @@ var useSpace = (spaceKeyLike) => {
26
27
  return;
27
28
  }
28
29
  const timeout = setTimeout(async () => {
29
- await client.spaces.isReady.wait();
30
+ await client.spaces.waitUntilReady();
30
31
  setReady(true);
31
32
  });
32
33
  return () => clearTimeout(timeout);
@@ -59,7 +60,7 @@ var useMembers = (spaceKey) => {
59
60
 
60
61
  // packages/sdk/react-client/src/echo/useQuery.ts
61
62
  import { useMemo, useSyncExternalStore } from "react";
62
- import { isSpace } from "@dxos/client/echo";
63
+ import { Filter, isSpace } from "@dxos/client/echo";
63
64
  var useQuery = (spaceOrEcho, filter, options, deps) => {
64
65
  const { subscribe, getObjects } = useMemo(() => {
65
66
  const query = isSpace(spaceOrEcho) ? spaceOrEcho.db.query(filter, options) : spaceOrEcho?.query(filter, options);
@@ -77,12 +78,14 @@ var useQuery = (spaceOrEcho, filter, options, deps) => {
77
78
  };
78
79
  }, [
79
80
  spaceOrEcho,
80
- ...typeof filter === "function" ? [] : filterToDepsArray(filter),
81
+ ...filterToDepsArray(filter),
81
82
  ...deps ?? []
82
83
  ]);
83
84
  return useSyncExternalStore(subscribe, getObjects) ?? [];
84
85
  };
85
- var filterToDepsArray = (filter) => Object.entries(filter ?? {}).flat(10).map((x) => typeof x === "function" || typeof x === "object" ? null : x);
86
+ var filterToDepsArray = (filter) => [
87
+ JSON.stringify(Filter.from(filter).toProto())
88
+ ];
86
89
  var noop = () => {
87
90
  };
88
91
  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,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,QAAQC,KAAI;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AAA,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.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 {\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 subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\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,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B,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", "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", "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,8 @@ import {
3
3
  } from "../chunk-AL2CUQ46.mjs";
4
4
  import {
5
5
  useClient
6
- } from "../chunk-CL7JDETM.mjs";
6
+ } from "../chunk-KX3DKZQL.mjs";
7
+ import "../chunk-DXE5O7SV.mjs";
7
8
 
8
9
  // packages/sdk/react-client/src/halo/index.ts
9
10
  import { Device, DeviceKind, DeviceType } from "@dxos/client/halo";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/halo/index.ts", "../../../../src/halo/useContacts.ts", "../../../../src/halo/useDevices.ts", "../../../../src/halo/useHaloInvitations.ts", "../../../../src/halo/useIdentity.ts", "../../../../src/halo/useKeyStore.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport { type Contact, type Identity, type Halo, Device, DeviceKind, DeviceType } from '@dxos/client/halo';\n\nexport * from './useContacts';\nexport * from './useDevices';\nexport * from './useHaloInvitations';\nexport * from './useIdentity';\nexport * from './useKeyStore';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Contact } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Returns all known Contacts across all Spaces.\n * Contacts are known members of a common Space.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useContacts = (): Contact[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.contacts);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Device } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\nexport const useDevices = (): Device[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.devices);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\nimport { useInvitationStatus, type CancellableInvitationObservable } from '../invitations';\n\nexport const useHaloInvitations = (): CancellableInvitationObservable[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.invitations);\n};\n\nexport const useHaloInvitation = (invitationId?: string) => {\n const invitations = useHaloInvitations();\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Identity } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Hook returning DXOS identity object.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useIdentity = (): Identity | null => {\n const client = useClient();\n return useMulticastObservable(client.halo.identity);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useMemo, useReducer } from 'react';\n\n// TODO(burdon): Move to settings plugin.\nexport class KeyStore {\n private _keyMap = new Map<string, string>();\n\n constructor(private readonly _defaultKeys: string[] = []) {}\n\n get map() {\n return this._keyMap;\n }\n\n // TODO(burdon): Create subkeys.\n initialize() {\n this._defaultKeys.forEach((key) => {\n const value = localStorage.getItem(key);\n this.setKey(key, value ?? '');\n });\n\n return this;\n }\n\n getKey(key: string) {\n localStorage.getItem(key);\n }\n\n setKey(key: string, value: string) {\n localStorage.setItem(key, '');\n this._keyMap.set(key, value);\n }\n}\n\n/**\n * Settings store.\n * @deprecated Replace with HALO key store when available.\n */\nexport const useKeyStore = (\n defaultKeys: string[] = [],\n): [Map<string, string>, (key: string, value: string) => void] => {\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n const store = useMemo(() => new KeyStore(defaultKeys).initialize(), [defaultKeys]);\n const setKey = (key: string, value: string) => {\n store.setKey(key, value);\n forceUpdate();\n };\n\n return [store.map, setKey];\n};\n"],
5
- "mappings": ";;;;;;;;AAKA,SAAiDA,QAAQC,YAAYC,kBAAkB;;;ACAvF,SAASC,8BAA8B;AAShC,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOC,uBAAuBF,OAAOG,KAAKC,QAAQ;AACpD;;;ACZA,SAASC,0BAAAA,+BAA8B;AAIhC,IAAMC,aAAa,MAAA;AACxB,QAAMC,SAASC,UAAAA;AACf,SAAOC,wBAAu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Aa;AACX,SAAKJ,aAAaK,QAAQ,CAACC,QAAAA;AACzB,YAAMC,QAAQC,aAAaC,QAAQH,GAAAA;AACnC,WAAKI,OAAOJ,KAAKC,SAAS,EAAA;IAC5B,CAAA;AAEA,WAAO;EACT;EAEAI,OAAOL,KAAa;AAClBE,iBAAaC,QAAQH,GAAAA;EACvB;EAEAI,OAAOJ,KAAaC,OAAe;AACjCC,iBAAaI,QAAQN,KAAK,EAAA;AAC1B,SAAKL,QAAQY,IAAIP,KAAKC,KAAAA;EACxB;AACF;AAMO,IAAMO,cAAc,CACzBC,cAAwB,CAAA,MAAE;AAE1B,QAAM,CAAA,EAAGC,WAAAA,IAAeC,WAAW,CAACC,MAAMA,IAAI,GAAG,CAAA;AACjD,QAAMC,QAAQC,SAAQ,MAAM,IAAItB,SAASiB,WAAAA,EAAaX,WAAU,GAAI;IAACW;GAAY;AACjF,QAAML,SAAS,CAACJ,KAAaC,UAAAA;AAC3BY,UAAMT,OAAOJ,KAAKC,KAAAA;AAClBS,gBAAAA;EACF;AAEA,SAAO;IAACG,MAAMhB;IAAKO;;AACrB;",
6
6
  "names": ["Device", "DeviceKind", "DeviceType", "useMulticastObservable", "useContacts", "client", "useClient", "useMulticastObservable", "halo", "contacts", "useMulticastObservable", "useDevices", "client", "useClient", "useMulticastObservable", "halo", "devices", "useMemo", "useMulticastObservable", "useHaloInvitations", "client", "useClient", "useMulticastObservable", "halo", "invitations", "useHaloInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "useMulticastObservable", "useIdentity", "client", "useClient", "useMulticastObservable", "halo", "identity", "useMemo", "useReducer", "KeyStore", "constructor", "_defaultKeys", "_keyMap", "Map", "map", "initialize", "forEach", "key", "value", "localStorage", "getItem", "setKey", "getKey", "setItem", "set", "useKeyStore", "defaultKeys", "forceUpdate", "useReducer", "x", "store", "useMemo"]
7
7
  }
@@ -1,21 +1,122 @@
1
1
  import {
2
- AgentHostingContext,
3
- AgentHostingProvider,
4
- ClientContext,
5
- ClientProvider,
6
- useAgentHostingClient,
7
- useClient,
8
- useClientServices,
9
- useClientStatus,
10
- useConfig,
11
- useShell,
12
- useShellDisplay,
13
- useStatus
14
- } from "./chunk-CL7JDETM.mjs";
2
+ useClient
3
+ } from "./chunk-KX3DKZQL.mjs";
4
+ import {
5
+ ClientProvider
6
+ } from "./chunk-OFVJLJ3V.mjs";
7
+ import {
8
+ ClientContext
9
+ } from "./chunk-DXE5O7SV.mjs";
15
10
 
16
11
  // packages/sdk/react-client/src/index.ts
17
12
  export * from "@dxos/client";
18
13
  import { useMulticastObservable } from "@dxos/react-hooks";
14
+
15
+ // packages/sdk/react-client/src/client/AgentHostingProvider.tsx
16
+ import React, { createContext, useContext, useState } from "react";
17
+ import { AgentManagerClient, FakeAgentHostingProvider } from "@dxos/client";
18
+ import { log } from "@dxos/log";
19
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/client/AgentHostingProvider.tsx";
20
+ var AgentHostingContext = /* @__PURE__ */ createContext(null);
21
+ var AgentHostingProvider = (props) => {
22
+ const client = useClient();
23
+ const [agentHostingProviderClient] = useState(makeClient(client));
24
+ return /* @__PURE__ */ React.createElement(AgentHostingContext.Provider, {
25
+ value: agentHostingProviderClient
26
+ }, " ", props.children);
27
+ };
28
+ var useAgentHostingClient = () => {
29
+ return useContext(AgentHostingContext);
30
+ };
31
+ var makeClient = ({ config, halo }) => {
32
+ const agentHostingConfig = config.get("runtime.services.agentHosting");
33
+ if (!agentHostingConfig) {
34
+ log("no agent hosting configured", void 0, {
35
+ F: __dxlog_file,
36
+ L: 39,
37
+ S: void 0,
38
+ C: (f, a) => f(...a)
39
+ });
40
+ return null;
41
+ }
42
+ let agentHostingProviderClient = null;
43
+ switch (agentHostingConfig.type) {
44
+ case "LOCAL_TESTING": {
45
+ log("using FakeAgentHostingProvider", void 0, {
46
+ F: __dxlog_file,
47
+ L: 47,
48
+ S: void 0,
49
+ C: (f, a) => f(...a)
50
+ });
51
+ return new FakeAgentHostingProvider();
52
+ }
53
+ case "AGENTHOSTING_API": {
54
+ agentHostingProviderClient = new AgentManagerClient(config, halo);
55
+ if (agentHostingProviderClient.init()) {
56
+ return agentHostingProviderClient;
57
+ } else {
58
+ return null;
59
+ }
60
+ }
61
+ default: {
62
+ log.error("Unknown agent hosting provider type: " + agentHostingConfig.type, void 0, {
63
+ F: __dxlog_file,
64
+ L: 62,
65
+ S: void 0,
66
+ C: (f, a) => f(...a)
67
+ });
68
+ return null;
69
+ }
70
+ }
71
+ };
72
+
73
+ // packages/sdk/react-client/src/client/useClientStatus.ts
74
+ import { useEffect, useState as useState2 } from "react";
75
+ var useClientStatus = (client) => {
76
+ const [status, setStatus] = useState2();
77
+ useEffect(() => {
78
+ if (!client) {
79
+ return;
80
+ }
81
+ const subscription = client.status.subscribe((status2) => setStatus(status2));
82
+ return () => subscription.unsubscribe();
83
+ }, [
84
+ client,
85
+ setStatus
86
+ ]);
87
+ return status;
88
+ };
89
+
90
+ // packages/sdk/react-client/src/client/useConfig.ts
91
+ import { useContext as useContext2 } from "react";
92
+ import { raise } from "@dxos/debug";
93
+ var useConfig = () => {
94
+ const { client } = useContext2(ClientContext) ?? raise(new Error("Missing ClientContext."));
95
+ return client.config;
96
+ };
97
+
98
+ // packages/sdk/react-client/src/client/useShell.ts
99
+ import { useEffect as useEffect2, useState as useState3 } from "react";
100
+ var useShell = () => {
101
+ const client = useClient();
102
+ return client.shell;
103
+ };
104
+ var useShellDisplay = () => {
105
+ const client = useClient();
106
+ const [display, setDisplay] = useState3(client.shell.display);
107
+ useEffect2(() => client.shell.onDisplayChange(setDisplay), [
108
+ client
109
+ ]);
110
+ return display;
111
+ };
112
+
113
+ // packages/sdk/react-client/src/client/useStatus.ts
114
+ import { useContext as useContext3 } from "react";
115
+ import { raise as raise2 } from "@dxos/debug";
116
+ var useStatus = () => {
117
+ const { status } = useContext3(ClientContext) ?? raise2(new Error("Missing ClientContext."));
118
+ return status;
119
+ };
19
120
  export {
20
121
  AgentHostingContext,
21
122
  AgentHostingProvider,
@@ -23,7 +124,6 @@ export {
23
124
  ClientProvider,
24
125
  useAgentHostingClient,
25
126
  useClient,
26
- useClientServices,
27
127
  useClientStatus,
28
128
  useConfig,
29
129
  useMulticastObservable,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/index.ts"],
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;",
6
- "names": ["useMulticastObservable"]
3
+ "sources": ["../../../src/index.ts", "../../../src/client/AgentHostingProvider.tsx", "../../../src/client/useClientStatus.ts", "../../../src/client/useConfig.ts", "../../../src/client/useShell.ts", "../../../src/client/useStatus.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client';\nexport { useMulticastObservable } from '@dxos/react-hooks';\n\nexport * from './client';\n", "//\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 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,cAAc;AACd,SAASA,8BAA8B;;;ACDvC,OAAOC,SAASC,eAAuCC,YAAYC,gBAAgB;AAEnF,SAA0CC,oBAAoBC,gCAAgC;AAG9F,SAASC,WAAW;;AAMb,IAAMC,sBAAsBC,8BAAiD,IAAA;AAQ7E,IAAMC,uBAAuB,CAACC,UAAAA;AACnC,QAAMC,SAASC,UAAAA;AACf,QAAM,CAACC,0BAAAA,IAA8BC,SAASC,WAAWJ,MAAAA,CAAAA;AACzD,SACE,sBAAA,cAACJ,oBAAoBS,UAAQ;IAACC,OAAOJ;KAA4B,KAAEH,MAAMQ,QAAQ;AAErF;AAEO,IAAMC,wBAAwB,MAAA;AACnC,SAAOC,WAAWb,mBAAAA;AACpB;AAEA,IAAMQ,aAAa,CAAC,EAAEM,QAAQC,KAAI,MAA6B;AAC7D,QAAMC,qBAAqBF,OAAOG,IAAI,+BAAA;AACtC,MAAI,CAACD,oBAAoB;AACvBE,QAAI,+BAAA,QAAA;;;;;;AACJ,WAAO;EACT;AAGA,MAAIZ,6BAAgE;AACpE,UAAQU,mBAAmBG,MAAI;IAC7B,KAAK,iBAAiB;AACpBD,UAAI,kCAAA,QAAA;;;;;;AACJ,aAAO,IAAIE,yBAAAA;IACb;IAEA,KAAK,oBAAoB;AACvBd,mCAA6B,IAAIe,mBAAmBP,QAAQC,IAAAA;AAC5D,UAAIT,2BAA2BgB,KAAI,GAAI;AACrC,eAAOhB;MACT,OAAO;AAEL,eAAO;MACT;IACF;IAEA,SAAS;AACPY,UAAIK,MAAM,0CAA0CP,mBAAmBG,MAAI,QAAA;;;;;;AAC3E,aAAO;IACT;EACF;AACF;;;AC7DA,SAASK,WAAWC,YAAAA,iBAAgB;AAI7B,IAAMC,kBAAkB,CAACC,WAAAA;AAC9B,QAAM,CAACC,QAAQC,SAAAA,IAAaC,UAAAA;AAC5BC,YAAU,MAAA;AACR,QAAI,CAACJ,QAAQ;AACX;IACF;AAEA,UAAMK,eAAeL,OAAOC,OAAOK,UAAU,CAACL,YAAWC,UAAUD,OAAAA,CAAAA;AACnE,WAAO,MAAMI,aAAaE,YAAW;EACvC,GAAG;IAACP;IAAQE;GAAU;AAEtB,SAAOD;AACT;;;AChBA,SAASO,cAAAA,mBAAkB;AAE3B,SAASC,aAAa;AAQf,IAAMC,YAAY,MAAA;AACvB,QAAM,EAAEC,OAAM,IAAKC,YAAWC,aAAAA,KAAkBC,MAAM,IAAIC,MAAM,wBAAA,CAAA;AAChE,SAAOJ,OAAOK;AAChB;;;ACbA,SAASC,aAAAA,YAAWC,YAAAA,iBAAgB;AAS7B,IAAMC,WAAW,MAAA;AACtB,QAAMC,SAASC,UAAAA;AACf,SAAOD,OAAOE;AAChB;AAKO,IAAMC,kBAAkB,MAAA;AAC7B,QAAMH,SAASC,UAAAA;AACf,QAAM,CAACG,SAASC,UAAAA,IAAcC,UAASN,OAAOE,MAAME,OAAO;AAC3DG,EAAAA,WAAU,MAAMP,OAAOE,MAAMM,gBAAgBH,UAAAA,GAAa;IAACL;GAAO;AAClE,SAAOI;AACT;;;ACtBA,SAASK,cAAAA,mBAAkB;AAG3B,SAASC,SAAAA,cAAa;AAIf,IAAMC,YAAY,MAAA;AACvB,QAAM,EAAEC,OAAM,IAAKC,YAAWC,aAAAA,KAAkBC,OAAM,IAAIC,MAAM,wBAAA,CAAA;AAChE,SAAOJ;AACT;",
6
+ "names": ["useMulticastObservable", "React", "createContext", "useContext", "useState", "AgentManagerClient", "FakeAgentHostingProvider", "log", "AgentHostingContext", "createContext", "AgentHostingProvider", "props", "client", "useClient", "agentHostingProviderClient", "useState", "makeClient", "Provider", "value", "children", "useAgentHostingClient", "useContext", "config", "halo", "agentHostingConfig", "get", "log", "type", "FakeAgentHostingProvider", "AgentManagerClient", "init", "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"]
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  useClient
3
- } from "../chunk-CL7JDETM.mjs";
3
+ } from "../chunk-KX3DKZQL.mjs";
4
+ import "../chunk-DXE5O7SV.mjs";
4
5
 
5
6
  // packages/sdk/react-client/src/mesh/index.ts
6
7
  export * from "@dxos/client/mesh";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/mesh/index.ts", "../../../../src/mesh/useNetworkStatus.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/mesh';\n\nexport * from './useNetworkStatus';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type NetworkStatus } from '@dxos/client/mesh';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Creates a network status subscription.\n */\nexport const useNetworkStatus = (): NetworkStatus => {\n const client = useClient();\n return useMulticastObservable(client.mesh.networkStatus);\n};\n"],
5
- "mappings": ";;;;;AAIA,cAAc;;;ACCd,SAASA,8BAA8B;AAOhC,IAAMC,mBAAmB,MAAA;AAC9B,QAAMC,SAASC,UAAAA;AACf,SAAOC,uBAAuBF,OAAOG,KAAKC,aAAa;AACzD;",
5
+ "mappings": ";;;;;;AAIA,cAAc;;;ACCd,SAASA,8BAA8B;AAOhC,IAAMC,mBAAmB,MAAA;AAC9B,QAAMC,SAASC,UAAAA;AACf,SAAOC,uBAAuBF,OAAOG,KAAKC,aAAa;AACzD;",
6
6
  "names": ["useMulticastObservable", "useNetworkStatus", "client", "useClient", "useMulticastObservable", "mesh", "networkStatus"]
7
7
  }