@dxos/plugin-client 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
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-ROTCC3C4.mjs → app-graph-builder-WAS4YZNA.mjs} +31 -35
- package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +7 -0
- package/dist/lib/browser/chunk-AN7FJKIJ.mjs +105 -0
- package/dist/lib/browser/chunk-AN7FJKIJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7OW22D2O.mjs → chunk-XZ4TQC56.mjs} +25 -29
- package/dist/lib/browser/chunk-XZ4TQC56.mjs.map +7 -0
- package/dist/lib/browser/{client-ICXXK55V.mjs → client-LV67Q3R7.mjs} +1 -1
- package/dist/lib/browser/client-LV67Q3R7.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-L4STUWGK.mjs → intent-resolver-NCISOZW4.mjs} +10 -10
- package/dist/lib/browser/intent-resolver-NCISOZW4.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/migrations-3DWFOL5Q.mjs +21 -0
- package/dist/lib/browser/migrations-3DWFOL5Q.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-VXFG7BEM.mjs → react-surface-J7SZR2J6.mjs} +3 -3
- package/dist/lib/browser/schema-JQAT6Q7S.mjs +23 -0
- package/dist/lib/browser/schema-JQAT6Q7S.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-DOHFMHXU.cjs → app-graph-builder-PXOJZJO5.cjs} +40 -44
- package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +7 -0
- package/dist/lib/node/{chunk-FABH7MJ3.cjs → chunk-3JE5BFCT.cjs} +25 -29
- package/dist/lib/node/chunk-3JE5BFCT.cjs.map +7 -0
- package/dist/lib/node/{chunk-J5SQ5Q22.cjs → chunk-FROKBEVH.cjs} +47 -47
- package/dist/lib/node/chunk-FROKBEVH.cjs.map +7 -0
- package/dist/lib/node/{client-OUBG63HJ.cjs → client-BKTGRBYM.cjs} +4 -4
- package/dist/lib/node/client-BKTGRBYM.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-IDLAVEHS.cjs → intent-resolver-U2576ALY.cjs} +29 -29
- package/dist/lib/node/intent-resolver-U2576ALY.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{migrations-ZI52SX4M.cjs → migrations-TGNI4FVL.cjs} +9 -11
- package/dist/lib/node/migrations-TGNI4FVL.cjs.map +7 -0
- package/dist/lib/node/{react-surface-UGXE6OAD.cjs → react-surface-BSTIXMER.cjs} +24 -24
- package/dist/lib/node/{schema-defs-BYGBDKOU.cjs → schema-INQ72F54.cjs} +11 -13
- package/dist/lib/node/schema-INQ72F54.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-XMXJG5YT.mjs → app-graph-builder-KIN6NWFI.mjs} +31 -35
- package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs +106 -0
- package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-34X2AMVA.mjs → chunk-LZN2UNN7.mjs} +25 -29
- package/dist/lib/node-esm/chunk-LZN2UNN7.mjs.map +7 -0
- package/dist/lib/node-esm/{client-YJNEHNUV.mjs → client-QQD6WFOB.mjs} +1 -1
- package/dist/lib/node-esm/client-QQD6WFOB.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-73FZIXX5.mjs → intent-resolver-G25U4UGI.mjs} +10 -10
- package/dist/lib/node-esm/intent-resolver-G25U4UGI.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-GHO52HKW.mjs → migrations-IVGATGZR.mjs} +6 -8
- package/dist/lib/node-esm/migrations-IVGATGZR.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-R65DYUV6.mjs → react-surface-ZPI7T4EM.mjs} +3 -3
- package/dist/lib/node-esm/schema-OK7HY3JJ.mjs +24 -0
- package/dist/lib/node-esm/schema-OK7HY3JJ.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 +179 -2
- 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 +181 -5
- 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.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/components/DevicesContainer.d.ts +3 -4
- 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/ProfileContainer.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.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 +25 -31
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +76 -94
- 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 +11 -14
- package/src/capabilities/schema.ts +26 -0
- package/src/components/DevicesContainer.stories.tsx +3 -7
- package/src/components/DevicesContainer.tsx +61 -85
- package/src/components/ProfileContainer.stories.tsx +1 -1
- package/src/components/ProfileContainer.tsx +21 -30
- package/src/components/RecoveryCodeDialog.stories.tsx +1 -1
- package/src/components/RecoveryCredentialsContainer.stories.tsx +2 -2
- package/src/components/RecoveryCredentialsContainer.tsx +46 -48
- package/src/components/ResetDialog.stories.tsx +1 -7
- package/src/translations.ts +2 -2
- package/src/types.ts +46 -50
- package/dist/lib/browser/app-graph-builder-ROTCC3C4.mjs.map +0 -7
- package/dist/lib/browser/chunk-7OW22D2O.mjs.map +0 -7
- package/dist/lib/browser/chunk-XPHDZ277.mjs +0 -105
- package/dist/lib/browser/chunk-XPHDZ277.mjs.map +0 -7
- package/dist/lib/browser/client-ICXXK55V.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-L4STUWGK.mjs.map +0 -7
- package/dist/lib/browser/migrations-DYDZ7DVP.mjs +0 -23
- package/dist/lib/browser/migrations-DYDZ7DVP.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-QVXP2JGN.mjs +0 -25
- package/dist/lib/browser/schema-defs-QVXP2JGN.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-DOHFMHXU.cjs.map +0 -7
- package/dist/lib/node/chunk-FABH7MJ3.cjs.map +0 -7
- package/dist/lib/node/chunk-J5SQ5Q22.cjs.map +0 -7
- package/dist/lib/node/client-OUBG63HJ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-IDLAVEHS.cjs.map +0 -7
- package/dist/lib/node/migrations-ZI52SX4M.cjs.map +0 -7
- package/dist/lib/node/schema-defs-BYGBDKOU.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-XMXJG5YT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34X2AMVA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V6SJNSKG.mjs +0 -106
- package/dist/lib/node-esm/chunk-V6SJNSKG.mjs.map +0 -7
- package/dist/lib/node-esm/client-YJNEHNUV.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-73FZIXX5.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-GHO52HKW.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-O4OHIIBN.mjs +0 -26
- package/dist/lib/node-esm/schema-defs-O4OHIIBN.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
- package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
- package/src/capabilities/schema-defs.ts +0 -29
- /package/dist/lib/browser/{react-surface-VXFG7BEM.mjs.map → react-surface-J7SZR2J6.mjs.map} +0 -0
- /package/dist/lib/node/{react-surface-UGXE6OAD.cjs.map → react-surface-BSTIXMER.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-R65DYUV6.mjs.map → react-surface-ZPI7T4EM.mjs.map} +0 -0
|
@@ -16,24 +16,22 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var migrations_TGNI4FVL_exports = {};
|
|
20
|
+
__export(migrations_TGNI4FVL_exports, {
|
|
21
21
|
default: () => migrations_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(migrations_TGNI4FVL_exports);
|
|
24
24
|
var import_chunk_ZVQIICEN = require("./chunk-ZVQIICEN.cjs");
|
|
25
25
|
var import_chunk_DJKWB5L6 = require("./chunk-DJKWB5L6.cjs");
|
|
26
|
+
var import_signals_core = require("@preact/signals-core");
|
|
26
27
|
var import_app_framework = require("@dxos/app-framework");
|
|
27
28
|
var migrations_default = (context) => {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const migrations = Array.from(new Set(_migrations.flat()));
|
|
29
|
+
const client = context.requestCapability(import_chunk_ZVQIICEN.ClientCapabilities.Client);
|
|
30
|
+
const unsubscribe = (0, import_signals_core.effect)(() => {
|
|
31
|
+
const migrations = Array.from(new Set(context.requestCapabilities(import_chunk_ZVQIICEN.ClientCapabilities.Migration).flat()));
|
|
32
32
|
const spaces = client.spaces.get();
|
|
33
33
|
void Promise.all(spaces.map((space) => space.db.runMigrations(migrations)));
|
|
34
|
-
}, {
|
|
35
|
-
immediate: true
|
|
36
34
|
});
|
|
37
|
-
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () =>
|
|
35
|
+
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () => unsubscribe());
|
|
38
36
|
};
|
|
39
|
-
//# sourceMappingURL=migrations-
|
|
37
|
+
//# sourceMappingURL=migrations-TGNI4FVL.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/migrations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\n\nimport { ClientCapabilities } from './capabilities';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n\n // NOTE: Migrations are currently unidirectional and idempotent.\n const unsubscribe = effect(() => {\n const migrations = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Migration).flat()));\n const spaces = client.spaces.get();\n void Promise.all(spaces.map((space) => space.db.runMigrations(migrations)));\n });\n\n return contributes(Capabilities.Null, null, () => unsubscribe());\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAAuB;AAEvB,2BAA+D;AAI/D,IAAA,qBAAe,CAACA,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,yCAAmBC,MAAM;AAGlE,QAAMC,kBAAcC,4BAAO,MAAA;AACzB,UAAMC,aAAaC,MAAMC,KAAK,IAAIC,IAAIV,QAAQW,oBAAoBR,yCAAmBS,SAAS,EAAEC,KAAI,CAAA,CAAA;AACpG,UAAMC,SAASb,OAAOa,OAAOC,IAAG;AAChC,SAAKC,QAAQC,IAAIH,OAAOI,IAAI,CAACC,UAAUA,MAAMC,GAAGC,cAAcd,UAAAA,CAAAA,CAAAA;EAChE,CAAA;AAEA,aAAOe,kCAAYC,kCAAaC,MAAM,MAAM,MAAMnB,YAAAA,CAAAA;AACpD;",
|
|
6
|
+
"names": ["context", "client", "requestCapability", "ClientCapabilities", "Client", "unsubscribe", "effect", "migrations", "Array", "from", "Set", "requestCapabilities", "Migration", "flat", "spaces", "get", "Promise", "all", "map", "space", "db", "runMigrations", "contributes", "Capabilities", "Null"]
|
|
7
|
+
}
|
|
@@ -26,57 +26,57 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var react_surface_BSTIXMER_exports = {};
|
|
30
|
+
__export(react_surface_BSTIXMER_exports, {
|
|
31
31
|
default: () => react_surface_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(react_surface_BSTIXMER_exports);
|
|
34
|
+
var import_chunk_3JE5BFCT = require("./chunk-3JE5BFCT.cjs");
|
|
35
|
+
var import_chunk_FROKBEVH = require("./chunk-FROKBEVH.cjs");
|
|
36
36
|
var import_chunk_DJKWB5L6 = require("./chunk-DJKWB5L6.cjs");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_app_framework = require("@dxos/app-framework");
|
|
39
39
|
var react_surface_default = ({ createInvitationUrl, onReset }) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
|
|
40
40
|
(0, import_app_framework.createSurface)({
|
|
41
|
-
id:
|
|
41
|
+
id: import_chunk_FROKBEVH.Account.Profile,
|
|
42
42
|
role: "article",
|
|
43
|
-
filter: (data) => data.subject ===
|
|
44
|
-
component: () => /* @__PURE__ */ import_react.default.createElement(
|
|
43
|
+
filter: (data) => data.subject === import_chunk_FROKBEVH.Account.Profile,
|
|
44
|
+
component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_3JE5BFCT.ProfileContainer, null)
|
|
45
45
|
}),
|
|
46
46
|
(0, import_app_framework.createSurface)({
|
|
47
|
-
id:
|
|
47
|
+
id: import_chunk_FROKBEVH.Account.Devices,
|
|
48
48
|
role: "article",
|
|
49
|
-
filter: (data) => data.subject ===
|
|
50
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
filter: (data) => data.subject === import_chunk_FROKBEVH.Account.Devices,
|
|
50
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_3JE5BFCT.DevicesContainer, {
|
|
51
51
|
createInvitationUrl
|
|
52
52
|
})
|
|
53
53
|
}),
|
|
54
54
|
(0, import_app_framework.createSurface)({
|
|
55
|
-
id:
|
|
55
|
+
id: import_chunk_FROKBEVH.Account.Security,
|
|
56
56
|
role: "article",
|
|
57
|
-
filter: (data) => data.subject ===
|
|
58
|
-
component: () => /* @__PURE__ */ import_react.default.createElement(
|
|
57
|
+
filter: (data) => data.subject === import_chunk_FROKBEVH.Account.Security,
|
|
58
|
+
component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_3JE5BFCT.RecoveryCredentialsContainer, null)
|
|
59
59
|
}),
|
|
60
60
|
(0, import_app_framework.createSurface)({
|
|
61
|
-
id:
|
|
61
|
+
id: import_chunk_3JE5BFCT.JOIN_DIALOG,
|
|
62
62
|
role: "dialog",
|
|
63
|
-
filter: (data) => data.component ===
|
|
64
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
63
|
+
filter: (data) => data.component === import_chunk_3JE5BFCT.JOIN_DIALOG,
|
|
64
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_3JE5BFCT.JoinDialog, data.props)
|
|
65
65
|
}),
|
|
66
66
|
(0, import_app_framework.createSurface)({
|
|
67
|
-
id:
|
|
67
|
+
id: import_chunk_3JE5BFCT.RECOVERY_CODE_DIALOG,
|
|
68
68
|
role: "dialog",
|
|
69
|
-
filter: (data) => data.component ===
|
|
70
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
filter: (data) => data.component === import_chunk_3JE5BFCT.RECOVERY_CODE_DIALOG,
|
|
70
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_3JE5BFCT.RecoveryCodeDialog, data.props)
|
|
71
71
|
}),
|
|
72
72
|
(0, import_app_framework.createSurface)({
|
|
73
|
-
id:
|
|
73
|
+
id: import_chunk_3JE5BFCT.RESET_DIALOG,
|
|
74
74
|
role: "dialog",
|
|
75
|
-
filter: (data) => data.component ===
|
|
76
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
75
|
+
filter: (data) => data.component === import_chunk_3JE5BFCT.RESET_DIALOG,
|
|
76
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_3JE5BFCT.ResetDialog, {
|
|
77
77
|
...data.props,
|
|
78
78
|
onReset
|
|
79
79
|
})
|
|
80
80
|
})
|
|
81
81
|
]);
|
|
82
|
-
//# sourceMappingURL=react-surface-
|
|
82
|
+
//# sourceMappingURL=react-surface-BSTIXMER.cjs.map
|
|
@@ -16,26 +16,24 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
default: () =>
|
|
19
|
+
var schema_INQ72F54_exports = {};
|
|
20
|
+
__export(schema_INQ72F54_exports, {
|
|
21
|
+
default: () => schema_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(schema_INQ72F54_exports);
|
|
24
24
|
var import_chunk_ZVQIICEN = require("./chunk-ZVQIICEN.cjs");
|
|
25
25
|
var import_chunk_DJKWB5L6 = require("./chunk-DJKWB5L6.cjs");
|
|
26
|
+
var import_signals_core = require("@preact/signals-core");
|
|
26
27
|
var import_app_framework = require("@dxos/app-framework");
|
|
27
|
-
var
|
|
28
|
-
const
|
|
29
|
-
const client = context.getCapability(import_chunk_ZVQIICEN.ClientCapabilities.Client);
|
|
28
|
+
var schema_default = (context) => {
|
|
29
|
+
const client = context.requestCapability(import_chunk_ZVQIICEN.ClientCapabilities.Client);
|
|
30
30
|
let previous = [];
|
|
31
|
-
const
|
|
32
|
-
const schemas = Array.from(new Set(
|
|
31
|
+
const unsubscribe = (0, import_signals_core.effect)(() => {
|
|
32
|
+
const schemas = Array.from(new Set(context.requestCapabilities(import_chunk_ZVQIICEN.ClientCapabilities.Schema).flat()));
|
|
33
33
|
const newSchemas = schemas.filter((schema) => !previous.includes(schema));
|
|
34
34
|
previous = schemas;
|
|
35
35
|
client.addTypes(newSchemas);
|
|
36
|
-
}, {
|
|
37
|
-
immediate: true
|
|
38
36
|
});
|
|
39
|
-
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () =>
|
|
37
|
+
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () => unsubscribe());
|
|
40
38
|
};
|
|
41
|
-
//# sourceMappingURL=schema-
|
|
39
|
+
//# sourceMappingURL=schema-INQ72F54.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/schema.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\n\nimport { ClientCapabilities } from './capabilities';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n\n // TODO(wittjosiah): Unregister schemas when they are disabled.\n let previous: TypedObject[] = [];\n const unsubscribe = effect(() => {\n const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));\n // TODO(wittjosiah): Filter out schemas which the client has already registered.\n const newSchemas = schemas.filter((schema) => !previous.includes(schema));\n previous = schemas;\n client.addTypes(newSchemas);\n });\n\n return contributes(Capabilities.Null, null, () => unsubscribe());\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAAuB;AAEvB,2BAA+D;AAK/D,IAAA,iBAAe,CAACA,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,yCAAmBC,MAAM;AAGlE,MAAIC,WAA0B,CAAA;AAC9B,QAAMC,kBAAcC,4BAAO,MAAA;AACzB,UAAMC,UAAUC,MAAMC,KAAK,IAAIC,IAAIX,QAAQY,oBAAoBT,yCAAmBU,MAAM,EAAEC,KAAI,CAAA,CAAA;AAE9F,UAAMC,aAAaP,QAAQQ,OAAO,CAACC,WAAW,CAACZ,SAASa,SAASD,MAAAA,CAAAA;AACjEZ,eAAWG;AACXP,WAAOkB,SAASJ,UAAAA;EAClB,CAAA;AAEA,aAAOK,kCAAYC,kCAAaC,MAAM,MAAM,MAAMhB,YAAAA,CAAAA;AACpD;",
|
|
6
|
+
"names": ["context", "client", "requestCapability", "ClientCapabilities", "Client", "previous", "unsubscribe", "effect", "schemas", "Array", "from", "Set", "requestCapabilities", "Schema", "flat", "newSchemas", "filter", "schema", "includes", "addTypes", "contributes", "Capabilities", "Null"]
|
|
7
|
+
}
|
package/dist/lib/node/types.cjs
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
Account: () =>
|
|
22
|
-
ClientAction: () =>
|
|
21
|
+
Account: () => import_chunk_FROKBEVH.Account,
|
|
22
|
+
ClientAction: () => import_chunk_FROKBEVH.ClientAction
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(types_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_FROKBEVH = require("./chunk-FROKBEVH.cjs");
|
|
26
26
|
var import_chunk_DJKWB5L6 = require("./chunk-DJKWB5L6.cjs");
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["types.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n Account,\n ClientAction\n} from \"./chunk-
|
|
4
|
+
"sourcesContent": ["import {\n Account,\n ClientAction\n} from \"./chunk-FROKBEVH.cjs\";\nimport \"./chunk-DJKWB5L6.cjs\";\nexport {\n Account,\n ClientAction\n};\n//# sourceMappingURL=types.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;AACP,4BAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,51 +5,47 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
Account,
|
|
7
7
|
ClientAction
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AD5W5QCQ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
CLIENT_PLUGIN
|
|
11
11
|
} from "./chunk-HM7VB4ZV.mjs";
|
|
12
12
|
|
|
13
13
|
// packages/plugins/plugin-client/src/capabilities/app-graph-builder.ts
|
|
14
|
-
import { Rx } from "@effect-rx/rx-react";
|
|
15
|
-
import { Option, pipe } from "effect";
|
|
16
14
|
import { createIntent } from "@dxos/app-framework";
|
|
17
15
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
18
|
-
import { createExtension,
|
|
16
|
+
import { createExtension, toSignal } from "@dxos/plugin-graph";
|
|
19
17
|
import { ConnectionState } from "@dxos/react-client/mesh";
|
|
20
18
|
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
21
19
|
id: CLIENT_PLUGIN,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
],
|
|
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+>"
|
|
20
|
+
filter: (node) => node.id === "root",
|
|
21
|
+
actions: () => [
|
|
22
|
+
{
|
|
23
|
+
id: `${CLIENT_PLUGIN}/open-user-account`,
|
|
24
|
+
data: async () => {
|
|
25
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
26
|
+
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
27
|
+
},
|
|
28
|
+
properties: {
|
|
29
|
+
label: [
|
|
30
|
+
"open user account label",
|
|
31
|
+
{
|
|
32
|
+
ns: CLIENT_PLUGIN
|
|
44
33
|
}
|
|
34
|
+
],
|
|
35
|
+
icon: "ph--user--regular",
|
|
36
|
+
keyBinding: {
|
|
37
|
+
macos: "meta+shift+.",
|
|
38
|
+
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
39
|
+
windows: "alt+shift+.",
|
|
40
|
+
linux: "alt+shift+>"
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
connector: (
|
|
50
|
-
const client = context.
|
|
51
|
-
const identity =
|
|
52
|
-
const status =
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
connector: () => {
|
|
46
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
47
|
+
const identity = client.halo.identity.get();
|
|
48
|
+
const status = toSignal((onChange) => client.mesh.networkStatus.subscribe(() => onChange()).unsubscribe, () => client.mesh.networkStatus.get());
|
|
53
49
|
return [
|
|
54
50
|
{
|
|
55
51
|
id: Account.id,
|
|
@@ -67,7 +63,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
67
63
|
userId: identity?.identityKey.toHex(),
|
|
68
64
|
hue: identity?.profile?.data?.hue,
|
|
69
65
|
emoji: identity?.profile?.data?.emoji,
|
|
70
|
-
status: status
|
|
66
|
+
status: status?.swarm === ConnectionState.OFFLINE ? "error" : "active"
|
|
71
67
|
},
|
|
72
68
|
nodes: [
|
|
73
69
|
{
|
|
@@ -116,9 +112,9 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
116
112
|
]
|
|
117
113
|
}
|
|
118
114
|
];
|
|
119
|
-
}
|
|
115
|
+
}
|
|
120
116
|
}));
|
|
121
117
|
export {
|
|
122
118
|
app_graph_builder_default as default
|
|
123
119
|
};
|
|
124
|
-
//# sourceMappingURL=app-graph-builder-
|
|
120
|
+
//# sourceMappingURL=app-graph-builder-KIN6NWFI.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createIntent } from '@dxos/app-framework';\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { createExtension, toSignal, type Node } 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: PluginsContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: `${CLIENT_PLUGIN}/open-user-account`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(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 keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n },\n },\n ],\n connector: () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n const status = toSignal(\n (onChange) => client.mesh.networkStatus.subscribe(() => onChange()).unsubscribe,\n () => client.mesh.networkStatus.get(),\n );\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 }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,SAASA,oBAAoB;AAC7B,SAASC,cAAcC,mBAAwC;AAC/D,SAASC,iBAAiBC,gBAA2B;AACrD,SAASC,uBAAuB;AAMhC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;EAClDI,SAAS,MAAM;IACb;MACEJ,IAAI,GAAGC,aAAAA;MACPI,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKZ,QAAQa,kBAAkBX,aAAaY,gBAAgB;AAC7F,cAAMF,SAASG,aAAaC,aAAaC,aAAa,CAAA;MACxD;MACAC,YAAY;QACVC,OAAO;UAAC;UAA2B;YAAEC,IAAId;UAAc;;QACvDe,MAAM;QACNC,YAAY;UACVC,OAAO;;UAEPC,SAAS;UACTC,OAAO;QACT;MACF;IACF;;EAEFC,WAAW,MAAA;AACT,UAAMC,SAAS3B,QAAQa,kBAAkBe,mBAAmBC,MAAM;AAClE,UAAMC,WAAWH,OAAOI,KAAKD,SAASE,IAAG;AACzC,UAAMC,SAASC,SACb,CAACC,aAAaR,OAAOS,KAAKC,cAAcC,UAAU,MAAMH,SAAAA,CAAAA,EAAYI,aACpE,MAAMZ,OAAOS,KAAKC,cAAcL,IAAG,CAAA;AAGrC,WAAO;MACL;QACE3B,IAAImC,QAAQnC;QACZoC,MAAMnC;QACNY,YAAY;UACVC,OAAO;YAAC;YAAiB;cAAEC,IAAId;YAAc;;UAC7Ce,MAAM;UACNqB,aAAa;;UAEbC,QAAQb,UAAUc,YAAYC,MAAAA;UAC9BC,KAAKhB,UAAUiB,SAASrC,MAAMoC;UAC9BE,OAAOlB,UAAUiB,SAASrC,MAAMsC;UAChCf,QAAQA,QAAQgB,UAAUC,gBAAgBC,UAAU,UAAU;QAChE;QACAC,OAAO;UACL;YACE/C,IAAImC,QAAQa;YACZ3C,MAAM8B,QAAQa;YACdZ,MAAMnC;YACNY,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAId;gBAAc;;cAC7Ce,MAAM;YACR;UACF;UACA;YACEhB,IAAImC,QAAQc;YACZ5C,MAAM8B,QAAQc;YACdb,MAAMnC;YACNY,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAId;gBAAc;;cAC7Ce,MAAM;cACNkC,QAAQ;YACV;UACF;UACA;YACElD,IAAImC,QAAQgB;YACZ9C,MAAM8B,QAAQgB;YACdf,MAAMnC;YACNY,YAAY;cACVC,OAAO;gBAAC;gBAAkB;kBAAEC,IAAId;gBAAc;;cAC9Ce,MAAM;YACR;UACF;;MAEJ;;EAEJ;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["createIntent", "Capabilities", "contributes", "createExtension", "toSignal", "ConnectionState", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "CLIENT_PLUGIN", "filter", "node", "actions", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "connector", "client", "ClientCapabilities", "Client", "identity", "halo", "get", "status", "toSignal", "onChange", "mesh", "networkStatus", "subscribe", "unsubscribe", "Account", "type", "disposition", "userId", "identityKey", "toHex", "hue", "profile", "emoji", "swarm", "ConnectionState", "OFFLINE", "nodes", "Profile", "Devices", "testId", "Security"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
CLIENT_PLUGIN
|
|
4
|
+
} from "./chunk-HM7VB4ZV.mjs";
|
|
5
|
+
|
|
6
|
+
// packages/plugins/plugin-client/src/types.ts
|
|
7
|
+
import { S } from "@dxos/echo-schema";
|
|
8
|
+
import { PublicKey } from "@dxos/react-client";
|
|
9
|
+
var IdentitySchema = S.Struct({
|
|
10
|
+
identityKey: S.instanceOf(PublicKey),
|
|
11
|
+
spaceKey: S.optional(S.instanceOf(PublicKey)),
|
|
12
|
+
profile: S.optional(S.Struct({
|
|
13
|
+
displayName: S.optional(S.String),
|
|
14
|
+
avatarCid: S.optional(S.String),
|
|
15
|
+
data: S.optional(S.Record({
|
|
16
|
+
key: S.String,
|
|
17
|
+
value: S.Any
|
|
18
|
+
}))
|
|
19
|
+
}))
|
|
20
|
+
});
|
|
21
|
+
var CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
|
|
22
|
+
var ClientAction;
|
|
23
|
+
(function(ClientAction2) {
|
|
24
|
+
class CreateIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/create-identity`, {
|
|
25
|
+
input: S.Struct({
|
|
26
|
+
displayName: S.optional(S.String)
|
|
27
|
+
}),
|
|
28
|
+
output: IdentitySchema
|
|
29
|
+
}) {
|
|
30
|
+
}
|
|
31
|
+
ClientAction2.CreateIdentity = CreateIdentity;
|
|
32
|
+
class JoinIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
|
|
33
|
+
input: S.Struct({
|
|
34
|
+
invitationCode: S.optional(S.String)
|
|
35
|
+
}),
|
|
36
|
+
output: S.Void
|
|
37
|
+
}) {
|
|
38
|
+
}
|
|
39
|
+
ClientAction2.JoinIdentity = JoinIdentity;
|
|
40
|
+
class ShareIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/share-identity`, {
|
|
41
|
+
input: S.Void,
|
|
42
|
+
output: S.Void
|
|
43
|
+
}) {
|
|
44
|
+
}
|
|
45
|
+
ClientAction2.ShareIdentity = ShareIdentity;
|
|
46
|
+
class RecoverIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/recover-identity`, {
|
|
47
|
+
input: S.Void,
|
|
48
|
+
output: S.Void
|
|
49
|
+
}) {
|
|
50
|
+
}
|
|
51
|
+
ClientAction2.RecoverIdentity = RecoverIdentity;
|
|
52
|
+
class ResetStorage extends S.TaggedClass()(`${CLIENT_ACTION}/reset-storage`, {
|
|
53
|
+
input: S.Struct({
|
|
54
|
+
mode: S.optional(S.String)
|
|
55
|
+
}),
|
|
56
|
+
output: S.Void
|
|
57
|
+
}) {
|
|
58
|
+
}
|
|
59
|
+
ClientAction2.ResetStorage = ResetStorage;
|
|
60
|
+
class CreateAgent extends S.TaggedClass()(`${CLIENT_ACTION}/create-agent`, {
|
|
61
|
+
input: S.Void,
|
|
62
|
+
output: S.Void
|
|
63
|
+
}) {
|
|
64
|
+
}
|
|
65
|
+
ClientAction2.CreateAgent = CreateAgent;
|
|
66
|
+
class CreateRecoveryCode extends S.TaggedClass()(`${CLIENT_ACTION}/create-recovery-code`, {
|
|
67
|
+
input: S.Void,
|
|
68
|
+
output: S.Void
|
|
69
|
+
}) {
|
|
70
|
+
}
|
|
71
|
+
ClientAction2.CreateRecoveryCode = CreateRecoveryCode;
|
|
72
|
+
class CreatePasskey extends S.TaggedClass()(`${CLIENT_ACTION}/create-passkey`, {
|
|
73
|
+
input: S.Void,
|
|
74
|
+
output: S.Void
|
|
75
|
+
}) {
|
|
76
|
+
}
|
|
77
|
+
ClientAction2.CreatePasskey = CreatePasskey;
|
|
78
|
+
class RedeemPasskey extends S.TaggedClass()(`${CLIENT_ACTION}/redeem-passkey`, {
|
|
79
|
+
input: S.Void,
|
|
80
|
+
output: S.Void
|
|
81
|
+
}) {
|
|
82
|
+
}
|
|
83
|
+
ClientAction2.RedeemPasskey = RedeemPasskey;
|
|
84
|
+
class RedeemToken extends S.TaggedClass()(`${CLIENT_ACTION}/redeem-token`, {
|
|
85
|
+
input: S.Struct({
|
|
86
|
+
token: S.String
|
|
87
|
+
}),
|
|
88
|
+
output: S.Void
|
|
89
|
+
}) {
|
|
90
|
+
}
|
|
91
|
+
ClientAction2.RedeemToken = RedeemToken;
|
|
92
|
+
})(ClientAction || (ClientAction = {}));
|
|
93
|
+
var Account;
|
|
94
|
+
(function(Account2) {
|
|
95
|
+
const _id = "dxos.org.plugin.client.account";
|
|
96
|
+
Account2.id = `!${_id}`;
|
|
97
|
+
Account2.Profile = `${_id}.profile`;
|
|
98
|
+
Account2.Devices = `${_id}.devices`;
|
|
99
|
+
Account2.Security = `${_id}.security`;
|
|
100
|
+
})(Account || (Account = {}));
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
ClientAction,
|
|
104
|
+
Account
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=chunk-AD5W5QCQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginsContext } from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { type Client, PublicKey, type ClientOptions } from '@dxos/react-client';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { CLIENT_PLUGIN } from './meta';\n\n// TODO(wittjosiah): Factor out. Generate?\nconst IdentitySchema = S.Struct({\n identityKey: S.instanceOf(PublicKey),\n spaceKey: S.optional(S.instanceOf(PublicKey)),\n profile: S.optional(\n S.Struct({\n displayName: S.optional(S.String),\n avatarCid: S.optional(S.String),\n data: S.optional(S.Record({ key: S.String, value: S.Any })),\n }),\n ),\n});\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport namespace ClientAction {\n export class CreateIdentity extends S.TaggedClass<CreateIdentity>()(`${CLIENT_ACTION}/create-identity`, {\n input: S.Struct({\n displayName: S.optional(S.String),\n }),\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends S.TaggedClass<JoinIdentity>()(`${CLIENT_ACTION}/join-identity`, {\n input: S.Struct({\n invitationCode: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class ShareIdentity extends S.TaggedClass<ShareIdentity>()(`${CLIENT_ACTION}/share-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RecoverIdentity extends S.TaggedClass<RecoverIdentity>()(`${CLIENT_ACTION}/recover-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class ResetStorage extends S.TaggedClass<ResetStorage>()(`${CLIENT_ACTION}/reset-storage`, {\n input: S.Struct({\n mode: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class CreateAgent extends S.TaggedClass<CreateAgent>()(`${CLIENT_ACTION}/create-agent`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreateRecoveryCode extends S.TaggedClass<CreateRecoveryCode>()(`${CLIENT_ACTION}/create-recovery-code`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreatePasskey extends S.TaggedClass<CreatePasskey>()(`${CLIENT_ACTION}/create-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RedeemPasskey extends S.TaggedClass<RedeemPasskey>()(`${CLIENT_ACTION}/redeem-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RedeemToken extends S.TaggedClass<RedeemToken>()(`${CLIENT_ACTION}/redeem-token`, {\n input: S.Struct({\n token: S.String,\n }),\n output: S.Void,\n }) {}\n}\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (context: PluginsContext, client: Client) => MaybePromise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => MaybePromise<void>;\n};\n\nexport namespace Account {\n // TODO(wittjosiah): Cannot use slashes in ids until we have a router which decouples ids from url paths.\n const _id = 'dxos.org.plugin.client.account';\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n export const id = `!${_id}`;\n\n export const Profile = `${_id}.profile`;\n export const Devices = `${_id}.devices`;\n export const Security = `${_id}.security`;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["S", "PublicKey", "IdentitySchema", "S", "Struct", "identityKey", "instanceOf", "PublicKey", "spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "CLIENT_ACTION", "CLIENT_PLUGIN", "ClientAction", "CreateIdentity", "TaggedClass", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "mode", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey", "RedeemToken", "token", "Account", "_id", "id", "Profile", "Devices", "Security"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ClientAction
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AD5W5QCQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CLIENT_PLUGIN
|
|
7
7
|
} from "./chunk-HM7VB4ZV.mjs";
|
|
@@ -17,7 +17,7 @@ import { useDevices } from "@dxos/react-client/halo";
|
|
|
17
17
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
18
18
|
import { useNetworkStatus } from "@dxos/react-client/mesh";
|
|
19
19
|
import { Button, Clipboard, IconButton, List, useId, useTranslation } from "@dxos/react-ui";
|
|
20
|
-
import { ControlFrame, ControlFrameItem, ControlGroup, ControlItem,
|
|
20
|
+
import { ControlFrame, ControlFrameItem, ControlGroup, ControlItem, ControlSection } from "@dxos/react-ui-form";
|
|
21
21
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
22
22
|
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
23
23
|
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from "@dxos/shell/react";
|
|
@@ -42,8 +42,8 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
42
42
|
dispatch
|
|
43
43
|
]);
|
|
44
44
|
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
45
|
-
classNames: "block overflow-y-auto"
|
|
46
|
-
}, /* @__PURE__ */ React.createElement(
|
|
45
|
+
classNames: "p-2 block overflow-y-auto"
|
|
46
|
+
}, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
47
47
|
title: t("devices verbose label", {
|
|
48
48
|
ns: CLIENT_PLUGIN
|
|
49
49
|
}),
|
|
@@ -60,7 +60,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
60
60
|
device,
|
|
61
61
|
connectionState
|
|
62
62
|
});
|
|
63
|
-
}))),
|
|
63
|
+
}))), /* @__PURE__ */ React.createElement(ControlFrameItem, {
|
|
64
64
|
title: "Add device"
|
|
65
65
|
}, /* @__PURE__ */ React.createElement(DeviceInvitation, {
|
|
66
66
|
createInvitationUrl
|
|
@@ -98,7 +98,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
98
98
|
variant: "destructive",
|
|
99
99
|
onClick: handleJoinNewIdentity,
|
|
100
100
|
"data-testid": "devicesContainer.joinExisting"
|
|
101
|
-
}, t("join new identity label")))))))
|
|
101
|
+
}, t("join new identity label")))))));
|
|
102
102
|
};
|
|
103
103
|
var DeviceInvitation = (props) => {
|
|
104
104
|
const client = useClient();
|
|
@@ -114,7 +114,7 @@ var DeviceInvitation = (props) => {
|
|
|
114
114
|
authCode: invitation3.authCode
|
|
115
115
|
}), void 0, {
|
|
116
116
|
F: __dxlog_file,
|
|
117
|
-
L:
|
|
117
|
+
L: 122,
|
|
118
118
|
S: void 0,
|
|
119
119
|
C: (f, a) => f(...a)
|
|
120
120
|
});
|
|
@@ -223,16 +223,12 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
223
223
|
}))), /* @__PURE__ */ React.createElement("span", {
|
|
224
224
|
id: qrLabel,
|
|
225
225
|
className: "sr-only"
|
|
226
|
-
}, t("qr label"))
|
|
227
|
-
className: "flex justify-center"
|
|
228
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
229
|
-
className: "flex gap-2"
|
|
230
|
-
}, /* @__PURE__ */ React.createElement(Clipboard.Button, {
|
|
226
|
+
}, t("qr label")), /* @__PURE__ */ React.createElement(Clipboard.Button, {
|
|
231
227
|
value: url ?? "never"
|
|
232
|
-
}), /* @__PURE__ */ React.createElement(Button, {
|
|
228
|
+
})), /* @__PURE__ */ React.createElement(Button, {
|
|
233
229
|
variant: "ghost",
|
|
234
230
|
onClick: onCancel
|
|
235
|
-
}, t("cancel label")))
|
|
231
|
+
}, t("cancel label")));
|
|
236
232
|
};
|
|
237
233
|
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
238
234
|
const { t } = useTranslation("os");
|
|
@@ -310,13 +306,13 @@ var JoinDialog = (props) => {
|
|
|
310
306
|
};
|
|
311
307
|
|
|
312
308
|
// packages/plugins/plugin-client/src/components/ProfileContainer.tsx
|
|
313
|
-
import { Schema } from "effect";
|
|
309
|
+
import { Schema as S } from "effect";
|
|
314
310
|
import React3, { useCallback as useCallback3, useMemo, useState as useState2 } from "react";
|
|
315
311
|
import { debounce } from "@dxos/async";
|
|
316
312
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
317
313
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
318
314
|
import { ButtonGroup, Clipboard as Clipboard2, Input, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
319
|
-
import { Form, ControlItem as ControlItem2, ControlItemInput, ControlSection as ControlSection2
|
|
315
|
+
import { Form, ControlItem as ControlItem2, ControlItemInput, ControlSection as ControlSection2 } from "@dxos/react-ui-form";
|
|
320
316
|
import { EmojiPickerBlock, HuePicker } from "@dxos/react-ui-pickers";
|
|
321
317
|
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
322
318
|
import { hexToHue, hexToEmoji as hexToEmoji2 } from "@dxos/util";
|
|
@@ -429,8 +425,8 @@ var ProfileContainer = () => {
|
|
|
429
425
|
t
|
|
430
426
|
]);
|
|
431
427
|
return /* @__PURE__ */ React3.createElement(StackItem2.Content, {
|
|
432
|
-
classNames: "block overflow-y-auto"
|
|
433
|
-
}, /* @__PURE__ */ React3.createElement(
|
|
428
|
+
classNames: "p-2 block overflow-y-auto"
|
|
429
|
+
}, /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(ControlSection2, {
|
|
434
430
|
title: t("profile label"),
|
|
435
431
|
description: t("profile description")
|
|
436
432
|
}, /* @__PURE__ */ React3.createElement(Form, {
|
|
@@ -440,19 +436,19 @@ var ProfileContainer = () => {
|
|
|
440
436
|
onSave: handleSave,
|
|
441
437
|
Custom: customElements,
|
|
442
438
|
classNames: 'p-0 container-max-width [&_[role="form"]]:grid [&_[role="form"]]:grid-cols-1 md:[&_[role="form"]]:grid-cols-[1fr_min-content] [&_[role="form"]]:gap-4'
|
|
443
|
-
}))))
|
|
439
|
+
}))));
|
|
444
440
|
};
|
|
445
|
-
var ProfileSchema =
|
|
446
|
-
displayName:
|
|
441
|
+
var ProfileSchema = S.Struct({
|
|
442
|
+
displayName: S.String.annotations({
|
|
447
443
|
title: "Display name"
|
|
448
444
|
}),
|
|
449
|
-
emoji:
|
|
445
|
+
emoji: S.String.annotations({
|
|
450
446
|
title: "Avatar"
|
|
451
447
|
}),
|
|
452
|
-
hue:
|
|
448
|
+
hue: S.String.annotations({
|
|
453
449
|
title: "Color"
|
|
454
450
|
}),
|
|
455
|
-
did:
|
|
451
|
+
did: S.String.annotations({
|
|
456
452
|
title: "DID"
|
|
457
453
|
})
|
|
458
454
|
});
|
|
@@ -513,7 +509,7 @@ import React5 from "react";
|
|
|
513
509
|
import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
514
510
|
import { useCredentials } from "@dxos/react-client/halo";
|
|
515
511
|
import { Icon, IconButton as IconButton2, List as List2, ListItem, useTranslation as useTranslation5, Message } from "@dxos/react-ui";
|
|
516
|
-
import { ControlGroup as ControlGroup2, ControlItem as ControlItem3,
|
|
512
|
+
import { ControlGroup as ControlGroup2, ControlItem as ControlItem3, ControlSection as ControlSection3 } from "@dxos/react-ui-form";
|
|
517
513
|
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
518
514
|
var MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;
|
|
519
515
|
var RecoveryCredentialsContainer = () => {
|
|
@@ -522,8 +518,8 @@ var RecoveryCredentialsContainer = () => {
|
|
|
522
518
|
const credentials = useCredentials();
|
|
523
519
|
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
524
520
|
return /* @__PURE__ */ React5.createElement(StackItem3.Content, {
|
|
525
|
-
classNames: "block overflow-y-auto"
|
|
526
|
-
}, /* @__PURE__ */ React5.createElement(
|
|
521
|
+
classNames: "p-2 block overflow-y-auto"
|
|
522
|
+
}, /* @__PURE__ */ React5.createElement(ControlSection3, {
|
|
527
523
|
title: t("recovery setup dialog title"),
|
|
528
524
|
description: t("recovery setup dialog description")
|
|
529
525
|
}, /* @__PURE__ */ React5.createElement(ControlGroup2, null, /* @__PURE__ */ React5.createElement(ControlItem3, {
|
|
@@ -560,7 +556,7 @@ var RecoveryCredentialsContainer = () => {
|
|
|
560
556
|
}, /* @__PURE__ */ React5.createElement(ListItem.Endcap, null, /* @__PURE__ */ React5.createElement(Icon, {
|
|
561
557
|
icon: "ph--key--regular",
|
|
562
558
|
size: 5
|
|
563
|
-
})), /* @__PURE__ */ React5.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString()))))))
|
|
559
|
+
})), /* @__PURE__ */ React5.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString()))))));
|
|
564
560
|
};
|
|
565
561
|
|
|
566
562
|
// packages/plugins/plugin-client/src/components/ResetDialog.tsx
|
|
@@ -621,4 +617,4 @@ export {
|
|
|
621
617
|
RESET_DIALOG,
|
|
622
618
|
ResetDialog
|
|
623
619
|
};
|
|
624
|
-
//# sourceMappingURL=chunk-
|
|
620
|
+
//# sourceMappingURL=chunk-LZN2UNN7.mjs.map
|