@dxos/react-client 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/.storybook/main.mts +11 -0
  2. package/.storybook/preview.mts +8 -0
  3. package/dist/lib/browser/{chunk-BXOLJYAY.mjs → chunk-LO3TU5CK.mjs} +4 -4
  4. package/dist/lib/browser/chunk-LO3TU5CK.mjs.map +7 -0
  5. package/dist/lib/browser/echo/index.mjs +8 -5
  6. package/dist/lib/browser/echo/index.mjs.map +3 -3
  7. package/dist/lib/browser/halo/index.mjs +1 -1
  8. package/dist/lib/browser/invitations/index.mjs +1 -1
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/testing/index.mjs +19 -16
  11. package/dist/lib/browser/testing/index.mjs.map +3 -3
  12. package/dist/lib/node-esm/{chunk-256IHY6F.mjs → chunk-AQJH2UNZ.mjs} +4 -4
  13. package/dist/lib/node-esm/chunk-AQJH2UNZ.mjs.map +7 -0
  14. package/dist/lib/node-esm/echo/index.mjs +8 -5
  15. package/dist/lib/node-esm/echo/index.mjs.map +3 -3
  16. package/dist/lib/node-esm/halo/index.mjs +1 -1
  17. package/dist/lib/node-esm/invitations/index.mjs +1 -1
  18. package/dist/lib/node-esm/meta.json +1 -1
  19. package/dist/lib/node-esm/testing/index.mjs +19 -16
  20. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  21. package/dist/types/src/echo/useQuery.d.ts +3 -3
  22. package/dist/types/src/echo/useQuery.d.ts.map +1 -1
  23. package/dist/types/src/echo/useSchema.d.ts +1 -1
  24. package/dist/types/src/echo/useSchema.d.ts.map +1 -1
  25. package/dist/types/src/echo/useSubscription.d.ts +1 -1
  26. package/dist/types/src/echo/useSubscription.d.ts.map +1 -1
  27. package/dist/types/src/halo/Passkey.stories.d.ts +1 -1
  28. package/dist/types/src/halo/Passkey.stories.d.ts.map +1 -1
  29. package/dist/types/src/invitations/useInvitationStatus.d.ts +1 -1
  30. package/dist/types/src/invitations/useInvitationStatus.d.ts.map +1 -1
  31. package/dist/types/src/testing/ClientRepeater.d.ts +2 -2
  32. package/dist/types/src/testing/ClientRepeater.d.ts.map +1 -1
  33. package/dist/types/src/testing/ClientRepeater.stories.d.ts +0 -1
  34. package/dist/types/src/testing/ClientRepeater.stories.d.ts.map +1 -1
  35. package/dist/types/src/testing/withClientProvider.d.ts +5 -6
  36. package/dist/types/src/testing/withClientProvider.d.ts.map +1 -1
  37. package/dist/types/src/testing/withClientProvider.stories.d.ts +1 -1
  38. package/dist/types/src/testing/withClientProvider.stories.d.ts.map +1 -1
  39. package/dist/types/tsconfig.tsbuildinfo +1 -1
  40. package/moon.yml +4 -0
  41. package/package.json +30 -31
  42. package/src/echo/useQuery.test.tsx +7 -7
  43. package/src/echo/useQuery.ts +28 -12
  44. package/src/echo/useSchema.ts +2 -2
  45. package/src/echo/useSubscription.ts +1 -1
  46. package/src/halo/Passkey.stories.tsx +11 -14
  47. package/src/invitations/useInvitationStatus.ts +9 -8
  48. package/src/testing/ClientRepeater.stories.tsx +1 -3
  49. package/src/testing/ClientRepeater.tsx +4 -4
  50. package/src/testing/withClientProvider.stories.tsx +12 -9
  51. package/src/testing/withClientProvider.tsx +17 -15
  52. package/tsconfig.json +0 -3
  53. package/vitest.config.ts +12 -16
  54. package/dist/lib/browser/chunk-BXOLJYAY.mjs.map +0 -7
  55. package/dist/lib/node-esm/chunk-256IHY6F.mjs.map +0 -7
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { createConfig } from '../../../../tools/storybook/.storybook/main';
6
+
7
+ export const stories = [
8
+ '../src/**/*.stories.tsx',
9
+ ]
10
+
11
+ export default createConfig({ stories });
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { preview } from '../../../../tools/storybook/.storybook/preview';
6
+
7
+ export * from '../../../../tools/storybook/.storybook/preview';
8
+ export default preview;
@@ -6,14 +6,14 @@ import { useCallback, useEffect, useMemo, useReducer } from "react";
6
6
  import { Invitation, InvitationEncoder } from "@dxos/client/invitations";
7
7
  import { log } from "@dxos/log";
8
8
  var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/invitations/useInvitationStatus.ts";
9
- var isShareableInvitation = (invitation) => invitation.authMethod !== Invitation.AuthMethod.KNOWN_PUBLIC_KEY || invitation.guestKeypair?.privateKey;
9
+ var isShareableInvitation = (invitation) => invitation.authMethod !== Invitation.AuthMethod.KNOWN_PUBLIC_KEY || !!invitation.guestKeypair?.privateKey;
10
10
  var useInvitationStatus = (observable) => {
11
11
  const [state, dispatch] = useReducer((prev, action) => {
12
12
  log("useInvitationStatus", {
13
13
  action
14
14
  }, {
15
15
  F: __dxlog_file,
16
- L: 90,
16
+ L: 91,
17
17
  S: void 0,
18
18
  C: (f, a) => f(...a)
19
19
  });
@@ -126,7 +126,7 @@ var useInvitationStatus = (observable) => {
126
126
  authCode
127
127
  }, {
128
128
  F: __dxlog_file,
129
- L: 195,
129
+ L: 196,
130
130
  S: void 0,
131
131
  C: (f, a) => f(...a)
132
132
  });
@@ -160,4 +160,4 @@ export {
160
160
  Invitation2 as Invitation,
161
161
  InvitationsProxy
162
162
  };
163
- //# sourceMappingURL=chunk-BXOLJYAY.mjs.map
163
+ //# sourceMappingURL=chunk-LO3TU5CK.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/invitations/index.ts", "../../../src/invitations/useInvitationStatus.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n AuthenticatingInvitationObservable,\n CancellableInvitationObservable,\n InvitationEncoder,\n Invitation,\n type Invitations,\n InvitationsProxy,\n} from '@dxos/client/invitations';\n\nexport * from './useInvitationStatus';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useCallback, useEffect, useMemo, useReducer } from 'react';\n\nimport { type PublicKey } from '@dxos/client';\nimport {\n type AuthenticatingInvitationObservable,\n type CancellableInvitationObservable,\n Invitation,\n InvitationEncoder,\n} from '@dxos/client/invitations';\nimport { log } from '@dxos/log';\n\nexport type InvitationResult = {\n spaceKey: PublicKey | null;\n identityKey: PublicKey | null;\n swarmKey: PublicKey | null;\n target: string | null;\n};\n\ninterface InvitationReducerState {\n status: Invitation.State; // TODO(burdon): Rename state.\n haltedAt?: Invitation.State;\n result: InvitationResult;\n error?: Error;\n id?: string;\n multiUse?: boolean;\n shareable?: boolean;\n invitationCode?: string;\n authCode?: string;\n authMethod?: Invitation.AuthMethod;\n type?: Invitation.Type;\n}\n\ntype InvitationPayload = { invitation: Invitation };\n\nexport type InvitationAction =\n | ({\n status:\n | Invitation.State.INIT\n | Invitation.State.CONNECTED\n | Invitation.State.READY_FOR_AUTHENTICATION\n | Invitation.State.AUTHENTICATING;\n } & InvitationPayload)\n | ({\n status: Invitation.State.CONNECTING;\n observable: CancellableInvitationObservable;\n } & InvitationPayload)\n | ({\n status: Invitation.State.SUCCESS;\n result: InvitationResult;\n } & InvitationPayload)\n | ({\n status: Invitation.State.CANCELLED | Invitation.State.TIMEOUT;\n haltedAt: Invitation.State;\n } & InvitationPayload)\n | {\n status: Invitation.State.ERROR;\n error?: Error;\n haltedAt: Invitation.State;\n };\n\nexport type InvitationStatus = {\n id?: string;\n invitationCode?: string;\n authCode?: string;\n authMethod?: Invitation.AuthMethod;\n type?: Invitation.Type;\n status: Invitation.State;\n haltedAt?: Invitation.State;\n multiUse?: boolean;\n shareable?: boolean;\n result: InvitationResult;\n error?: Error;\n cancel(): void;\n // TODO(wittjosiah): Remove?\n connect(observable: CancellableInvitationObservable): void;\n authenticate(authCode: string): Promise<void>;\n};\n\n// Without private key, the invitation code cannot be created.\n// These invitations are only available to be accepted but not shared.\nconst isShareableInvitation = (invitation: Invitation) =>\n invitation.authMethod !== Invitation.AuthMethod.KNOWN_PUBLIC_KEY || !!invitation.guestKeypair?.privateKey;\n\nexport const useInvitationStatus = (observable?: CancellableInvitationObservable): InvitationStatus => {\n const [state, dispatch] = useReducer(\n (prev: InvitationReducerState, action: InvitationAction): InvitationReducerState => {\n log('useInvitationStatus', { action });\n const invitationProps =\n 'invitation' in action\n ? {\n id: action.invitation.invitationId,\n multiUse: action.invitation.multiUse,\n invitationCode: InvitationEncoder.encode(action.invitation),\n authCode: action.invitation.authCode,\n authMethod: action.invitation.authMethod,\n shareable: isShareableInvitation(action.invitation),\n type: action.invitation.type,\n }\n : {};\n return {\n ...prev,\n ...invitationProps,\n // TODO(burdon): State.\n status: action.status,\n // `invitationObservable`, `secret`, and `result` is persisted between the status-actions that set them.\n result: action.status === Invitation.State.SUCCESS ? action.result : prev.result,\n // `error` gets set each time we enter the error state\n ...(action.status === Invitation.State.ERROR && { error: action.error }),\n // `haltedAt` gets set on only the first error/cancelled/timeout action and reset on any others.\n ...((action.status === Invitation.State.ERROR ||\n action.status === Invitation.State.CANCELLED ||\n action.status === Invitation.State.TIMEOUT) && {\n haltedAt: typeof prev.haltedAt === 'undefined' ? action.haltedAt : prev.haltedAt,\n }),\n };\n },\n null,\n (_arg: null): InvitationReducerState => {\n const invitation = observable?.get();\n return {\n status: Invitation.State.INIT,\n result: { spaceKey: null, identityKey: null, swarmKey: null, target: null },\n id: invitation?.invitationId,\n multiUse: invitation?.multiUse,\n invitationCode: invitation ? InvitationEncoder.encode(invitation) : undefined,\n authCode: invitation?.authCode,\n authMethod: invitation?.authMethod,\n shareable: invitation ? isShareableInvitation(invitation) : false,\n type: invitation?.type,\n };\n },\n );\n\n // Handle unmount.\n\n useEffect(() => {\n const update = (invitation: Invitation) => {\n switch (invitation.state) {\n case Invitation.State.INIT:\n case Invitation.State.CONNECTED:\n case Invitation.State.READY_FOR_AUTHENTICATION:\n case Invitation.State.AUTHENTICATING: {\n dispatch({\n invitation,\n status: invitation.state,\n });\n break;\n }\n\n case Invitation.State.SUCCESS: {\n dispatch({\n invitation,\n status: invitation.state,\n result: {\n spaceKey: invitation.spaceKey || null,\n identityKey: invitation.identityKey || null,\n swarmKey: invitation.swarmKey || null,\n target: invitation.target || null,\n },\n });\n break;\n }\n\n case Invitation.State.CANCELLED:\n case Invitation.State.TIMEOUT: {\n dispatch({ invitation, status: invitation.state, haltedAt: state.status });\n break;\n }\n }\n };\n\n const subscription = observable?.subscribe(update, (err: Error) => {\n dispatch({ status: Invitation.State.ERROR, error: err, haltedAt: state.status });\n });\n\n const currentState = observable?.get();\n if (currentState) {\n update(currentState);\n }\n\n return () => subscription?.unsubscribe();\n }, [observable, state.status]);\n\n // Return memoized callbacks & values.\n\n const connect = useCallback((observable: CancellableInvitationObservable) => {\n dispatch({ invitation: observable.get(), status: Invitation.State.CONNECTING, observable });\n }, []);\n\n const authenticate = useCallback(\n (authCode: string) => {\n log('authenticating...', { authCode });\n return (observable as AuthenticatingInvitationObservable).authenticate(authCode);\n },\n [observable],\n );\n\n const cancel = useCallback(async () => observable?.cancel(), [observable]);\n\n return useMemo(() => {\n return {\n ...state,\n cancel,\n connect,\n authenticate,\n };\n }, [state, cancel, connect, authenticate]);\n};\n"],
5
+ "mappings": ";AAKA,SACEA,oCACAC,iCACAC,qBAAAA,oBACAC,cAAAA,aAEAC,wBACK;;;ACRP,SAASC,aAAaC,WAAWC,SAASC,kBAAkB;AAG5D,SAGEC,YACAC,yBACK;AACP,SAASC,WAAW;;AAuEpB,IAAMC,wBAAwB,CAACC,eAC7BA,WAAWC,eAAeL,WAAWM,WAAWC,oBAAoB,CAAC,CAACH,WAAWI,cAAcC;AAE1F,IAAMC,sBAAsB,CAACC,eAAAA;AAClC,QAAM,CAACC,OAAOC,QAAAA,IAAYd,WACxB,CAACe,MAA8BC,WAAAA;AAC7Bb,QAAI,uBAAuB;MAAEa;IAAO,GAAA;;;;;;AACpC,UAAMC,kBACJ,gBAAgBD,SACZ;MACEE,IAAIF,OAAOX,WAAWc;MACtBC,UAAUJ,OAAOX,WAAWe;MAC5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zE,SAAOb,QAAQ,MAAA;AACb,WAAO;MACL,GAAGc;MACH0C;MACAH;MACAE;IACF;EACF,GAAG;IAACzC;IAAO0C;IAAQH;IAASE;GAAa;AAC3C;",
6
+ "names": ["AuthenticatingInvitationObservable", "CancellableInvitationObservable", "InvitationEncoder", "Invitation", "InvitationsProxy", "useCallback", "useEffect", "useMemo", "useReducer", "Invitation", "InvitationEncoder", "log", "isShareableInvitation", "invitation", "authMethod", "AuthMethod", "KNOWN_PUBLIC_KEY", "guestKeypair", "privateKey", "useInvitationStatus", "observable", "state", "dispatch", "prev", "action", "invitationProps", "id", "invitationId", "multiUse", "invitationCode", "encode", "authCode", "shareable", "type", "status", "result", "State", "SUCCESS", "ERROR", "error", "CANCELLED", "TIMEOUT", "haltedAt", "_arg", "get", "INIT", "spaceKey", "identityKey", "swarmKey", "target", "undefined", "update", "CONNECTED", "READY_FOR_AUTHENTICATION", "AUTHENTICATING", "subscription", "subscribe", "err", "currentState", "unsubscribe", "connect", "CONNECTING", "authenticate", "cancel"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useInvitationStatus
3
- } from "../chunk-BXOLJYAY.mjs";
3
+ } from "../chunk-LO3TU5CK.mjs";
4
4
  import {
5
5
  useClient
6
6
  } from "../chunk-TA2HGRAF.mjs";
@@ -60,11 +60,14 @@ import { Filter, Query, isSpace } from "@dxos/client/echo";
60
60
  var EMPTY_ARRAY = [];
61
61
  var noop = () => {
62
62
  };
63
- var useQuery = (spaceOrEcho, queryOrFilter, deps) => {
63
+ var useQuery = (resource, queryOrFilter, deps) => {
64
64
  const query = Filter.is(queryOrFilter) ? Query.select(queryOrFilter) : queryOrFilter;
65
65
  const { getObjects, subscribe } = useMemo(() => {
66
+ let queryResult = void 0;
67
+ if (resource) {
68
+ queryResult = isSpace(resource) ? resource.db.query(query) : resource.query(query);
69
+ }
66
70
  let subscribed = false;
67
- const queryResult = spaceOrEcho === void 0 ? void 0 : isSpace(spaceOrEcho) ? spaceOrEcho.db.query(query) : spaceOrEcho.query(query);
68
71
  return {
69
72
  getObjects: () => subscribed && queryResult ? queryResult.objects : EMPTY_ARRAY,
70
73
  subscribe: (cb) => {
@@ -77,7 +80,7 @@ var useQuery = (spaceOrEcho, queryOrFilter, deps) => {
77
80
  }
78
81
  };
79
82
  }, [
80
- spaceOrEcho,
83
+ resource,
81
84
  JSON.stringify(query.ast),
82
85
  ...deps ?? []
83
86
  ]);
@@ -197,7 +200,7 @@ import { createSubscription } from "@dxos/client/echo";
197
200
  var useSubscription = (cb, selection) => {
198
201
  const callbackRef = useRef2(cb);
199
202
  callbackRef.current = cb;
200
- const subscriptionRef = useRef2();
203
+ const subscriptionRef = useRef2(null);
201
204
  useEffect2(() => {
202
205
  subscriptionRef.current = createSubscription(() => {
203
206
  callbackRef.current();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useQuery.ts", "../../../../src/echo/useQueue.ts", "../../../../src/echo/useSchema.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useQueue';\nexport * from './useSchema';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\nexport * from './useSyncState';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { HaloSpaceMember, type SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpaces } from './useSpaces';\n\nexport const useMembers = (spaceKey: PublicKey | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey ? spaces.find((space) => space.key.equals(spaceKey)) : undefined;\n\n // EMPTY_OBSERVABLE needs to be a stable reference to avoid re-subscribing on every render.\n const members = useMulticastObservable(space?.members ?? MulticastObservable.empty()) ?? [];\n return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useState } from 'react';\n\nimport { type PublicKeyLike } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { useAsyncEffect, useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its key.\n * The space is not guaranteed to be in the ready state.\n * Returns the default space if no key is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceKeyLike the key of the space to look for\n */\nexport const useSpace = (spaceKeyLike?: PublicKeyLike): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n const [ready, setReady] = useState(false);\n\n useAsyncEffect(async () => {\n // Only wait for ready if looking for the default space.\n if (spaceKeyLike) {\n return;\n }\n\n await client.spaces.waitUntilReady();\n setReady(true);\n }, [client, spaceKeyLike]);\n\n if (spaceKeyLike) {\n return spaces.find((space) => space.key.equals(spaceKeyLike) || space.id === spaceKeyLike);\n }\n\n if (ready && client.halo.identity.get()) {\n return client.spaces.default;\n }\n};\n\nexport type UseSpacesParams = {\n /**\n * Return uninitialized spaces as well.\n */\n all?: boolean;\n};\n\n/**\n * Get all Spaces available to current user.\n * Requires a ClientProvider somewhere in the parent tree.\n * By default, only ready spaces are returned.\n * @returns an array of Spaces\n */\nexport const useSpaces = ({ all = false }: UseSpacesParams = {}): Space[] => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n\n // TODO(dmaretskyi): Array reference equality.\n return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Echo, Filter, type Live, Query, type Space, isSpace } from '@dxos/client/echo';\n\nconst EMPTY_ARRAY: never[] = [];\n\nconst noop = () => {};\n\n// TODO(dmaretskyi): Queries are fully serializable, so we can remove `deps` argument.\ninterface UseQueryFn {\n <Q extends Query.Any>(spaceOrEcho: Space | Echo | undefined, query: Q, deps?: any[]): Live<Query.Type<Q>>[];\n\n <F extends Filter.Any>(spaceOrEcho: Space | Echo | undefined, filter: F, deps?: any[]): Live<Filter.Type<F>>[];\n}\n\n/**\n * Create subscription.\n */\nexport const useQuery: UseQueryFn = (\n spaceOrEcho: Space | Echo | undefined,\n queryOrFilter: Query.Any | Filter.Any,\n deps?: any[],\n): Live<unknown>[] => {\n const query = Filter.is(queryOrFilter) ? Query.select(queryOrFilter) : queryOrFilter;\n\n const { getObjects, subscribe } = useMemo(() => {\n let subscribed = false;\n const queryResult =\n spaceOrEcho === undefined\n ? undefined\n : isSpace(spaceOrEcho)\n ? spaceOrEcho.db.query(query)\n : spaceOrEcho.query(query);\n\n return {\n getObjects: () => (subscribed && queryResult ? queryResult.objects : EMPTY_ARRAY),\n subscribe: (cb: () => void) => {\n subscribed = true;\n const unsubscribe = queryResult?.subscribe(cb) ?? noop;\n return () => {\n unsubscribe?.();\n subscribed = false;\n };\n },\n };\n }, [spaceOrEcho, JSON.stringify(query.ast), ...(deps ?? [])]);\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n // NOTE: This hook will resubscribe whenever the callback passed to the first argument changes; make sure it is stable.\n const objects = useSyncExternalStore<Live<unknown>[] | undefined>(subscribe, getObjects);\n return objects ?? [];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { type Queue } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type Obj, type Relation } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst MIN_POLL_INTERVAL = 1_000;\n\nexport type UseQueueOptions = {\n pollInterval?: number;\n};\n\n/**\n * Polls the given Edge queue.\n */\n// TODO(burdon): Replace polling with socket?\n// TODO(dmaretskyi): Move into client package.\n// TODO(dmaretskyi): Consider passing the space into the hook to support queue DXNs without space id.\n// TODO(ZaymonFC): If queue is unchanged returned object should be refferentially stable on poll.\nexport const useQueue = <T extends Obj.Any | Relation.Any>(\n queueDxn?: DXN,\n options: UseQueueOptions = {},\n): Queue<T> | undefined => {\n const client = useClient();\n const mountedRef = useRef(true);\n\n const queue = useMemo<Queue<T> | undefined>(() => {\n if (!queueDxn) {\n return undefined;\n }\n\n const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError('Invalid queue DXN'));\n return client.spaces.get(spaceId)?.queues.get<T>(queueDxn);\n }, [client, queueDxn?.toString()]);\n\n useEffect(() => {\n void queue?.refresh();\n }, [queue]);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n mountedRef.current = true;\n\n const poll = () => {\n if (!mountedRef.current) {\n return;\n }\n\n void queue?.refresh().finally(() => {\n if (mountedRef.current && options.pollInterval) {\n timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));\n }\n });\n };\n\n if (options.pollInterval) {\n poll();\n }\n\n return () => {\n mountedRef.current = false;\n clearTimeout(timeout);\n };\n }, [queue, options.pollInterval]);\n\n return queue;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { type BaseSchema } from '@dxos/echo-schema';\n\n/**\n * Subscribe to and retrieve schema changes from a space's schema registry.\n */\nexport const useSchema = (\n client: Client,\n space: Space | undefined,\n typename: string | undefined,\n): Schema.Schema.AnyNoContext | undefined => {\n const { subscribe, getSchema } = useMemo(() => {\n if (!typename || !space) {\n return {\n subscribe: () => () => {},\n getSchema: () => undefined,\n };\n }\n\n const staticSchema = client.graph.schemaRegistry.getSchema(typename);\n if (staticSchema) {\n return {\n subscribe: () => () => {},\n getSchema: () => staticSchema,\n };\n }\n\n const query = space.db.schemaRegistry.query({ typename });\n const initialResult: BaseSchema = query.runSync()[0];\n let currentSchema = initialResult;\n\n return {\n subscribe: (onStoreChange: () => void) => {\n const unsubscribe = query.subscribe(() => {\n currentSchema = query.results[0];\n onStoreChange();\n });\n\n return unsubscribe;\n },\n getSchema: () => currentSchema,\n };\n }, [typename, space]);\n\n return useSyncExternalStore(subscribe, getSchema);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\n\nimport { useSpace } from './useSpaces';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceKey);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\nexport const useSpaceInvitation = (spaceKey?: PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceKey);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useRef } from 'react';\n\nimport { type Selection, type SubscriptionHandle, createSubscription } from '@dxos/client/echo';\n\n/**\n * Create reactive selection.\n * Calls the callback when the selection changes and during the first render.\n */\n// TODO(wittjosiah): Is this still needed with signals reactivity? If not, remove or update jsdoc with usage info.\nexport const useSubscription = (cb: () => void, selection: Selection) => {\n // Make sure that the callback is always the one from the latest render.\n // Without this, we would always call the callback from the initial render,\n // which might contain stale data.\n const callbackRef = useRef(cb);\n callbackRef.current = cb;\n\n const subscriptionRef = useRef<SubscriptionHandle>();\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\n\nimport { useClient } from '../client';\n\nconst isEdgePeerId = (peerId: string, spaceId: SpaceId) =>\n peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n"],
5
- "m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,MAAMxB,QAAQgB,MAAMC,EAAE,CAAA;AAC3E,UAAIK,WAAW;AACbb,sBAAca,SAAAA;MAChB;IACF,CAAA;AAEA,WAAO,MAAA;AACL,WAAKV,IAAIe,QAAO;IAClB;EACF,GAAG;IAACX;GAAM;AAEV,SAAOR;AACT;",
6
- "names": ["MulticastObservable", "HaloSpaceMember", "useMulticastObservable", "useState", "SpaceState", "useAsyncEffect", "useMulticastObservable", "useSpace", "spaceKeyLike", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useAsyncEffect", "waitUntilReady", "find", "space", "key", "equals", "id", "halo", "identity", "get", "default", "useSpaces", "all", "filter", "state", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "key", "equals", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "useSyncExternalStore", "Filter", "Query", "isSpace", "EMPTY_ARRAY", "noop", "useQuery", "spaceOrEcho", "queryOrFilter", "deps", "query", "Filter", "is", "Query", "select", "getObjects", "subscribe", "useMemo", "subscribed", "queryResult", "undefined", "isSpace", "db", "objects", "cb", "unsubscribe", "JSON", "stringify", "ast", "useSyncExternalStore", "useEffect", "useMemo", "useRef", "raise", "MIN_POLL_INTERVAL", "useQueue", "queueDxn", "options", "client", "useClient", "mountedRef", "useRef", "queue", "useMemo", "undefined", "spaceId", "asQueueDXN", "raise", "TypeError", "spaces", "get", "queues", "toString", "useEffect", "refresh", "timeout", "current", "poll", "finally", "pollInterval", "setTimeout", "Math", "max", "clearTimeout", "useMemo", "useSyncExternalStore", "useSchema", "client", "space", "typename", "subscribe", "getSchema", "useMemo", "undefined", "staticSchema", "graph", "schemaRegistry", "query", "db", "initialResult", "runSync", "currentSchema", "onStoreChange", "unsubscribe", "results", "useSyncExternalStore", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceKey", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "useRef", "current", "subscriptionRef", "useEffect", "createSubscription", "unsubscribe", "update", "useEffect", "useState", "Context", "EdgeService", "isEdgePeerId", "peerId", "spaceId", "startsWith", "EdgeService", "AUTOMERGE_REPLICATOR", "useSyncState", "client", "useClient", "spaceState", "setSpaceState", "useState", "useEffect", "ctx", "Context", "createSubscriptions", "spaces", "space", "id", "onDispose", "db", "subscribeToSyncState", "peers", "syncState", "find", "state", "get", "subscribe", "dispose", "useSpaceSyncState"]
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useQueue';\nexport * from './useSchema';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\nexport * from './useSyncState';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { HaloSpaceMember, type SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpaces } from './useSpaces';\n\nexport const useMembers = (spaceKey: PublicKey | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey ? spaces.find((space) => space.key.equals(spaceKey)) : undefined;\n\n // EMPTY_OBSERVABLE needs to be a stable reference to avoid re-subscribing on every render.\n const members = useMulticastObservable(space?.members ?? MulticastObservable.empty()) ?? [];\n return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useState } from 'react';\n\nimport { type PublicKeyLike } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { useAsyncEffect, useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its key.\n * The space is not guaranteed to be in the ready state.\n * Returns the default space if no key is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceKeyLike the key of the space to look for\n */\nexport const useSpace = (spaceKeyLike?: PublicKeyLike): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n const [ready, setReady] = useState(false);\n\n useAsyncEffect(async () => {\n // Only wait for ready if looking for the default space.\n if (spaceKeyLike) {\n return;\n }\n\n await client.spaces.waitUntilReady();\n setReady(true);\n }, [client, spaceKeyLike]);\n\n if (spaceKeyLike) {\n return spaces.find((space) => space.key.equals(spaceKeyLike) || space.id === spaceKeyLike);\n }\n\n if (ready && client.halo.identity.get()) {\n return client.spaces.default;\n }\n};\n\nexport type UseSpacesParams = {\n /**\n * Return uninitialized spaces as well.\n */\n all?: boolean;\n};\n\n/**\n * Get all Spaces available to current user.\n * Requires a ClientProvider somewhere in the parent tree.\n * By default, only ready spaces are returned.\n * @returns an array of Spaces\n */\nexport const useSpaces = ({ all = false }: UseSpacesParams = {}): Space[] => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n\n // TODO(dmaretskyi): Array reference equality.\n return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport {\n type Echo,\n Filter,\n type Live,\n Query,\n type Queryable,\n type Queue,\n type Space,\n isSpace,\n} from '@dxos/client/echo';\n\nconst EMPTY_ARRAY: never[] = [];\n\nconst noop = () => {};\n\n// TODO(dmaretskyi): Queries are fully serializable, so we can remove `deps` argument.\ninterface UseQueryFn {\n <Q extends Query.Any>(\n spaceOrEcho: Space | Echo | Queue<any> | undefined,\n query: Q,\n deps?: any[],\n ): Live<Query.Type<Q>>[];\n\n <F extends Filter.Any>(\n spaceOrEcho: Space | Echo | Queue<any> | undefined,\n filter: F,\n deps?: any[],\n ): Live<Filter.Type<F>>[];\n}\n\n/**\n * Create subscription.\n */\nexport const useQuery: UseQueryFn = (\n // TODO(burdon): Remove Space and just requre Queryable?\n resource: Space | Queryable | undefined,\n queryOrFilter: Query.Any | Filter.Any,\n deps?: any[],\n): Live<unknown>[] => {\n const query = Filter.is(queryOrFilter) ? Query.select(queryOrFilter) : queryOrFilter;\n\n const { getObjects, subscribe } = useMemo(() => {\n let queryResult = undefined;\n if (resource) {\n queryResult = isSpace(resource) ? resource.db.query(query) : resource.query(query);\n }\n\n let subscribed = false;\n return {\n getObjects: () => (subscribed && queryResult ? queryResult.objects : EMPTY_ARRAY),\n subscribe: (cb: () => void) => {\n subscribed = true;\n const unsubscribe = queryResult?.subscribe(cb) ?? noop;\n return () => {\n unsubscribe?.();\n subscribed = false;\n };\n },\n };\n }, [resource, JSON.stringify(query.ast), ...(deps ?? [])]);\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n // NOTE: This hook will resubscribe whenever the callback passed to the first argument changes; make sure it is stable.\n const objects = useSyncExternalStore<Live<unknown>[] | undefined>(subscribe, getObjects);\n return objects ?? [];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { type Queue } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type Obj, type Relation } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst MIN_POLL_INTERVAL = 1_000;\n\nexport type UseQueueOptions = {\n pollInterval?: number;\n};\n\n/**\n * Polls the given Edge queue.\n */\n// TODO(burdon): Replace polling with socket?\n// TODO(dmaretskyi): Move into client package.\n// TODO(dmaretskyi): Consider passing the space into the hook to support queue DXNs without space id.\n// TODO(ZaymonFC): If queue is unchanged returned object should be refferentially stable on poll.\nexport const useQueue = <T extends Obj.Any | Relation.Any>(\n queueDxn?: DXN,\n options: UseQueueOptions = {},\n): Queue<T> | undefined => {\n const client = useClient();\n const mountedRef = useRef(true);\n\n const queue = useMemo<Queue<T> | undefined>(() => {\n if (!queueDxn) {\n return undefined;\n }\n\n const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError('Invalid queue DXN'));\n return client.spaces.get(spaceId)?.queues.get<T>(queueDxn);\n }, [client, queueDxn?.toString()]);\n\n useEffect(() => {\n void queue?.refresh();\n }, [queue]);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n mountedRef.current = true;\n\n const poll = () => {\n if (!mountedRef.current) {\n return;\n }\n\n void queue?.refresh().finally(() => {\n if (mountedRef.current && options.pollInterval) {\n timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));\n }\n });\n };\n\n if (options.pollInterval) {\n poll();\n }\n\n return () => {\n mountedRef.current = false;\n clearTimeout(timeout);\n };\n }, [queue, options.pollInterval]);\n\n return queue;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { type BaseSchema } from '@dxos/echo/internal';\n\n/**\n * Subscribe to and retrieve schema changes from a space's schema registry.\n */\nexport const useSchema = (\n client: Client,\n space: Space | undefined,\n typename: string | undefined,\n): Schema.Schema.AnyNoContext | undefined => {\n const { subscribe, getSchema } = useMemo(() => {\n if (!typename || !space) {\n return {\n subscribe: () => () => {},\n getSchema: () => undefined,\n };\n }\n\n const staticSchema = client.graph.schemaRegistry.getSchema(typename);\n if (staticSchema) {\n return {\n subscribe: () => () => {},\n getSchema: () => staticSchema,\n };\n }\n\n const query = space.db.schemaRegistry.query({ typename });\n const initialResult: BaseSchema = query.runSync()[0];\n let currentSchema = initialResult;\n\n return {\n subscribe: (onStoreChange: () => void) => {\n const unsubscribe = query.subscribe(() => {\n currentSchema = query.results[0];\n onStoreChange();\n });\n\n return unsubscribe;\n },\n getSchema: () => currentSchema,\n };\n }, [typename, space]);\n\n return useSyncExternalStore(subscribe, getSchema);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\n\nimport { useSpace } from './useSpaces';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceKey);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\nexport const useSpaceInvitation = (spaceKey?: PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceKey);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useRef } from 'react';\n\nimport { type Selection, type SubscriptionHandle, createSubscription } from '@dxos/client/echo';\n\n/**\n * Create reactive selection.\n * Calls the callback when the selection changes and during the first render.\n */\n// TODO(wittjosiah): Is this still needed with signals reactivity? If not, remove or update jsdoc with usage info.\nexport const useSubscription = (cb: () => void, selection: Selection) => {\n // Make sure that the callback is always the one from the latest render.\n // Without this, we would always call the callback from the initial render,\n // which might contain stale data.\n const callbackRef = useRef(cb);\n callbackRef.current = cb;\n\n const subscriptionRef = useRef<SubscriptionHandle>(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 { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\n\nimport { useClient } from '../client';\n\nconst isEdgePeerId = (peerId: string, spaceId: SpaceId) =>\n peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n"],
5
+ "mappings": ";;;;;;;;AAIA,cAAc;;;ACAd,SAASA,2BAA2B;AAEpC,SAASC,uBAAyC;AAClD,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,gBAAgB;AAGzB,SAAqBC,kBAAkB;AACvC,SAASC,gBAAgBC,8BAA8B;AAYhD,IAAMC,WAAW,CAACC,iBAAAA;AACvB,QAAMC,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAO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yncEffect", "useMulticastObservable", "useSpace", "spaceKeyLike", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useAsyncEffect", "waitUntilReady", "find", "space", "key", "equals", "id", "halo", "identity", "get", "default", "useSpaces", "all", "filter", "state", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "key", "equals", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "useSyncExternalStore", "Filter", "Query", "isSpace", "EMPTY_ARRAY", "noop", "useQuery", "resource", "queryOrFilter", "deps", "query", "Filter", "is", "Query", "select", "getObjects", "subscribe", "useMemo", "queryResult", "undefined", "isSpace", "db", "subscribed", "objects", "cb", "unsubscribe", "JSON", "stringify", "ast", "useSyncExternalStore", "useEffect", "useMemo", "useRef", "raise", "MIN_POLL_INTERVAL", "useQueue", "queueDxn", "options", "client", "useClient", "mountedRef", "useRef", "queue", "useMemo", "undefined", "spaceId", "asQueueDXN", "raise", "TypeError", "spaces", "get", "queues", "toString", "useEffect", "refresh", "timeout", "current", "poll", "finally", "pollInterval", "setTimeout", "Math", "max", "clearTimeout", "useMemo", "useSyncExternalStore", "useSchema", "client", "space", "typename", "subscribe", "getSchema", "useMemo", "undefined", "staticSchema", "graph", "schemaRegistry", "query", "db", "initialResult", "runSync", "currentSchema", "onStoreChange", "unsubscribe", "results", "useSyncExternalStore", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceKey", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "useRef", "current", "subscriptionRef", "useEffect", "createSubscription", "unsubscribe", "update", "useEffect", "useState", "Context", "EdgeService", "isEdgePeerId", "peerId", "spaceId", "startsWith", "EdgeService", "AUTOMERGE_REPLICATOR", "useSyncState", "client", "useClient", "spaceState", "setSpaceState", "useState", "useEffect", "ctx", "Context", "createSubscriptions", "spaces", "space", "id", "onDispose", "db", "subscribeToSyncState", "peers", "syncState", "find", "state", "get", "subscribe", "dispose", "useSpaceSyncState"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useInvitationStatus
3
- } from "../chunk-BXOLJYAY.mjs";
3
+ } from "../chunk-LO3TU5CK.mjs";
4
4
  import {
5
5
  useClient
6
6
  } from "../chunk-TA2HGRAF.mjs";
@@ -5,7 +5,7 @@ import {
5
5
  InvitationEncoder,
6
6
  InvitationsProxy,
7
7
  useInvitationStatus
8
- } from "../chunk-BXOLJYAY.mjs";
8
+ } from "../chunk-LO3TU5CK.mjs";
9
9
  export {
10
10
  AuthenticatingInvitationObservable,
11
11
  CancellableInvitationObservable,
@@ -1 +1 @@
1
- {"inputs":{"src/client/AgentHostingProvider.tsx":{"bytes":7107,"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":3825,"imports":[],"format":"esm"},"src/client/context.ts":{"bytes":1279,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/ClientProvider.tsx":{"bytes":18266,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","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":1643,"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":1969,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/useConfig.ts":{"bytes":1748,"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":2332,"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":1464,"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":1150,"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":1400,"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":2795,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/devtools/index.ts":{"bytes":680,"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":5996,"imports":[{"path":"react","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":3144,"imports":[{"path":"@dxos/async","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/echo/useQuery.ts":{"bytes":5589,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useQueue.ts":{"bytes":6369,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useSchema.ts":{"bytes":4839,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/useInvitationStatus.ts":{"bytes":20410,"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":1286,"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":3240,"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/useSubscription.ts":{"bytes":3515,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useSyncState.ts":{"bytes":7689,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/index.ts":{"bytes":1254,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"src/echo/useQuery.ts","kind":"import-statement","original":"./useQuery"},{"path":"src/echo/useQueue.ts","kind":"import-statement","original":"./useQueue"},{"path":"src/echo/useSchema.ts","kind":"import-statement","original":"./useSchema"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"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":1705,"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":1344,"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":1292,"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":2724,"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":1575,"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":4978,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/halo/index.ts":{"bytes":1446,"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":760,"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":1504,"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":588,"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":1701,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/testing/ClientRepeater.tsx":{"bytes":10980,"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/echo-signals/react","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":21374,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-error-boundary","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":"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":793,"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":478,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2291},"dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.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":677}},"bytes":1126},"dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21259},"dist/lib/browser/echo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BXOLJYAY.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TA2HGRAF.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/async","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/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/client/echo","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/async","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/protocols","kind":"import-statement","external":true}],"exports":["useMembers","useQuery","useQueue","useSchema","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaceSyncState","useSpaces","useSubscription","useSyncState"],"entryPoint":"src/echo/index.ts","inputs":{"src/echo/index.ts":{"bytesInOutput":35},"src/echo/useMembers.ts":{"bytesInOutput":545},"src/echo/useSpaces.ts":{"bytesInOutput":932},"src/echo/useQuery.ts":{"bytesInOutput":1012},"src/echo/useQueue.ts":{"bytesInOutput":1176},"src/echo/useSchema.ts":{"bytesInOutput":1057},"src/echo/useSpaceInvitations.ts":{"bytesInOutput":677},"src/echo/useSubscription.ts":{"bytesInOutput":532},"src/echo/useSyncState.ts":{"bytesInOutput":1820}},"bytes":8400},"dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7031},"dist/lib/browser/halo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BXOLJYAY.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TA2HGRAF.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":1275}},"bytes":3179},"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":344},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","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}},"bytes":610},"dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BXOLJYAY.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"src/invitations/index.ts","inputs":{},"bytes":388},"dist/lib/browser/chunk-BXOLJYAY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11015},"dist/lib/browser/chunk-BXOLJYAY.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":4665}},"bytes":5178},"dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":935},"dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.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":393},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18176},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.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/echo-signals/react","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":"react-error-boundary","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}],"exports":["ClientRepeater","ClientStory","useClientProvider","useMultiClient","withClientProvider","withMultiClientProvider"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":38},"src/testing/context.tsx":{"bytesInOutput":257},"src/testing/ClientRepeater.tsx":{"bytesInOutput":1994},"src/testing/withClientProvider.tsx":{"bytesInOutput":5430}},"bytes":8071},"dist/lib/browser/chunk-TA2HGRAF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19448},"dist/lib/browser/chunk-TA2HGRAF.mjs":{"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":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","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":"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},{"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","useShell","useShellDisplay","useStatus"],"inputs":{"src/client/AgentHostingProvider.tsx":{"bytesInOutput":1864},"src/client/index.ts":{"bytesInOutput":0},"src/client/ClientProvider.tsx":{"bytesInOutput":4119},"src/banner.ts":{"bytesInOutput":817},"src/client/context.ts":{"bytesInOutput":82},"src/client/useClient.ts":{"bytesInOutput":211},"src/client/useClientStatus.ts":{"bytesInOutput":398},"src/client/useConfig.ts":{"bytesInOutput":245},"src/client/useShell.ts":{"bytesInOutput":377},"src/client/useStatus.ts":{"bytesInOutput":238}},"bytes":8939},"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":7107,"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":3825,"imports":[],"format":"esm"},"src/client/context.ts":{"bytes":1279,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/ClientProvider.tsx":{"bytes":18266,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","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":1643,"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":1969,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/useConfig.ts":{"bytes":1748,"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":2332,"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":1464,"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":1150,"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":1400,"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":2795,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/devtools/index.ts":{"bytes":680,"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":5996,"imports":[{"path":"react","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":3144,"imports":[{"path":"@dxos/async","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/echo/useQuery.ts":{"bytes":5880,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useQueue.ts":{"bytes":6369,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useSchema.ts":{"bytes":4851,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/useInvitationStatus.ts":{"bytes":20448,"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":1286,"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":3240,"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/useSubscription.ts":{"bytes":3535,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useSyncState.ts":{"bytes":7689,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/index.ts":{"bytes":1254,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"src/echo/useQuery.ts","kind":"import-statement","original":"./useQuery"},{"path":"src/echo/useQueue.ts","kind":"import-statement","original":"./useQueue"},{"path":"src/echo/useSchema.ts","kind":"import-statement","original":"./useSchema"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"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":1705,"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":1344,"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":1292,"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":2724,"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":1575,"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":4978,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/halo/index.ts":{"bytes":1446,"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":760,"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":1504,"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":588,"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":1701,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/testing/ClientRepeater.tsx":{"bytes":10974,"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/echo-signals/react","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":21894,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-error-boundary","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":"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":793,"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":478,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2291},"dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.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":677}},"bytes":1126},"dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21429},"dist/lib/browser/echo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TA2HGRAF.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/async","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/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/client/echo","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/async","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/protocols","kind":"import-statement","external":true}],"exports":["useMembers","useQuery","useQueue","useSchema","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaceSyncState","useSpaces","useSubscription","useSyncState"],"entryPoint":"src/echo/index.ts","inputs":{"src/echo/index.ts":{"bytesInOutput":35},"src/echo/useMembers.ts":{"bytesInOutput":545},"src/echo/useSpaces.ts":{"bytesInOutput":932},"src/echo/useQuery.ts":{"bytesInOutput":1015},"src/echo/useQueue.ts":{"bytesInOutput":1176},"src/echo/useSchema.ts":{"bytesInOutput":1057},"src/echo/useSpaceInvitations.ts":{"bytesInOutput":677},"src/echo/useSubscription.ts":{"bytesInOutput":536},"src/echo/useSyncState.ts":{"bytesInOutput":1820}},"bytes":8407},"dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7031},"dist/lib/browser/halo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TA2HGRAF.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":1275}},"bytes":3179},"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":344},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","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}},"bytes":610},"dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"src/invitations/index.ts","inputs":{},"bytes":388},"dist/lib/browser/chunk-LO3TU5CK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11043},"dist/lib/browser/chunk-LO3TU5CK.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":4667}},"bytes":5180},"dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":935},"dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.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":393},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18437},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TA2HGRAF.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/echo-signals/react","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":"react-error-boundary","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}],"exports":["ClientRepeater","ClientStory","useClientProvider","useMultiClient","withClientProvider","withMultiClientProvider"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":38},"src/testing/context.tsx":{"bytesInOutput":257},"src/testing/ClientRepeater.tsx":{"bytesInOutput":1992},"src/testing/withClientProvider.tsx":{"bytesInOutput":5561}},"bytes":8200},"dist/lib/browser/chunk-TA2HGRAF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19448},"dist/lib/browser/chunk-TA2HGRAF.mjs":{"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":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","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":"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},{"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","useShell","useShellDisplay","useStatus"],"inputs":{"src/client/AgentHostingProvider.tsx":{"bytesInOutput":1864},"src/client/index.ts":{"bytesInOutput":0},"src/client/ClientProvider.tsx":{"bytesInOutput":4119},"src/banner.ts":{"bytesInOutput":817},"src/client/context.ts":{"bytesInOutput":82},"src/client/useClient.ts":{"bytesInOutput":211},"src/client/useClientStatus.ts":{"bytesInOutput":398},"src/client/useConfig.ts":{"bytesInOutput":245},"src/client/useShell.ts":{"bytesInOutput":377},"src/client/useStatus.ts":{"bytesInOutput":238}},"bytes":8939},"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}}}
@@ -21,7 +21,7 @@ import { registerSignalsRuntime } from "@dxos/echo-signals/react";
21
21
  import { faker } from "@dxos/random";
22
22
  import { useAsyncEffect } from "@dxos/react-hooks";
23
23
  var ClientRepeater = (props) => {
24
- const { component: Component, controls: Controls, count = 1, types, createIdentity, createSpace, onSpaceCreated } = props;
24
+ const { component: Component, controls: Controls, count = 1, types, createIdentity, createSpace, onCreateSpace } = props;
25
25
  useEffect(() => {
26
26
  registerSignalsRuntime();
27
27
  }, []);
@@ -45,7 +45,7 @@ var ClientRepeater = (props) => {
45
45
  name: faker.commerce.productName()
46
46
  });
47
47
  setSpaceKey(space.key);
48
- await onSpaceCreated?.({
48
+ await onCreateSpace?.({
49
49
  client,
50
50
  space
51
51
  }, {});
@@ -79,14 +79,16 @@ import { Trigger } from "@dxos/async";
79
79
  import { TestBuilder as TestBuilder2, performInvitation as performInvitation2 } from "@dxos/client/testing";
80
80
  import { log } from "@dxos/log";
81
81
  var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/testing/withClientProvider.tsx";
82
- var initializeClient = async (client, { createIdentity, createSpace, onSpaceCreated, onIdentityCreated, onInitialized }, context) => {
82
+ var initializeClient = async (client, { createIdentity, createSpace, onCreateIdentity, onCreateSpace, onInitialized }, context) => {
83
83
  await onInitialized?.(client);
84
84
  if (createIdentity || createSpace) {
85
85
  if (!client.halo.identity.get()) {
86
86
  await client.halo.createIdentity();
87
- await onIdentityCreated?.({
87
+ await client.spaces.waitUntilReady();
88
+ await client.spaces.default.waitUntilReady();
89
+ await onCreateIdentity?.({
88
90
  client
89
- });
91
+ }, context);
90
92
  }
91
93
  }
92
94
  let space;
@@ -94,7 +96,8 @@ var initializeClient = async (client, { createIdentity, createSpace, onSpaceCrea
94
96
  space = await client.spaces.create({
95
97
  name: "Test Space"
96
98
  });
97
- await onSpaceCreated?.({
99
+ await space.waitUntilReady();
100
+ await onCreateSpace?.({
98
101
  client,
99
102
  space
100
103
  }, context);
@@ -103,15 +106,15 @@ var initializeClient = async (client, { createIdentity, createSpace, onSpaceCrea
103
106
  space
104
107
  };
105
108
  };
106
- var withClientProvider = ({ createIdentity, createSpace, onSpaceCreated, onIdentityCreated, onInitialized, ...props } = {}) => {
109
+ var withClientProvider = ({ createIdentity, createSpace, onCreateSpace, onCreateIdentity, onInitialized, ...props } = {}) => {
107
110
  return (Story, context) => {
108
111
  const [data, setData] = useState2({});
109
112
  const handleInitialized = async (client) => {
110
113
  const data2 = await initializeClient(client, {
111
114
  createIdentity,
112
115
  createSpace,
113
- onSpaceCreated,
114
- onIdentityCreated,
116
+ onCreateSpace,
117
+ onCreateIdentity,
115
118
  onInitialized
116
119
  }, context);
117
120
  setData(data2);
@@ -128,17 +131,17 @@ var MultiClientContext = /* @__PURE__ */ createContext2({
128
131
  id: 0
129
132
  });
130
133
  var useMultiClient = () => useContext2(MultiClientContext);
131
- var withMultiClientProvider = ({ numClients = 2, createIdentity, createSpace, onSpaceCreated, onIdentityCreated, onInitialized, ...props }) => {
134
+ var withMultiClientProvider = ({ numClients = 2, createIdentity, createSpace, onCreateSpace, onCreateIdentity, onInitialized, ...props }) => {
132
135
  return (Story, context) => {
133
136
  const builder = useRef2(new TestBuilder2());
134
- const hostRef = useRef2();
137
+ const hostRef = useRef2(null);
135
138
  const spaceReady = useRef2(new Trigger());
136
139
  const handleInitialized = async (client, index) => {
137
140
  log.info("initialized", {
138
141
  index
139
142
  }, {
140
143
  F: __dxlog_file,
141
- L: 130,
144
+ L: 132,
142
145
  S: void 0,
143
146
  C: (f, a) => f(...a)
144
147
  });
@@ -148,8 +151,8 @@ var withMultiClientProvider = ({ numClients = 2, createIdentity, createSpace, on
148
151
  const { space } = await initializeClient(client, {
149
152
  createIdentity,
150
153
  createSpace,
151
- onSpaceCreated,
152
- onIdentityCreated,
154
+ onCreateSpace,
155
+ onCreateIdentity,
153
156
  onInitialized
154
157
  }, context);
155
158
  spaceReady.current.wake(space);
@@ -157,7 +160,7 @@ var withMultiClientProvider = ({ numClients = 2, createIdentity, createSpace, on
157
160
  index
158
161
  }, {
159
162
  F: __dxlog_file,
160
- L: 147,
163
+ L: 149,
161
164
  S: void 0,
162
165
  C: (f, a) => f(...a)
163
166
  });
@@ -172,7 +175,7 @@ var withMultiClientProvider = ({ numClients = 2, createIdentity, createSpace, on
172
175
  index
173
176
  }, {
174
177
  F: __dxlog_file,
175
- L: 152,
178
+ L: 154,
176
179
  S: void 0,
177
180
  C: (f, a) => f(...a)
178
181
  });