@dxos/react-client 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731
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.
- package/dist/lib/browser/echo/index.mjs +70 -0
- package/dist/lib/browser/echo/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/echo/index.mjs +70 -0
- package/dist/lib/node-esm/echo/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/echo/index.d.ts +2 -0
- package/dist/types/src/echo/index.d.ts.map +1 -1
- package/dist/types/src/echo/useFeedSyncState.d.ts +13 -0
- package/dist/types/src/echo/useFeedSyncState.d.ts.map +1 -0
- package/dist/types/src/echo/useRegistry.d.ts +6 -0
- package/dist/types/src/echo/useRegistry.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -26
- package/src/echo/index.ts +2 -0
- package/src/echo/useFeedSyncState.ts +78 -0
- package/src/echo/useRegistry.ts +15 -0
- package/tsconfig.json +0 -3
|
@@ -154,9 +154,79 @@ var useSpaceSyncState = (space) => {
|
|
|
154
154
|
]);
|
|
155
155
|
return spaceState;
|
|
156
156
|
};
|
|
157
|
+
|
|
158
|
+
// src/echo/useFeedSyncState.ts
|
|
159
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
160
|
+
var DEFAULT_POLL_INTERVAL_MS = 5e3;
|
|
161
|
+
var useFeedSyncState = (pollIntervalMs = DEFAULT_POLL_INTERVAL_MS) => {
|
|
162
|
+
const client = useClient();
|
|
163
|
+
const [feedSyncState, setFeedSyncState] = useState2({});
|
|
164
|
+
useEffect3(() => {
|
|
165
|
+
const queueService = client.services.services.QueueService;
|
|
166
|
+
if (!queueService) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
let cancelled = false;
|
|
170
|
+
const poll = async () => {
|
|
171
|
+
const spaces = client.spaces.get();
|
|
172
|
+
const entries = await Promise.all(spaces.map(async (space) => {
|
|
173
|
+
try {
|
|
174
|
+
const response = await queueService.getSyncState({
|
|
175
|
+
spaceId: space.id
|
|
176
|
+
});
|
|
177
|
+
const state = (response.namespaces ?? []).reduce((acc, entry) => {
|
|
178
|
+
acc.pending += Number(entry.blocksToPull ?? 0) + Number(entry.blocksToPush ?? 0);
|
|
179
|
+
acc.total += Number(entry.totalBlocks ?? 0);
|
|
180
|
+
return acc;
|
|
181
|
+
}, {
|
|
182
|
+
pending: 0,
|
|
183
|
+
total: 0
|
|
184
|
+
});
|
|
185
|
+
return [
|
|
186
|
+
space.id,
|
|
187
|
+
state
|
|
188
|
+
];
|
|
189
|
+
} catch {
|
|
190
|
+
return [
|
|
191
|
+
space.id,
|
|
192
|
+
{
|
|
193
|
+
pending: 0,
|
|
194
|
+
total: 0
|
|
195
|
+
}
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
}));
|
|
199
|
+
if (!cancelled) {
|
|
200
|
+
setFeedSyncState(Object.fromEntries(entries));
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
void poll();
|
|
204
|
+
const interval = setInterval(() => void poll(), pollIntervalMs);
|
|
205
|
+
const spacesSubscription = client.spaces.subscribe(() => {
|
|
206
|
+
void poll();
|
|
207
|
+
});
|
|
208
|
+
return () => {
|
|
209
|
+
cancelled = true;
|
|
210
|
+
clearInterval(interval);
|
|
211
|
+
spacesSubscription.unsubscribe();
|
|
212
|
+
};
|
|
213
|
+
}, [
|
|
214
|
+
client,
|
|
215
|
+
pollIntervalMs
|
|
216
|
+
]);
|
|
217
|
+
return feedSyncState;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// src/echo/useRegistry.ts
|
|
221
|
+
var useRegistry = () => {
|
|
222
|
+
const client = useClient();
|
|
223
|
+
return client.graph.registry;
|
|
224
|
+
};
|
|
157
225
|
export {
|
|
158
226
|
useDatabase,
|
|
227
|
+
useFeedSyncState,
|
|
159
228
|
useMembers,
|
|
229
|
+
useRegistry,
|
|
160
230
|
useSpace,
|
|
161
231
|
useSpaceInvitation,
|
|
162
232
|
useSpaceInvitations,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSpaceProperties.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\nexport * from '@dxos/echo-react';\n\nexport * from './useMembers';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSpaceProperties';\nexport * from './useSubscription';\nexport * from './useSyncState';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { PublicKey, type PublicKeyLike } 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: PublicKeyLike | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey\n ? spaces.find((space) => (spaceKey instanceof PublicKey ? space.key.equals(spaceKey) : space.id === spaceKey))\n : 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 { PublicKey } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its id.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n */\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpace = (spaceId?: SpaceId | PublicKey): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n if (!spaceId) {\n return undefined;\n }\n\n return spaces.find((space) => {\n if (spaceId instanceof PublicKey) {\n return space.key.equals(spaceId);\n }\n\n return space.id === spaceId;\n });\n};\n\n/**\n * Get a Space database by the id of the space.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n * @deprecated Use useSpace.\n */\nexport const useDatabase = (spaceId?: SpaceId): Space['db'] | undefined => {\n const space = useSpace(spaceId);\n return space?.db;\n};\n\nexport type UseSpacesProps = {\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 }: UseSpacesProps = {}): 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 } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\nimport { useSpace } from './useSpaces';\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitations = (spaceId?: SpaceId | PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceId);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitation = (spaceId?: SpaceId | PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceId);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type SpaceProperties, SpaceState } from '@dxos/client/echo';\nimport { type Key, type Obj } from '@dxos/echo';\nimport { type ObjectUpdateCallback, useObject } from '@dxos/echo-react';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpace } from './useSpaces';\n\n/**\n * Subscribe to a space's properties with reactive updates.\n * Returns undefined if the space is undefined or not ready yet.\n * Automatically waits for the space to be ready before returning properties.\n *\n * @param spaceId - The space ID to get properties from (can be undefined).\n * @returns A tuple of [snapshot, updateCallback] or [undefined, no-op] if not ready.\n */\nexport const useSpaceProperties = (\n spaceId: Key.SpaceId | undefined,\n): [Obj.Snapshot<SpaceProperties> | undefined, ObjectUpdateCallback<SpaceProperties>] => {\n const space = useSpace(spaceId);\n const spaceState = useMulticastObservable(space?.state ?? MulticastObservable.empty());\n const properties = spaceState === SpaceState.SPACE_READY ? space?.properties : undefined;\n return useObject(properties);\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>(null);\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { isEdgePeerId } from '@dxos/echo-protocol';\n\nimport { useClient } from '../client';\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx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AAA;AACF,sBAAA,SAAA;MAEA;;AAEA,WAAA,MAAA;AACC,WAAA,IAAA,QAAA;IAACJ;KAAM;IAEV;EACA,CAAA;;;",
|
|
6
|
-
"names": ["MulticastObservable", "PublicKey", "HaloSpaceMember", "useMulticastObservable", "PublicKey", "SpaceState", "useMulticastObservable", "useSpace", "spaceId", "client", "useClient", "spaces", "useMulticastObservable", "undefined", "find", "space", "PublicKey", "key", "equals", "id", "useDatabase", "db", "useSpaces", "all", "filter", "state", "get", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "PublicKey", "key", "equals", "id", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceId", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "MulticastObservable", "SpaceState", "useObject", "useMulticastObservable", "useSpaceProperties", "spaceId", "space", "useSpace", "spaceState", "useMulticastObservable", "state", "MulticastObservable", "empty", "properties", "SpaceState", "SPACE_READY", "undefined", "useObject", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "current", "subscriptionRef", "unsubscribe", "update", "useEffect", "useState", "Context", "isEdgePeerId", "spaceState", "setSpaceState", "useEffect", "Context", "createSubscriptions", "space", "spaces", "id", "onDispose", "syncState", "client", "internal", "peers", "find", "isEdgePeerId", "state"]
|
|
3
|
+
"sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSpaceProperties.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts", "../../../../src/echo/useFeedSyncState.ts", "../../../../src/echo/useRegistry.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\nexport * from '@dxos/echo-react';\n\nexport * from './useMembers';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSpaceProperties';\nexport * from './useSubscription';\nexport * from './useSyncState';\nexport * from './useFeedSyncState';\nexport * from './useRegistry';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { PublicKey, type PublicKeyLike } 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: PublicKeyLike | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey\n ? spaces.find((space) => (spaceKey instanceof PublicKey ? space.key.equals(spaceKey) : space.id === spaceKey))\n : 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 { PublicKey } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its id.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n */\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpace = (spaceId?: SpaceId | PublicKey): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n if (!spaceId) {\n return undefined;\n }\n\n return spaces.find((space) => {\n if (spaceId instanceof PublicKey) {\n return space.key.equals(spaceId);\n }\n\n return space.id === spaceId;\n });\n};\n\n/**\n * Get a Space database by the id of the space.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n * @deprecated Use useSpace.\n */\nexport const useDatabase = (spaceId?: SpaceId): Space['db'] | undefined => {\n const space = useSpace(spaceId);\n return space?.db;\n};\n\nexport type UseSpacesProps = {\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 }: UseSpacesProps = {}): 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 } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\nimport { useSpace } from './useSpaces';\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitations = (spaceId?: SpaceId | PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceId);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitation = (spaceId?: SpaceId | PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceId);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type SpaceProperties, SpaceState } from '@dxos/client/echo';\nimport { type Key, type Obj } from '@dxos/echo';\nimport { type ObjectUpdateCallback, useObject } from '@dxos/echo-react';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpace } from './useSpaces';\n\n/**\n * Subscribe to a space's properties with reactive updates.\n * Returns undefined if the space is undefined or not ready yet.\n * Automatically waits for the space to be ready before returning properties.\n *\n * @param spaceId - The space ID to get properties from (can be undefined).\n * @returns A tuple of [snapshot, updateCallback] or [undefined, no-op] if not ready.\n */\nexport const useSpaceProperties = (\n spaceId: Key.SpaceId | undefined,\n): [Obj.Snapshot<SpaceProperties> | undefined, ObjectUpdateCallback<SpaceProperties>] => {\n const space = useSpace(spaceId);\n const spaceState = useMulticastObservable(space?.state ?? MulticastObservable.empty());\n const properties = spaceState === SpaceState.SPACE_READY ? space?.properties : undefined;\n return useObject(properties);\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>(null);\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { isEdgePeerId } from '@dxos/echo-protocol';\n\nimport { useClient } from '../client';\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type SpaceId } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst DEFAULT_POLL_INTERVAL_MS = 5_000;\n\nexport type FeedSyncState = {\n /** Combined blocks to pull + push across namespaces. */\n pending: number;\n /** Total blocks stored locally across namespaces. */\n total: number;\n};\n\nexport type FeedSyncStateMap = Record<SpaceId, FeedSyncState>;\n\n/**\n * Polls queue replication state per space.\n */\nexport const useFeedSyncState = (pollIntervalMs = DEFAULT_POLL_INTERVAL_MS): FeedSyncStateMap => {\n const client = useClient();\n const [feedSyncState, setFeedSyncState] = useState<FeedSyncStateMap>({});\n\n useEffect(() => {\n const queueService = client.services.services.QueueService;\n if (!queueService) {\n return;\n }\n\n let cancelled = false;\n\n const poll = async () => {\n const spaces = client.spaces.get();\n const entries = await Promise.all(\n spaces.map(async (space) => {\n try {\n const response = await queueService.getSyncState({ spaceId: space.id });\n const state = (response.namespaces ?? []).reduce<FeedSyncState>(\n (acc, entry) => {\n acc.pending += Number(entry.blocksToPull ?? 0) + Number(entry.blocksToPush ?? 0);\n acc.total += Number(entry.totalBlocks ?? 0);\n return acc;\n },\n { pending: 0, total: 0 },\n );\n return [space.id, state] as const;\n } catch {\n return [space.id, { pending: 0, total: 0 }] as const;\n }\n }),\n );\n\n if (!cancelled) {\n setFeedSyncState(Object.fromEntries(entries));\n }\n };\n\n void poll();\n const interval = setInterval(() => void poll(), pollIntervalMs);\n\n const spacesSubscription = client.spaces.subscribe(() => {\n void poll();\n });\n\n return () => {\n cancelled = true;\n clearInterval(interval);\n spacesSubscription.unsubscribe();\n };\n }, [client, pollIntervalMs]);\n\n return feedSyncState;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Registry } from '@dxos/echo';\n\nimport { useClient } from '../client';\n\n/**\n * Returns the hypergraph registry attached to the current client.\n */\nexport const useRegistry = (): Registry.Registry => {\n const client = useClient();\n return client.graph.registry;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,cAAc;AACd,cAAc;;;ACDd,SAASA,2BAA2B;AACpC,SAASC,aAAAA,kBAAqC;AAC9C,SAASC,uBAAyC;AAClD,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,iBAAiB;AAC1B,SAAqBC,kBAAkB;AAEvC,SAASC,8BAA8B;AAchC,IAAMC,WAAW,CAACC,YAAAA;AACvB,QAAMC,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAA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paceMember", "useMulticastObservable", "PublicKey", "SpaceState", "useMulticastObservable", "useSpace", "spaceId", "client", "useClient", "spaces", "useMulticastObservable", "undefined", "find", "space", "PublicKey", "key", "equals", "id", "useDatabase", "db", "useSpaces", "all", "filter", "state", "get", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "PublicKey", "key", "equals", "id", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceId", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "MulticastObservable", "SpaceState", "useObject", "useMulticastObservable", "useSpaceProperties", "spaceId", "space", "useSpace", "spaceState", "useMulticastObservable", "state", "MulticastObservable", "empty", "properties", "SpaceState", "SPACE_READY", "undefined", "useObject", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "current", "subscriptionRef", "unsubscribe", "update", "useEffect", "useState", "Context", "isEdgePeerId", "spaceState", "setSpaceState", "useEffect", "Context", "createSubscriptions", "space", "spaces", "id", "onDispose", "syncState", "client", "internal", "peers", "find", "isEdgePeerId", "state", "useEffect", "useState", "DEFAULT_POLL_INTERVAL_MS", "useFeedSyncState", "pollIntervalMs", "client", "useClient", "feedSyncState", "setFeedSyncState", "useState", "useEffect", "queueService", "services", "QueueService", "cancelled", "poll", "spaces", "get", "entries", "Promise", "all", "map", "space", "response", "getSyncState", "spaceId", "id", "state", "namespaces", "reduce", "acc", "entry", "pending", "Number", "blocksToPull", "blocksToPush", "total", "totalBlocks", "Object", "fromEntries", "interval", "setInterval", "spacesSubscription", "subscribe", "clearInterval", "unsubscribe", "useRegistry", "client", "useClient", "graph", "registry"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/client/AgentHostingProvider.tsx":{"bytes":6817,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/banner.ts":{"bytes":3744,"imports":[],"format":"esm"},"src/client/context.ts":{"bytes":1194,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/ClientProvider.tsx":{"bytes":15846,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/banner.ts","kind":"import-statement","original":"../banner"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useClient.ts":{"bytes":1556,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"../client/context"}],"format":"esm"},"src/client/useClientStatus.ts":{"bytes":1872,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/useConfig.ts":{"bytes":1657,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useShell.ts":{"bytes":2242,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"}],"format":"esm"},"src/client/useStatus.ts":{"bytes":1377,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/index.ts":{"bytes":1067,"imports":[{"path":"src/client/AgentHostingProvider.tsx","kind":"import-statement","original":"./AgentHostingProvider"},{"path":"src/client/ClientProvider.tsx","kind":"import-statement","original":"./ClientProvider"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"},{"path":"src/client/useClientStatus.ts","kind":"import-statement","original":"./useClientStatus"},{"path":"src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"}],"format":"esm"},"src/devtools/useDevtools.ts":{"bytes":1305,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/devtools/useStream.ts":{"bytes":2683,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/devtools/index.ts":{"bytes":595,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"src/echo/useSpaces.ts":{"bytes":6283,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useMembers.ts":{"bytes":3380,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/invitations/useInvitationStatus.ts":{"bytes":20307,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":1198,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"src/echo/useSpaceInvitations.ts":{"bytes":3945,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSpaceProperties.ts":{"bytes":3500,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSubscription.ts":{"bytes":3440,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useSyncState.ts":{"bytes":7194,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/index.ts":{"bytes":1124,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"src/echo/useSpaceProperties.ts","kind":"import-statement","original":"./useSpaceProperties"},{"path":"src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"},{"path":"src/echo/useSyncState.ts","kind":"import-statement","original":"./useSyncState"}],"format":"esm"},"src/halo/useContacts.ts":{"bytes":1618,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useCredentials.ts":{"bytes":1250,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useDevices.ts":{"bytes":1202,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useHaloInvitations.ts":{"bytes":2626,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"src/halo/useIdentity.ts":{"bytes":1488,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useKeyStore.ts":{"bytes":4446,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/halo/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"src/halo/useCredentials.ts","kind":"import-statement","original":"./useCredentials"},{"path":"src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"src/index.ts":{"bytes":680,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"src/mesh/useNetworkStatus.ts":{"bytes":1408,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/mesh/index.ts":{"bytes":507,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"src/testing/context.tsx":{"bytes":1581,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/testing/ClientRepeater.tsx":{"bytes":10392,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/testing/withClientProvider.tsx":{"bytes":17977,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"}],"format":"esm"},"src/testing/index.ts":{"bytes":709,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"},{"path":"src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"src/testing/withClientProvider.tsx","kind":"import-statement","original":"./withClientProvider"}],"format":"esm"},"src/worker.ts":{"bytes":401,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2196},"dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"src/devtools/index.ts","inputs":{"src/devtools/index.ts":{"bytesInOutput":39},"src/devtools/useDevtools.ts":{"bytesInOutput":195},"src/devtools/useStream.ts":{"bytesInOutput":631}},"bytes":1112},"dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14273},"dist/lib/browser/echo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YHE6WD44.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true}],"exports":["useDatabase","useMembers","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaceProperties","useSpaceSyncState","useSpaces","useSubscription","useSyncState"],"entryPoint":"src/echo/index.ts","inputs":{"src/echo/index.ts":{"bytesInOutput":69},"src/echo/useMembers.ts":{"bytesInOutput":659},"src/echo/useSpaces.ts":{"bytesInOutput":781},"src/echo/useSpaceInvitations.ts":{"bytesInOutput":660},"src/echo/useSpaceProperties.ts":{"bytesInOutput":563},"src/echo/useSubscription.ts":{"bytesInOutput":508},"src/echo/useSyncState.ts":{"bytesInOutput":1735}},"bytes":5580},"dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6965},"dist/lib/browser/halo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YHE6WD44.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","KeyStore","useContacts","useCredentials","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"src/halo/index.ts","inputs":{"src/halo/index.ts":{"bytesInOutput":68},"src/halo/useContacts.ts":{"bytesInOutput":174},"src/halo/useCredentials.ts":{"bytesInOutput":208},"src/halo/useDevices.ts":{"bytesInOutput":200},"src/halo/useHaloInvitations.ts":{"bytesInOutput":521},"src/halo/useIdentity.ts":{"bytesInOutput":202},"src/halo/useKeyStore.ts":{"bytesInOutput":937}},"bytes":2873},"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7138},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-XT352YI6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["AgentHostingContext","AgentHostingProvider","ClientContext","ClientProvider","useAgentHostingClient","useClient","useClientStatus","useConfig","useMulticastObservable","useShell","useShellDisplay","useStatus"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":90},"src/client/AgentHostingProvider.tsx":{"bytesInOutput":1700},"src/client/useClientStatus.ts":{"bytesInOutput":383},"src/client/useConfig.ts":{"bytesInOutput":234},"src/client/useShell.ts":{"bytesInOutput":377},"src/client/useStatus.ts":{"bytesInOutput":238}},"bytes":3629},"dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YHE6WD44.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"src/invitations/index.ts","inputs":{},"bytes":388},"dist/lib/browser/chunk-YHE6WD44.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10410},"dist/lib/browser/chunk-YHE6WD44.mjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"src/invitations/index.ts":{"bytesInOutput":198},"src/invitations/useInvitationStatus.ts":{"bytesInOutput":4615}},"bytes":5128},"dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":936},"dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"src/mesh/index.ts","inputs":{"src/mesh/index.ts":{"bytesInOutput":35},"src/mesh/useNetworkStatus.ts":{"bytesInOutput":184}},"bytes":425},"dist/lib/browser/chunk-3LVU7RNK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":807},"dist/lib/browser/chunk-3LVU7RNK.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["useClient"],"inputs":{"src/client/useClient.ts":{"bytesInOutput":211}},"bytes":364},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15608},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-XT352YI6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ClientRepeater","ClientStory","useClientStory","withClientProvider","withMultiClientProvider"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":38},"src/testing/context.tsx":{"bytesInOutput":254},"src/testing/ClientRepeater.tsx":{"bytesInOutput":1851},"src/testing/withClientProvider.tsx":{"bytesInOutput":4257}},"bytes":6763},"dist/lib/browser/chunk-XT352YI6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9977},"dist/lib/browser/chunk-XT352YI6.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ClientProvider"],"inputs":{"src/client/ClientProvider.tsx":{"bytesInOutput":3513},"src/banner.ts":{"bytesInOutput":817}},"bytes":4546},"dist/lib/browser/chunk-CZMIVAGI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":694},"dist/lib/browser/chunk-CZMIVAGI.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["ClientContext"],"inputs":{"src/client/context.ts":{"bytesInOutput":82}},"bytes":180},"dist/lib/browser/worker.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"dist/lib/browser/worker.mjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/worker.ts","inputs":{"src/worker.ts":{"bytesInOutput":37}},"bytes":90}}}
|
|
1
|
+
{"inputs":{"src/client/AgentHostingProvider.tsx":{"bytes":6817,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/banner.ts":{"bytes":3744,"imports":[],"format":"esm"},"src/client/context.ts":{"bytes":1194,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/ClientProvider.tsx":{"bytes":15846,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/banner.ts","kind":"import-statement","original":"../banner"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useClient.ts":{"bytes":1556,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"../client/context"}],"format":"esm"},"src/client/useClientStatus.ts":{"bytes":1872,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/useConfig.ts":{"bytes":1657,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useShell.ts":{"bytes":2242,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"}],"format":"esm"},"src/client/useStatus.ts":{"bytes":1377,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/index.ts":{"bytes":1067,"imports":[{"path":"src/client/AgentHostingProvider.tsx","kind":"import-statement","original":"./AgentHostingProvider"},{"path":"src/client/ClientProvider.tsx","kind":"import-statement","original":"./ClientProvider"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"},{"path":"src/client/useClientStatus.ts","kind":"import-statement","original":"./useClientStatus"},{"path":"src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"}],"format":"esm"},"src/devtools/useDevtools.ts":{"bytes":1305,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/devtools/useStream.ts":{"bytes":2683,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/devtools/index.ts":{"bytes":595,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"src/echo/useSpaces.ts":{"bytes":6283,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useMembers.ts":{"bytes":3380,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/invitations/useInvitationStatus.ts":{"bytes":20307,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":1198,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"src/echo/useSpaceInvitations.ts":{"bytes":3945,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSpaceProperties.ts":{"bytes":3500,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSubscription.ts":{"bytes":3440,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useSyncState.ts":{"bytes":7194,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useFeedSyncState.ts":{"bytes":7676,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useRegistry.ts":{"bytes":1132,"imports":[{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/index.ts":{"bytes":1331,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"src/echo/useSpaceProperties.ts","kind":"import-statement","original":"./useSpaceProperties"},{"path":"src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"},{"path":"src/echo/useSyncState.ts","kind":"import-statement","original":"./useSyncState"},{"path":"src/echo/useFeedSyncState.ts","kind":"import-statement","original":"./useFeedSyncState"},{"path":"src/echo/useRegistry.ts","kind":"import-statement","original":"./useRegistry"}],"format":"esm"},"src/halo/useContacts.ts":{"bytes":1618,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useCredentials.ts":{"bytes":1250,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useDevices.ts":{"bytes":1202,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useHaloInvitations.ts":{"bytes":2626,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"src/halo/useIdentity.ts":{"bytes":1488,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useKeyStore.ts":{"bytes":4446,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/halo/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"src/halo/useCredentials.ts","kind":"import-statement","original":"./useCredentials"},{"path":"src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"src/index.ts":{"bytes":680,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"src/mesh/useNetworkStatus.ts":{"bytes":1408,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/mesh/index.ts":{"bytes":507,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"src/testing/context.tsx":{"bytes":1581,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/testing/ClientRepeater.tsx":{"bytes":10392,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/testing/withClientProvider.tsx":{"bytes":17977,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"}],"format":"esm"},"src/testing/index.ts":{"bytes":709,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"},{"path":"src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"src/testing/withClientProvider.tsx","kind":"import-statement","original":"./withClientProvider"}],"format":"esm"},"src/worker.ts":{"bytes":401,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2196},"dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"src/devtools/index.ts","inputs":{"src/devtools/index.ts":{"bytesInOutput":39},"src/devtools/useDevtools.ts":{"bytesInOutput":195},"src/devtools/useStream.ts":{"bytesInOutput":631}},"bytes":1112},"dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18838},"dist/lib/browser/echo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YHE6WD44.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["useDatabase","useFeedSyncState","useMembers","useRegistry","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaceProperties","useSpaceSyncState","useSpaces","useSubscription","useSyncState"],"entryPoint":"src/echo/index.ts","inputs":{"src/echo/index.ts":{"bytesInOutput":69},"src/echo/useMembers.ts":{"bytesInOutput":659},"src/echo/useSpaces.ts":{"bytesInOutput":781},"src/echo/useSpaceInvitations.ts":{"bytesInOutput":660},"src/echo/useSpaceProperties.ts":{"bytesInOutput":563},"src/echo/useSubscription.ts":{"bytesInOutput":508},"src/echo/useSyncState.ts":{"bytesInOutput":1735},"src/echo/useFeedSyncState.ts":{"bytesInOutput":1718},"src/echo/useRegistry.ts":{"bytesInOutput":91}},"bytes":7485},"dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6965},"dist/lib/browser/halo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YHE6WD44.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","KeyStore","useContacts","useCredentials","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"src/halo/index.ts","inputs":{"src/halo/index.ts":{"bytesInOutput":68},"src/halo/useContacts.ts":{"bytesInOutput":174},"src/halo/useCredentials.ts":{"bytesInOutput":208},"src/halo/useDevices.ts":{"bytesInOutput":200},"src/halo/useHaloInvitations.ts":{"bytesInOutput":521},"src/halo/useIdentity.ts":{"bytesInOutput":202},"src/halo/useKeyStore.ts":{"bytesInOutput":937}},"bytes":2873},"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7138},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-XT352YI6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["AgentHostingContext","AgentHostingProvider","ClientContext","ClientProvider","useAgentHostingClient","useClient","useClientStatus","useConfig","useMulticastObservable","useShell","useShellDisplay","useStatus"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":90},"src/client/AgentHostingProvider.tsx":{"bytesInOutput":1700},"src/client/useClientStatus.ts":{"bytesInOutput":383},"src/client/useConfig.ts":{"bytesInOutput":234},"src/client/useShell.ts":{"bytesInOutput":377},"src/client/useStatus.ts":{"bytesInOutput":238}},"bytes":3629},"dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YHE6WD44.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"src/invitations/index.ts","inputs":{},"bytes":388},"dist/lib/browser/chunk-YHE6WD44.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10410},"dist/lib/browser/chunk-YHE6WD44.mjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"src/invitations/index.ts":{"bytesInOutput":198},"src/invitations/useInvitationStatus.ts":{"bytesInOutput":4615}},"bytes":5128},"dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":936},"dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LVU7RNK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"src/mesh/index.ts","inputs":{"src/mesh/index.ts":{"bytesInOutput":35},"src/mesh/useNetworkStatus.ts":{"bytesInOutput":184}},"bytes":425},"dist/lib/browser/chunk-3LVU7RNK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":807},"dist/lib/browser/chunk-3LVU7RNK.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["useClient"],"inputs":{"src/client/useClient.ts":{"bytesInOutput":211}},"bytes":364},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15608},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-XT352YI6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ClientRepeater","ClientStory","useClientStory","withClientProvider","withMultiClientProvider"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":38},"src/testing/context.tsx":{"bytesInOutput":254},"src/testing/ClientRepeater.tsx":{"bytesInOutput":1851},"src/testing/withClientProvider.tsx":{"bytesInOutput":4257}},"bytes":6763},"dist/lib/browser/chunk-XT352YI6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9977},"dist/lib/browser/chunk-XT352YI6.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CZMIVAGI.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ClientProvider"],"inputs":{"src/client/ClientProvider.tsx":{"bytesInOutput":3513},"src/banner.ts":{"bytesInOutput":817}},"bytes":4546},"dist/lib/browser/chunk-CZMIVAGI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":694},"dist/lib/browser/chunk-CZMIVAGI.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["ClientContext"],"inputs":{"src/client/context.ts":{"bytesInOutput":82}},"bytes":180},"dist/lib/browser/worker.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"dist/lib/browser/worker.mjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/worker.ts","inputs":{"src/worker.ts":{"bytesInOutput":37}},"bytes":90}}}
|
|
@@ -155,9 +155,79 @@ var useSpaceSyncState = (space) => {
|
|
|
155
155
|
]);
|
|
156
156
|
return spaceState;
|
|
157
157
|
};
|
|
158
|
+
|
|
159
|
+
// src/echo/useFeedSyncState.ts
|
|
160
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
161
|
+
var DEFAULT_POLL_INTERVAL_MS = 5e3;
|
|
162
|
+
var useFeedSyncState = (pollIntervalMs = DEFAULT_POLL_INTERVAL_MS) => {
|
|
163
|
+
const client = useClient();
|
|
164
|
+
const [feedSyncState, setFeedSyncState] = useState2({});
|
|
165
|
+
useEffect3(() => {
|
|
166
|
+
const queueService = client.services.services.QueueService;
|
|
167
|
+
if (!queueService) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
let cancelled = false;
|
|
171
|
+
const poll = async () => {
|
|
172
|
+
const spaces = client.spaces.get();
|
|
173
|
+
const entries = await Promise.all(spaces.map(async (space) => {
|
|
174
|
+
try {
|
|
175
|
+
const response = await queueService.getSyncState({
|
|
176
|
+
spaceId: space.id
|
|
177
|
+
});
|
|
178
|
+
const state = (response.namespaces ?? []).reduce((acc, entry) => {
|
|
179
|
+
acc.pending += Number(entry.blocksToPull ?? 0) + Number(entry.blocksToPush ?? 0);
|
|
180
|
+
acc.total += Number(entry.totalBlocks ?? 0);
|
|
181
|
+
return acc;
|
|
182
|
+
}, {
|
|
183
|
+
pending: 0,
|
|
184
|
+
total: 0
|
|
185
|
+
});
|
|
186
|
+
return [
|
|
187
|
+
space.id,
|
|
188
|
+
state
|
|
189
|
+
];
|
|
190
|
+
} catch {
|
|
191
|
+
return [
|
|
192
|
+
space.id,
|
|
193
|
+
{
|
|
194
|
+
pending: 0,
|
|
195
|
+
total: 0
|
|
196
|
+
}
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
200
|
+
if (!cancelled) {
|
|
201
|
+
setFeedSyncState(Object.fromEntries(entries));
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
void poll();
|
|
205
|
+
const interval = setInterval(() => void poll(), pollIntervalMs);
|
|
206
|
+
const spacesSubscription = client.spaces.subscribe(() => {
|
|
207
|
+
void poll();
|
|
208
|
+
});
|
|
209
|
+
return () => {
|
|
210
|
+
cancelled = true;
|
|
211
|
+
clearInterval(interval);
|
|
212
|
+
spacesSubscription.unsubscribe();
|
|
213
|
+
};
|
|
214
|
+
}, [
|
|
215
|
+
client,
|
|
216
|
+
pollIntervalMs
|
|
217
|
+
]);
|
|
218
|
+
return feedSyncState;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
// src/echo/useRegistry.ts
|
|
222
|
+
var useRegistry = () => {
|
|
223
|
+
const client = useClient();
|
|
224
|
+
return client.graph.registry;
|
|
225
|
+
};
|
|
158
226
|
export {
|
|
159
227
|
useDatabase,
|
|
228
|
+
useFeedSyncState,
|
|
160
229
|
useMembers,
|
|
230
|
+
useRegistry,
|
|
161
231
|
useSpace,
|
|
162
232
|
useSpaceInvitation,
|
|
163
233
|
useSpaceInvitations,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSpaceProperties.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\nexport * from '@dxos/echo-react';\n\nexport * from './useMembers';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSpaceProperties';\nexport * from './useSubscription';\nexport * from './useSyncState';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { PublicKey, type PublicKeyLike } 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: PublicKeyLike | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey\n ? spaces.find((space) => (spaceKey instanceof PublicKey ? space.key.equals(spaceKey) : space.id === spaceKey))\n : 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 { PublicKey } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its id.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n */\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpace = (spaceId?: SpaceId | PublicKey): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n if (!spaceId) {\n return undefined;\n }\n\n return spaces.find((space) => {\n if (spaceId instanceof PublicKey) {\n return space.key.equals(spaceId);\n }\n\n return space.id === spaceId;\n });\n};\n\n/**\n * Get a Space database by the id of the space.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n * @deprecated Use useSpace.\n */\nexport const useDatabase = (spaceId?: SpaceId): Space['db'] | undefined => {\n const space = useSpace(spaceId);\n return space?.db;\n};\n\nexport type UseSpacesProps = {\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 }: UseSpacesProps = {}): 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 } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\nimport { useSpace } from './useSpaces';\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitations = (spaceId?: SpaceId | PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceId);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitation = (spaceId?: SpaceId | PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceId);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type SpaceProperties, SpaceState } from '@dxos/client/echo';\nimport { type Key, type Obj } from '@dxos/echo';\nimport { type ObjectUpdateCallback, useObject } from '@dxos/echo-react';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpace } from './useSpaces';\n\n/**\n * Subscribe to a space's properties with reactive updates.\n * Returns undefined if the space is undefined or not ready yet.\n * Automatically waits for the space to be ready before returning properties.\n *\n * @param spaceId - The space ID to get properties from (can be undefined).\n * @returns A tuple of [snapshot, updateCallback] or [undefined, no-op] if not ready.\n */\nexport const useSpaceProperties = (\n spaceId: Key.SpaceId | undefined,\n): [Obj.Snapshot<SpaceProperties> | undefined, ObjectUpdateCallback<SpaceProperties>] => {\n const space = useSpace(spaceId);\n const spaceState = useMulticastObservable(space?.state ?? MulticastObservable.empty());\n const properties = spaceState === SpaceState.SPACE_READY ? space?.properties : undefined;\n return useObject(properties);\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>(null);\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { isEdgePeerId } from '@dxos/echo-protocol';\n\nimport { useClient } from '../client';\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,cAAc;AACd,cAAc;;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CAAA;;;",
|
|
6
|
-
"names": ["MulticastObservable", "PublicKey", "HaloSpaceMember", "useMulticastObservable", "PublicKey", "SpaceState", "useMulticastObservable", "useSpace", "spaceId", "client", "useClient", "spaces", "useMulticastObservable", "undefined", "find", "space", "PublicKey", "key", "equals", "id", "useDatabase", "db", "useSpaces", "all", "filter", "state", "get", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "PublicKey", "key", "equals", "id", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceId", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "MulticastObservable", "SpaceState", "useObject", "useMulticastObservable", "useSpaceProperties", "spaceId", "space", "useSpace", "spaceState", "useMulticastObservable", "state", "MulticastObservable", "empty", "properties", "SpaceState", "SPACE_READY", "undefined", "useObject", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "current", "subscriptionRef", "unsubscribe", "update", "useEffect", "useState", "Context", "isEdgePeerId", "spaceState", "setSpaceState", "useEffect", "Context", "createSubscriptions", "space", "spaces", "id", "onDispose", "syncState", "client", "internal", "peers", "find", "isEdgePeerId", "state"]
|
|
3
|
+
"sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSpaceProperties.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts", "../../../../src/echo/useFeedSyncState.ts", "../../../../src/echo/useRegistry.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\nexport * from '@dxos/echo-react';\n\nexport * from './useMembers';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSpaceProperties';\nexport * from './useSubscription';\nexport * from './useSyncState';\nexport * from './useFeedSyncState';\nexport * from './useRegistry';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { PublicKey, type PublicKeyLike } 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: PublicKeyLike | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey\n ? spaces.find((space) => (spaceKey instanceof PublicKey ? space.key.equals(spaceKey) : space.id === spaceKey))\n : 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 { PublicKey } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its id.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n */\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpace = (spaceId?: SpaceId | PublicKey): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n if (!spaceId) {\n return undefined;\n }\n\n return spaces.find((space) => {\n if (spaceId instanceof PublicKey) {\n return space.key.equals(spaceId);\n }\n\n return space.id === spaceId;\n });\n};\n\n/**\n * Get a Space database by the id of the space.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n * @deprecated Use useSpace.\n */\nexport const useDatabase = (spaceId?: SpaceId): Space['db'] | undefined => {\n const space = useSpace(spaceId);\n return space?.db;\n};\n\nexport type UseSpacesProps = {\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 }: UseSpacesProps = {}): 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 } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\nimport { useSpace } from './useSpaces';\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitations = (spaceId?: SpaceId | PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceId);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitation = (spaceId?: SpaceId | PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceId);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type SpaceProperties, SpaceState } from '@dxos/client/echo';\nimport { type Key, type Obj } from '@dxos/echo';\nimport { type ObjectUpdateCallback, useObject } from '@dxos/echo-react';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpace } from './useSpaces';\n\n/**\n * Subscribe to a space's properties with reactive updates.\n * Returns undefined if the space is undefined or not ready yet.\n * Automatically waits for the space to be ready before returning properties.\n *\n * @param spaceId - The space ID to get properties from (can be undefined).\n * @returns A tuple of [snapshot, updateCallback] or [undefined, no-op] if not ready.\n */\nexport const useSpaceProperties = (\n spaceId: Key.SpaceId | undefined,\n): [Obj.Snapshot<SpaceProperties> | undefined, ObjectUpdateCallback<SpaceProperties>] => {\n const space = useSpace(spaceId);\n const spaceState = useMulticastObservable(space?.state ?? MulticastObservable.empty());\n const properties = spaceState === SpaceState.SPACE_READY ? space?.properties : undefined;\n return useObject(properties);\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>(null);\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { isEdgePeerId } from '@dxos/echo-protocol';\n\nimport { useClient } from '../client';\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type SpaceId } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst DEFAULT_POLL_INTERVAL_MS = 5_000;\n\nexport type FeedSyncState = {\n /** Combined blocks to pull + push across namespaces. */\n pending: number;\n /** Total blocks stored locally across namespaces. */\n total: number;\n};\n\nexport type FeedSyncStateMap = Record<SpaceId, FeedSyncState>;\n\n/**\n * Polls queue replication state per space.\n */\nexport const useFeedSyncState = (pollIntervalMs = DEFAULT_POLL_INTERVAL_MS): FeedSyncStateMap => {\n const client = useClient();\n const [feedSyncState, setFeedSyncState] = useState<FeedSyncStateMap>({});\n\n useEffect(() => {\n const queueService = client.services.services.QueueService;\n if (!queueService) {\n return;\n }\n\n let cancelled = false;\n\n const poll = async () => {\n const spaces = client.spaces.get();\n const entries = await Promise.all(\n spaces.map(async (space) => {\n try {\n const response = await queueService.getSyncState({ spaceId: space.id });\n const state = (response.namespaces ?? []).reduce<FeedSyncState>(\n (acc, entry) => {\n acc.pending += Number(entry.blocksToPull ?? 0) + Number(entry.blocksToPush ?? 0);\n acc.total += Number(entry.totalBlocks ?? 0);\n return acc;\n },\n { pending: 0, total: 0 },\n );\n return [space.id, state] as const;\n } catch {\n return [space.id, { pending: 0, total: 0 }] as const;\n }\n }),\n );\n\n if (!cancelled) {\n setFeedSyncState(Object.fromEntries(entries));\n }\n };\n\n void poll();\n const interval = setInterval(() => void poll(), pollIntervalMs);\n\n const spacesSubscription = client.spaces.subscribe(() => {\n void poll();\n });\n\n return () => {\n cancelled = true;\n clearInterval(interval);\n spacesSubscription.unsubscribe();\n };\n }, [client, pollIntervalMs]);\n\n return feedSyncState;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Registry } from '@dxos/echo';\n\nimport { useClient } from '../client';\n\n/**\n * Returns the hypergraph registry attached to the current client.\n */\nexport const useRegistry = (): Registry.Registry => {\n const client = useClient();\n return client.graph.registry;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,cAAc;AACd,cAAc;;;ACDd,SAASA,2BAA2B;AACpC,SAASC,aAAAA,kBAAqC;AAC9C,SAASC,uBAAyC;AAClD,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,iBAAiB;AAC1B,SAAqBC,kBAAkB;AAEvC,SAASC,8BAA8B;AAchC,IAAMC,WAAW,CAACC,YAAAA;AACvB,QAAMC,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAOE,MAAM;AAC5D,MAAI,CAACH,SAAS;AACZ,WAAOK;EACT;AAEA,SAAOF,OAAOG,KAAK,CAACC,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,OAAO,YAAA;AACX,YAAMC,SAASX,OAAOW,OAAOC,IAAG;AAChC,YAAMC,UAAU,MAAMC,QAAQC,IAC5BJ,OAAOK,IAAI,OAAOC,UAAAA;AAChB,YAAI;AACF,gBAAMC,WAAW,MAAMZ,aAAaa,aAAa;YAAEC,SAASH,MAAMI;UAAG,CAAA;AACrE,gBAAMC,SAASJ,SAASK,cAAc,CAAA,GAAIC,OACxC,CAACC,KAAKC,UAAAA;AACJD,gBAAIE,WAAWC,OAAOF,MAAMG,gBAAgB,CAAA,IAAKD,OAAOF,MAAMI,gBAAgB,CAAA;AAC9EL,gBAAIM,SAASH,OAAOF,MAAMM,eAAe,CAAA;AACzC,mBAAOP;UACT,GACA;YAAEE,SAAS;YAAGI,OAAO;UAAE,CAAA;AAEzB,iBAAO;YAACd,MAAMI;YAAIC;;QACpB,QAAQ;AACN,iBAAO;YAACL,MAAMI;YAAI;cAAEM,SAAS;cAAGI,OAAO;YAAE;;QAC3C;MACF,CAAA,CAAA;AAGF,UAAI,CAACtB,WAAW;AACdN,yBAAiB8B,OAAOC,YAAYrB,OAAAA,CAAAA;MACtC;IACF;AAEA,SAAKH,KAAAA;AACL,UAAMyB,WAAWC,YAAY,MAAM,KAAK1B,KAAAA,GAAQX,cAAAA;AAEhD,UAAMsC,qBAAqBrC,OAAOW,OAAO2B,UAAU,MAAA;AACjD,WAAK5B,KAAAA;IACP,CAAA;AAEA,WAAO,MAAA;AACLD,kBAAY;AACZ8B,oBAAcJ,QAAAA;AACdE,yBAAmBG,YAAW;IAChC;EACF,GAAG;IAACxC;IAAQD;GAAe;AAE3B,SAAOG;AACT;;;AClEO,IAAMuC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOD,OAAOE,MAAMC;AACtB;",
|
|
6
|
+
"names": ["MulticastObservable", "PublicKey", "HaloSpaceMember", "useMulticastObservable", "PublicKey", "SpaceState", "useMulticastObservable", "useSpace", "spaceId", "client", "useClient", "spaces", "useMulticastObservable", "undefined", "find", "space", "PublicKey", "key", "equals", "id", "useDatabase", "db", "useSpaces", "all", "filter", "state", "get", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "PublicKey", "key", "equals", "id", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceId", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "MulticastObservable", "SpaceState", "useObject", "useMulticastObservable", "useSpaceProperties", "spaceId", "space", "useSpace", "spaceState", "useMulticastObservable", "state", "MulticastObservable", "empty", "properties", "SpaceState", "SPACE_READY", "undefined", "useObject", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "current", "subscriptionRef", "unsubscribe", "update", "useEffect", "useState", "Context", "isEdgePeerId", "spaceState", "setSpaceState", "useEffect", "Context", "createSubscriptions", "space", "spaces", "id", "onDispose", "syncState", "client", "internal", "peers", "find", "isEdgePeerId", "state", "useEffect", "useState", "DEFAULT_POLL_INTERVAL_MS", "useFeedSyncState", "pollIntervalMs", "client", "useClient", "feedSyncState", "setFeedSyncState", "useState", "useEffect", "queueService", "services", "QueueService", "cancelled", "poll", "spaces", "get", "entries", "Promise", "all", "map", "space", "response", "getSyncState", "spaceId", "id", "state", "namespaces", "reduce", "acc", "entry", "pending", "Number", "blocksToPull", "blocksToPush", "total", "totalBlocks", "Object", "fromEntries", "interval", "setInterval", "spacesSubscription", "subscribe", "clearInterval", "unsubscribe", "useRegistry", "client", "useClient", "graph", "registry"]
|
|
7
7
|
}
|