@dxos/plugin-client 0.8.4-main.21d9917 → 0.8.4-main.2244d791bb
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-3FGBMLTF.mjs → app-graph-builder-DTETNB5U.mjs} +4 -3
- package/dist/lib/browser/app-graph-builder-DTETNB5U.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F7H2Y3Z2.mjs → chunk-MY6BJCB6.mjs} +4 -4
- package/dist/lib/browser/cli/index.mjs +22 -21
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{client-IX5LMWV4.mjs → client-XOQQ5POJ.mjs} +3 -3
- package/dist/lib/browser/client-XOQQ5POJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +20 -19
- 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-YNQ7L5GT.mjs} +4 -4
- package/dist/lib/browser/migrations-YNQ7L5GT.mjs.map +7 -0
- package/dist/lib/browser/{operation-resolver-2NT3ISVP.mjs → operation-resolver-N4YCJ4KS.mjs} +18 -17
- package/dist/lib/browser/operation-resolver-N4YCJ4KS.mjs.map +7 -0
- package/dist/lib/browser/{react-context-4UABG3GP.mjs → react-context-FDXHIBZL.mjs} +4 -4
- package/dist/lib/browser/react-context-FDXHIBZL.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-RSQ74XCT.mjs → react-surface-ZP3FLVRS.mjs} +50 -49
- package/dist/lib/browser/react-surface-ZP3FLVRS.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-O7VLP745.mjs → schema-defs-AYXOYD2M.mjs} +6 -5
- package/dist/lib/browser/schema-defs-AYXOYD2M.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-2PIYVUNC.mjs → app-graph-builder-PFKVFRXI.mjs} +4 -3
- package/dist/lib/node-esm/app-graph-builder-PFKVFRXI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BCELGXRI.mjs → chunk-MUOMX53G.mjs} +4 -4
- package/dist/lib/node-esm/cli/index.mjs +22 -21
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{client-FFPK5UFP.mjs → client-3YIMWKR7.mjs} +3 -3
- package/dist/lib/node-esm/client-3YIMWKR7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +20 -19
- 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-ZH5GNG4U.mjs} +4 -4
- package/dist/lib/node-esm/migrations-ZH5GNG4U.mjs.map +7 -0
- package/dist/lib/node-esm/{operation-resolver-VW5R2BE4.mjs → operation-resolver-CHGWI5P2.mjs} +18 -17
- package/dist/lib/node-esm/operation-resolver-CHGWI5P2.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-UVXMGPW4.mjs → react-context-7Z2TVUTV.mjs} +4 -4
- package/dist/lib/node-esm/react-context-7Z2TVUTV.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-KBHANGGC.mjs → react-surface-BHJMHIMH.mjs} +50 -49
- package/dist/lib/node-esm/react-surface-BHJMHIMH.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-QLRGBIKY.mjs → schema-defs-TV2SCKSH.mjs} +6 -5
- package/dist/lib/node-esm/schema-defs-TV2SCKSH.mjs.map +7 -0
- package/dist/types/src/ClientPlugin.d.ts.map +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.map +1 -1
- package/dist/types/src/capabilities/client/index.d.ts +1 -0
- package/dist/types/src/capabilities/client/index.d.ts.map +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.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.map +1 -1
- package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.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.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.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/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -34
- package/src/ClientPlugin.ts +9 -8
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +3 -2
- package/src/capabilities/client/client.ts +2 -2
- package/src/capabilities/migrations/migrations.ts +3 -3
- package/src/capabilities/operation-resolver/operation-resolver.ts +10 -9
- package/src/capabilities/react-context/react-context.tsx +3 -3
- package/src/capabilities/react-surface/react-surface.tsx +9 -8
- package/src/capabilities/schema-defs/schema-defs.ts +5 -4
- package/src/cli/commands/halo/create/create.ts +2 -2
- package/src/cli/plugin.ts +7 -6
- package/src/components/DevicesContainer.stories.tsx +3 -2
- package/src/components/DevicesContainer.tsx +26 -36
- package/src/components/JoinDialog.tsx +3 -3
- package/src/components/ProfileContainer.stories.tsx +1 -1
- package/src/components/ProfileContainer.tsx +17 -25
- package/src/components/RecoveryCodeDialog.stories.tsx +1 -1
- package/src/components/RecoveryCredentialsContainer.stories.tsx +1 -1
- package/src/components/RecoveryCredentialsContainer.tsx +14 -14
- package/src/components/ResetDialog.stories.tsx +22 -10
- package/src/components/ResetDialog.tsx +11 -8
- package/src/translations.ts +1 -1
- package/dist/lib/browser/app-graph-builder-3FGBMLTF.mjs.map +0 -7
- 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.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/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.map +0 -7
- package/dist/lib/node-esm/schema-defs-QLRGBIKY.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-F7H2Y3Z2.mjs.map → chunk-MY6BJCB6.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-BCELGXRI.mjs.map → chunk-MUOMX53G.mjs.map} +0 -0
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.2244d791bb",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -44,35 +44,36 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@effect/cli": "0.
|
|
48
|
-
"@effect/platform": "0.
|
|
49
|
-
"effect": "3.19.
|
|
47
|
+
"@effect/cli": "0.73.2",
|
|
48
|
+
"@effect/platform": "0.94.4",
|
|
49
|
+
"effect": "3.19.16",
|
|
50
50
|
"react-qr-rounded": "^1.0.0",
|
|
51
51
|
"yaml": "^2.7.0",
|
|
52
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/client-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/echo": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/invariant": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/plugin-
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
52
|
+
"@dxos/app-framework": "0.8.4-main.2244d791bb",
|
|
53
|
+
"@dxos/app-toolkit": "0.8.4-main.2244d791bb",
|
|
54
|
+
"@dxos/cli-util": "0.8.4-main.2244d791bb",
|
|
55
|
+
"@dxos/async": "0.8.4-main.2244d791bb",
|
|
56
|
+
"@dxos/client-services": "0.8.4-main.2244d791bb",
|
|
57
|
+
"@dxos/client-protocol": "0.8.4-main.2244d791bb",
|
|
58
|
+
"@dxos/client": "0.8.4-main.2244d791bb",
|
|
59
|
+
"@dxos/config": "0.8.4-main.2244d791bb",
|
|
60
|
+
"@dxos/echo": "0.8.4-main.2244d791bb",
|
|
61
|
+
"@dxos/effect": "0.8.4-main.2244d791bb",
|
|
62
|
+
"@dxos/invariant": "0.8.4-main.2244d791bb",
|
|
63
|
+
"@dxos/log": "0.8.4-main.2244d791bb",
|
|
64
|
+
"@dxos/operation": "0.8.4-main.2244d791bb",
|
|
65
|
+
"@dxos/plugin-graph": "0.8.4-main.2244d791bb",
|
|
66
|
+
"@dxos/protocols": "0.8.4-main.2244d791bb",
|
|
67
|
+
"@dxos/react-client": "0.8.4-main.2244d791bb",
|
|
68
|
+
"@dxos/react-ui-form": "0.8.4-main.2244d791bb",
|
|
69
|
+
"@dxos/plugin-observability": "0.8.4-main.2244d791bb",
|
|
70
|
+
"@dxos/react-ui-stack": "0.8.4-main.2244d791bb",
|
|
71
|
+
"@dxos/react-ui-pickers": "0.8.4-main.2244d791bb",
|
|
72
|
+
"@dxos/shell": "0.8.4-main.2244d791bb",
|
|
73
|
+
"@dxos/util": "0.8.4-main.2244d791bb"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
|
-
"@effect-atom/atom-react": "^0.
|
|
76
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
76
77
|
"@effect/printer": "0.47.0",
|
|
77
78
|
"@effect/printer-ansi": "0.47.0",
|
|
78
79
|
"@types/react": "~19.2.7",
|
|
@@ -80,18 +81,18 @@
|
|
|
80
81
|
"react": "~19.2.3",
|
|
81
82
|
"react-dom": "~19.2.3",
|
|
82
83
|
"vite": "7.1.9",
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
85
|
-
"@dxos/
|
|
84
|
+
"@dxos/storybook-utils": "0.8.4-main.2244d791bb",
|
|
85
|
+
"@dxos/react-ui": "0.8.4-main.2244d791bb",
|
|
86
|
+
"@dxos/ui-theme": "0.8.4-main.2244d791bb"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
|
-
"@effect-atom/atom-react": "^0.
|
|
89
|
-
"@effect/platform": "0.
|
|
90
|
-
"effect": "3.19.
|
|
89
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
90
|
+
"@effect/platform": "0.94.4",
|
|
91
|
+
"effect": "3.19.16",
|
|
91
92
|
"react": "~19.2.3",
|
|
92
93
|
"react-dom": "~19.2.3",
|
|
93
|
-
"@dxos/ui
|
|
94
|
-
"@dxos/
|
|
94
|
+
"@dxos/react-ui": "0.8.4-main.2244d791bb",
|
|
95
|
+
"@dxos/ui-theme": "0.8.4-main.2244d791bb"
|
|
95
96
|
},
|
|
96
97
|
"publishConfig": {
|
|
97
98
|
"access": "public"
|
package/src/ClientPlugin.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ActivationEvent,
|
|
5
|
+
import { ActivationEvent, ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
AppGraphBuilder,
|
|
@@ -19,17 +20,21 @@ import { ClientEvents } from './types';
|
|
|
19
20
|
import { type ClientPluginOptions } from './types';
|
|
20
21
|
|
|
21
22
|
export const ClientPlugin = Plugin.define<ClientPluginOptions>(meta).pipe(
|
|
23
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
24
|
+
AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
25
|
+
AppPlugin.addReactContextModule({ activate: ReactContext }),
|
|
26
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
22
27
|
Plugin.addModule((options) => {
|
|
23
28
|
return {
|
|
24
29
|
id: Capability.getModuleTag(Client),
|
|
25
|
-
activatesOn: ActivationEvent.oneOf(
|
|
30
|
+
activatesOn: ActivationEvent.oneOf(ActivationEvents.Startup, AppActivationEvents.SetupAppGraph),
|
|
26
31
|
activatesAfter: [ClientEvents.ClientReady],
|
|
27
32
|
activate: () => Client(options),
|
|
28
33
|
};
|
|
29
34
|
}),
|
|
30
35
|
Plugin.addModule({
|
|
31
36
|
activatesOn: ClientEvents.ClientReady,
|
|
32
|
-
activatesBefore: [
|
|
37
|
+
activatesBefore: [AppActivationEvents.SetupSchema],
|
|
33
38
|
activate: SchemaDefs,
|
|
34
39
|
}),
|
|
35
40
|
Plugin.addModule({
|
|
@@ -37,7 +42,6 @@ export const ClientPlugin = Plugin.define<ClientPluginOptions>(meta).pipe(
|
|
|
37
42
|
activatesBefore: [ClientEvents.SetupMigration],
|
|
38
43
|
activate: Migrations,
|
|
39
44
|
}),
|
|
40
|
-
Common.Plugin.addReactContextModule({ activate: ReactContext }),
|
|
41
45
|
Plugin.addModule(({ invitationUrl = window.location.origin, invitationProp = 'deviceInvitationCode', onReset }) => {
|
|
42
46
|
const createInvitationUrl = (invitationCode: string) => {
|
|
43
47
|
const baseUrl = new URL(invitationUrl);
|
|
@@ -47,12 +51,9 @@ export const ClientPlugin = Plugin.define<ClientPluginOptions>(meta).pipe(
|
|
|
47
51
|
|
|
48
52
|
return {
|
|
49
53
|
id: Capability.getModuleTag(ReactSurface),
|
|
50
|
-
activatesOn:
|
|
54
|
+
activatesOn: ActivationEvents.SetupReactSurface,
|
|
51
55
|
activate: () => ReactSurface({ createInvitationUrl, onReset }),
|
|
52
56
|
};
|
|
53
57
|
}),
|
|
54
|
-
Common.Plugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
55
|
-
Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
56
|
-
Common.Plugin.addTranslationsModule({ translations }),
|
|
57
58
|
Plugin.make,
|
|
58
59
|
);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { Operation } from '@dxos/operation';
|
|
9
10
|
import { CreateAtom, GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
10
11
|
import { ConnectionState } from '@dxos/react-client/mesh';
|
|
@@ -90,6 +91,6 @@ export default Capability.makeModule(
|
|
|
90
91
|
}),
|
|
91
92
|
});
|
|
92
93
|
|
|
93
|
-
return Capability.contributes(
|
|
94
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
94
95
|
}),
|
|
95
96
|
);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
8
8
|
import { Client, ClientService } from '@dxos/client';
|
|
9
9
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
@@ -69,7 +69,7 @@ export default Capability.makeModule(
|
|
|
69
69
|
yield* Effect.tryPromise(() => client.destroy());
|
|
70
70
|
}),
|
|
71
71
|
),
|
|
72
|
-
Capability.contributes(
|
|
72
|
+
Capability.contributes(Capabilities.Layer, ClientService.fromClient(client)),
|
|
73
73
|
];
|
|
74
74
|
}),
|
|
75
75
|
);
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
9
|
import { ClientCapabilities } from '../../types';
|
|
10
10
|
|
|
11
11
|
export default Capability.makeModule(
|
|
12
12
|
Effect.fnUntraced(function* () {
|
|
13
|
-
const registry = yield* Capability.get(
|
|
13
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
14
14
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
15
15
|
const migrationsAtom = yield* Capability.atom(ClientCapabilities.Migration);
|
|
16
16
|
|
|
@@ -25,6 +25,6 @@ export default Capability.makeModule(
|
|
|
25
25
|
{ immediate: true },
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
return Capability.contributes(
|
|
28
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cancel()));
|
|
29
29
|
}),
|
|
30
30
|
);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
9
|
import { PublicKey } from '@dxos/client';
|
|
9
10
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
10
11
|
import { invariant } from '@dxos/invariant';
|
|
@@ -27,14 +28,14 @@ export default Capability.makeModule(
|
|
|
27
28
|
Effect.fnUntraced(function* (props?: OperationResolverOptions) {
|
|
28
29
|
const { appName = 'Composer' } = props ?? {};
|
|
29
30
|
|
|
30
|
-
return Capability.contributes(
|
|
31
|
+
return Capability.contributes(Capabilities.OperationResolver, [
|
|
31
32
|
//
|
|
32
33
|
// CreateIdentity
|
|
33
34
|
//
|
|
34
35
|
OperationResolver.make({
|
|
35
36
|
operation: ClientOperation.CreateIdentity,
|
|
36
37
|
handler: Effect.fnUntraced(function* (profile) {
|
|
37
|
-
const manager = yield* Capability.get(
|
|
38
|
+
const manager = yield* Capability.get(Capabilities.PluginManager);
|
|
38
39
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
39
40
|
const data = yield* Effect.promise(() => client.halo.createIdentity(profile));
|
|
40
41
|
yield* Effect.promise(() => runAndForwardErrors(manager.activate(ClientEvents.IdentityCreated)));
|
|
@@ -49,7 +50,7 @@ export default Capability.makeModule(
|
|
|
49
50
|
OperationResolver.make({
|
|
50
51
|
operation: ClientOperation.JoinIdentity,
|
|
51
52
|
handler: Effect.fnUntraced(function* (data) {
|
|
52
|
-
yield* Operation.invoke(
|
|
53
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
53
54
|
subject: JOIN_DIALOG,
|
|
54
55
|
blockAlign: 'start',
|
|
55
56
|
props: {
|
|
@@ -66,8 +67,8 @@ export default Capability.makeModule(
|
|
|
66
67
|
OperationResolver.make({
|
|
67
68
|
operation: ClientOperation.ShareIdentity,
|
|
68
69
|
handler: Effect.fnUntraced(function* () {
|
|
69
|
-
yield* Operation.invoke(
|
|
70
|
-
yield* Operation.invoke(
|
|
70
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: Account.id });
|
|
71
|
+
yield* Operation.invoke(LayoutOperation.Open, { subject: [Account.Profile] });
|
|
71
72
|
yield* Operation.schedule(ObservabilityOperation.SendEvent, { name: 'identity.share' });
|
|
72
73
|
}),
|
|
73
74
|
}),
|
|
@@ -78,7 +79,7 @@ export default Capability.makeModule(
|
|
|
78
79
|
OperationResolver.make({
|
|
79
80
|
operation: ClientOperation.RecoverIdentity,
|
|
80
81
|
handler: Effect.fnUntraced(function* () {
|
|
81
|
-
yield* Operation.invoke(
|
|
82
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
82
83
|
subject: JOIN_DIALOG,
|
|
83
84
|
blockAlign: 'start',
|
|
84
85
|
props: {
|
|
@@ -94,7 +95,7 @@ export default Capability.makeModule(
|
|
|
94
95
|
OperationResolver.make({
|
|
95
96
|
operation: ClientOperation.ResetStorage,
|
|
96
97
|
handler: Effect.fnUntraced(function* (data) {
|
|
97
|
-
yield* Operation.invoke(
|
|
98
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
98
99
|
subject: RESET_DIALOG,
|
|
99
100
|
blockAlign: 'start',
|
|
100
101
|
props: {
|
|
@@ -129,7 +130,7 @@ export default Capability.makeModule(
|
|
|
129
130
|
const { recoveryCode } = yield* Effect.promise(() =>
|
|
130
131
|
client.services.services.IdentityService!.createRecoveryCredential({}),
|
|
131
132
|
);
|
|
132
|
-
yield* Operation.invoke(
|
|
133
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
133
134
|
subject: RECOVERY_CODE_DIALOG,
|
|
134
135
|
blockAlign: 'start',
|
|
135
136
|
type: 'alert',
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { useCapability } from '@dxos/app-framework/
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
10
10
|
import { ClientProvider } from '@dxos/react-client';
|
|
11
11
|
|
|
12
12
|
import { meta } from '../../meta';
|
|
@@ -14,7 +14,7 @@ import { ClientCapabilities } from '../../types';
|
|
|
14
14
|
|
|
15
15
|
export default Capability.makeModule(() =>
|
|
16
16
|
Effect.succeed(
|
|
17
|
-
Capability.contributes(
|
|
17
|
+
Capability.contributes(Capabilities.ReactContext, {
|
|
18
18
|
id: meta.id,
|
|
19
19
|
context: ({ children }: { children?: React.ReactNode }) => {
|
|
20
20
|
const client = useCapability(ClientCapabilities.Client);
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
10
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
10
11
|
|
|
11
12
|
import {
|
|
@@ -30,38 +31,38 @@ export default Capability.makeModule(
|
|
|
30
31
|
const { createInvitationUrl, onReset } = props!;
|
|
31
32
|
const capabilityManager = yield* Capability.Service;
|
|
32
33
|
|
|
33
|
-
return Capability.contributes(
|
|
34
|
-
|
|
34
|
+
return Capability.contributes(Capabilities.ReactSurface, [
|
|
35
|
+
Surface.create({
|
|
35
36
|
id: Account.Profile,
|
|
36
37
|
role: 'article',
|
|
37
38
|
filter: (data): data is any => data.subject === Account.Profile,
|
|
38
39
|
component: () => <ProfileContainer />,
|
|
39
40
|
}),
|
|
40
|
-
|
|
41
|
+
Surface.create({
|
|
41
42
|
id: Account.Devices,
|
|
42
43
|
role: 'article',
|
|
43
44
|
filter: (data): data is any => data.subject === Account.Devices,
|
|
44
45
|
component: () => <DevicesContainer createInvitationUrl={createInvitationUrl} />,
|
|
45
46
|
}),
|
|
46
|
-
|
|
47
|
+
Surface.create({
|
|
47
48
|
id: Account.Security,
|
|
48
49
|
role: 'article',
|
|
49
50
|
filter: (data): data is any => data.subject === Account.Security,
|
|
50
51
|
component: () => <RecoveryCredentialsContainer />,
|
|
51
52
|
}),
|
|
52
|
-
|
|
53
|
+
Surface.create({
|
|
53
54
|
id: JOIN_DIALOG,
|
|
54
55
|
role: 'dialog',
|
|
55
56
|
filter: (data): data is { props: JoinPanelProps } => data.component === JOIN_DIALOG,
|
|
56
57
|
component: ({ data }: { data: any }) => <JoinDialog {...data.props} />,
|
|
57
58
|
}),
|
|
58
|
-
|
|
59
|
+
Surface.create({
|
|
59
60
|
id: RECOVERY_CODE_DIALOG,
|
|
60
61
|
role: 'dialog',
|
|
61
62
|
filter: (data): data is { props: RecoveryCodeDialogProps } => data.component === RECOVERY_CODE_DIALOG,
|
|
62
63
|
component: ({ data }: { data: any }) => <RecoveryCodeDialog {...data.props} />,
|
|
63
64
|
}),
|
|
64
|
-
|
|
65
|
+
Surface.create({
|
|
65
66
|
id: RESET_DIALOG,
|
|
66
67
|
role: 'dialog',
|
|
67
68
|
filter: (data): data is { props: ResetDialogProps } => data.component === RESET_DIALOG,
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { type Type } from '@dxos/echo';
|
|
9
10
|
|
|
10
11
|
import { ClientCapabilities } from '../../types';
|
|
11
12
|
|
|
12
13
|
export default Capability.makeModule(
|
|
13
14
|
Effect.fnUntraced(function* () {
|
|
14
|
-
const registry = yield* Capability.get(
|
|
15
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
15
16
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
16
|
-
const schemasAtom = yield* Capability.atom(
|
|
17
|
+
const schemasAtom = yield* Capability.atom(AppCapabilities.Schema);
|
|
17
18
|
|
|
18
19
|
// TODO(wittjosiah): Unregister schemas when they are disabled.
|
|
19
20
|
let previous: Type.Entity.Any[] = [];
|
|
@@ -30,6 +31,6 @@ export default Capability.makeModule(
|
|
|
30
31
|
{ immediate: true },
|
|
31
32
|
);
|
|
32
33
|
|
|
33
|
-
return Capability.contributes(
|
|
34
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cancel()));
|
|
34
35
|
}),
|
|
35
36
|
);
|
|
@@ -8,7 +8,7 @@ import * as Console from 'effect/Console';
|
|
|
8
8
|
import * as Effect from 'effect/Effect';
|
|
9
9
|
import * as Option from 'effect/Option';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Capabilities, Plugin } from '@dxos/app-framework';
|
|
12
12
|
import { CommandConfig, flushAndSync, spaceLayer } from '@dxos/cli-util';
|
|
13
13
|
import { print } from '@dxos/cli-util';
|
|
14
14
|
import { ClientService } from '@dxos/client';
|
|
@@ -30,7 +30,7 @@ export const handler = Effect.fn(function* ({
|
|
|
30
30
|
invariant(!client.halo.identity.get(), 'Identity already exists');
|
|
31
31
|
|
|
32
32
|
const manager = yield* Plugin.Service;
|
|
33
|
-
const { invoke } = manager.capabilities.get(
|
|
33
|
+
const { invoke } = manager.capabilities.get(Capabilities.OperationInvoker);
|
|
34
34
|
const identity = yield* invoke(ClientOperation.CreateIdentity, {
|
|
35
35
|
displayName: Option.getOrUndefined(displayName),
|
|
36
36
|
});
|
package/src/cli/plugin.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
8
|
// NOTE: Must not import from index to avoid pulling in react dependencies.
|
|
8
9
|
import { Client } from '../capabilities/client';
|
|
@@ -15,19 +16,19 @@ import { type ClientPluginOptions } from '../types';
|
|
|
15
16
|
import { config, device, edge, halo, profile } from './commands';
|
|
16
17
|
|
|
17
18
|
export const ClientPlugin = Plugin.define<ClientPluginOptions>(meta).pipe(
|
|
19
|
+
// TODO(wittjosiah): Could some of these commands make use of operations?
|
|
20
|
+
AppPlugin.addCommandModule({ commands: [config, device, edge, halo, profile] }),
|
|
21
|
+
AppPlugin.addOperationResolverModule({ activate: () => OperationResolver() }),
|
|
18
22
|
Plugin.addModule((options) => ({
|
|
19
23
|
id: Capability.getModuleTag(Client),
|
|
20
|
-
activatesOn:
|
|
24
|
+
activatesOn: ActivationEvents.Startup,
|
|
21
25
|
activatesAfter: [ClientEvents.ClientReady],
|
|
22
26
|
activate: () => Client(options),
|
|
23
27
|
})),
|
|
24
28
|
Plugin.addModule({
|
|
25
29
|
activatesOn: ClientEvents.ClientReady,
|
|
26
|
-
activatesBefore: [
|
|
30
|
+
activatesBefore: [AppActivationEvents.SetupSchema],
|
|
27
31
|
activate: SchemaDefs,
|
|
28
32
|
}),
|
|
29
|
-
// TODO(wittjosiah): Could some of these commands make use of operations?
|
|
30
|
-
Common.Plugin.addCommandModule({ commands: [config, device, edge, halo, profile] }),
|
|
31
|
-
Common.Plugin.addOperationResolverModule({ activate: () => OperationResolver() }),
|
|
32
33
|
Plugin.make,
|
|
33
34
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import { OperationPlugin } from '@dxos/app-framework';
|
|
8
|
+
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
11
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
@@ -19,7 +19,7 @@ const meta = {
|
|
|
19
19
|
title: 'plugins/plugin-client/DevicesContainer',
|
|
20
20
|
component: DevicesContainer,
|
|
21
21
|
decorators: [
|
|
22
|
-
withTheme,
|
|
22
|
+
withTheme(),
|
|
23
23
|
withPluginManager({
|
|
24
24
|
plugins: [
|
|
25
25
|
ClientPlugin({
|
|
@@ -29,6 +29,7 @@ const meta = {
|
|
|
29
29
|
}),
|
|
30
30
|
}),
|
|
31
31
|
OperationPlugin(),
|
|
32
|
+
RuntimePlugin(),
|
|
32
33
|
],
|
|
33
34
|
}),
|
|
34
35
|
],
|
|
@@ -5,23 +5,15 @@
|
|
|
5
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
import { QR } from 'react-qr-rounded';
|
|
7
7
|
|
|
8
|
-
import { useOperationInvoker } from '@dxos/app-framework/
|
|
8
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
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
14
|
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from '@dxos/react-ui';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
ControlFrameItem,
|
|
18
|
-
ControlGroup,
|
|
19
|
-
ControlItem,
|
|
20
|
-
ControlPage,
|
|
21
|
-
ControlSection,
|
|
22
|
-
} from '@dxos/react-ui-form';
|
|
23
|
-
import { translationKey } from '@dxos/shell/react';
|
|
24
|
-
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from '@dxos/shell/react';
|
|
15
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
16
|
+
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport, translationKey } from '@dxos/shell/react';
|
|
25
17
|
import { osTranslations } from '@dxos/ui-theme';
|
|
26
18
|
import { hexToEmoji } from '@dxos/util';
|
|
27
19
|
|
|
@@ -52,57 +44,55 @@ export const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps)
|
|
|
52
44
|
|
|
53
45
|
return (
|
|
54
46
|
<Clipboard.Provider>
|
|
55
|
-
<
|
|
56
|
-
<
|
|
47
|
+
<Settings.Root>
|
|
48
|
+
<Settings.Section
|
|
57
49
|
title={t('devices verbose label', { ns: meta.id })}
|
|
58
50
|
description={t('devices description', { ns: meta.id })}
|
|
59
51
|
>
|
|
60
|
-
<
|
|
61
|
-
<
|
|
52
|
+
<Settings.Frame>
|
|
53
|
+
<Settings.FrameItem title={t('devices label', { ns: meta.id })}>
|
|
62
54
|
<List>
|
|
63
|
-
{devices.map((device: Device) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
67
|
-
})}
|
|
55
|
+
{devices.map((device: Device) => (
|
|
56
|
+
<DeviceListItem key={device.deviceKey.toHex()} device={device} connectionState={connectionState} />
|
|
57
|
+
))}
|
|
68
58
|
</List>
|
|
69
|
-
</
|
|
59
|
+
</Settings.FrameItem>
|
|
70
60
|
{createInvitationUrl && (
|
|
71
|
-
<
|
|
61
|
+
<Settings.FrameItem title='Add device'>
|
|
72
62
|
<DeviceInvitation createInvitationUrl={createInvitationUrl} />
|
|
73
|
-
</
|
|
63
|
+
</Settings.FrameItem>
|
|
74
64
|
)}
|
|
75
|
-
</
|
|
76
|
-
</
|
|
77
|
-
<
|
|
65
|
+
</Settings.Frame>
|
|
66
|
+
</Settings.Section>
|
|
67
|
+
<Settings.Section
|
|
78
68
|
title={t('danger zone title', { ns: meta.id })}
|
|
79
69
|
description={t('danger zone description', { ns: meta.id })}
|
|
80
70
|
>
|
|
81
|
-
<
|
|
82
|
-
<
|
|
71
|
+
<Settings.Group>
|
|
72
|
+
<Settings.Item title={t('reset device label')} description={t('reset device description', { ns: meta.id })}>
|
|
83
73
|
<Button variant='destructive' onClick={handleResetStorage} data-testid='devicesContainer.reset'>
|
|
84
74
|
{t('reset device label')}
|
|
85
75
|
</Button>
|
|
86
|
-
</
|
|
87
|
-
<
|
|
76
|
+
</Settings.Item>
|
|
77
|
+
<Settings.Item
|
|
88
78
|
title={t('recover identity label')}
|
|
89
79
|
description={t('recover identity description', { ns: meta.id })}
|
|
90
80
|
>
|
|
91
81
|
<Button variant='destructive' onClick={handleRecover} data-testid='devicesContainer.recover'>
|
|
92
82
|
{t('recover identity label')}
|
|
93
83
|
</Button>
|
|
94
|
-
</
|
|
95
|
-
<
|
|
84
|
+
</Settings.Item>
|
|
85
|
+
<Settings.Item
|
|
96
86
|
title={t('join new identity label')}
|
|
97
87
|
description={t('join new identity description', { ns: meta.id })}
|
|
98
88
|
>
|
|
99
89
|
<Button variant='destructive' onClick={handleJoinNewIdentity} data-testid='devicesContainer.joinExisting'>
|
|
100
90
|
{t('join new identity label')}
|
|
101
91
|
</Button>
|
|
102
|
-
</
|
|
103
|
-
</
|
|
104
|
-
</
|
|
105
|
-
</
|
|
92
|
+
</Settings.Item>
|
|
93
|
+
</Settings.Group>
|
|
94
|
+
</Settings.Section>
|
|
95
|
+
</Settings.Root>
|
|
106
96
|
</Clipboard.Provider>
|
|
107
97
|
);
|
|
108
98
|
};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { ObservabilityOperation } from '@dxos/plugin-observability/types';
|
|
10
10
|
import { type InvitationResult } from '@dxos/react-client/invitations';
|
|
11
11
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
@@ -25,7 +25,7 @@ export const JoinDialog = (props: JoinPanelProps) => {
|
|
|
25
25
|
async (result: InvitationResult | null) => {
|
|
26
26
|
if (result?.identityKey) {
|
|
27
27
|
await Promise.all([
|
|
28
|
-
invokePromise(
|
|
28
|
+
invokePromise(LayoutOperation.UpdateDialog, { state: false }),
|
|
29
29
|
invokePromise(ObservabilityOperation.SendEvent, {
|
|
30
30
|
name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',
|
|
31
31
|
}),
|
|
@@ -14,7 +14,7 @@ import { ProfileContainer } from './ProfileContainer';
|
|
|
14
14
|
const meta = {
|
|
15
15
|
title: 'plugins/plugin-client/ProfileContainer',
|
|
16
16
|
component: ProfileContainer,
|
|
17
|
-
decorators: [withTheme, withClientProvider({ createIdentity: true })],
|
|
17
|
+
decorators: [withTheme(), withClientProvider({ createIdentity: true })],
|
|
18
18
|
parameters: {
|
|
19
19
|
layout: 'fullscreen',
|
|
20
20
|
translations,
|