@dxos/plugin-client 0.8.4-main.c1de068 → 0.8.4-main.fd6878d
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/{app-graph-builder-JNIES5L4.mjs → app-graph-builder-ENKIVZWH.mjs} +3 -3
- package/dist/lib/browser/app-graph-builder-ENKIVZWH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SV3MHIKI.mjs → chunk-56EADSTE.mjs} +8 -8
- package/dist/lib/{node-esm/chunk-FBYODKEL.mjs.map → browser/chunk-56EADSTE.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-RMHBOY3Y.mjs → chunk-HLWIF3AW.mjs} +1 -1
- package/dist/lib/browser/{chunk-RMHBOY3Y.mjs.map → chunk-HLWIF3AW.mjs.map} +2 -2
- package/dist/lib/browser/{client-SKVKXPLY.mjs → client-F73MIXMT.mjs} +9 -3
- package/dist/lib/browser/client-F73MIXMT.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-LNPLD5CA.mjs → intent-resolver-S3PUYK5Q.mjs} +11 -11
- package/dist/lib/browser/intent-resolver-S3PUYK5Q.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-D76RCG72.mjs → migrations-YJSO7JXY.mjs} +1 -1
- package/dist/lib/{node-esm/migrations-YISDI7LF.mjs.map → browser/migrations-YJSO7JXY.mjs.map} +2 -2
- package/dist/lib/browser/{react-context-YWVPZUMU.mjs → react-context-QBXCHNH2.mjs} +1 -1
- package/dist/lib/browser/{react-context-YWVPZUMU.mjs.map → react-context-QBXCHNH2.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-QFZTDNLS.mjs → react-surface-YON76BFE.mjs} +4 -4
- package/dist/lib/browser/{react-surface-QFZTDNLS.mjs.map → react-surface-YON76BFE.mjs.map} +3 -3
- package/dist/lib/browser/{schema-defs-HKW6VNZB.mjs → schema-defs-AMSX6T3B.mjs} +1 -1
- package/dist/lib/{node-esm/schema-defs-5ZNI63RW.mjs.map → browser/schema-defs-AMSX6T3B.mjs.map} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{app-graph-builder-SWFB4FID.mjs → app-graph-builder-D4XJCLPN.mjs} +3 -3
- package/dist/lib/node-esm/app-graph-builder-D4XJCLPN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FBYODKEL.mjs → chunk-J6I6JZPI.mjs} +8 -8
- package/dist/lib/{browser/chunk-SV3MHIKI.mjs.map → node-esm/chunk-J6I6JZPI.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-5V3RCXZV.mjs → chunk-JG6AFSFU.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-5V3RCXZV.mjs.map → chunk-JG6AFSFU.mjs.map} +2 -2
- package/dist/lib/node-esm/{client-SLL6GDC2.mjs → client-A7CNP37P.mjs} +9 -3
- package/dist/lib/node-esm/client-A7CNP37P.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -8
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-L7C6YRWV.mjs → intent-resolver-EBJABYM3.mjs} +11 -11
- package/dist/lib/node-esm/intent-resolver-EBJABYM3.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-YISDI7LF.mjs → migrations-UOEK7HB7.mjs} +1 -1
- package/dist/lib/{browser/migrations-D76RCG72.mjs.map → node-esm/migrations-UOEK7HB7.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-context-EEHS4S3L.mjs → react-context-JIH7YBFI.mjs} +1 -1
- package/dist/lib/node-esm/{react-context-EEHS4S3L.mjs.map → react-context-JIH7YBFI.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-2K6W37R4.mjs → react-surface-YKCZF43D.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-2K6W37R4.mjs.map → react-surface-YKCZF43D.mjs.map} +3 -3
- package/dist/lib/node-esm/{schema-defs-5ZNI63RW.mjs → schema-defs-4UTKKRTF.mjs} +1 -1
- package/dist/lib/{browser/schema-defs-HKW6VNZB.mjs.map → node-esm/schema-defs-4UTKKRTF.mjs.map} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts +1 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +9 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -26
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +4 -3
- package/src/capabilities/client.ts +6 -4
- package/src/capabilities/intent-resolver.ts +5 -4
- package/src/capabilities/migrations.ts +1 -1
- package/src/capabilities/react-context.tsx +2 -1
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/capabilities/schema-defs.ts +1 -1
- package/src/components/DevicesContainer.stories.tsx +5 -4
- package/src/components/DevicesContainer.tsx +1 -1
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/ProfileContainer.stories.tsx +4 -3
- package/src/components/ProfileContainer.tsx +4 -4
- package/src/components/RecoveryCodeDialog.stories.tsx +4 -3
- package/src/components/RecoveryCredentialsContainer.stories.tsx +5 -4
- package/src/components/RecoveryCredentialsContainer.tsx +1 -1
- package/src/components/ResetDialog.stories.tsx +4 -3
- package/src/components/ResetDialog.tsx +1 -1
- package/src/types/schema.ts +3 -3
- package/dist/lib/browser/app-graph-builder-JNIES5L4.mjs.map +0 -7
- package/dist/lib/browser/client-SKVKXPLY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-LNPLD5CA.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SWFB4FID.mjs.map +0 -7
- package/dist/lib/node-esm/client-SLL6GDC2.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-L7C6YRWV.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-client",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fd6878d",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
18
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -36,37 +38,37 @@
|
|
|
36
38
|
"@preact-signals/safe-react": "^0.9.0",
|
|
37
39
|
"@preact/signals-core": "^1.9.0",
|
|
38
40
|
"react-qr-rounded": "^1.0.0",
|
|
39
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/echo": "0.8.4-main.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/local-storage": "0.8.4-main.
|
|
47
|
-
"@dxos/log": "0.8.4-main.
|
|
48
|
-
"@dxos/plugin-
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
41
|
+
"@dxos/app-framework": "0.8.4-main.fd6878d",
|
|
42
|
+
"@dxos/echo": "0.8.4-main.fd6878d",
|
|
43
|
+
"@dxos/async": "0.8.4-main.fd6878d",
|
|
44
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
45
|
+
"@dxos/config": "0.8.4-main.fd6878d",
|
|
46
|
+
"@dxos/invariant": "0.8.4-main.fd6878d",
|
|
47
|
+
"@dxos/echo-signals": "0.8.4-main.fd6878d",
|
|
48
|
+
"@dxos/local-storage": "0.8.4-main.fd6878d",
|
|
49
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
50
|
+
"@dxos/plugin-observability": "0.8.4-main.fd6878d",
|
|
51
|
+
"@dxos/react-client": "0.8.4-main.fd6878d",
|
|
52
|
+
"@dxos/react-ui-form": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/shell": "0.8.4-main.fd6878d",
|
|
54
|
+
"@dxos/react-ui-stack": "0.8.4-main.fd6878d",
|
|
55
|
+
"@dxos/util": "0.8.4-main.fd6878d",
|
|
56
|
+
"@dxos/react-ui-pickers": "0.8.4-main.fd6878d",
|
|
57
|
+
"@dxos/plugin-graph": "0.8.4-main.fd6878d"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"@effect-rx/rx-react": "0.38.0",
|
|
59
|
-
"@effect/platform": "0.
|
|
61
|
+
"@effect/platform": "0.90.2",
|
|
60
62
|
"@types/react": "~18.2.0",
|
|
61
63
|
"@types/react-dom": "~18.2.0",
|
|
62
|
-
"effect": "3.17.
|
|
64
|
+
"effect": "3.17.7",
|
|
63
65
|
"react": "~18.2.0",
|
|
64
66
|
"react-dom": "~18.2.0",
|
|
65
67
|
"vite": "5.4.7",
|
|
66
|
-
"@dxos/live-object": "0.8.4-main.
|
|
67
|
-
"@dxos/react-ui
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
68
|
+
"@dxos/live-object": "0.8.4-main.fd6878d",
|
|
69
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
71
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d"
|
|
70
72
|
},
|
|
71
73
|
"peerDependencies": {
|
|
72
74
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -74,8 +76,8 @@
|
|
|
74
76
|
"effect": "^3.13.3",
|
|
75
77
|
"react": "~18.2.0",
|
|
76
78
|
"react-dom": "~18.2.0",
|
|
77
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
78
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
79
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
80
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
79
81
|
},
|
|
80
82
|
"publishConfig": {
|
|
81
83
|
"access": "public"
|
package/src/ClientPlugin.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, defineModule, definePlugin,
|
|
5
|
+
import { Capabilities, Events, contributes, defineModule, definePlugin, oneOf } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
Client,
|
|
9
8
|
AppGraphBuilder,
|
|
9
|
+
Client,
|
|
10
10
|
IntentResolver,
|
|
11
11
|
Migrations,
|
|
12
12
|
ReactContext,
|
|
@@ -6,14 +6,15 @@ import { Rx } from '@effect-rx/rx-react';
|
|
|
6
6
|
import { Option, pipe } from 'effect';
|
|
7
7
|
|
|
8
8
|
import { createIntent } from '@dxos/app-framework';
|
|
9
|
-
import { Capabilities,
|
|
10
|
-
import { createExtension, rxFromObservable
|
|
9
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
|
+
import { ROOT_ID, createExtension, rxFromObservable } from '@dxos/plugin-graph';
|
|
11
11
|
import { ConnectionState } from '@dxos/react-client/mesh';
|
|
12
12
|
|
|
13
|
-
import { ClientCapabilities } from './capabilities';
|
|
14
13
|
import { CLIENT_PLUGIN } from '../meta';
|
|
15
14
|
import { Account, ClientAction } from '../types';
|
|
16
15
|
|
|
16
|
+
import { ClientCapabilities } from './capabilities';
|
|
17
|
+
|
|
17
18
|
export default (context: PluginContext) =>
|
|
18
19
|
contributes(
|
|
19
20
|
Capabilities.AppGraphBuilder,
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { Client } from '@dxos/react-client';
|
|
7
7
|
|
|
8
|
-
import { ClientCapabilities } from './capabilities';
|
|
9
8
|
import { ClientEvents } from '../events';
|
|
10
9
|
import { type ClientPluginOptions } from '../types';
|
|
11
10
|
|
|
11
|
+
import { ClientCapabilities } from './capabilities';
|
|
12
|
+
|
|
12
13
|
type ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {
|
|
13
14
|
context: PluginContext;
|
|
14
15
|
};
|
|
@@ -16,7 +17,7 @@ type ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationU
|
|
|
16
17
|
export default async ({ context, onClientInitialized, onSpacesReady, ...options }: ClientCapabilityOptions) => {
|
|
17
18
|
const client = new Client(options);
|
|
18
19
|
await client.initialize();
|
|
19
|
-
await onClientInitialized?.(context, client);
|
|
20
|
+
await onClientInitialized?.({ context, client });
|
|
20
21
|
|
|
21
22
|
// TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.
|
|
22
23
|
client.reloaded.on(() => {
|
|
@@ -27,10 +28,11 @@ export default async ({ context, onClientInitialized, onSpacesReady, ...options
|
|
|
27
28
|
});
|
|
28
29
|
});
|
|
29
30
|
|
|
31
|
+
// TODO(burdon): The callback isn't called?
|
|
30
32
|
const subscription = client.spaces.isReady.subscribe(async (ready) => {
|
|
31
33
|
if (ready) {
|
|
32
34
|
await context.activatePromise(ClientEvents.SpacesReady);
|
|
33
|
-
await onSpacesReady?.(context, client);
|
|
35
|
+
await onSpacesReady?.({ context, client });
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
|
|
@@ -6,23 +6,24 @@ import { pipe } from 'effect';
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
Capabilities,
|
|
9
|
+
LayoutAction,
|
|
10
|
+
type PluginContext,
|
|
9
11
|
chain,
|
|
10
12
|
contributes,
|
|
11
13
|
createIntent,
|
|
12
14
|
createResolver,
|
|
13
|
-
LayoutAction,
|
|
14
|
-
type PluginContext,
|
|
15
15
|
} from '@dxos/app-framework';
|
|
16
16
|
import { invariant } from '@dxos/invariant';
|
|
17
17
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
18
18
|
import { PublicKey } from '@dxos/react-client';
|
|
19
19
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
20
20
|
|
|
21
|
-
import { ClientCapabilities } from './capabilities';
|
|
22
21
|
import { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../components';
|
|
23
22
|
import { ClientEvents } from '../events';
|
|
24
23
|
import { Account, ClientAction } from '../types';
|
|
25
24
|
|
|
25
|
+
import { ClientCapabilities } from './capabilities';
|
|
26
|
+
|
|
26
27
|
type IntentResolverOptions = {
|
|
27
28
|
context: PluginContext;
|
|
28
29
|
appName?: string;
|
|
@@ -173,7 +174,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
173
174
|
challenge: new Uint8Array(),
|
|
174
175
|
rp: { id: location.hostname, name: appName },
|
|
175
176
|
user: {
|
|
176
|
-
id: lookupKey.asUint8Array()
|
|
177
|
+
id: lookupKey.asUint8Array() as Uint8Array<ArrayBuffer>,
|
|
177
178
|
name: identity.did,
|
|
178
179
|
displayName: identity.profile?.displayName ?? '',
|
|
179
180
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { ClientCapabilities } from './capabilities';
|
|
8
8
|
|
|
@@ -7,9 +7,10 @@ import React from 'react';
|
|
|
7
7
|
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { ClientProvider } from '@dxos/react-client';
|
|
9
9
|
|
|
10
|
-
import { ClientCapabilities } from './capabilities';
|
|
11
10
|
import { CLIENT_PLUGIN } from '../meta';
|
|
12
11
|
|
|
12
|
+
import { ClientCapabilities } from './capabilities';
|
|
13
|
+
|
|
13
14
|
export default () =>
|
|
14
15
|
contributes(Capabilities.ReactContext, {
|
|
15
16
|
id: CLIENT_PLUGIN,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
8
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
JoinDialog,
|
|
14
14
|
ProfileContainer,
|
|
15
15
|
RECOVERY_CODE_DIALOG,
|
|
16
|
+
RESET_DIALOG,
|
|
16
17
|
RecoveryCodeDialog,
|
|
18
|
+
type RecoveryCodeDialogProps,
|
|
17
19
|
RecoveryCredentialsContainer,
|
|
18
|
-
RESET_DIALOG,
|
|
19
20
|
ResetDialog,
|
|
20
21
|
type ResetDialogProps,
|
|
21
|
-
type RecoveryCodeDialogProps,
|
|
22
22
|
} from '../components';
|
|
23
23
|
import { Account, type ClientPluginOptions } from '../types';
|
|
24
24
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { type Type } from '@dxos/echo';
|
|
7
7
|
|
|
8
8
|
import { ClientCapabilities } from './capabilities';
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
|
|
9
9
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
12
|
-
import {
|
|
12
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
13
13
|
|
|
14
|
-
import { DevicesContainer } from './DevicesContainer';
|
|
15
14
|
import { ClientPlugin } from '../ClientPlugin';
|
|
16
15
|
import { translations } from '../translations';
|
|
17
16
|
|
|
17
|
+
import { DevicesContainer } from './DevicesContainer';
|
|
18
|
+
|
|
18
19
|
const meta: Meta = {
|
|
19
20
|
title: 'plugins/plugin-client/DevicesContainer',
|
|
20
21
|
component: DevicesContainer,
|
|
@@ -22,7 +23,7 @@ const meta: Meta = {
|
|
|
22
23
|
withPluginManager({
|
|
23
24
|
plugins: [
|
|
24
25
|
ClientPlugin({
|
|
25
|
-
onClientInitialized: async (
|
|
26
|
+
onClientInitialized: async ({ client }) => {
|
|
26
27
|
await client.halo.createIdentity();
|
|
27
28
|
},
|
|
28
29
|
}),
|
|
@@ -11,7 +11,7 @@ import { useClient, useMulticastObservable } from '@dxos/react-client';
|
|
|
11
11
|
import { type Device, useDevices } from '@dxos/react-client/halo';
|
|
12
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
13
13
|
import { useNetworkStatus } from '@dxos/react-client/mesh';
|
|
14
|
-
import { Button, Clipboard, IconButton, List, useId, useTranslation
|
|
14
|
+
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from '@dxos/react-ui';
|
|
15
15
|
import {
|
|
16
16
|
ControlFrame,
|
|
17
17
|
ControlFrameItem,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
9
9
|
import { type InvitationResult } from '@dxos/react-client/invitations';
|
|
10
10
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
|
|
9
9
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
10
|
-
import {
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
11
11
|
|
|
12
|
-
import { ProfileContainer } from './ProfileContainer';
|
|
13
12
|
import { translations } from '../translations';
|
|
14
13
|
|
|
14
|
+
import { ProfileContainer } from './ProfileContainer';
|
|
15
|
+
|
|
15
16
|
const meta: Meta = {
|
|
16
17
|
title: 'plugins/plugin-client/ProfileContainer',
|
|
17
18
|
component: ProfileContainer,
|
|
@@ -10,16 +10,16 @@ import { useClient } from '@dxos/react-client';
|
|
|
10
10
|
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
11
11
|
import { ButtonGroup, Clipboard, Input, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import {
|
|
13
|
-
Form,
|
|
14
|
-
type InputComponent,
|
|
15
13
|
ControlItem,
|
|
16
14
|
ControlItemInput,
|
|
17
|
-
ControlSection,
|
|
18
15
|
ControlPage,
|
|
16
|
+
ControlSection,
|
|
17
|
+
Form,
|
|
18
|
+
type InputComponent,
|
|
19
19
|
} from '@dxos/react-ui-form';
|
|
20
20
|
import { EmojiPickerBlock, HuePicker } from '@dxos/react-ui-pickers';
|
|
21
21
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
22
|
-
import {
|
|
22
|
+
import { hexToEmoji, hexToHue } from '@dxos/util';
|
|
23
23
|
|
|
24
24
|
import { CLIENT_PLUGIN } from '../meta';
|
|
25
25
|
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { AlertDialog, useAsyncEffect } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
|
|
15
|
-
import { RecoveryCodeDialog, type RecoveryCodeDialogProps } from './RecoveryCodeDialog';
|
|
16
15
|
import { translations } from '../translations';
|
|
17
16
|
|
|
17
|
+
import { RecoveryCodeDialog, type RecoveryCodeDialogProps } from './RecoveryCodeDialog';
|
|
18
|
+
|
|
18
19
|
const DefaultStory = () => {
|
|
19
20
|
const client = useClient();
|
|
20
21
|
const [recoveryCode, setRecoveryCode] = useState<string>();
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
|
|
9
9
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
-
import {
|
|
11
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
-
import { RecoveryCredentialsContainer } from './RecoveryCredentialsContainer';
|
|
14
13
|
import { ClientPlugin } from '../ClientPlugin';
|
|
15
14
|
import { translations } from '../translations';
|
|
16
15
|
|
|
16
|
+
import { RecoveryCredentialsContainer } from './RecoveryCredentialsContainer';
|
|
17
|
+
|
|
17
18
|
const meta: Meta = {
|
|
18
19
|
title: 'plugins/plugin-client/RecoveryCredentialsContainer',
|
|
19
20
|
component: RecoveryCredentialsContainer,
|
|
@@ -21,7 +22,7 @@ const meta: Meta = {
|
|
|
21
22
|
withPluginManager({
|
|
22
23
|
plugins: [
|
|
23
24
|
ClientPlugin({
|
|
24
|
-
onClientInitialized: async (
|
|
25
|
+
onClientInitialized: async ({ client }) => {
|
|
25
26
|
await client.halo.createIdentity();
|
|
26
27
|
},
|
|
27
28
|
}),
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { useCredentials } from '@dxos/react-client/halo';
|
|
9
|
-
import { Icon, IconButton, List, ListItem,
|
|
9
|
+
import { Icon, IconButton, List, ListItem, Message, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { ControlGroup, ControlItem, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
11
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
12
|
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import { Dialog } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
|
|
15
|
-
import { ResetDialog, type ResetDialogProps } from './ResetDialog';
|
|
16
15
|
import { translations } from '../translations';
|
|
17
16
|
|
|
17
|
+
import { ResetDialog, type ResetDialogProps } from './ResetDialog';
|
|
18
|
+
|
|
18
19
|
const Render = (props: ResetDialogProps) => {
|
|
19
20
|
return (
|
|
20
21
|
<Dialog.Root open>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
9
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { ConfirmReset, type ConfirmResetProps } from '@dxos/shell/react';
|
package/src/types/schema.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
7
|
import { type PluginContext } from '@dxos/app-framework';
|
|
8
|
-
import { type Client,
|
|
8
|
+
import { type Client, type ClientOptions, PublicKey } from '@dxos/react-client';
|
|
9
9
|
import { type MaybePromise } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { meta } from '../meta';
|
|
@@ -104,12 +104,12 @@ export type ClientPluginOptions = ClientOptions & {
|
|
|
104
104
|
/**
|
|
105
105
|
* Run after the client has been initialized.
|
|
106
106
|
*/
|
|
107
|
-
onClientInitialized?: (context: PluginContext
|
|
107
|
+
onClientInitialized?: (params: { context: PluginContext; client: Client }) => MaybePromise<void>;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Called when spaces are ready.
|
|
111
111
|
*/
|
|
112
|
-
onSpacesReady?: (context: PluginContext
|
|
112
|
+
onSpacesReady?: (params: { context: PluginContext; client: Client }) => MaybePromise<void>;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Called when the client is reset.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { createIntent } from '@dxos/app-framework';\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\nimport { createExtension, rxFromObservable, ROOT_ID } from '@dxos/plugin-graph';\nimport { ConnectionState } from '@dxos/react-client/mesh';\n\nimport { ClientCapabilities } from './capabilities';\nimport { CLIENT_PLUGIN } from '../meta';\nimport { Account, ClientAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: CLIENT_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n return [\n {\n id: `${CLIENT_PLUGIN}/open-user-account`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open user account label', { ns: CLIENT_PLUGIN }],\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 }),\n Option.getOrElse(() => []),\n ),\n ),\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const client = context.getCapability(ClientCapabilities.Client);\n const identity = get(rxFromObservable(client.halo.identity));\n const status = get(rxFromObservable(client.mesh.networkStatus));\n\n return [\n {\n id: Account.id,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['account label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--user--regular',\n disposition: 'user-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: CLIENT_PLUGIN,\n properties: {\n label: ['profile label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--user--regular',\n },\n },\n {\n id: Account.Devices,\n data: Account.Devices,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['devices label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--devices--regular',\n testId: 'clientPlugin.devices',\n },\n },\n {\n id: Account.Security,\n data: Account.Security,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['security label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--key--regular',\n },\n },\n ],\n },\n ];\n }),\n Option.getOrElse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AC1D,UAAMG,SAASjC,IAAI+B,iBAAiBJ,OAAOO,KAAKC,aAAa,CAAA;AAE7D,WAAO;MACL;QACEzC,IAAI0C,QAAQ1C;QACZ2C,MAAM1C;QACNqB,YAAY;UACVC,OAAO;YAAC;YAAiB;cAAEC,IAAIvB;YAAc;;UAC7CwB,MAAM;UACNC,aAAa;;UAEbkB,QAAQR,UAAUS,YAAYC,MAAAA;UAC9BC,KAAKX,UAAUY,SAASlC,MAAMiC;UAC9BE,OAAOb,UAAUY,SAASlC,MAAMmC;UAChCV,QAAQA,OAAOW,UAAUC,gBAAgBC,UAAU,UAAU;QAC/D;QACAC,OAAO;UACL;YACErD,IAAI0C,QAAQY;YACZxC,MAAM4B,QAAQY;YACdX,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAIvB;gBAAc;;cAC7CwB,MAAM;YACR;UACF;UACA;YACEzB,IAAI0C,QAAQa;YACZzC,MAAM4B,QAAQa;YACdZ,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAIvB;gBAAc;;cAC7CwB,MAAM;cACN+B,QAAQ;YACV;UACF;UACA;YACExD,IAAI0C,QAAQe;YACZ3C,MAAM4B,QAAQe;YACdd,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAkB;kBAAEC,IAAIvB;gBAAc;;cAC9CwB,MAAM;YACR;UACF;;MAEJ;;EAEJ,CAAA,GACAjB,OAAOuB,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "createIntent", "Capabilities", "contributes", "createExtension", "rxFromObservable", "ROOT_ID", "ConnectionState", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "CLIENT_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "linux", "getOrElse", "connector", "client", "ClientCapabilities", "Client", "identity", "rxFromObservable", "halo", "status", "mesh", "networkStatus", "Account", "type", "userId", "identityKey", "toHex", "hue", "profile", "emoji", "swarm", "ConnectionState", "OFFLINE", "nodes", "Profile", "Devices", "testId", "Security"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/client.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginContext } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginContext;\n};\n\nexport default async ({ context, onClientInitialized, onSpacesReady, ...options }: ClientCapabilityOptions) => {\n const client = new Client(options);\n await client.initialize();\n await onClientInitialized?.(context, client);\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 const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activatePromise(ClientEvents.SpacesReady);\n await onSpacesReady?.(context, client);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,SAASA,mBAAuC;AAChD,SAASC,cAAc;AAUvB,IAAA,iBAAe,OAAO,EAAEC,SAASC,qBAAqBC,eAAe,GAAGC,QAAAA,MAAkC;AACxG,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAML,sBAAsBD,SAASI,MAAAA;AAGrCA,SAAOG,SAASC,GAAG,MAAA;AACjBJ,WAAOK,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,UAAIA,UAAU;AACZE,eAAOC,SAASC,OAAOF,OAAOC,SAASE;MACzC;IACF,CAAA;EACF,CAAA;AAEA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMnB,QAAQoB,gBAAgBC,aAAaC,WAAW;AACtD,YAAMpB,gBAAgBF,SAASI,MAAAA;IACjC;EACF,CAAA;AAEA,SAAOmB,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
|
|
6
|
-
"names": ["contributes", "Client", "context", "onClientInitialized", "onSpacesReady", "options", "client", "Client", "initialize", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activatePromise", "ClientEvents", "SpacesReady", "contributes", "ClientCapabilities", "unsubscribe", "destroy"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { pipe } from 'effect';\n\nimport {\n Capabilities,\n chain,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { Account, ClientAction } from '../types';\n\ntype IntentResolverOptions = {\n context: PluginContext;\n appName?: string;\n};\n\nconst RECOVER_IDENTITY_RPC_TIMEOUT = 20_000;\n\nexport default ({ context, appName = 'Composer' }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: async (profile) => {\n const manager = context.getCapability(Capabilities.PluginManager);\n const client = context.getCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity(profile);\n await manager.activate(ClientEvents.IdentityCreated);\n return {\n data,\n intents: [\n createIntent(ObservabilityAction.SendEvent, {\n name: 'identity.create',\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n pipe(\n createIntent(LayoutAction.SwitchWorkspace, {\n part: 'workspace',\n subject: Account.id,\n }),\n chain(LayoutAction.Open, {\n part: 'main',\n subject: [Account.Profile],\n }),\n ),\n createIntent(ObservabilityAction.SendEvent, {\n name: 'identity.share',\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RESET_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n mode: data.mode ?? 'reset storage',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n },\n }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVERY_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const lookupKey = PublicKey.random();\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array(),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n await client.services.services.IdentityService.recoverIdentity(\n {\n external: {\n lookupKey,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n },\n { timeout: RECOVER_IDENTITY_RPC_TIMEOUT },\n );\n },\n }),\n createResolver({\n intent: ClientAction.RedeemToken,\n resolve: async (data) => {\n const client = context.getCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.recoverIdentity(\n { token: data.token },\n { timeout: RECOVER_IDENTITY_RPC_TIMEOUT },\n );\n },\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAIA,SAASA,YAAY;AAErB,SACEC,cACAC,OACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAa1B,IAAMC,+BAA+B;AAErC,IAAA,0BAAe,CAAC,EAAEC,SAASC,UAAU,WAAU,MAC7CC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,aAAaC;IACrBC,SAAS,OAAOC,YAAAA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ACA6B;UACAC;UACAQ,WAAWN,OAAOT,KAAMpB,WAAmBqB,SAASc,SAAS;UAC7DC,gBAAgBP,OAAOT,KAAMpB,WAAmBqB,SAASgB,cAAc;UACvEC,mBAAmBT,OAAOT,KAAMpB,WAAmBqB,SAASiB,iBAAiB;QAC/E;MACF,GACA;QAAEpD,SAAS1D;MAA6B,CAAA;IAE5C;EACF,CAAA;EACAM,eAAe;IACbC,QAAQC,aAAauG;IACrBrG,SAAS,OAAOQ,SAAAA;AACd,YAAMH,SAASd,QAAQY,cAAcG,mBAAmBC,MAAM;AAE9DqC,gBAAUvC,OAAOwC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAM7C,OAAOwC,SAASA,SAASK,gBAAgB6C,gBAC7C;QAAEO,OAAO9F,KAAK8F;MAAM,GACpB;QAAEtD,SAAS1D;MAA6B,CAAA;IAE5C;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["pipe", "Capabilities", "chain", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "RECOVER_IDENTITY_RPC_TIMEOUT", "context", "appName", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "profile", "manager", "getCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "pipe", "SwitchWorkspace", "Account", "id", "chain", "Open", "Profile", "RecoverIdentity", "ResetStorage", "RESET_DIALOG", "mode", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVERY_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "location", "hostname", "user", "asUint8Array", "did", "displayName", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData", "RedeemToken", "token"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { createIntent } from '@dxos/app-framework';\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\nimport { createExtension, rxFromObservable, ROOT_ID } from '@dxos/plugin-graph';\nimport { ConnectionState } from '@dxos/react-client/mesh';\n\nimport { ClientCapabilities } from './capabilities';\nimport { CLIENT_PLUGIN } from '../meta';\nimport { Account, ClientAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: CLIENT_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n return [\n {\n id: `${CLIENT_PLUGIN}/open-user-account`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open user account label', { ns: CLIENT_PLUGIN }],\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 }),\n Option.getOrElse(() => []),\n ),\n ),\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const client = context.getCapability(ClientCapabilities.Client);\n const identity = get(rxFromObservable(client.halo.identity));\n const status = get(rxFromObservable(client.mesh.networkStatus));\n\n return [\n {\n id: Account.id,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['account label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--user--regular',\n disposition: 'user-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: CLIENT_PLUGIN,\n properties: {\n label: ['profile label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--user--regular',\n },\n },\n {\n id: Account.Devices,\n data: Account.Devices,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['devices label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--devices--regular',\n testId: 'clientPlugin.devices',\n },\n },\n {\n id: Account.Security,\n data: Account.Security,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['security label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--key--regular',\n },\n },\n ],\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,oBAAoB;AAC7B,SAASC,cAAcC,mBAAuC;AAC9D,SAASC,iBAAiBC,kBAAkBC,eAAe;AAC3D,SAASC,uBAAuB;AAMhC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;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ASlC,MAAMiC;UAC9BE,OAAOb,UAAUY,SAASlC,MAAMmC;UAChCV,QAAQA,OAAOW,UAAUC,gBAAgBC,UAAU,UAAU;QAC/D;QACAC,OAAO;UACL;YACErD,IAAI0C,QAAQY;YACZxC,MAAM4B,QAAQY;YACdX,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAIvB;gBAAc;;cAC7CwB,MAAM;YACR;UACF;UACA;YACEzB,IAAI0C,QAAQa;YACZzC,MAAM4B,QAAQa;YACdZ,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAIvB;gBAAc;;cAC7CwB,MAAM;cACN+B,QAAQ;YACV;UACF;UACA;YACExD,IAAI0C,QAAQe;YACZ3C,MAAM4B,QAAQe;YACdd,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAkB;kBAAEC,IAAIvB;gBAAc;;cAC9CwB,MAAM;YACR;UACF;;MAEJ;;EAEJ,CAAA,GACAjB,OAAOuB,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "createIntent", "Capabilities", "contributes", "createExtension", "rxFromObservable", "ROOT_ID", "ConnectionState", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "CLIENT_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "linux", "getOrElse", "connector", "client", "ClientCapabilities", "Client", "identity", "rxFromObservable", "halo", "status", "mesh", "networkStatus", "Account", "type", "userId", "identityKey", "toHex", "hue", "profile", "emoji", "swarm", "ConnectionState", "OFFLINE", "nodes", "Profile", "Devices", "testId", "Security"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/client.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginContext } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginContext;\n};\n\nexport default async ({ context, onClientInitialized, onSpacesReady, ...options }: ClientCapabilityOptions) => {\n const client = new Client(options);\n await client.initialize();\n await onClientInitialized?.(context, client);\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 const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activatePromise(ClientEvents.SpacesReady);\n await onSpacesReady?.(context, client);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,SAASA,mBAAuC;AAChD,SAASC,cAAc;AAUvB,IAAA,iBAAe,OAAO,EAAEC,SAASC,qBAAqBC,eAAe,GAAGC,QAAAA,MAAkC;AACxG,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAML,sBAAsBD,SAASI,MAAAA;AAGrCA,SAAOG,SAASC,GAAG,MAAA;AACjBJ,WAAOK,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,UAAIA,UAAU;AACZE,eAAOC,SAASC,OAAOF,OAAOC,SAASE;MACzC;IACF,CAAA;EACF,CAAA;AAEA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMnB,QAAQoB,gBAAgBC,aAAaC,WAAW;AACtD,YAAMpB,gBAAgBF,SAASI,MAAAA;IACjC;EACF,CAAA;AAEA,SAAOmB,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
|
|
6
|
-
"names": ["contributes", "Client", "context", "onClientInitialized", "onSpacesReady", "options", "client", "Client", "initialize", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activatePromise", "ClientEvents", "SpacesReady", "contributes", "ClientCapabilities", "unsubscribe", "destroy"]
|
|
7
|
-
}
|