@dxos/plugin-client 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/DevicesContainer-3N7ANEJ7.mjs +268 -0
- package/dist/lib/browser/DevicesContainer-3N7ANEJ7.mjs.map +7 -0
- package/dist/lib/browser/JoinDialog-VTTK7NHO.mjs +59 -0
- package/dist/lib/browser/JoinDialog-VTTK7NHO.mjs.map +7 -0
- package/dist/lib/browser/ProfileContainer-XV7OXJC2.mjs +171 -0
- package/dist/lib/browser/ProfileContainer-XV7OXJC2.mjs.map +7 -0
- package/dist/lib/browser/RecoveryCodeDialog-WO34OZEJ.mjs +60 -0
- package/dist/lib/browser/RecoveryCodeDialog-WO34OZEJ.mjs.map +7 -0
- package/dist/lib/browser/RecoveryCredentialsContainer-G22FSTIX.mjs +57 -0
- package/dist/lib/browser/RecoveryCredentialsContainer-G22FSTIX.mjs.map +7 -0
- package/dist/lib/browser/ResetDialog-W24FOWBQ.mjs +52 -0
- package/dist/lib/browser/ResetDialog-W24FOWBQ.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-3FGBMLTF.mjs → app-graph-builder-GGJKFY3X.mjs} +9 -6
- package/dist/lib/browser/app-graph-builder-GGJKFY3X.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4BZGRIFS.mjs → chunk-FVEKZBM7.mjs} +34 -44
- package/dist/lib/browser/chunk-FVEKZBM7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F7H2Y3Z2.mjs → chunk-GSVYEYVS.mjs} +4 -4
- package/dist/lib/browser/chunk-HSFDKP5D.mjs +15 -0
- package/dist/lib/browser/{chunk-G7C3S2BE.mjs.map → chunk-HSFDKP5D.mjs.map} +1 -1
- package/dist/lib/browser/chunk-JHSBBOCI.mjs +15 -0
- package/dist/lib/browser/chunk-JHSBBOCI.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +60 -49
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{client-IX5LMWV4.mjs → client-BXCP3EUE.mjs} +11 -11
- package/dist/lib/browser/client-BXCP3EUE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +26 -23
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-3EBTAW3N.mjs → migrations-GKUA2ARL.mjs} +6 -5
- package/dist/lib/browser/migrations-GKUA2ARL.mjs.map +7 -0
- package/dist/lib/browser/{operation-resolver-2NT3ISVP.mjs → operation-resolver-VSWA74RS.mjs} +24 -23
- package/dist/lib/browser/operation-resolver-VSWA74RS.mjs.map +7 -0
- package/dist/lib/browser/{react-context-4UABG3GP.mjs → react-context-GZ3T5UON.mjs} +8 -6
- package/dist/lib/browser/react-context-GZ3T5UON.mjs.map +7 -0
- package/dist/lib/browser/react-surface-5VZP34X3.mjs +77 -0
- package/dist/lib/browser/react-surface-5VZP34X3.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-O7VLP745.mjs → schema-defs-KAG6HQMI.mjs} +8 -6
- package/dist/lib/browser/schema-defs-KAG6HQMI.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -1
- package/dist/lib/node-esm/DevicesContainer-V7HEUPO7.mjs +269 -0
- package/dist/lib/node-esm/DevicesContainer-V7HEUPO7.mjs.map +7 -0
- package/dist/lib/node-esm/JoinDialog-XVKW4SLT.mjs +60 -0
- package/dist/lib/node-esm/JoinDialog-XVKW4SLT.mjs.map +7 -0
- package/dist/lib/node-esm/ProfileContainer-B5LJ6TMU.mjs +172 -0
- package/dist/lib/node-esm/ProfileContainer-B5LJ6TMU.mjs.map +7 -0
- package/dist/lib/node-esm/RecoveryCodeDialog-YIRGXM7N.mjs +61 -0
- package/dist/lib/node-esm/RecoveryCodeDialog-YIRGXM7N.mjs.map +7 -0
- package/dist/lib/node-esm/RecoveryCredentialsContainer-MVJEFNXX.mjs +58 -0
- package/dist/lib/node-esm/RecoveryCredentialsContainer-MVJEFNXX.mjs.map +7 -0
- package/dist/lib/node-esm/ResetDialog-GGBWSQZO.mjs +54 -0
- package/dist/lib/node-esm/ResetDialog-GGBWSQZO.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-2PIYVUNC.mjs → app-graph-builder-PTNZ46NN.mjs} +9 -6
- package/dist/lib/node-esm/app-graph-builder-PTNZ46NN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BOTJSPCT.mjs +17 -0
- package/dist/lib/node-esm/chunk-BOTJSPCT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JAF64TFQ.mjs → chunk-DT2ZNOGU.mjs} +33 -44
- package/dist/lib/node-esm/chunk-DT2ZNOGU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BCELGXRI.mjs → chunk-OFJUOKY7.mjs} +4 -4
- package/dist/lib/node-esm/chunk-VLNCZYIC.mjs +16 -0
- package/dist/lib/node-esm/{chunk-PRAFFO54.mjs.map → chunk-VLNCZYIC.mjs.map} +1 -1
- package/dist/lib/node-esm/cli/index.mjs +60 -49
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{client-FFPK5UFP.mjs → client-EGZHGRRC.mjs} +11 -11
- package/dist/lib/node-esm/client-EGZHGRRC.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +26 -23
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-WSZSFGDK.mjs → migrations-4NEKCBGU.mjs} +6 -5
- package/dist/lib/node-esm/migrations-4NEKCBGU.mjs.map +7 -0
- package/dist/lib/node-esm/{operation-resolver-VW5R2BE4.mjs → operation-resolver-4GWB3YZG.mjs} +24 -23
- package/dist/lib/node-esm/operation-resolver-4GWB3YZG.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-UVXMGPW4.mjs → react-context-T2ORT5CC.mjs} +8 -6
- package/dist/lib/node-esm/react-context-T2ORT5CC.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-B65OUZYI.mjs +78 -0
- package/dist/lib/node-esm/react-surface-B65OUZYI.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-QLRGBIKY.mjs → schema-defs-GXQ47JZN.mjs} +8 -6
- package/dist/lib/node-esm/schema-defs-GXQ47JZN.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client/client.d.ts +2 -2
- package/dist/types/src/capabilities/client/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/client/index.d.ts +2 -1
- package/dist/types/src/capabilities/client/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations/migrations.d.ts +1 -1
- package/dist/types/src/capabilities/migrations/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts +1 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -1
- package/dist/types/src/cli/commands/profile/create.d.ts +2 -1
- package/dist/types/src/cli/commands/profile/create.d.ts.map +1 -1
- package/dist/types/src/cli/commands/profile/delete.d.ts +1 -1
- package/dist/types/src/cli/commands/profile/delete.d.ts.map +1 -1
- package/dist/types/src/cli/commands/profile/list.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DevicesContainer}/DevicesContainer.stories.d.ts +9 -7
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/index.d.ts +3 -0
- package/dist/types/src/containers/DevicesContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts +3 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ProfileContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts +4 -0
- package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts +3 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ResetDialog}/ResetDialog.d.ts +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ResetDialog}/ResetDialog.stories.d.ts +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ResetDialog/index.d.ts +4 -0
- package/dist/types/src/containers/ResetDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +1 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +36 -32
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -35
- package/src/ClientPlugin.ts +27 -19
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +4 -3
- package/src/capabilities/client/client.ts +7 -5
- package/src/capabilities/migrations/migrations.ts +3 -3
- package/src/capabilities/operation-resolver/operation-resolver.ts +13 -12
- package/src/capabilities/react-context/react-context.tsx +3 -3
- package/src/capabilities/react-surface/react-surface.tsx +12 -12
- package/src/capabilities/schema-defs/schema-defs.ts +7 -6
- package/src/cli/commands/edge/status.ts +2 -2
- package/src/cli/commands/halo/create/create.ts +2 -2
- package/src/cli/commands/profile/create.ts +9 -6
- package/src/cli/commands/profile/delete.ts +5 -2
- package/src/cli/commands/profile/list.ts +13 -11
- package/src/cli/plugin.ts +7 -6
- package/src/components/index.ts +0 -7
- package/src/constants.ts +3 -3
- package/src/{components → containers/DevicesContainer}/DevicesContainer.stories.tsx +8 -6
- package/src/{components → containers/DevicesContainer}/DevicesContainer.tsx +49 -57
- package/src/containers/DevicesContainer/index.ts +7 -0
- package/src/{components → containers/JoinDialog}/JoinDialog.tsx +8 -6
- package/src/containers/JoinDialog/index.ts +7 -0
- package/src/{components → containers/ProfileContainer}/ProfileContainer.stories.tsx +4 -4
- package/src/{components → containers/ProfileContainer}/ProfileContainer.tsx +20 -28
- package/src/containers/ProfileContainer/index.ts +7 -0
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.stories.tsx +4 -4
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.tsx +28 -25
- package/src/containers/RecoveryCodeDialog/index.ts +8 -0
- package/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.stories.tsx +8 -6
- package/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.tsx +19 -19
- package/src/containers/RecoveryCredentialsContainer/index.ts +7 -0
- package/src/{components → containers/ResetDialog}/ResetDialog.stories.tsx +27 -14
- package/src/{components → containers/ResetDialog}/ResetDialog.tsx +10 -10
- package/src/containers/ResetDialog/index.ts +8 -0
- package/src/containers/index.ts +15 -0
- package/src/meta.ts +1 -1
- package/src/translations.ts +1 -1
- package/src/types/capabilities.ts +3 -3
- package/src/types/events.ts +5 -5
- package/src/types/schema.ts +28 -23
- package/dist/lib/browser/app-graph-builder-3FGBMLTF.mjs.map +0 -7
- package/dist/lib/browser/chunk-4BZGRIFS.mjs.map +0 -7
- package/dist/lib/browser/chunk-G7C3S2BE.mjs +0 -15
- package/dist/lib/browser/client-IX5LMWV4.mjs.map +0 -7
- package/dist/lib/browser/migrations-3EBTAW3N.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-2NT3ISVP.mjs.map +0 -7
- package/dist/lib/browser/react-context-4UABG3GP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-RSQ74XCT.mjs +0 -675
- package/dist/lib/browser/react-surface-RSQ74XCT.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-O7VLP745.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-2PIYVUNC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JAF64TFQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PRAFFO54.mjs +0 -16
- package/dist/lib/node-esm/client-FFPK5UFP.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-WSZSFGDK.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-VW5R2BE4.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-UVXMGPW4.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-KBHANGGC.mjs +0 -676
- package/dist/lib/node-esm/react-surface-KBHANGGC.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-QLRGBIKY.mjs.map +0 -7
- package/dist/types/src/components/DevicesContainer.d.ts.map +0 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
- package/dist/types/src/components/ProfileContainer.d.ts.map +0 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResetDialog.d.ts.map +0 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +0 -1
- /package/dist/lib/browser/{chunk-F7H2Y3Z2.mjs.map → chunk-GSVYEYVS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-BCELGXRI.mjs.map → chunk-OFJUOKY7.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/DevicesContainer}/DevicesContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/JoinDialog}/JoinDialog.d.ts +0 -0
- /package/dist/types/src/{components → containers/ProfileContainer}/ProfileContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/ProfileContainer}/ProfileContainer.stories.d.ts +0 -0
- /package/dist/types/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.d.ts +0 -0
- /package/dist/types/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.stories.d.ts +0 -0
- /package/dist/types/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.stories.d.ts +0 -0
package/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.tsx
RENAMED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { useOperationInvoker } from '@dxos/app-framework/
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
8
|
import { useCredentials } from '@dxos/react-client/halo';
|
|
9
9
|
import { Icon, IconButton, List, ListItem, Message, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
11
11
|
|
|
12
|
-
import { meta } from '
|
|
13
|
-
import { ClientOperation } from '
|
|
12
|
+
import { meta } from '../../meta';
|
|
13
|
+
import { ClientOperation } from '../../types';
|
|
14
14
|
|
|
15
|
-
export const MANAGE_CREDENTIALS_DIALOG = `${meta.id}
|
|
15
|
+
export const MANAGE_CREDENTIALS_DIALOG = `${meta.id}.ManageCredentialsDialog`;
|
|
16
16
|
|
|
17
17
|
export const RecoveryCredentialsContainer = () => {
|
|
18
18
|
const { t } = useTranslation(meta.id);
|
|
@@ -23,35 +23,35 @@ export const RecoveryCredentialsContainer = () => {
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
<
|
|
26
|
+
<Settings.Root>
|
|
27
|
+
<Settings.Section title={t('recovery setup dialog title')} description={t('recovery setup dialog description')}>
|
|
28
|
+
<Settings.Group>
|
|
29
|
+
<Settings.Item title={t('create passkey label')} description={t('create passkey description')}>
|
|
30
30
|
<IconButton
|
|
31
31
|
label={t('create passkey label')}
|
|
32
32
|
icon='ph--key--duotone'
|
|
33
33
|
variant='primary'
|
|
34
34
|
onClick={() => invokePromise(ClientOperation.CreatePasskey)}
|
|
35
35
|
/>
|
|
36
|
-
</
|
|
37
|
-
<
|
|
36
|
+
</Settings.Item>
|
|
37
|
+
<Settings.Item title={t('create recovery code label')} description={t('create recovery code description')}>
|
|
38
38
|
<IconButton
|
|
39
39
|
label={t('create recovery code label')}
|
|
40
40
|
icon='ph--receipt--duotone'
|
|
41
41
|
variant='default'
|
|
42
42
|
onClick={() => invokePromise(ClientOperation.CreateRecoveryCode)}
|
|
43
43
|
/>
|
|
44
|
-
</
|
|
45
|
-
</
|
|
46
|
-
</
|
|
47
|
-
<
|
|
44
|
+
</Settings.Item>
|
|
45
|
+
</Settings.Group>
|
|
46
|
+
</Settings.Section>
|
|
47
|
+
<Settings.Section title={t('credentials list label')}>
|
|
48
48
|
{recoveryCredentials.length < 1 ? (
|
|
49
|
-
<Message.Root valence='error'
|
|
49
|
+
<Message.Root valence='error'>
|
|
50
50
|
<Message.Title icon='ph--shield-warning--duotone'>{t('no credentials title')}</Message.Title>
|
|
51
51
|
<Message.Content>{t('no credentials message')}</Message.Content>
|
|
52
52
|
</Message.Root>
|
|
53
53
|
) : (
|
|
54
|
-
<List
|
|
54
|
+
<List>
|
|
55
55
|
{recoveryCredentials.map((credential) => (
|
|
56
56
|
<ListItem.Root key={credential.id?.toHex()}>
|
|
57
57
|
<ListItem.Endcap>
|
|
@@ -62,7 +62,7 @@ export const RecoveryCredentialsContainer = () => {
|
|
|
62
62
|
))}
|
|
63
63
|
</List>
|
|
64
64
|
)}
|
|
65
|
-
</
|
|
66
|
-
</
|
|
65
|
+
</Settings.Section>
|
|
66
|
+
</Settings.Root>
|
|
67
67
|
);
|
|
68
68
|
};
|
|
@@ -6,26 +6,26 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { OperationPlugin } from '@dxos/app-framework';
|
|
10
|
-
import { usePluginManager } from '@dxos/app-framework/react';
|
|
9
|
+
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
11
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { usePluginManager } from '@dxos/app-framework/ui';
|
|
12
12
|
import { Dialog } from '@dxos/react-ui';
|
|
13
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
14
|
|
|
15
|
-
import { ClientPlugin } from '
|
|
16
|
-
import { translations } from '
|
|
15
|
+
import { ClientPlugin } from '../../ClientPlugin';
|
|
16
|
+
import { translations } from '../../translations';
|
|
17
17
|
|
|
18
18
|
import { ResetDialog, type ResetDialogProps } from './ResetDialog';
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const DefaultStory = (props: Omit<ResetDialogProps, 'capabilityManager'>) => {
|
|
21
21
|
const manager = usePluginManager();
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<Dialog.Root open>
|
|
25
25
|
<Dialog.Overlay>
|
|
26
26
|
<ResetDialog
|
|
27
|
-
onReset={() => Effect.sync(() => console.log('reset'))}
|
|
28
27
|
capabilityManager={manager.capabilities}
|
|
28
|
+
onReset={() => Effect.sync(() => console.log('reset'))}
|
|
29
29
|
{...props}
|
|
30
30
|
/>
|
|
31
31
|
</Dialog.Overlay>
|
|
@@ -34,13 +34,14 @@ const Render = (props: Omit<ResetDialogProps, 'capabilityManager'>) => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const meta = {
|
|
37
|
-
title: 'plugins/plugin-client/ResetDialog',
|
|
37
|
+
title: 'plugins/plugin-client/containers/ResetDialog',
|
|
38
38
|
component: ResetDialog,
|
|
39
|
-
render:
|
|
39
|
+
render: DefaultStory,
|
|
40
40
|
decorators: [
|
|
41
|
-
withTheme,
|
|
41
|
+
withTheme(),
|
|
42
|
+
withLayout({ layout: 'fullscreen' }),
|
|
42
43
|
withPluginManager({
|
|
43
|
-
plugins: [OperationPlugin(), ClientPlugin({})],
|
|
44
|
+
plugins: [RuntimePlugin(), OperationPlugin(), ClientPlugin({})],
|
|
44
45
|
}),
|
|
45
46
|
],
|
|
46
47
|
parameters: {
|
|
@@ -53,8 +54,20 @@ export default meta;
|
|
|
53
54
|
|
|
54
55
|
type Story = StoryObj<typeof meta>;
|
|
55
56
|
|
|
56
|
-
export const Default: Story = {
|
|
57
|
+
export const Default: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
mode: 'reset storage' as const,
|
|
60
|
+
} as any,
|
|
61
|
+
};
|
|
57
62
|
|
|
58
|
-
export const JoinNewIdentity: Story = {
|
|
63
|
+
export const JoinNewIdentity: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
mode: 'join new identity' as const,
|
|
66
|
+
} as any,
|
|
67
|
+
};
|
|
59
68
|
|
|
60
|
-
export const Recover: Story = {
|
|
69
|
+
export const Recover: Story = {
|
|
70
|
+
args: {
|
|
71
|
+
mode: 'recover' as const,
|
|
72
|
+
} as any,
|
|
73
|
+
};
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Capability, type CapabilityManager
|
|
9
|
-
import { useOperationInvoker } from '@dxos/app-framework/
|
|
8
|
+
import { Capability, type CapabilityManager } from '@dxos/app-framework';
|
|
9
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
10
11
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
12
|
import { useClient } from '@dxos/react-client';
|
|
12
13
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
13
|
-
import { ConfirmReset, type ConfirmResetProps } from '@dxos/shell/react';
|
|
14
|
+
import { ConfirmReset, type ConfirmResetProps, translationKey } from '@dxos/shell/react';
|
|
14
15
|
|
|
15
|
-
import {
|
|
16
|
-
import { type ClientPluginOptions } from '../types';
|
|
16
|
+
import { type ClientPluginOptions } from '../../types';
|
|
17
17
|
|
|
18
18
|
export type ResetDialogProps = Pick<ConfirmResetProps, 'mode'> &
|
|
19
19
|
Pick<ClientPluginOptions, 'onReset'> & {
|
|
@@ -21,7 +21,7 @@ export type ResetDialogProps = Pick<ConfirmResetProps, 'mode'> &
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export const ResetDialog = ({ mode, onReset, capabilityManager }: ResetDialogProps) => {
|
|
24
|
-
const { t } = useTranslation(
|
|
24
|
+
const { t } = useTranslation(translationKey);
|
|
25
25
|
const { invokePromise } = useOperationInvoker();
|
|
26
26
|
const client = useClient();
|
|
27
27
|
|
|
@@ -35,14 +35,14 @@ export const ResetDialog = ({ mode, onReset, capabilityManager }: ResetDialogPro
|
|
|
35
35
|
}, [client, mode, onReset, capabilityManager]);
|
|
36
36
|
|
|
37
37
|
const handleCancel = useCallback(() => {
|
|
38
|
-
void invokePromise(
|
|
38
|
+
void invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
39
39
|
}, [invokePromise]);
|
|
40
40
|
|
|
41
|
-
// TODO(wittjosiah): Add the sr-only translations.
|
|
42
|
-
// TODO(wittjosiah): Add missing descriptions to other dialogs.
|
|
43
41
|
return (
|
|
44
42
|
<Dialog.Content>
|
|
45
|
-
<Dialog.
|
|
43
|
+
<Dialog.Header>
|
|
44
|
+
<Dialog.Title>{t('reset dialog title')}</Dialog.Title>
|
|
45
|
+
</Dialog.Header>
|
|
46
46
|
<Dialog.Description classNames='sr-only'>{t('reset dialog description')}</Dialog.Description>
|
|
47
47
|
<ConfirmReset active mode={mode} onConfirm={handleReset} onCancel={handleCancel} />
|
|
48
48
|
</Dialog.Content>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export { type RecoveryCodeDialogProps } from './RecoveryCodeDialog';
|
|
8
|
+
export { type ResetDialogProps } from './ResetDialog';
|
|
9
|
+
|
|
10
|
+
export const DevicesContainer: ComponentType<any> = lazy(() => import('./DevicesContainer'));
|
|
11
|
+
export const JoinDialog: ComponentType<any> = lazy(() => import('./JoinDialog'));
|
|
12
|
+
export const ProfileContainer: ComponentType<any> = lazy(() => import('./ProfileContainer'));
|
|
13
|
+
export const RecoveryCodeDialog: ComponentType<any> = lazy(() => import('./RecoveryCodeDialog'));
|
|
14
|
+
export const RecoveryCredentialsContainer: ComponentType<any> = lazy(() => import('./RecoveryCredentialsContainer'));
|
|
15
|
+
export const ResetDialog: ComponentType<any> = lazy(() => import('./ResetDialog'));
|
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.client',
|
|
10
10
|
name: 'Client',
|
|
11
11
|
description: trim`
|
|
12
12
|
Core client connectivity and peer-to-peer networking infrastructure.
|
package/src/translations.ts
CHANGED
|
@@ -36,7 +36,7 @@ const pluginTranslations = [
|
|
|
36
36
|
'display name description': 'Your name as it appears in the app.',
|
|
37
37
|
'display name input placeholder': 'Enter a name',
|
|
38
38
|
'icon label': 'Avatar',
|
|
39
|
-
'icon description': 'The emoji used to represent
|
|
39
|
+
'icon description': 'The emoji used to represent the user.',
|
|
40
40
|
'hue label': 'Color',
|
|
41
41
|
'hue description':
|
|
42
42
|
'The color used to represent you in the app, including as your avatar’s background, your cursor as it appears to others, and the messages you send in group threads.',
|
|
@@ -10,7 +10,7 @@ import { type Type } from '@dxos/echo';
|
|
|
10
10
|
import { meta } from '../meta';
|
|
11
11
|
|
|
12
12
|
export namespace ClientCapabilities {
|
|
13
|
-
export const Client = Capability.make<Client>(`${meta.id}
|
|
14
|
-
export const Schema = Capability.make<Type.
|
|
15
|
-
export const Migration = Capability.make<ObjectMigration[]>(`${meta.id}
|
|
13
|
+
export const Client = Capability.make<Client>(`${meta.id}.capability.client`);
|
|
14
|
+
export const Schema = Capability.make<Type.AnyEntity[]>(`${meta.id}.capability.schema`);
|
|
15
|
+
export const Migration = Capability.make<ObjectMigration[]>(`${meta.id}.capability.migration`);
|
|
16
16
|
}
|
package/src/types/events.ts
CHANGED
|
@@ -7,9 +7,9 @@ import { ActivationEvent } from '@dxos/app-framework';
|
|
|
7
7
|
import { meta } from '../meta';
|
|
8
8
|
|
|
9
9
|
export namespace ClientEvents {
|
|
10
|
-
export const ClientReady = ActivationEvent.make(`${meta.id}
|
|
11
|
-
export const SetupSchema = ActivationEvent.make(`${meta.id}
|
|
12
|
-
export const SetupMigration = ActivationEvent.make(`${meta.id}
|
|
13
|
-
export const IdentityCreated = ActivationEvent.make(`${meta.id}
|
|
14
|
-
export const SpacesReady = ActivationEvent.make(`${meta.id}
|
|
10
|
+
export const ClientReady = ActivationEvent.make(`${meta.id}.event.client-ready`);
|
|
11
|
+
export const SetupSchema = ActivationEvent.make(`${meta.id}.event.setup-schema`);
|
|
12
|
+
export const SetupMigration = ActivationEvent.make(`${meta.id}.event.setup-migration`);
|
|
13
|
+
export const IdentityCreated = ActivationEvent.make(`${meta.id}.event.identity-created`);
|
|
14
|
+
export const SpacesReady = ActivationEvent.make(`${meta.id}.event.spaces-ready`);
|
|
15
15
|
}
|
package/src/types/schema.ts
CHANGED
|
@@ -31,59 +31,59 @@ export namespace ClientAction {
|
|
|
31
31
|
data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${meta.id}
|
|
34
|
+
export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${meta.id}.action.create-identity`, {
|
|
35
35
|
input: ProfileSchema,
|
|
36
36
|
output: IdentitySchema,
|
|
37
37
|
}) {}
|
|
38
38
|
|
|
39
|
-
export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${meta.id}
|
|
39
|
+
export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${meta.id}.action.join-identity`, {
|
|
40
40
|
input: Schema.Struct({
|
|
41
41
|
invitationCode: Schema.optional(Schema.String),
|
|
42
42
|
}),
|
|
43
43
|
output: Schema.Void,
|
|
44
44
|
}) {}
|
|
45
45
|
|
|
46
|
-
export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${meta.id}
|
|
46
|
+
export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${meta.id}.action.share-identity`, {
|
|
47
47
|
input: Schema.Void,
|
|
48
48
|
output: Schema.Void,
|
|
49
49
|
}) {}
|
|
50
50
|
|
|
51
|
-
export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${meta.id}
|
|
51
|
+
export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${meta.id}.action.recover-identity`, {
|
|
52
52
|
input: Schema.Void,
|
|
53
53
|
output: Schema.Void,
|
|
54
54
|
}) {}
|
|
55
55
|
|
|
56
|
-
export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${meta.id}
|
|
56
|
+
export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${meta.id}.action.reset-storage`, {
|
|
57
57
|
input: Schema.Struct({
|
|
58
58
|
mode: Schema.optional(Schema.String),
|
|
59
59
|
}),
|
|
60
60
|
output: Schema.Void,
|
|
61
61
|
}) {}
|
|
62
62
|
|
|
63
|
-
export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${meta.id}
|
|
63
|
+
export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${meta.id}.action.create-agent`, {
|
|
64
64
|
input: Schema.Void,
|
|
65
65
|
output: Schema.Void,
|
|
66
66
|
}) {}
|
|
67
67
|
|
|
68
68
|
export class CreateRecoveryCode extends Schema.TaggedClass<CreateRecoveryCode>()(
|
|
69
|
-
`${meta.id}
|
|
69
|
+
`${meta.id}.action.create-recovery-code`,
|
|
70
70
|
{
|
|
71
71
|
input: Schema.Void,
|
|
72
72
|
output: Schema.Void,
|
|
73
73
|
},
|
|
74
74
|
) {}
|
|
75
75
|
|
|
76
|
-
export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${meta.id}
|
|
76
|
+
export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${meta.id}.action.create-passkey`, {
|
|
77
77
|
input: Schema.Void,
|
|
78
78
|
output: Schema.Void,
|
|
79
79
|
}) {}
|
|
80
80
|
|
|
81
|
-
export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${meta.id}
|
|
81
|
+
export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${meta.id}.action.redeem-passkey`, {
|
|
82
82
|
input: Schema.Void,
|
|
83
83
|
output: Schema.Void,
|
|
84
84
|
}) {}
|
|
85
85
|
|
|
86
|
-
export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${meta.id}
|
|
86
|
+
export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${meta.id}.action.redeem-token`, {
|
|
87
87
|
input: Schema.Struct({
|
|
88
88
|
token: Schema.String,
|
|
89
89
|
}),
|
|
@@ -91,7 +91,7 @@ export namespace ClientAction {
|
|
|
91
91
|
}) {}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const CLIENT_OPERATION = `${meta.id}
|
|
94
|
+
const CLIENT_OPERATION = `${meta.id}.operation`;
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Operations for the Client plugin.
|
|
@@ -104,7 +104,7 @@ export namespace ClientOperation {
|
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
export const CreateIdentity = Operation.make({
|
|
107
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
107
|
+
meta: { key: `${CLIENT_OPERATION}.create-identity`, name: 'Create Identity' },
|
|
108
108
|
services: [Capability.Service],
|
|
109
109
|
schema: {
|
|
110
110
|
input: ProfileSchema,
|
|
@@ -113,7 +113,7 @@ export namespace ClientOperation {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
export const JoinIdentity = Operation.make({
|
|
116
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
116
|
+
meta: { key: `${CLIENT_OPERATION}.join-identity`, name: 'Join Identity' },
|
|
117
117
|
services: [Capability.Service],
|
|
118
118
|
schema: {
|
|
119
119
|
input: Schema.Struct({
|
|
@@ -124,7 +124,7 @@ export namespace ClientOperation {
|
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
export const ShareIdentity = Operation.make({
|
|
127
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
127
|
+
meta: { key: `${CLIENT_OPERATION}.share-identity`, name: 'Share Identity' },
|
|
128
128
|
services: [Capability.Service],
|
|
129
129
|
schema: {
|
|
130
130
|
input: Schema.Void,
|
|
@@ -133,7 +133,7 @@ export namespace ClientOperation {
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
export const RecoverIdentity = Operation.make({
|
|
136
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
136
|
+
meta: { key: `${CLIENT_OPERATION}.recover-identity`, name: 'Recover Identity' },
|
|
137
137
|
services: [Capability.Service],
|
|
138
138
|
schema: {
|
|
139
139
|
input: Schema.Void,
|
|
@@ -142,7 +142,7 @@ export namespace ClientOperation {
|
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
export const ResetStorage = Operation.make({
|
|
145
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
145
|
+
meta: { key: `${CLIENT_OPERATION}.reset-storage`, name: 'Reset Storage' },
|
|
146
146
|
services: [Capability.Service],
|
|
147
147
|
schema: {
|
|
148
148
|
input: Schema.Struct({
|
|
@@ -153,7 +153,7 @@ export namespace ClientOperation {
|
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
export const CreateAgent = Operation.make({
|
|
156
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
156
|
+
meta: { key: `${CLIENT_OPERATION}.create-agent`, name: 'Create Agent' },
|
|
157
157
|
services: [Capability.Service],
|
|
158
158
|
schema: {
|
|
159
159
|
input: Schema.Void,
|
|
@@ -162,7 +162,7 @@ export namespace ClientOperation {
|
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
export const CreateRecoveryCode = Operation.make({
|
|
165
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
165
|
+
meta: { key: `${CLIENT_OPERATION}.create-recovery-code`, name: 'Create Recovery Code' },
|
|
166
166
|
services: [Capability.Service],
|
|
167
167
|
schema: {
|
|
168
168
|
input: Schema.Void,
|
|
@@ -171,7 +171,7 @@ export namespace ClientOperation {
|
|
|
171
171
|
});
|
|
172
172
|
|
|
173
173
|
export const CreatePasskey = Operation.make({
|
|
174
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
174
|
+
meta: { key: `${CLIENT_OPERATION}.create-passkey`, name: 'Create Passkey' },
|
|
175
175
|
services: [Capability.Service],
|
|
176
176
|
schema: {
|
|
177
177
|
input: Schema.Void,
|
|
@@ -180,7 +180,7 @@ export namespace ClientOperation {
|
|
|
180
180
|
});
|
|
181
181
|
|
|
182
182
|
export const RedeemPasskey = Operation.make({
|
|
183
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
183
|
+
meta: { key: `${CLIENT_OPERATION}.redeem-passkey`, name: 'Redeem Passkey' },
|
|
184
184
|
services: [Capability.Service],
|
|
185
185
|
schema: {
|
|
186
186
|
input: Schema.Void,
|
|
@@ -189,7 +189,7 @@ export namespace ClientOperation {
|
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
export const RedeemToken = Operation.make({
|
|
192
|
-
meta: { key: `${CLIENT_OPERATION}
|
|
192
|
+
meta: { key: `${CLIENT_OPERATION}.redeem-token`, name: 'Redeem Token' },
|
|
193
193
|
services: [Capability.Service],
|
|
194
194
|
schema: {
|
|
195
195
|
input: Schema.Struct({
|
|
@@ -202,9 +202,14 @@ export namespace ClientOperation {
|
|
|
202
202
|
|
|
203
203
|
export type ClientPluginOptions = ClientOptions & {
|
|
204
204
|
/**
|
|
205
|
-
* Base
|
|
205
|
+
* Base origin for the invitation link.
|
|
206
206
|
*/
|
|
207
|
-
|
|
207
|
+
shareableLinkOrigin?: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Path for the invitation link.
|
|
211
|
+
*/
|
|
212
|
+
invitationPath?: string;
|
|
208
213
|
|
|
209
214
|
/**
|
|
210
215
|
* Query parameter for the invitation code.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\nimport { CreateAtom, GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\nimport { ConnectionState } from '@dxos/react-client/mesh';\n\nimport { meta } from '../../meta';\nimport { Account, ClientCapabilities, ClientOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* GraphBuilder.createExtension({\n id: meta.id,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: `${meta.id}/open-user-account`,\n data: () => Operation.invoke(ClientOperation.ShareIdentity),\n properties: {\n label: ['open user account label', { ns: meta.id }],\n icon: 'ph--user--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n },\n },\n ]),\n connector: Effect.fnUntraced(function* (node, get) {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const identity = get(CreateAtom.fromObservable(client.halo.identity));\n const status = get(CreateAtom.fromObservable(client.mesh.networkStatus));\n\n return [\n {\n id: Account.id,\n type: meta.id,\n properties: {\n label: ['account label', { ns: meta.id }],\n icon: 'ph--user--regular',\n disposition: 'user-account',\n testId: 'clientPlugin.account',\n // NOTE: This currently needs to be the identity key because the fallback is generated from hex.\n userId: identity?.identityKey.toHex(),\n hue: identity?.profile?.data?.hue,\n emoji: identity?.profile?.data?.emoji,\n status: status.swarm === ConnectionState.OFFLINE ? 'error' : 'active',\n },\n nodes: [\n {\n id: Account.Profile,\n data: Account.Profile,\n type: meta.id,\n properties: {\n label: ['profile label', { ns: meta.id }],\n icon: 'ph--user--regular',\n },\n },\n {\n id: Account.Devices,\n data: Account.Devices,\n type: meta.id,\n properties: {\n label: ['devices label', { ns: meta.id }],\n icon: 'ph--devices--regular',\n testId: 'clientPlugin.devices',\n },\n },\n {\n id: Account.Security,\n data: Account.Security,\n type: meta.id,\n properties: {\n label: ['security label', { ns: meta.id }],\n icon: 'ph--key--regular',\n },\n },\n ],\n },\n ];\n }),\n });\n\n return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,cAAcC,mBAAmB;AACtD,SAASC,uBAAuB;AAKhC,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAOC,aAAaC,gBAAgB;IACrDC,IAAIC,KAAKD;IACTE,OAAOC,YAAYC;IACnBC,SAAS,MACAC,eAAQ;MACb;QACEN,IAAI,GAAGC,KAAKD,EAAE;QACdO,MAAM,MAAMC,UAAUC,OAAOC,gBAAgBC,aAAa;QAC1DC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIb,KAAKD;YAAG;;UACjDe,MAAM;UACNC,aAAa;UACbC,YAAY;YACV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YAAYC,OAAOzD,WAAW0D,iBAAiBvD,UAAAA;AACnE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "Operation", "CreateAtom", "GraphBuilder", "NodeMatcher", "ConnectionState", "Capability", "makeModule", "fnUntraced", "extensions", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "data", "Operation", "invoke", "ClientOperation", "ShareIdentity", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "linux", "connector", "node", "get", "client", "ClientCapabilities", "Client", "identity", "CreateAtom", "fromObservable", "halo", "status", "mesh", "networkStatus", "Account", "type", "testId", "userId", "identityKey", "toHex", "hue", "profile", "emoji", "swarm", "ConnectionState", "OFFLINE", "nodes", "Profile", "Devices", "Security", "contributes", "Common", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/capabilities.ts", "../../../src/meta.ts", "../../../src/types/events.ts", "../../../src/types/schema.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { type Client } from '@dxos/client';\nimport { type ObjectMigration } from '@dxos/client/echo';\nimport { type Type } from '@dxos/echo';\n\nimport { meta } from '../meta';\n\nexport namespace ClientCapabilities {\n export const Client = Capability.make<Client>(`${meta.id}/capability/client`);\n export const Schema = Capability.make<Type.Entity.Any[]>(`${meta.id}/capability/schema`);\n export const Migration = Capability.make<ObjectMigration[]>(`${meta.id}/capability/migration`);\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/client',\n name: 'Client',\n description: trim`\n Core client connectivity and peer-to-peer networking infrastructure.\n Manages identity, authentication, and real-time synchronization across devices.\n `,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\n\nexport namespace ClientEvents {\n export const ClientReady = ActivationEvent.make(`${meta.id}/event/client-ready`);\n export const SetupSchema = ActivationEvent.make(`${meta.id}/event/setup-schema`);\n export const SetupMigration = ActivationEvent.make(`${meta.id}/event/setup-migration`);\n export const IdentityCreated = ActivationEvent.make(`${meta.id}/event/identity-created`);\n export const SpacesReady = ActivationEvent.make(`${meta.id}/event/spaces-ready`);\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { type Client, type ClientOptions, PublicKey } from '@dxos/client';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '../meta';\n\n// TODO(wittjosiah): Factor out. Generate?\nconst IdentitySchema = Schema.Struct({\n identityKey: Schema.instanceOf(PublicKey),\n spaceKey: Schema.optional(Schema.instanceOf(PublicKey)),\n profile: Schema.optional(\n Schema.Struct({\n displayName: Schema.optional(Schema.String),\n avatarCid: Schema.optional(Schema.String),\n data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n ),\n});\n\nexport namespace ClientAction {\n const ProfileSchema = Schema.Struct({\n displayName: Schema.optional(Schema.String),\n avatarCid: Schema.optional(Schema.String),\n data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n });\n\n export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${meta.id}/action/create-identity`, {\n input: ProfileSchema,\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${meta.id}/action/join-identity`, {\n input: Schema.Struct({\n invitationCode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${meta.id}/action/share-identity`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${meta.id}/action/recover-identity`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${meta.id}/action/reset-storage`, {\n input: Schema.Struct({\n mode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${meta.id}/action/create-agent`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class CreateRecoveryCode extends Schema.TaggedClass<CreateRecoveryCode>()(\n `${meta.id}/action/create-recovery-code`,\n {\n input: Schema.Void,\n output: Schema.Void,\n },\n ) {}\n\n export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${meta.id}/action/create-passkey`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${meta.id}/action/redeem-passkey`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${meta.id}/action/redeem-token`, {\n input: Schema.Struct({\n token: Schema.String,\n }),\n output: Schema.Void,\n }) {}\n}\n\nconst CLIENT_OPERATION = `${meta.id}/operation`;\n\n/**\n * Operations for the Client plugin.\n */\nexport namespace ClientOperation {\n const ProfileSchema = Schema.Struct({\n displayName: Schema.optional(Schema.String),\n avatarCid: Schema.optional(Schema.String),\n data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n });\n\n export const CreateIdentity = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/create-identity`, name: 'Create Identity' },\n services: [Capability.Service],\n schema: {\n input: ProfileSchema,\n output: IdentitySchema,\n },\n });\n\n export const JoinIdentity = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/join-identity`, name: 'Join Identity' },\n services: [Capability.Service],\n schema: {\n input: Schema.Struct({\n invitationCode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n },\n });\n\n export const ShareIdentity = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/share-identity`, name: 'Share Identity' },\n services: [Capability.Service],\n schema: {\n input: Schema.Void,\n output: Schema.Void,\n },\n });\n\n export const RecoverIdentity = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/recover-identity`, name: 'Recover Identity' },\n services: [Capability.Service],\n schema: {\n input: Schema.Void,\n output: Schema.Void,\n },\n });\n\n export const ResetStorage = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/reset-storage`, name: 'Reset Storage' },\n services: [Capability.Service],\n schema: {\n input: Schema.Struct({\n mode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n },\n });\n\n export const CreateAgent = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/create-agent`, name: 'Create Agent' },\n services: [Capability.Service],\n schema: {\n input: Schema.Void,\n output: Schema.Void,\n },\n });\n\n export const CreateRecoveryCode = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/create-recovery-code`, name: 'Create Recovery Code' },\n services: [Capability.Service],\n schema: {\n input: Schema.Void,\n output: Schema.Void,\n },\n });\n\n export const CreatePasskey = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/create-passkey`, name: 'Create Passkey' },\n services: [Capability.Service],\n schema: {\n input: Schema.Void,\n output: Schema.Void,\n },\n });\n\n export const RedeemPasskey = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/redeem-passkey`, name: 'Redeem Passkey' },\n services: [Capability.Service],\n schema: {\n input: Schema.Void,\n output: Schema.Void,\n },\n });\n\n export const RedeemToken = Operation.make({\n meta: { key: `${CLIENT_OPERATION}/redeem-token`, name: 'Redeem Token' },\n services: [Capability.Service],\n schema: {\n input: Schema.Struct({\n token: Schema.String,\n }),\n output: Schema.Void,\n },\n });\n}\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationProp?: string;\n\n /**\n * Run after the client has been initialized.\n * Plugin context is provided so capabilities are accessible.\n */\n onClientInitialized?: (params: { client: Client }) => Effect.Effect<void, Error | never, Capability.Service | never>;\n\n /**\n * Called when spaces are ready.\n * Plugin context is provided so capabilities are accessible.\n */\n onSpacesReady?: (params: { client: Client }) => Effect.Effect<void, Error | never, Capability.Service | never>;\n\n /**\n * Called when the client is reset.\n * Plugin context is provided so capabilities are accessible.\n */\n onReset?: (params: { target?: string }) => Effect.Effect<void, Error | never, Capability.Service | never>;\n};\n\nexport namespace Account {\n // TODO(wittjosiah): Cannot use slashes in ids until we have a router which decouples ids from url paths.\n const _id = 'dxos.org.plugin.client.account';\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n export const id = `!${_id}`;\n\n export const Profile = `${_id}.profile`;\n export const Devices = `${_id}.devices`;\n export const Security = `${_id}.security`;\n}\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,kBAAkB;;;ACC3B,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;;;UDHiBC,qBAAAA;sBACFC,SAASC,WAAWC,KAAa,GAAGC,KAAKC,EAAE,oBAAoB;sBAC/DC,SAASJ,WAAWC,KAAwB,GAAGC,KAAKC,EAAE,oBAAoB;sBAC1EE,YAAYL,WAAWC,KAAwB,GAAGC,KAAKC,EAAE,uBAAuB;AAC/F,GAJiBL,uBAAAA,qBAAAA,CAAAA,EAAAA;;;;AEPjB,SAASQ,uBAAuB;UAIfC,eAAAA;gBACFC,cAAcC,gBAAgBC,KAAK,GAAGC,KAAKC,EAAE,qBAAqB;gBAClEC,cAAcJ,gBAAgBC,KAAK,GAAGC,KAAKC,EAAE,qBAAqB;gBAClEE,iBAAiBL,gBAAgBC,KAAK,GAAGC,KAAKC,EAAE,wBAAwB;gBACxEG,kBAAkBN,gBAAgBC,KAAK,GAAGC,KAAKC,EAAE,yBAAyB;gBAC1EI,c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A;mBAEaM,qBAAqBO,UAAUC,KAAK;IAC/CpB,MAAM;MAAEP,KAAK,GAAGwB,gBAAAA;MAAyCI,MAAM;IAAuB;IACtFC,UAAU;MAACC,YAAWC;;IACtBC,QAAQ;MACNvB,OAAcI;MACdH,QAAeG;IACjB;EACF,CAAA;mBAEaO,gBAAgBM,UAAUC,KAAK;IAC1CpB,MAAM;MAAEP,KAAK,GAAGwB,gBAAAA;MAAmCI,MAAM;IAAiB;IAC1EC,UAAU;MAACC,YAAWC;;IACtBC,QAAQ;MACNvB,OAAcI;MACdH,QAAeG;IACjB;EACF,CAAA;mBAEaQ,gBAAgBK,UAAUC,KAAK;IAC1CpB,MAAM;MAAEP,KAAK,GAAGwB,gBAAAA;MAAmCI,MAAM;IAAiB;IAC1EC,UAAU;MAACC,YAAWC;;IACtBC,QAAQ;MACNvB,OAAcI;MACdH,QAAeG;IACjB;EACF,CAAA;mBAEaS,cAAcI,UAAUC,KAAK;IACxCpB,MAAM;MAAEP,KAAK,GAAGwB,gBAAAA;MAAiCI,MAAM;IAAe;IACtEC,UAAU;MAACC,YAAWC;;IACtBC,QAAQ;MACNvB,OAAcrB,cAAO;QACnBmC,OAAc3B;MAChB,CAAA;MACAc,QAAeG;IACjB;EACF,CAAA;AACF,GAtGiBY,oBAAAA,kBAAAA,CAAAA,EAAAA;UAsIAQ,UAAAA;AAEf,QAAMC,MAAM;WAGC1B,KAAK,IAAI0B,GAAAA;WAETC,UAAU,GAAGD,GAAAA;WACbE,UAAU,GAAGF,GAAAA;WACbG,WAAW,GAAGH,GAAAA;AAC7B,GAViBD,YAAAA,UAAAA,CAAAA,EAAAA;;;;",
|
|
6
|
-
"names": ["Capability", "trim", "meta", "id", "name", "description", "trim", "ClientCapabilities", "Client", "Capability", "make", "meta", "id", "Schema", "Migration", "ActivationEvent", "ClientEvents", "ClientReady", "ActivationEvent", "make", "meta", "id", "SetupSchema", "SetupMigration", "IdentityCreated", "SpacesReady", "Schema", "Capability", "PublicKey", "Operation", "IdentitySchema", "Struct", "identityKey", "instanceOf", "PublicKey", "spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "ClientAction", "ProfileSchema", "CreateIdentity", "TaggedClass", "meta", "id", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "mode", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey", "RedeemToken", "token", "CLIENT_OPERATION", "ClientOperation", "Operation", "make", "name", "services", "Capability", "Service", "schema", "Account", "_id", "Profile", "Devices", "Security"]
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-4BZGRIFS.mjs";
|
|
4
|
-
|
|
5
|
-
// src/constants.ts
|
|
6
|
-
var JOIN_DIALOG = `${meta.id}/JoinDialog`;
|
|
7
|
-
var RECOVERY_CODE_DIALOG = `${meta.id}/RecoveryCodeDialog`;
|
|
8
|
-
var RESET_DIALOG = `${meta.id}/ResetDialog`;
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
JOIN_DIALOG,
|
|
12
|
-
RECOVERY_CODE_DIALOG,
|
|
13
|
-
RESET_DIALOG
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-G7C3S2BE.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/client/client.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common, Plugin } from '@dxos/app-framework';\nimport { Client, ClientService } from '@dxos/client';\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { log } from '@dxos/log';\n\nimport { ClientEvents } from '../../types';\nimport { ClientCapabilities, type ClientPluginOptions } from '../../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'>;\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* (props?: ClientCapabilityOptions) {\n const { onClientInitialized, onSpacesReady, ...options } = props!;\n const capabilityManager = yield* Capability.Service;\n const pluginManager = yield* Plugin.Service;\n\n log('creating client');\n const client = new Client(options);\n log('initializing client');\n yield* Effect.tryPromise(() => client.initialize());\n log('initialized client');\n if (onClientInitialized) {\n yield* onClientInitialized({ client }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n );\n }\n log('called client initialized callback');\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n\n // TODO(burdon): The callback isn't called?\n const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await Effect.gen(function* () {\n yield* Plugin.activate(ClientEvents.SpacesReady);\n if (onSpacesReady) {\n yield* onSpacesReady({ client });\n }\n }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n runAndForwardErrors,\n );\n }\n });\n\n log('client capability ready');\n\n return [\n // TODO(wittjosiah): Try to remove and prefer layer?\n // Perhaps move to using layer has source of truth and add a getter capability for the client.\n Capability.contributes(ClientCapabilities.Client, client, () =>\n Effect.gen(function* () {\n subscription.unsubscribe();\n yield* Effect.tryPromise(() => client.destroy());\n }),\n ),\n Capability.contributes(Common.Capability.Layer, ClientService.fromClient(client)),\n ];\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,QAAQC,cAAc;AAC3C,SAASC,QAAQC,qBAAqB;AACtC,SAASC,2BAA2B;AACpC,SAASC,WAAW;;AAOpB,IAAA,iBAAeC,WAAWC,WACjBC,kBAAW,WAAWC,OAA+B;AAC1D,QAAM,EAAEC,qBAAqB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AAOxC,WAAWyC,OAAOC,cAAcC,WAAW/B,MAAAA,CAAAA;;AAE7E,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "Plugin", "Client", "ClientService", "runAndForwardErrors", "log", "Capability", "makeModule", "fnUntraced", "props", "onClientInitialized", "onSpacesReady", "options", "capabilityManager", "Service", "pluginManager", "Plugin", "log", "client", "Client", "tryPromise", "initialize", "pipe", "provideService", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "gen", "activate", "ClientEvents", "SpacesReady", "runAndForwardErrors", "contributes", "ClientCapabilities", "unsubscribe", "destroy", "Common", "Layer", "ClientService", "fromClient"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/migrations/migrations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\n\nimport { ClientCapabilities } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Common.Capability.AtomRegistry);\n const client = yield* Capability.get(ClientCapabilities.Client);\n const migrationsAtom = yield* Capability.atom(ClientCapabilities.Migration);\n\n // NOTE: Migrations are currently unidirectional and idempotent.\n const cancel = registry.subscribe(\n migrationsAtom,\n (_migrations: any[]) => {\n const migrations = Array.from(new Set(_migrations.flat()));\n const spaces = client.spaces.get();\n void Promise.all(spaces.map((space: any) => space.internal.db.runMigrations(migrations)));\n },\n { immediate: true },\n );\n\n return Capability.contributes(Common.Capability.Null, null, () => Effect.sync(() => cancel()));\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AAInC,IAAA,qBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,YAAY;AACrE,QAAMC,SAAS,OAAOP,WAAWI,IAAII,mBAAmBC,MAAM;AAC9D,QAAMC,iBAAiB,OAAOV,WAAWW,KAAKH,mBAAmBI,SAAS;AAG1E,QAAMC,SAASV,SAASW,UACtBJ,gBACA,CAACK,gBAAAA;AACC,UAAMC,aAAaC,MAAMC,KAAK,IAAIC,IAAIJ,YAAYK,KAAI,CAAA,CAAA;AACtD,UAAMC,SAASd,OAAOc,OAAOjB,IAAG;AAChC,SAAKkB,QAAQC,IAAIF,OAAOG,IAAI,CAACC,UAAeA,MAAMC,SAASC,GAAGC,cAAcZ,UAAAA,CAAAA,CAAAA;EAC9E,GACA;IAAEa,WAAW;EAAK,CAAA;AAGpB,SAAO7B,WAAW8B,YAAYzB,OAAOL,WAAW+B,MAAM,MAAM,MAAaC,YAAK,MAAMnB,OAAAA,CAAAA,CAAAA;AACtF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "Capability", "makeModule", "fnUntraced", "registry", "get", "Common", "AtomRegistry", "client", "ClientCapabilities", "Client", "migrationsAtom", "atom", "Migration", "cancel", "subscribe", "_migrations", "migrations", "Array", "from", "Set", "flat", "spaces", "Promise", "all", "map", "space", "internal", "db", "runMigrations", "immediate", "contributes", "Null", "sync"]
|
|
7
|
-
}
|