@dxos/plugin-client 0.8.2-main.f081794 → 0.8.2-main.fbd8ed0
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-WAS4YZNA.mjs → app-graph-builder-ROTCC3C4.mjs} +35 -31
- package/dist/lib/browser/app-graph-builder-ROTCC3C4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XNV35HZK.mjs → chunk-7OW22D2O.mjs} +17 -13
- package/dist/lib/browser/chunk-7OW22D2O.mjs.map +7 -0
- package/dist/lib/browser/chunk-XPHDZ277.mjs +105 -0
- package/dist/lib/browser/chunk-XPHDZ277.mjs.map +7 -0
- package/dist/lib/browser/{client-LV67Q3R7.mjs → client-ICXXK55V.mjs} +1 -1
- package/dist/lib/browser/client-ICXXK55V.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +9 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-Y5GTS7CW.mjs → intent-resolver-L4STUWGK.mjs} +10 -10
- package/dist/lib/browser/intent-resolver-L4STUWGK.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/migrations-DYDZ7DVP.mjs +23 -0
- package/dist/lib/browser/migrations-DYDZ7DVP.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-AUZGNKC5.mjs → react-surface-VXFG7BEM.mjs} +3 -3
- package/dist/lib/browser/schema-defs-QVXP2JGN.mjs +25 -0
- package/dist/lib/browser/schema-defs-QVXP2JGN.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-PXOJZJO5.cjs → app-graph-builder-DOHFMHXU.cjs} +44 -40
- package/dist/lib/node/app-graph-builder-DOHFMHXU.cjs.map +7 -0
- package/dist/lib/node/{chunk-QNZIRU35.cjs → chunk-FABH7MJ3.cjs} +20 -16
- package/dist/lib/node/chunk-FABH7MJ3.cjs.map +7 -0
- package/dist/lib/node/{chunk-FROKBEVH.cjs → chunk-J5SQ5Q22.cjs} +47 -47
- package/dist/lib/node/chunk-J5SQ5Q22.cjs.map +7 -0
- package/dist/lib/node/{client-BKTGRBYM.cjs → client-OUBG63HJ.cjs} +4 -4
- package/dist/lib/node/client-OUBG63HJ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +9 -9
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-ZFYETGJI.cjs → intent-resolver-IDLAVEHS.cjs} +29 -29
- package/dist/lib/node/intent-resolver-IDLAVEHS.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{migrations-TGNI4FVL.cjs → migrations-ZI52SX4M.cjs} +11 -9
- package/dist/lib/node/migrations-ZI52SX4M.cjs.map +7 -0
- package/dist/lib/node/{react-surface-GBPBVXLE.cjs → react-surface-UGXE6OAD.cjs} +24 -24
- package/dist/lib/node/{schema-INQ72F54.cjs → schema-defs-BYGBDKOU.cjs} +13 -11
- package/dist/lib/node/schema-defs-BYGBDKOU.cjs.map +7 -0
- package/dist/lib/node/types.cjs +3 -3
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-KIN6NWFI.mjs → app-graph-builder-XMXJG5YT.mjs} +35 -31
- package/dist/lib/node-esm/app-graph-builder-XMXJG5YT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6G43BNMU.mjs → chunk-34X2AMVA.mjs} +17 -13
- package/dist/lib/node-esm/chunk-34X2AMVA.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V6SJNSKG.mjs +106 -0
- package/dist/lib/node-esm/chunk-V6SJNSKG.mjs.map +7 -0
- package/dist/lib/node-esm/{client-QQD6WFOB.mjs → client-YJNEHNUV.mjs} +1 -1
- package/dist/lib/node-esm/client-YJNEHNUV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +9 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-OVG4QCHK.mjs → intent-resolver-73FZIXX5.mjs} +10 -10
- package/dist/lib/node-esm/intent-resolver-73FZIXX5.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-IVGATGZR.mjs → migrations-GHO52HKW.mjs} +8 -6
- package/dist/lib/node-esm/migrations-GHO52HKW.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-SMPVSOTA.mjs → react-surface-R65DYUV6.mjs} +3 -3
- package/dist/lib/node-esm/schema-defs-O4OHIIBN.mjs +26 -0
- package/dist/lib/node-esm/schema-defs-O4OHIIBN.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts +2 -2
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -181
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +2 -2
- package/dist/types/src/capabilities/migrations.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 +4 -0
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- package/dist/types/src/components/DevicesContainer.d.ts +4 -3
- package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.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.map +1 -1
- package/dist/types/src/types.d.ts +53 -53
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -25
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +94 -76
- package/src/capabilities/client.ts +2 -2
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/intent-resolver.ts +9 -9
- package/src/capabilities/migrations.ts +14 -11
- package/src/capabilities/schema-defs.ts +29 -0
- package/src/components/DevicesContainer.stories.tsx +7 -3
- package/src/components/DevicesContainer.tsx +19 -12
- package/src/components/ProfileContainer.stories.tsx +1 -1
- package/src/components/ProfileContainer.tsx +7 -7
- package/src/components/RecoveryCodeDialog.stories.tsx +1 -1
- package/src/components/RecoveryCredentialsContainer.stories.tsx +2 -2
- package/src/components/ResetDialog.stories.tsx +7 -1
- package/src/translations.ts +2 -2
- package/src/types.ts +50 -46
- package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +0 -7
- package/dist/lib/browser/chunk-AN7FJKIJ.mjs +0 -105
- package/dist/lib/browser/chunk-AN7FJKIJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-XNV35HZK.mjs.map +0 -7
- package/dist/lib/browser/client-LV67Q3R7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-Y5GTS7CW.mjs.map +0 -7
- package/dist/lib/browser/migrations-3DWFOL5Q.mjs +0 -21
- package/dist/lib/browser/migrations-3DWFOL5Q.mjs.map +0 -7
- package/dist/lib/browser/schema-JQAT6Q7S.mjs +0 -23
- package/dist/lib/browser/schema-JQAT6Q7S.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +0 -7
- package/dist/lib/node/chunk-FROKBEVH.cjs.map +0 -7
- package/dist/lib/node/chunk-QNZIRU35.cjs.map +0 -7
- package/dist/lib/node/client-BKTGRBYM.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-ZFYETGJI.cjs.map +0 -7
- package/dist/lib/node/migrations-TGNI4FVL.cjs.map +0 -7
- package/dist/lib/node/schema-INQ72F54.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6G43BNMU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs +0 -106
- package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs.map +0 -7
- package/dist/lib/node-esm/client-QQD6WFOB.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-OVG4QCHK.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-IVGATGZR.mjs.map +0 -7
- package/dist/lib/node-esm/schema-OK7HY3JJ.mjs +0 -24
- package/dist/lib/node-esm/schema-OK7HY3JJ.mjs.map +0 -7
- package/dist/types/src/capabilities/schema.d.ts +0 -4
- package/dist/types/src/capabilities/schema.d.ts.map +0 -1
- package/src/capabilities/schema.ts +0 -26
- /package/dist/lib/browser/{react-surface-AUZGNKC5.mjs.map → react-surface-VXFG7BEM.mjs.map} +0 -0
- /package/dist/lib/node/{react-surface-GBPBVXLE.cjs.map → react-surface-UGXE6OAD.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-SMPVSOTA.mjs.map → react-surface-R65DYUV6.mjs.map} +0 -0
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { type PluginContext } from '@dxos/app-framework';
|
|
3
3
|
import { type Client, PublicKey, type ClientOptions } from '@dxos/react-client';
|
|
4
4
|
import { type MaybePromise } from '@dxos/util';
|
|
5
5
|
export declare namespace ClientAction {
|
|
6
|
-
const CreateIdentity_base:
|
|
7
|
-
readonly _tag:
|
|
6
|
+
const CreateIdentity_base: Schema.TaggedClass<CreateIdentity, "dxos.org/plugin/client/action/create-identity", {
|
|
7
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/create-identity">;
|
|
8
8
|
} & {
|
|
9
|
-
input:
|
|
10
|
-
displayName:
|
|
9
|
+
input: Schema.Struct<{
|
|
10
|
+
displayName: Schema.optional<typeof Schema.String>;
|
|
11
11
|
}>;
|
|
12
|
-
output:
|
|
13
|
-
identityKey:
|
|
14
|
-
spaceKey:
|
|
15
|
-
profile:
|
|
16
|
-
displayName:
|
|
17
|
-
avatarCid:
|
|
18
|
-
data:
|
|
12
|
+
output: Schema.Struct<{
|
|
13
|
+
identityKey: Schema.instanceOf<PublicKey>;
|
|
14
|
+
spaceKey: Schema.optional<Schema.instanceOf<PublicKey>>;
|
|
15
|
+
profile: Schema.optional<Schema.Struct<{
|
|
16
|
+
displayName: Schema.optional<typeof Schema.String>;
|
|
17
|
+
avatarCid: Schema.optional<typeof Schema.String>;
|
|
18
|
+
data: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
19
19
|
}>>;
|
|
20
20
|
}>;
|
|
21
21
|
}>;
|
|
22
22
|
export class CreateIdentity extends CreateIdentity_base {
|
|
23
23
|
}
|
|
24
|
-
const JoinIdentity_base:
|
|
25
|
-
readonly _tag:
|
|
24
|
+
const JoinIdentity_base: Schema.TaggedClass<JoinIdentity, "dxos.org/plugin/client/action/join-identity", {
|
|
25
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/join-identity">;
|
|
26
26
|
} & {
|
|
27
|
-
input:
|
|
28
|
-
invitationCode:
|
|
27
|
+
input: Schema.Struct<{
|
|
28
|
+
invitationCode: Schema.optional<typeof Schema.String>;
|
|
29
29
|
}>;
|
|
30
|
-
output: typeof
|
|
30
|
+
output: typeof Schema.Void;
|
|
31
31
|
}>;
|
|
32
32
|
export class JoinIdentity extends JoinIdentity_base {
|
|
33
33
|
}
|
|
34
|
-
const ShareIdentity_base:
|
|
35
|
-
readonly _tag:
|
|
34
|
+
const ShareIdentity_base: Schema.TaggedClass<ShareIdentity, "dxos.org/plugin/client/action/share-identity", {
|
|
35
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/share-identity">;
|
|
36
36
|
} & {
|
|
37
|
-
input: typeof
|
|
38
|
-
output: typeof
|
|
37
|
+
input: typeof Schema.Void;
|
|
38
|
+
output: typeof Schema.Void;
|
|
39
39
|
}>;
|
|
40
40
|
export class ShareIdentity extends ShareIdentity_base {
|
|
41
41
|
}
|
|
42
|
-
const RecoverIdentity_base:
|
|
43
|
-
readonly _tag:
|
|
42
|
+
const RecoverIdentity_base: Schema.TaggedClass<RecoverIdentity, "dxos.org/plugin/client/action/recover-identity", {
|
|
43
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/recover-identity">;
|
|
44
44
|
} & {
|
|
45
|
-
input: typeof
|
|
46
|
-
output: typeof
|
|
45
|
+
input: typeof Schema.Void;
|
|
46
|
+
output: typeof Schema.Void;
|
|
47
47
|
}>;
|
|
48
48
|
export class RecoverIdentity extends RecoverIdentity_base {
|
|
49
49
|
}
|
|
50
|
-
const ResetStorage_base:
|
|
51
|
-
readonly _tag:
|
|
50
|
+
const ResetStorage_base: Schema.TaggedClass<ResetStorage, "dxos.org/plugin/client/action/reset-storage", {
|
|
51
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/reset-storage">;
|
|
52
52
|
} & {
|
|
53
|
-
input:
|
|
54
|
-
mode:
|
|
53
|
+
input: Schema.Struct<{
|
|
54
|
+
mode: Schema.optional<typeof Schema.String>;
|
|
55
55
|
}>;
|
|
56
|
-
output: typeof
|
|
56
|
+
output: typeof Schema.Void;
|
|
57
57
|
}>;
|
|
58
58
|
export class ResetStorage extends ResetStorage_base {
|
|
59
59
|
}
|
|
60
|
-
const CreateAgent_base:
|
|
61
|
-
readonly _tag:
|
|
60
|
+
const CreateAgent_base: Schema.TaggedClass<CreateAgent, "dxos.org/plugin/client/action/create-agent", {
|
|
61
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/create-agent">;
|
|
62
62
|
} & {
|
|
63
|
-
input: typeof
|
|
64
|
-
output: typeof
|
|
63
|
+
input: typeof Schema.Void;
|
|
64
|
+
output: typeof Schema.Void;
|
|
65
65
|
}>;
|
|
66
66
|
export class CreateAgent extends CreateAgent_base {
|
|
67
67
|
}
|
|
68
|
-
const CreateRecoveryCode_base:
|
|
69
|
-
readonly _tag:
|
|
68
|
+
const CreateRecoveryCode_base: Schema.TaggedClass<CreateRecoveryCode, "dxos.org/plugin/client/action/create-recovery-code", {
|
|
69
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/create-recovery-code">;
|
|
70
70
|
} & {
|
|
71
|
-
input: typeof
|
|
72
|
-
output: typeof
|
|
71
|
+
input: typeof Schema.Void;
|
|
72
|
+
output: typeof Schema.Void;
|
|
73
73
|
}>;
|
|
74
74
|
export class CreateRecoveryCode extends CreateRecoveryCode_base {
|
|
75
75
|
}
|
|
76
|
-
const CreatePasskey_base:
|
|
77
|
-
readonly _tag:
|
|
76
|
+
const CreatePasskey_base: Schema.TaggedClass<CreatePasskey, "dxos.org/plugin/client/action/create-passkey", {
|
|
77
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/create-passkey">;
|
|
78
78
|
} & {
|
|
79
|
-
input: typeof
|
|
80
|
-
output: typeof
|
|
79
|
+
input: typeof Schema.Void;
|
|
80
|
+
output: typeof Schema.Void;
|
|
81
81
|
}>;
|
|
82
82
|
export class CreatePasskey extends CreatePasskey_base {
|
|
83
83
|
}
|
|
84
|
-
const RedeemPasskey_base:
|
|
85
|
-
readonly _tag:
|
|
84
|
+
const RedeemPasskey_base: Schema.TaggedClass<RedeemPasskey, "dxos.org/plugin/client/action/redeem-passkey", {
|
|
85
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/redeem-passkey">;
|
|
86
86
|
} & {
|
|
87
|
-
input: typeof
|
|
88
|
-
output: typeof
|
|
87
|
+
input: typeof Schema.Void;
|
|
88
|
+
output: typeof Schema.Void;
|
|
89
89
|
}>;
|
|
90
90
|
export class RedeemPasskey extends RedeemPasskey_base {
|
|
91
91
|
}
|
|
92
|
-
const RedeemToken_base:
|
|
93
|
-
readonly _tag:
|
|
92
|
+
const RedeemToken_base: Schema.TaggedClass<RedeemToken, "dxos.org/plugin/client/action/redeem-token", {
|
|
93
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/client/action/redeem-token">;
|
|
94
94
|
} & {
|
|
95
|
-
input:
|
|
96
|
-
token: typeof
|
|
95
|
+
input: Schema.Struct<{
|
|
96
|
+
token: typeof Schema.String;
|
|
97
97
|
}>;
|
|
98
|
-
output: typeof
|
|
98
|
+
output: typeof Schema.Void;
|
|
99
99
|
}>;
|
|
100
100
|
export class RedeemToken extends RedeemToken_base {
|
|
101
101
|
}
|
|
@@ -113,7 +113,7 @@ export type ClientPluginOptions = ClientOptions & {
|
|
|
113
113
|
/**
|
|
114
114
|
* Run after the client has been initialized.
|
|
115
115
|
*/
|
|
116
|
-
onClientInitialized?: (context:
|
|
116
|
+
onClientInitialized?: (context: PluginContext, client: Client) => MaybePromise<void>;
|
|
117
117
|
/**
|
|
118
118
|
* Called when the client is reset.
|
|
119
119
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAkB/C,yBAAiB,YAAY,CAAC;;;;;;;;;;;;;;;;;IAC5B,MAAM,OAAO,cAAe,SAAQ,mBAKlC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAKhC;KAAG;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAGjC;KAAG;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAGnC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAKhC;KAAG;;;;;;;IAEL,MAAM,OAAO,WAAY,SAAQ,gBAG/B;KAAG;;;;;;;IAEL,MAAM,OAAO,kBAAmB,SAAQ,uBAMvC;KAAG;;;;;;;IAEJ,MAAM,OAAO,aAAc,SAAQ,kBAGjC;KAAG;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAGjC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,WAAY,SAAQ,gBAK/B;KAAG;;CACN;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAErF;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CAC/D,CAAC;AAEF,yBAAiB,OAAO,CAAC;IAKhB,MAAM,EAAE,oCAAY,CAAC;IAErB,MAAM,OAAO,2CAAmB,CAAC;IACjC,MAAM,OAAO,2CAAmB,CAAC;IACjC,MAAM,QAAQ,4CAAoB,CAAC;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-client",
|
|
3
|
-
"version": "0.8.2-main.
|
|
3
|
+
"version": "0.8.2-main.fbd8ed0",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -34,44 +34,50 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@preact/signals-core": "^1.6.0",
|
|
37
|
+
"effect": "3.14.21",
|
|
37
38
|
"react-qr-rounded": "^1.0.0",
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/echo
|
|
42
|
-
"@dxos/echo-
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/plugin-graph": "0.8.2-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/react-client": "0.8.2-main.
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
39
|
+
"@dxos/async": "0.8.2-main.fbd8ed0",
|
|
40
|
+
"@dxos/app-framework": "0.8.2-main.fbd8ed0",
|
|
41
|
+
"@dxos/config": "0.8.2-main.fbd8ed0",
|
|
42
|
+
"@dxos/echo": "0.8.2-main.fbd8ed0",
|
|
43
|
+
"@dxos/echo-schema": "0.8.2-main.fbd8ed0",
|
|
44
|
+
"@dxos/echo-signals": "0.8.2-main.fbd8ed0",
|
|
45
|
+
"@dxos/invariant": "0.8.2-main.fbd8ed0",
|
|
46
|
+
"@dxos/local-storage": "0.8.2-main.fbd8ed0",
|
|
47
|
+
"@dxos/plugin-graph": "0.8.2-main.fbd8ed0",
|
|
48
|
+
"@dxos/log": "0.8.2-main.fbd8ed0",
|
|
49
|
+
"@dxos/plugin-observability": "0.8.2-main.fbd8ed0",
|
|
50
|
+
"@dxos/react-client": "0.8.2-main.fbd8ed0",
|
|
51
|
+
"@dxos/react-ui-form": "0.8.2-main.fbd8ed0",
|
|
52
|
+
"@dxos/react-ui-stack": "0.8.2-main.fbd8ed0",
|
|
53
|
+
"@dxos/react-ui-pickers": "0.8.2-main.fbd8ed0",
|
|
54
|
+
"@dxos/shell": "0.8.2-main.fbd8ed0",
|
|
55
|
+
"@dxos/util": "0.8.2-main.fbd8ed0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
58
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
59
|
+
"@effect/platform": "0.80.12",
|
|
56
60
|
"@phosphor-icons/react": "^2.1.5",
|
|
57
61
|
"@types/react": "~18.2.0",
|
|
58
62
|
"@types/react-dom": "~18.2.0",
|
|
59
|
-
"effect": "3.
|
|
63
|
+
"effect": "3.14.21",
|
|
60
64
|
"react": "~18.2.0",
|
|
61
65
|
"react-dom": "~18.2.0",
|
|
62
66
|
"vite": "5.4.7",
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/storybook-utils": "0.8.2-main.
|
|
67
|
+
"@dxos/react-ui": "0.8.2-main.fbd8ed0",
|
|
68
|
+
"@dxos/react-ui-theme": "0.8.2-main.fbd8ed0",
|
|
69
|
+
"@dxos/live-object": "0.8.2-main.fbd8ed0",
|
|
70
|
+
"@dxos/storybook-utils": "0.8.2-main.fbd8ed0"
|
|
67
71
|
},
|
|
68
72
|
"peerDependencies": {
|
|
73
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
74
|
+
"@effect/platform": "0.80.12",
|
|
69
75
|
"@phosphor-icons/react": "^2.1.5",
|
|
70
|
-
"effect": "3.13.3",
|
|
76
|
+
"effect": "^3.13.3",
|
|
71
77
|
"react": "~18.2.0",
|
|
72
78
|
"react-dom": "~18.2.0",
|
|
73
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
74
|
-
"@dxos/react-ui-theme": "0.8.2-main.
|
|
79
|
+
"@dxos/react-ui": "0.8.2-main.fbd8ed0",
|
|
80
|
+
"@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
|
|
75
81
|
},
|
|
76
82
|
"publishConfig": {
|
|
77
83
|
"access": "public"
|
package/src/ClientPlugin.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
Migrations,
|
|
12
12
|
ReactContext,
|
|
13
13
|
ReactSurface,
|
|
14
|
-
|
|
14
|
+
SchemaDefs,
|
|
15
15
|
} from './capabilities';
|
|
16
16
|
import { ClientEvents } from './events';
|
|
17
17
|
import { meta } from './meta';
|
|
@@ -41,7 +41,7 @@ export const ClientPlugin = ({
|
|
|
41
41
|
id: `${meta.id}/module/schema`,
|
|
42
42
|
activatesOn: ClientEvents.ClientReady,
|
|
43
43
|
activatesBefore: [ClientEvents.SetupSchema],
|
|
44
|
-
activate:
|
|
44
|
+
activate: SchemaDefs,
|
|
45
45
|
}),
|
|
46
46
|
defineModule({
|
|
47
47
|
id: `${meta.id}/module/migration`,
|
|
@@ -2,94 +2,112 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
+
import { Option, pipe } from 'effect';
|
|
7
|
+
|
|
5
8
|
import { createIntent } from '@dxos/app-framework';
|
|
6
|
-
import { Capabilities, contributes, type
|
|
7
|
-
import { createExtension,
|
|
9
|
+
import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
10
|
+
import { createExtension, rxFromObservable, ROOT_ID } from '@dxos/plugin-graph';
|
|
8
11
|
import { ConnectionState } from '@dxos/react-client/mesh';
|
|
9
12
|
|
|
10
13
|
import { ClientCapabilities } from './capabilities';
|
|
11
14
|
import { CLIENT_PLUGIN } from '../meta';
|
|
12
15
|
import { Account, ClientAction } from '../types';
|
|
13
16
|
|
|
14
|
-
export default (context:
|
|
17
|
+
export default (context: PluginContext) =>
|
|
15
18
|
contributes(
|
|
16
19
|
Capabilities.AppGraphBuilder,
|
|
17
20
|
createExtension({
|
|
18
21
|
id: CLIENT_PLUGIN,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(onChange) => client.mesh.networkStatus.subscribe(() => onChange()).unsubscribe,
|
|
44
|
-
() => client.mesh.networkStatus.get(),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return [
|
|
48
|
-
{
|
|
49
|
-
id: Account.id,
|
|
50
|
-
type: CLIENT_PLUGIN,
|
|
51
|
-
properties: {
|
|
52
|
-
label: ['account label', { ns: CLIENT_PLUGIN }],
|
|
53
|
-
icon: 'ph--user--regular',
|
|
54
|
-
disposition: 'user-account',
|
|
55
|
-
// NOTE: This currently needs to be the identity key because the fallback is generated from hex.
|
|
56
|
-
userId: identity?.identityKey.toHex(),
|
|
57
|
-
hue: identity?.profile?.data?.hue,
|
|
58
|
-
emoji: identity?.profile?.data?.emoji,
|
|
59
|
-
status: status?.swarm === ConnectionState.OFFLINE ? 'error' : 'active',
|
|
60
|
-
},
|
|
61
|
-
nodes: [
|
|
62
|
-
{
|
|
63
|
-
id: Account.Profile,
|
|
64
|
-
data: Account.Profile,
|
|
65
|
-
type: CLIENT_PLUGIN,
|
|
66
|
-
properties: {
|
|
67
|
-
label: ['profile label', { ns: CLIENT_PLUGIN }],
|
|
68
|
-
icon: 'ph--user--regular',
|
|
22
|
+
actions: (node) =>
|
|
23
|
+
Rx.make((get) =>
|
|
24
|
+
pipe(
|
|
25
|
+
get(node),
|
|
26
|
+
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
27
|
+
Option.map(() => {
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
id: `${CLIENT_PLUGIN}/open-user-account`,
|
|
31
|
+
data: async () => {
|
|
32
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
33
|
+
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
34
|
+
},
|
|
35
|
+
properties: {
|
|
36
|
+
label: ['open user account label', { ns: CLIENT_PLUGIN }],
|
|
37
|
+
icon: 'ph--user--regular',
|
|
38
|
+
disposition: 'menu',
|
|
39
|
+
keyBinding: {
|
|
40
|
+
macos: 'meta+shift+.',
|
|
41
|
+
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
42
|
+
windows: 'alt+shift+.',
|
|
43
|
+
linux: 'alt+shift+>',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
69
46
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
47
|
+
];
|
|
48
|
+
}),
|
|
49
|
+
Option.getOrElse(() => []),
|
|
50
|
+
),
|
|
51
|
+
),
|
|
52
|
+
connector: (node) =>
|
|
53
|
+
Rx.make((get) =>
|
|
54
|
+
pipe(
|
|
55
|
+
get(node),
|
|
56
|
+
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
57
|
+
Option.map(() => {
|
|
58
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
59
|
+
const identity = get(rxFromObservable(client.halo.identity));
|
|
60
|
+
const status = get(rxFromObservable(client.mesh.networkStatus));
|
|
61
|
+
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
id: Account.id,
|
|
65
|
+
type: CLIENT_PLUGIN,
|
|
66
|
+
properties: {
|
|
67
|
+
label: ['account label', { ns: CLIENT_PLUGIN }],
|
|
68
|
+
icon: 'ph--user--regular',
|
|
69
|
+
disposition: 'user-account',
|
|
70
|
+
// NOTE: This currently needs to be the identity key because the fallback is generated from hex.
|
|
71
|
+
userId: identity?.identityKey.toHex(),
|
|
72
|
+
hue: identity?.profile?.data?.hue,
|
|
73
|
+
emoji: identity?.profile?.data?.emoji,
|
|
74
|
+
status: status.swarm === ConnectionState.OFFLINE ? 'error' : 'active',
|
|
75
|
+
},
|
|
76
|
+
nodes: [
|
|
77
|
+
{
|
|
78
|
+
id: Account.Profile,
|
|
79
|
+
data: Account.Profile,
|
|
80
|
+
type: CLIENT_PLUGIN,
|
|
81
|
+
properties: {
|
|
82
|
+
label: ['profile label', { ns: CLIENT_PLUGIN }],
|
|
83
|
+
icon: 'ph--user--regular',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: Account.Devices,
|
|
88
|
+
data: Account.Devices,
|
|
89
|
+
type: CLIENT_PLUGIN,
|
|
90
|
+
properties: {
|
|
91
|
+
label: ['devices label', { ns: CLIENT_PLUGIN }],
|
|
92
|
+
icon: 'ph--devices--regular',
|
|
93
|
+
testId: 'clientPlugin.devices',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: Account.Security,
|
|
98
|
+
data: Account.Security,
|
|
99
|
+
type: CLIENT_PLUGIN,
|
|
100
|
+
properties: {
|
|
101
|
+
label: ['security label', { ns: CLIENT_PLUGIN }],
|
|
102
|
+
icon: 'ph--key--regular',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
],
|
|
88
106
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
107
|
+
];
|
|
108
|
+
}),
|
|
109
|
+
Option.getOrElse(() => []),
|
|
110
|
+
),
|
|
111
|
+
),
|
|
94
112
|
}),
|
|
95
113
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { contributes, type
|
|
5
|
+
import { contributes, type PluginContext } from '@dxos/app-framework';
|
|
6
6
|
import { Client } from '@dxos/react-client';
|
|
7
7
|
|
|
8
8
|
import { ClientCapabilities } from './capabilities';
|
|
@@ -10,7 +10,7 @@ import { ClientEvents } from '../events';
|
|
|
10
10
|
import { type ClientPluginOptions } from '../types';
|
|
11
11
|
|
|
12
12
|
type ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {
|
|
13
|
-
context:
|
|
13
|
+
context: PluginContext;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default async ({ context, onClientInitialized, ...options }: ClientCapabilityOptions) => {
|
|
@@ -10,6 +10,6 @@ export const IntentResolver = lazy(async () => import('./intent-resolver'));
|
|
|
10
10
|
export const Migrations = lazy(async () => import('./migrations'));
|
|
11
11
|
export const ReactContext = lazy(async () => import('./react-context'));
|
|
12
12
|
export const ReactSurface = lazy(async () => import('./react-surface'));
|
|
13
|
-
export const
|
|
13
|
+
export const SchemaDefs = lazy(async () => import('./schema-defs'));
|
|
14
14
|
|
|
15
15
|
export * from './capabilities';
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createIntent,
|
|
12
12
|
createResolver,
|
|
13
13
|
LayoutAction,
|
|
14
|
-
type
|
|
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';
|
|
@@ -24,7 +24,7 @@ import { ClientEvents } from '../events';
|
|
|
24
24
|
import { Account, ClientAction } from '../types';
|
|
25
25
|
|
|
26
26
|
type IntentResolverOptions = {
|
|
27
|
-
context:
|
|
27
|
+
context: PluginContext;
|
|
28
28
|
appName?: string;
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -35,8 +35,8 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
35
35
|
createResolver({
|
|
36
36
|
intent: ClientAction.CreateIdentity,
|
|
37
37
|
resolve: async () => {
|
|
38
|
-
const manager = context.
|
|
39
|
-
const client = context.
|
|
38
|
+
const manager = context.getCapability(Capabilities.PluginManager);
|
|
39
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
40
40
|
const data = await client.halo.createIdentity();
|
|
41
41
|
await manager.activate(ClientEvents.IdentityCreated);
|
|
42
42
|
return {
|
|
@@ -132,7 +132,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
132
132
|
createResolver({
|
|
133
133
|
intent: ClientAction.CreateAgent,
|
|
134
134
|
resolve: async () => {
|
|
135
|
-
const client = context.
|
|
135
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
136
136
|
invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');
|
|
137
137
|
await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });
|
|
138
138
|
},
|
|
@@ -140,7 +140,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
140
140
|
createResolver({
|
|
141
141
|
intent: ClientAction.CreateRecoveryCode,
|
|
142
142
|
resolve: async () => {
|
|
143
|
-
const client = context.
|
|
143
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
144
144
|
invariant(client.services.services.IdentityService, 'IdentityService not available');
|
|
145
145
|
// TODO(wittjosiah): This needs a proper api.
|
|
146
146
|
const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});
|
|
@@ -162,7 +162,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
162
162
|
createResolver({
|
|
163
163
|
intent: ClientAction.CreatePasskey,
|
|
164
164
|
resolve: async () => {
|
|
165
|
-
const client = context.
|
|
165
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
166
166
|
const identity = client.halo.identity.get();
|
|
167
167
|
invariant(identity, 'Identity not available');
|
|
168
168
|
|
|
@@ -207,7 +207,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
207
207
|
createResolver({
|
|
208
208
|
intent: ClientAction.RedeemPasskey,
|
|
209
209
|
resolve: async () => {
|
|
210
|
-
const client = context.
|
|
210
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
211
211
|
// TODO(wittjosiah): This needs a proper api.
|
|
212
212
|
invariant(client.services.services.IdentityService, 'IdentityService not available');
|
|
213
213
|
const { deviceKey, controlFeedKey, challenge } =
|
|
@@ -238,7 +238,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
238
238
|
createResolver({
|
|
239
239
|
intent: ClientAction.RedeemToken,
|
|
240
240
|
resolve: async (data) => {
|
|
241
|
-
const client = context.
|
|
241
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
242
242
|
// TODO(wittjosiah): This needs a proper api.
|
|
243
243
|
invariant(client.services.services.IdentityService, 'IdentityService not available');
|
|
244
244
|
await client.services.services.IdentityService.recoverIdentity(
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
5
|
+
import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
8
6
|
|
|
9
7
|
import { ClientCapabilities } from './capabilities';
|
|
10
8
|
|
|
11
|
-
export default (context:
|
|
12
|
-
const
|
|
9
|
+
export default (context: PluginContext) => {
|
|
10
|
+
const registry = context.getCapability(Capabilities.RxRegistry);
|
|
11
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
13
12
|
|
|
14
13
|
// NOTE: Migrations are currently unidirectional and idempotent.
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const cancel = registry.subscribe(
|
|
15
|
+
context.capabilities(ClientCapabilities.Migration),
|
|
16
|
+
(_migrations) => {
|
|
17
|
+
const migrations = Array.from(new Set(_migrations.flat()));
|
|
18
|
+
const spaces = client.spaces.get();
|
|
19
|
+
void Promise.all(spaces.map((space) => space.db.runMigrations(migrations)));
|
|
20
|
+
},
|
|
21
|
+
{ immediate: true },
|
|
22
|
+
);
|
|
20
23
|
|
|
21
|
-
return contributes(Capabilities.Null, null, () =>
|
|
24
|
+
return contributes(Capabilities.Null, null, () => cancel());
|
|
22
25
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
6
|
+
import { type TypedObject } from '@dxos/echo-schema';
|
|
7
|
+
|
|
8
|
+
import { ClientCapabilities } from './capabilities';
|
|
9
|
+
|
|
10
|
+
export default (context: PluginContext) => {
|
|
11
|
+
const registry = context.getCapability(Capabilities.RxRegistry);
|
|
12
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
13
|
+
|
|
14
|
+
// TODO(wittjosiah): Unregister schemas when they are disabled.
|
|
15
|
+
let previous: TypedObject[] = [];
|
|
16
|
+
const cancel = registry.subscribe(
|
|
17
|
+
context.capabilities(ClientCapabilities.Schema),
|
|
18
|
+
(_schemas) => {
|
|
19
|
+
const schemas = Array.from(new Set(_schemas.flat()));
|
|
20
|
+
// TODO(wittjosiah): Filter out schemas which the client has already registered.
|
|
21
|
+
const newSchemas = schemas.filter((schema) => !previous.includes(schema));
|
|
22
|
+
previous = schemas;
|
|
23
|
+
client.addTypes(newSchemas);
|
|
24
|
+
},
|
|
25
|
+
{ immediate: true },
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return contributes(Capabilities.Null, null, () => cancel());
|
|
29
|
+
};
|