@dxos/plugin-client 0.7.5-labs.ea4b4c2 → 0.7.5-labs.f400bbc
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-JRQVJHEH.mjs → app-graph-builder-ON64R7SO.mjs} +2 -2
- package/dist/lib/browser/{chunk-GYCVFUTM.mjs → chunk-7DPLXOMO.mjs} +2 -2
- package/dist/lib/browser/chunk-7DPLXOMO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BFNE5KCF.mjs → chunk-EYBZZHSM.mjs} +2 -2
- package/dist/lib/browser/{chunk-MSK3TLIH.mjs → chunk-GHEQL2E6.mjs} +1 -2
- package/dist/lib/browser/{chunk-MSK3TLIH.mjs.map → chunk-GHEQL2E6.mjs.map} +3 -3
- package/dist/lib/browser/{client-BY3RGW3H.mjs → client-A7YSVURS.mjs} +2 -2
- package/dist/lib/browser/index.mjs +9 -9
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-LWSDA6RM.mjs → intent-resolver-XZ2FBRQN.mjs} +13 -11
- package/dist/lib/browser/{intent-resolver-LWSDA6RM.mjs.map → intent-resolver-XZ2FBRQN.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-PHX2CVI7.mjs → react-context-R3SG55F5.mjs} +2 -2
- package/dist/lib/browser/{react-surface-6BINNBEX.mjs → react-surface-XGOUHVIH.mjs} +3 -3
- package/dist/lib/browser/{schema-AL34NY2M.mjs → schema-J4MJIXRP.mjs} +3 -13
- package/dist/lib/browser/schema-J4MJIXRP.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-R6QR2VLZ.cjs → app-graph-builder-RW7ESEX3.cjs} +6 -6
- package/dist/lib/node/{chunk-3P5BBMXO.cjs → chunk-7LVBFGKQ.cjs} +13 -13
- package/dist/lib/node/{chunk-NZKGFE46.cjs → chunk-TREVKZCJ.cjs} +5 -5
- package/dist/lib/node/chunk-TREVKZCJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-ZI7AV5RP.cjs → chunk-UHIGZJQL.cjs} +4 -5
- package/dist/lib/node/{chunk-ZI7AV5RP.cjs.map → chunk-UHIGZJQL.cjs.map} +3 -3
- package/dist/lib/node/{client-JCI7A3IV.cjs → client-2RQATBB6.cjs} +6 -6
- package/dist/lib/node/index.cjs +10 -10
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/{intent-resolver-ODZVEAZ2.cjs → intent-resolver-MKNGTBJU.cjs} +34 -32
- package/dist/lib/node/{intent-resolver-ODZVEAZ2.cjs.map → intent-resolver-MKNGTBJU.cjs.map} +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-context-WMOFXPT4.cjs → react-context-TD6VGBVA.cjs} +6 -6
- package/dist/lib/node/{react-surface-KRKGFWS3.cjs → react-surface-IY7GXEGU.cjs} +21 -21
- package/dist/lib/node/{schema-HW4W3QYU.cjs → schema-JXJS75HQ.cjs} +8 -18
- package/dist/lib/node/schema-JXJS75HQ.cjs.map +7 -0
- package/dist/lib/node/types.cjs +2 -2
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-WXXGCOJB.mjs → app-graph-builder-TDYRWNI7.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-2FPF25KT.mjs → chunk-CRF22MJJ.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-M2NR7HNG.mjs → chunk-QJMF2MWP.mjs} +2 -2
- package/dist/lib/node-esm/chunk-QJMF2MWP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-B73LKPGU.mjs → chunk-T35SFKK3.mjs} +1 -2
- package/dist/lib/node-esm/{chunk-B73LKPGU.mjs.map → chunk-T35SFKK3.mjs.map} +3 -3
- package/dist/lib/node-esm/{client-XWK653HB.mjs → client-36DKBSB7.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +9 -9
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-resolver-IHYGJREB.mjs → intent-resolver-M72XLGTY.mjs} +13 -11
- package/dist/lib/node-esm/{intent-resolver-IHYGJREB.mjs.map → intent-resolver-M72XLGTY.mjs.map} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-context-EEGDXBWA.mjs → react-context-ZOGDOWJ2.mjs} +2 -2
- package/dist/lib/node-esm/{react-surface-OQFDVSAP.mjs → react-surface-F3PDFJMV.mjs} +3 -3
- package/dist/lib/node-esm/{schema-74LVJ3EU.mjs → schema-XM4HBLIX.mjs} +3 -13
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +110 -110
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +111 -111
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema.d.ts.map +1 -1
- package/dist/types/src/components/IdentityDialog.d.ts +1 -2
- package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -2
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/ManageCredentialsDialog.d.ts +1 -2
- package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -2
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoverySetupDialog.d.ts +1 -2
- package/dist/types/src/components/RecoverySetupDialog.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +1 -1
- package/package.json +20 -19
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/capabilities.ts +0 -2
- package/src/capabilities/intent-resolver.ts +9 -4
- package/src/capabilities/schema.ts +3 -13
- package/src/types.ts +1 -1
- package/dist/lib/browser/chunk-GYCVFUTM.mjs.map +0 -7
- package/dist/lib/browser/schema-AL34NY2M.mjs.map +0 -7
- package/dist/lib/node/chunk-NZKGFE46.cjs.map +0 -7
- package/dist/lib/node/schema-HW4W3QYU.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-M2NR7HNG.mjs.map +0 -7
- package/dist/lib/node-esm/schema-74LVJ3EU.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-JRQVJHEH.mjs.map → app-graph-builder-ON64R7SO.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-BFNE5KCF.mjs.map → chunk-EYBZZHSM.mjs.map} +0 -0
- /package/dist/lib/browser/{client-BY3RGW3H.mjs.map → client-A7YSVURS.mjs.map} +0 -0
- /package/dist/lib/browser/{react-context-PHX2CVI7.mjs.map → react-context-R3SG55F5.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-6BINNBEX.mjs.map → react-surface-XGOUHVIH.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-R6QR2VLZ.cjs.map → app-graph-builder-RW7ESEX3.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-3P5BBMXO.cjs.map → chunk-7LVBFGKQ.cjs.map} +0 -0
- /package/dist/lib/node/{client-JCI7A3IV.cjs.map → client-2RQATBB6.cjs.map} +0 -0
- /package/dist/lib/node/{react-context-WMOFXPT4.cjs.map → react-context-TD6VGBVA.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-KRKGFWS3.cjs.map → react-surface-IY7GXEGU.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-WXXGCOJB.mjs.map → app-graph-builder-TDYRWNI7.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-2FPF25KT.mjs.map → chunk-CRF22MJJ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{client-XWK653HB.mjs.map → client-36DKBSB7.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-context-EEGDXBWA.mjs.map → react-context-ZOGDOWJ2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-OQFDVSAP.mjs.map → react-surface-F3PDFJMV.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GHEQL2E6.mjs";
|
|
4
4
|
import "./chunk-NHIL4T3L.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-client/src/capabilities/schema.ts
|
|
@@ -8,13 +8,6 @@ import { effect } from "@preact/signals-core";
|
|
|
8
8
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
9
9
|
var schema_default = (context) => {
|
|
10
10
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
11
|
-
let previousSystem = [];
|
|
12
|
-
const unsubscribeSystem = effect(() => {
|
|
13
|
-
const systemSchemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.SystemSchema).flat()));
|
|
14
|
-
const newSchemas = systemSchemas.filter((schema) => !previousSystem.includes(schema));
|
|
15
|
-
previousSystem = systemSchemas;
|
|
16
|
-
client.addTypes(newSchemas);
|
|
17
|
-
});
|
|
18
11
|
let previous = [];
|
|
19
12
|
const unsubscribe = effect(() => {
|
|
20
13
|
const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));
|
|
@@ -22,12 +15,9 @@ var schema_default = (context) => {
|
|
|
22
15
|
previous = schemas;
|
|
23
16
|
client.addTypes(newSchemas);
|
|
24
17
|
});
|
|
25
|
-
return contributes(Capabilities.Null, null, () =>
|
|
26
|
-
unsubscribeSystem();
|
|
27
|
-
unsubscribe();
|
|
28
|
-
});
|
|
18
|
+
return contributes(Capabilities.Null, null, () => unsubscribe());
|
|
29
19
|
};
|
|
30
20
|
export {
|
|
31
21
|
schema_default as default
|
|
32
22
|
};
|
|
33
|
-
//# sourceMappingURL=schema-
|
|
23
|
+
//# sourceMappingURL=schema-J4MJIXRP.mjs.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,SAASA,cAAc;AAEvB,SAASC,cAAcC,mBAAwC;AAK/D,IAAA,iBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,mBAAmBC,MAAM;AAGlE,MAAIC,WAA0B,CAAA;AAC9B,QAAMC,cAAcC,OAAO,MAAA;AACzB,UAAMC,UAAUC,MAAMC,KAAK,IAAIC,IAAIX,QAAQY,oBAAoBT,mBAAmBU,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,SAAOK,YAAYC,aAAaC,MAAM,MAAM,MAAMhB,YAAAA,CAAAA;AACpD;",
|
|
6
|
+
"names": ["effect", "Capabilities", "contributes", "context", "client", "requestCapability", "ClientCapabilities", "Client", "previous", "unsubscribe", "effect", "schemas", "Array", "from", "Set", "requestCapabilities", "Schema", "flat", "newSchemas", "filter", "schema", "includes", "addTypes", "contributes", "Capabilities", "Null"]
|
|
7
|
+
}
|
|
@@ -16,12 +16,12 @@ 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 app_graph_builder_RW7ESEX3_exports = {};
|
|
20
|
+
__export(app_graph_builder_RW7ESEX3_exports, {
|
|
21
21
|
default: () => app_graph_builder_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(app_graph_builder_RW7ESEX3_exports);
|
|
24
|
+
var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
|
|
25
25
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
26
26
|
var import_app_framework = require("@dxos/app-framework");
|
|
27
27
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
@@ -34,7 +34,7 @@ var app_graph_builder_default = (context) => (0, import_app_framework2.contribut
|
|
|
34
34
|
id: `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/open-shell`,
|
|
35
35
|
data: async () => {
|
|
36
36
|
const { dispatchPromise: dispatch } = context.requestCapability(import_app_framework2.Capabilities.IntentDispatcher);
|
|
37
|
-
await dispatch((0, import_app_framework.createIntent)(
|
|
37
|
+
await dispatch((0, import_app_framework.createIntent)(import_chunk_TREVKZCJ.ClientAction.ShareIdentity));
|
|
38
38
|
},
|
|
39
39
|
properties: {
|
|
40
40
|
label: [
|
|
@@ -55,4 +55,4 @@ var app_graph_builder_default = (context) => (0, import_app_framework2.contribut
|
|
|
55
55
|
}
|
|
56
56
|
]
|
|
57
57
|
}));
|
|
58
|
-
//# sourceMappingURL=app-graph-builder-
|
|
58
|
+
//# sourceMappingURL=app-graph-builder-RW7ESEX3.cjs.map
|
|
@@ -26,8 +26,8 @@ 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 chunk_7LVBFGKQ_exports = {};
|
|
30
|
+
__export(chunk_7LVBFGKQ_exports, {
|
|
31
31
|
IDENTITY_DIALOG: () => IDENTITY_DIALOG,
|
|
32
32
|
IdentityDialog: () => IdentityDialog,
|
|
33
33
|
JOIN_DIALOG: () => JOIN_DIALOG,
|
|
@@ -39,8 +39,8 @@ __export(chunk_3P5BBMXO_exports, {
|
|
|
39
39
|
RecoveryCodeDialog: () => RecoveryCodeDialog,
|
|
40
40
|
RecoverySetupDialog: () => RecoverySetupDialog
|
|
41
41
|
});
|
|
42
|
-
module.exports = __toCommonJS(
|
|
43
|
-
var
|
|
42
|
+
module.exports = __toCommonJS(chunk_7LVBFGKQ_exports);
|
|
43
|
+
var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
|
|
44
44
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
45
45
|
var import_react = require("@phosphor-icons/react");
|
|
46
46
|
var import_react2 = __toESM(require("react"));
|
|
@@ -77,13 +77,13 @@ var ManageCredentialsDialog = () => {
|
|
|
77
77
|
description: t("create passkey description"),
|
|
78
78
|
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
79
79
|
icon: import_react.Key,
|
|
80
|
-
onClick: () => dispatch((0, import_app_framework.createIntent)(
|
|
80
|
+
onClick: () => dispatch((0, import_app_framework.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreatePasskey))
|
|
81
81
|
},
|
|
82
82
|
createRecoveryCode: {
|
|
83
83
|
label: t("create recovery code label"),
|
|
84
84
|
description: t("create recovery code description"),
|
|
85
85
|
icon: import_react.Receipt,
|
|
86
|
-
onClick: () => dispatch((0, import_app_framework.createIntent)(
|
|
86
|
+
onClick: () => dispatch((0, import_app_framework.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreateRecoveryCode))
|
|
87
87
|
}
|
|
88
88
|
}), [
|
|
89
89
|
t
|
|
@@ -117,13 +117,13 @@ var IdentityDialog = (props) => {
|
|
|
117
117
|
]);
|
|
118
118
|
const handleResetStorage = (0, import_react4.useCallback)(async () => {
|
|
119
119
|
await client.reset();
|
|
120
|
-
await dispatch((0, import_app_framework2.createIntent)(
|
|
120
|
+
await dispatch((0, import_app_framework2.createIntent)(import_chunk_TREVKZCJ.ClientAction.ResetStorage));
|
|
121
121
|
}, [
|
|
122
122
|
dispatch
|
|
123
123
|
]);
|
|
124
124
|
const handleRecover = (0, import_react4.useCallback)(async () => {
|
|
125
125
|
await client.reset();
|
|
126
|
-
await dispatch((0, import_app_framework2.createIntent)(
|
|
126
|
+
await dispatch((0, import_app_framework2.createIntent)(import_chunk_TREVKZCJ.ClientAction.ResetStorage, {
|
|
127
127
|
target: "recoverIdentity"
|
|
128
128
|
}));
|
|
129
129
|
}, [
|
|
@@ -131,7 +131,7 @@ var IdentityDialog = (props) => {
|
|
|
131
131
|
]);
|
|
132
132
|
const handleJoinNewIdentity = (0, import_react4.useCallback)(async () => {
|
|
133
133
|
await client.reset();
|
|
134
|
-
await dispatch((0, import_app_framework2.createIntent)(
|
|
134
|
+
await dispatch((0, import_app_framework2.createIntent)(import_chunk_TREVKZCJ.ClientAction.ResetStorage, {
|
|
135
135
|
target: "deviceInvitation"
|
|
136
136
|
}));
|
|
137
137
|
}, [
|
|
@@ -164,7 +164,7 @@ var IdentityDialog = (props) => {
|
|
|
164
164
|
var JOIN_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/JoinDialog`;
|
|
165
165
|
var JoinDialog = (props) => {
|
|
166
166
|
const { dispatchPromise: dispatch } = (0, import_app_framework3.useIntentDispatcher)();
|
|
167
|
-
const handleCancelResetStorage = (0, import_react6.useCallback)(() => dispatch((0, import_app_framework3.createIntent)(
|
|
167
|
+
const handleCancelResetStorage = (0, import_react6.useCallback)(() => dispatch((0, import_app_framework3.createIntent)(import_chunk_TREVKZCJ.ClientAction.ShareIdentity)), [
|
|
168
168
|
dispatch
|
|
169
169
|
]);
|
|
170
170
|
const handleDone = (0, import_react6.useCallback)(async (result) => {
|
|
@@ -255,7 +255,7 @@ var RecoverySetupDialog = () => {
|
|
|
255
255
|
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
256
256
|
icon: import_react9.Key,
|
|
257
257
|
onClick: async () => {
|
|
258
|
-
await dispatch((0, import_app_framework4.createIntent)(
|
|
258
|
+
await dispatch((0, import_app_framework4.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreatePasskey));
|
|
259
259
|
await dispatch((0, import_app_framework4.createIntent)(import_app_framework4.LayoutAction.UpdateDialog, {
|
|
260
260
|
part: "dialog",
|
|
261
261
|
options: {
|
|
@@ -268,7 +268,7 @@ var RecoverySetupDialog = () => {
|
|
|
268
268
|
label: t("create recovery code label"),
|
|
269
269
|
description: t("create recovery code description"),
|
|
270
270
|
icon: import_react9.Receipt,
|
|
271
|
-
onClick: () => dispatch((0, import_app_framework4.createIntent)(
|
|
271
|
+
onClick: () => dispatch((0, import_app_framework4.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreateRecoveryCode))
|
|
272
272
|
}
|
|
273
273
|
}), [
|
|
274
274
|
t
|
|
@@ -296,4 +296,4 @@ var RecoverySetupDialog = () => {
|
|
|
296
296
|
RecoveryCodeDialog,
|
|
297
297
|
RecoverySetupDialog
|
|
298
298
|
});
|
|
299
|
-
//# sourceMappingURL=chunk-
|
|
299
|
+
//# sourceMappingURL=chunk-7LVBFGKQ.cjs.map
|
|
@@ -16,11 +16,11 @@ 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 chunk_TREVKZCJ_exports = {};
|
|
20
|
+
__export(chunk_TREVKZCJ_exports, {
|
|
21
21
|
ClientAction: () => ClientAction
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_TREVKZCJ_exports);
|
|
24
24
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
25
25
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
26
26
|
var import_react_client = require("@dxos/react-client");
|
|
@@ -49,7 +49,7 @@ var ClientAction;
|
|
|
49
49
|
ClientAction2.CreateIdentity = CreateIdentity;
|
|
50
50
|
class JoinIdentity extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
|
|
51
51
|
input: import_echo_schema.S.Struct({
|
|
52
|
-
invitationCode: import_echo_schema.S.String
|
|
52
|
+
invitationCode: import_echo_schema.S.optional(import_echo_schema.S.String)
|
|
53
53
|
}),
|
|
54
54
|
output: import_echo_schema.S.Void
|
|
55
55
|
}) {
|
|
@@ -104,4 +104,4 @@ var ClientAction;
|
|
|
104
104
|
0 && (module.exports = {
|
|
105
105
|
ClientAction
|
|
106
106
|
});
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-TREVKZCJ.cjs.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 target: 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\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAKA,yBAAkB;AAClB,0BAA2D;AAM3D,IAAMA,iBAAiBC,qBAAEC,OAAO;EAC9BC,aAAaF,qBAAEG,WAAWC,6BAAAA;EAC1BC,UAAUL,qBAAEM,SAASN,qBAAEG,WAAWC,6BAAAA,CAAAA;EAClCG,SAASP,qBAAEM,SACTN,qBAAEC,OAAO;IACPO,aAAaR,qBAAEM,SAASN,qBAAES,MAAM;IAChCC,WAAWV,qBAAEM,SAASN,qBAAES,MAAM;IAC9BE,MAAMX,qBAAEM,SAASN,qBAAEY,OAAO;MAAEC,KAAKb,qBAAES;MAAQK,OAAOd,qBAAEe;IAAI,CAAA,CAAA;EAC1D,CAAA,CAAA;AAEJ,CAAA;AAEA,IAAMC,gBAAgB,GAAGC,mCAAAA;;UACRC,eAAAA;EACR,MAAMC,uBAAuBnB,qBAAEoB,YAAW,EAAmB,GAAGJ,aAAAA,oBAAiC;IACtGK,OAAOrB,qBAAEC,OAAO;MACdO,aAAaR,qBAAEM,SAASN,qBAAES,MAAM;IAClC,CAAA;IACAa,QAAQvB;EACV,CAAA,EAAA;EAAI;gBALSoB,iBAAAA;EAON,MAAMI,qBAAqBvB,qBAAEoB,YAAW,EAAiB,GAAGJ,aAAAA,kBAA+B;IAChGK,OAAOrB,qBAAEC,OAAO;MACduB,gBAAgBxB,qBAAEM,SAASN,qBAAES,MAAM;IACrC,CAAA;IACAa,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBALSF,eAAAA;EAON,MAAMG,sBAAsB1B,qBAAEoB,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSC,gBAAAA;EAKN,MAAMC,wBAAwB3B,qBAAEoB,YAAW,EAAoB,GAAGJ,aAAAA,qBAAkC;IACzGK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSE,kBAAAA;EAKN,MAAMC,qBAAqB5B,qBAAEoB,YAAW,EAAiB,GAAGJ,aAAAA,kBAA+B;IAChGK,OAAOrB,qBAAEC,OAAO;MACd4B,QAAQ7B,qBAAEM,SAASN,qBAAES,MAAM;IAC7B,CAAA;IACAa,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBALSG,eAAAA;EAON,MAAME,oBAAoB9B,qBAAEoB,YAAW,EAAgB,GAAGJ,aAAAA,iBAA8B;IAC7FK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSK,cAAAA;EAKN,MAAMC,2BAA2B/B,qBAAEoB,YAAW,EAAuB,GAAGJ,aAAAA,yBAAsC;IACnHK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSM,qBAAAA;EAKN,MAAMC,sBAAsBhC,qBAAEoB,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSO,gBAAAA;EAKN,MAAMC,sBAAsBjC,qBAAEoB,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSQ,gBAAAA;AAIf,GAnDiBf,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["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", "target", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey"]
|
|
7
|
+
}
|
|
@@ -16,21 +16,20 @@ 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 chunk_UHIGZJQL_exports = {};
|
|
20
|
+
__export(chunk_UHIGZJQL_exports, {
|
|
21
21
|
ClientCapabilities: () => ClientCapabilities
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_UHIGZJQL_exports);
|
|
24
24
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
25
25
|
var import_app_framework = require("@dxos/app-framework");
|
|
26
26
|
var ClientCapabilities;
|
|
27
27
|
(function(ClientCapabilities2) {
|
|
28
28
|
ClientCapabilities2.Client = (0, import_app_framework.defineCapability)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/capability/client`);
|
|
29
29
|
ClientCapabilities2.Schema = (0, import_app_framework.defineCapability)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/capability/schema`);
|
|
30
|
-
ClientCapabilities2.SystemSchema = (0, import_app_framework.defineCapability)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/capability/system-schema`);
|
|
31
30
|
})(ClientCapabilities || (ClientCapabilities = {}));
|
|
32
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
32
|
0 && (module.exports = {
|
|
34
33
|
ClientCapabilities
|
|
35
34
|
});
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-UHIGZJQL.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\nimport { type Client } from '@dxos/react-client';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport namespace ClientCapabilities {\n export const Client = defineCapability<Client>(`${CLIENT_PLUGIN}/capability/client`);\n export const Schema = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/schema`);\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAiC;;UAMhBA,qBAAAA;sBACFC,aAASC,uCAAyB,GAAGC,mCAAAA,oBAAiC;sBACtEC,aAASF,uCAAgC,GAAGC,mCAAAA,oBAAiC;
|
|
6
|
-
"names": ["ClientCapabilities", "Client", "defineCapability", "CLIENT_PLUGIN", "Schema"
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\nimport { type Client } from '@dxos/react-client';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport namespace ClientCapabilities {\n export const Client = defineCapability<Client>(`${CLIENT_PLUGIN}/capability/client`);\n export const Schema = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/schema`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAiC;;UAMhBA,qBAAAA;sBACFC,aAASC,uCAAyB,GAAGC,mCAAAA,oBAAiC;sBACtEC,aAASF,uCAAgC,GAAGC,mCAAAA,oBAAiC;AAC5F,GAHiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["ClientCapabilities", "Client", "defineCapability", "CLIENT_PLUGIN", "Schema"]
|
|
7
7
|
}
|
|
@@ -16,13 +16,13 @@ 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 client_2RQATBB6_exports = {};
|
|
20
|
+
__export(client_2RQATBB6_exports, {
|
|
21
21
|
default: () => client_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(client_2RQATBB6_exports);
|
|
24
24
|
var import_chunk_XPC4JOPP = require("./chunk-XPC4JOPP.cjs");
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_UHIGZJQL = require("./chunk-UHIGZJQL.cjs");
|
|
26
26
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
27
27
|
var import_app_framework = require("@dxos/app-framework");
|
|
28
28
|
var import_react_client = require("@dxos/react-client");
|
|
@@ -42,9 +42,9 @@ var client_default = async ({ context, onClientInitialized, ...options }) => {
|
|
|
42
42
|
await context.activate(import_chunk_XPC4JOPP.ClientEvents.SpacesReady);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
return (0, import_app_framework.contributes)(
|
|
45
|
+
return (0, import_app_framework.contributes)(import_chunk_UHIGZJQL.ClientCapabilities.Client, client, async () => {
|
|
46
46
|
subscription.unsubscribe();
|
|
47
47
|
await client.destroy();
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=client-
|
|
50
|
+
//# sourceMappingURL=client-2RQATBB6.cjs.map
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -29,23 +29,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
31
|
CLIENT_PLUGIN: () => import_chunk_OIFPM5ZW.CLIENT_PLUGIN,
|
|
32
|
-
ClientCapabilities: () =>
|
|
32
|
+
ClientCapabilities: () => import_chunk_UHIGZJQL.ClientCapabilities,
|
|
33
33
|
ClientEvents: () => import_chunk_XPC4JOPP.ClientEvents,
|
|
34
34
|
ClientPlugin: () => ClientPlugin,
|
|
35
35
|
meta: () => import_chunk_OIFPM5ZW.meta
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(node_exports);
|
|
38
38
|
var import_chunk_XPC4JOPP = require("./chunk-XPC4JOPP.cjs");
|
|
39
|
-
var
|
|
39
|
+
var import_chunk_UHIGZJQL = require("./chunk-UHIGZJQL.cjs");
|
|
40
40
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
41
41
|
var import_app_framework = require("@dxos/app-framework");
|
|
42
42
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
43
|
-
var AppGraphBuilder = (0, import_app_framework2.lazy)(async () => import("./app-graph-builder-
|
|
44
|
-
var Client = (0, import_app_framework2.lazy)(async () => import("./client-
|
|
45
|
-
var IntentResolver = (0, import_app_framework2.lazy)(async () => import("./intent-resolver-
|
|
46
|
-
var ReactContext = (0, import_app_framework2.lazy)(async () => import("./react-context-
|
|
47
|
-
var ReactSurface = (0, import_app_framework2.lazy)(async () => import("./react-surface-
|
|
48
|
-
var Schema = (0, import_app_framework2.lazy)(async () => import("./schema-
|
|
43
|
+
var AppGraphBuilder = (0, import_app_framework2.lazy)(async () => import("./app-graph-builder-RW7ESEX3.cjs"));
|
|
44
|
+
var Client = (0, import_app_framework2.lazy)(async () => import("./client-2RQATBB6.cjs"));
|
|
45
|
+
var IntentResolver = (0, import_app_framework2.lazy)(async () => import("./intent-resolver-MKNGTBJU.cjs"));
|
|
46
|
+
var ReactContext = (0, import_app_framework2.lazy)(async () => import("./react-context-TD6VGBVA.cjs"));
|
|
47
|
+
var ReactSurface = (0, import_app_framework2.lazy)(async () => import("./react-surface-IY7GXEGU.cjs"));
|
|
48
|
+
var Schema = (0, import_app_framework2.lazy)(async () => import("./schema-JXJS75HQ.cjs"));
|
|
49
49
|
var translations_default = [
|
|
50
50
|
{
|
|
51
51
|
"en-US": {
|
|
@@ -101,7 +101,7 @@ var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam =
|
|
|
101
101
|
}),
|
|
102
102
|
(0, import_app_framework.defineModule)({
|
|
103
103
|
id: `${import_chunk_OIFPM5ZW.meta.id}/module/react-surface`,
|
|
104
|
-
activatesOn: import_app_framework.Events.
|
|
104
|
+
activatesOn: import_app_framework.Events.SetupReactSurface,
|
|
105
105
|
activate: () => ReactSurface({
|
|
106
106
|
createInvitationUrl
|
|
107
107
|
})
|
|
@@ -113,7 +113,7 @@ var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam =
|
|
|
113
113
|
}),
|
|
114
114
|
(0, import_app_framework.defineModule)({
|
|
115
115
|
id: `${import_chunk_OIFPM5ZW.meta.id}/module/intent-resolver`,
|
|
116
|
-
activatesOn: import_app_framework.Events.
|
|
116
|
+
activatesOn: import_app_framework.Events.SetupIntentResolver,
|
|
117
117
|
activate: (context) => IntentResolver({
|
|
118
118
|
context,
|
|
119
119
|
onReset
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ClientPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport { Client, AppGraphBuilder, IntentResolver, ReactContext, ReactSurface, Schema } from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport { Client, AppGraphBuilder, IntentResolver, ReactContext, ReactSurface, Schema } from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\nexport const Schema = lazy(async () => import('./schema'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'recovery setup dialog title': 'Account Recovery',\n 'recovery setup dialog description':\n 'In order to recover your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.',\n 'create passkey label': 'Create Passkey',\n 'create passkey description':\n 'A passkey is a secure and easy to use credential that can be used to recover your account.',\n 'create recovery code label': 'Create Recovery Code',\n 'create recovery code description': 'A recovery code is 12 word phrase representing a private key.',\n 'recovery code dialog title': 'Recovery Code',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAqF;ACArF,IAAAA,wBAAqB;AAEd,IAAMC,sBAAkBC,4BAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,aAASD,4BAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,qBAAiBF,4BAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,mBAAeH,4BAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMI,mBAAeJ,4BAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMK,aAASL,4BAAK,YAAY,OAAO,uBAAA,CAAA;ACL9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACM,mCAAAA,GAAgB;QACf,oBAAoB;QACpB,mCAAmC;QACnC,+BAA+B;QAC/B,qCACE;QACF,wBAAwB;QACxB,8BACE;QACF,8BAA8B;QAC9B,oCAAoC;QACpC,8BAA8B;QAC9B,oCACE;QACF,kCAAkC;QAClC,kCACE;QACF,oCAAoC;QACpC,kBAAkB;MACpB;IACF;EACF;;AFlBK,IAAMC,eAAe,CAAC,EAC3BC,gBAAgBC,OAAOC,SAASC,QAChCC,kBAAkB,wBAClBC,SACA,GAAGC,QAAAA,MACiB;AACpB,QAAMC,sBAAsB,CAACC,mBAAAA;AAC3B,UAAMC,UAAU,IAAIC,IAAIV,aAAAA;AACxBS,YAAQE,aAAaC,IAAIR,iBAAiBI,cAAAA;AAC1C,WAAOC,QAAQI,SAAQ;EACzB;AAEA,aAAOC,mCAAaC,4BAAM;QACxBC,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,iBAAaC,4BAAMC,4BAAOC,SAASD,4BAAOE,aAAa;MACvDC,gBAAgB;QAACC,mCAAaC;;MAC9BC,UAAU,CAACC,YAAYlC,OAAO;QAAE,GAAGa;QAASqB;MAAQ,CAAA;IACtD,CAAA;QACAX,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaM,mCAAaC;MAC1BG,iBAAiB;QAACJ,mCAAaK;;MAC/BH,UAAU7B;IACZ,CAAA;QACAmB,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOC;MACpBK,UAAU/B;IACZ,CAAA;QACAqB,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOU;MACpBJ,UAAU,MAAM9B,aAAa;QAAEW;MAAoB,CAAA;IACrD,CAAA;QACAS,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOE;MACpBI,UAAUnC;IACZ,CAAA;QACAyB,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOW;MACpBL,UAAU,CAACC,YAAYjC,eAAe;QAAEiC;QAAStB;MAAQ,CAAA;IAC3D,CAAA;QACAW,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOY;MACpBN,UAAU,UAAMO,kCAAYC,kCAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
|
|
6
|
-
"names": ["import_app_framework", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "ReactContext", "ReactSurface", "Schema", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "activatesBefore", "SetupSchema", "
|
|
6
|
+
"names": ["import_app_framework", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "ReactContext", "ReactSurface", "Schema", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "activatesBefore", "SetupSchema", "SetupReactSurface", "SetupIntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
|
|
7
7
|
}
|
|
@@ -16,15 +16,15 @@ 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 intent_resolver_MKNGTBJU_exports = {};
|
|
20
|
+
__export(intent_resolver_MKNGTBJU_exports, {
|
|
21
21
|
default: () => intent_resolver_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(intent_resolver_MKNGTBJU_exports);
|
|
24
24
|
var import_chunk_XPC4JOPP = require("./chunk-XPC4JOPP.cjs");
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
25
|
+
var import_chunk_7LVBFGKQ = require("./chunk-7LVBFGKQ.cjs");
|
|
26
|
+
var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
|
|
27
|
+
var import_chunk_UHIGZJQL = require("./chunk-UHIGZJQL.cjs");
|
|
28
28
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
29
29
|
var import_app_framework = require("@dxos/app-framework");
|
|
30
30
|
var import_invariant = require("@dxos/invariant");
|
|
@@ -33,10 +33,10 @@ var import_react_client = require("@dxos/react-client");
|
|
|
33
33
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/capabilities/intent-resolver.ts";
|
|
34
34
|
var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.IntentResolver, [
|
|
35
35
|
(0, import_app_framework.createResolver)({
|
|
36
|
-
intent:
|
|
36
|
+
intent: import_chunk_TREVKZCJ.ClientAction.CreateIdentity,
|
|
37
37
|
resolve: async () => {
|
|
38
38
|
const manager = context.requestCapability(import_app_framework.Capabilities.PluginManager);
|
|
39
|
-
const client = context.requestCapability(
|
|
39
|
+
const client = context.requestCapability(import_chunk_UHIGZJQL.ClientCapabilities.Client);
|
|
40
40
|
const data = await client.halo.createIdentity();
|
|
41
41
|
await manager.activate(import_chunk_XPC4JOPP.ClientEvents.IdentityCreated);
|
|
42
42
|
return {
|
|
@@ -50,13 +50,13 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
50
50
|
}
|
|
51
51
|
}),
|
|
52
52
|
(0, import_app_framework.createResolver)({
|
|
53
|
-
intent:
|
|
53
|
+
intent: import_chunk_TREVKZCJ.ClientAction.JoinIdentity,
|
|
54
54
|
resolve: async (data) => {
|
|
55
55
|
return {
|
|
56
56
|
intents: [
|
|
57
57
|
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
|
|
58
58
|
part: "dialog",
|
|
59
|
-
subject:
|
|
59
|
+
subject: import_chunk_7LVBFGKQ.JOIN_DIALOG,
|
|
60
60
|
options: {
|
|
61
61
|
blockAlign: "start",
|
|
62
62
|
props: {
|
|
@@ -70,13 +70,13 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
70
70
|
}
|
|
71
71
|
}),
|
|
72
72
|
(0, import_app_framework.createResolver)({
|
|
73
|
-
intent:
|
|
73
|
+
intent: import_chunk_TREVKZCJ.ClientAction.ShareIdentity,
|
|
74
74
|
resolve: async () => {
|
|
75
75
|
return {
|
|
76
76
|
intents: [
|
|
77
77
|
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
|
|
78
78
|
part: "dialog",
|
|
79
|
-
subject:
|
|
79
|
+
subject: import_chunk_7LVBFGKQ.IDENTITY_DIALOG,
|
|
80
80
|
options: {
|
|
81
81
|
blockAlign: "start"
|
|
82
82
|
}
|
|
@@ -89,13 +89,13 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
89
89
|
}
|
|
90
90
|
}),
|
|
91
91
|
(0, import_app_framework.createResolver)({
|
|
92
|
-
intent:
|
|
92
|
+
intent: import_chunk_TREVKZCJ.ClientAction.RecoverIdentity,
|
|
93
93
|
resolve: async () => {
|
|
94
94
|
return {
|
|
95
95
|
intents: [
|
|
96
96
|
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
|
|
97
97
|
part: "dialog",
|
|
98
|
-
subject:
|
|
98
|
+
subject: import_chunk_7LVBFGKQ.JOIN_DIALOG,
|
|
99
99
|
options: {
|
|
100
100
|
blockAlign: "start",
|
|
101
101
|
props: {
|
|
@@ -108,7 +108,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
108
108
|
}
|
|
109
109
|
}),
|
|
110
110
|
(0, import_app_framework.createResolver)({
|
|
111
|
-
intent:
|
|
111
|
+
intent: import_chunk_TREVKZCJ.ClientAction.ResetStorage,
|
|
112
112
|
resolve: async (data) => {
|
|
113
113
|
await onReset?.({
|
|
114
114
|
target: data.target
|
|
@@ -116,9 +116,9 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
116
116
|
}
|
|
117
117
|
}),
|
|
118
118
|
(0, import_app_framework.createResolver)({
|
|
119
|
-
intent:
|
|
119
|
+
intent: import_chunk_TREVKZCJ.ClientAction.CreateAgent,
|
|
120
120
|
resolve: async () => {
|
|
121
|
-
const client = context.requestCapability(
|
|
121
|
+
const client = context.requestCapability(import_chunk_UHIGZJQL.ClientCapabilities.Client);
|
|
122
122
|
(0, import_invariant.invariant)(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
123
123
|
F: __dxlog_file,
|
|
124
124
|
L: 106,
|
|
@@ -134,9 +134,9 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
134
134
|
}
|
|
135
135
|
}),
|
|
136
136
|
(0, import_app_framework.createResolver)({
|
|
137
|
-
intent:
|
|
137
|
+
intent: import_chunk_TREVKZCJ.ClientAction.CreateRecoveryCode,
|
|
138
138
|
resolve: async () => {
|
|
139
|
-
const client = context.requestCapability(
|
|
139
|
+
const client = context.requestCapability(import_chunk_UHIGZJQL.ClientCapabilities.Client);
|
|
140
140
|
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
141
141
|
F: __dxlog_file,
|
|
142
142
|
L: 114,
|
|
@@ -151,7 +151,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
151
151
|
intents: [
|
|
152
152
|
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
|
|
153
153
|
part: "dialog",
|
|
154
|
-
subject:
|
|
154
|
+
subject: import_chunk_7LVBFGKQ.RECOVER_CODE_DIALOG,
|
|
155
155
|
options: {
|
|
156
156
|
blockAlign: "start",
|
|
157
157
|
type: "alert",
|
|
@@ -165,9 +165,9 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
165
165
|
}
|
|
166
166
|
}),
|
|
167
167
|
(0, import_app_framework.createResolver)({
|
|
168
|
-
intent:
|
|
168
|
+
intent: import_chunk_TREVKZCJ.ClientAction.CreatePasskey,
|
|
169
169
|
resolve: async () => {
|
|
170
|
-
const client = context.requestCapability(
|
|
170
|
+
const client = context.requestCapability(import_chunk_UHIGZJQL.ClientCapabilities.Client);
|
|
171
171
|
const identity = client.halo.identity.get();
|
|
172
172
|
(0, import_invariant.invariant)(identity, "Identity not available", {
|
|
173
173
|
F: __dxlog_file,
|
|
@@ -178,6 +178,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
178
178
|
"'Identity not available'"
|
|
179
179
|
]
|
|
180
180
|
});
|
|
181
|
+
const lookupKey = import_react_client.PublicKey.random();
|
|
181
182
|
const credential = await navigator.credentials.create({
|
|
182
183
|
publicKey: {
|
|
183
184
|
challenge: new Uint8Array(),
|
|
@@ -186,7 +187,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
186
187
|
name: appName
|
|
187
188
|
},
|
|
188
189
|
user: {
|
|
189
|
-
id:
|
|
190
|
+
id: lookupKey.asUint8Array(),
|
|
190
191
|
name: identity.did,
|
|
191
192
|
displayName: identity.profile?.displayName ?? ""
|
|
192
193
|
},
|
|
@@ -209,7 +210,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
209
210
|
});
|
|
210
211
|
(0, import_invariant.invariant)(credential, "Credential not available", {
|
|
211
212
|
F: __dxlog_file,
|
|
212
|
-
L:
|
|
213
|
+
L: 162,
|
|
213
214
|
S: void 0,
|
|
214
215
|
A: [
|
|
215
216
|
"credential",
|
|
@@ -220,7 +221,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
220
221
|
const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
|
|
221
222
|
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
222
223
|
F: __dxlog_file,
|
|
223
|
-
L:
|
|
224
|
+
L: 167,
|
|
224
225
|
S: void 0,
|
|
225
226
|
A: [
|
|
226
227
|
"client.services.services.IdentityService",
|
|
@@ -229,17 +230,18 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
229
230
|
});
|
|
230
231
|
await client.services.services.IdentityService.createRecoveryCredential({
|
|
231
232
|
recoveryKey,
|
|
232
|
-
algorithm
|
|
233
|
+
algorithm,
|
|
234
|
+
lookupKey
|
|
233
235
|
});
|
|
234
236
|
}
|
|
235
237
|
}),
|
|
236
238
|
(0, import_app_framework.createResolver)({
|
|
237
|
-
intent:
|
|
239
|
+
intent: import_chunk_TREVKZCJ.ClientAction.RedeemPasskey,
|
|
238
240
|
resolve: async () => {
|
|
239
|
-
const client = context.requestCapability(
|
|
241
|
+
const client = context.requestCapability(import_chunk_UHIGZJQL.ClientCapabilities.Client);
|
|
240
242
|
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
241
243
|
F: __dxlog_file,
|
|
242
|
-
L:
|
|
244
|
+
L: 180,
|
|
243
245
|
S: void 0,
|
|
244
246
|
A: [
|
|
245
247
|
"client.services.services.IdentityService",
|
|
@@ -254,10 +256,10 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
254
256
|
userVerification: "required"
|
|
255
257
|
}
|
|
256
258
|
});
|
|
257
|
-
const
|
|
259
|
+
const lookupKey = import_react_client.PublicKey.from(new Uint8Array(credential.response.userHandle));
|
|
258
260
|
await client.services.services.IdentityService.recoverIdentity({
|
|
259
261
|
external: {
|
|
260
|
-
|
|
262
|
+
lookupKey,
|
|
261
263
|
deviceKey,
|
|
262
264
|
controlFeedKey,
|
|
263
265
|
signature: Buffer.from(credential.response.signature),
|
|
@@ -268,4 +270,4 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => (0
|
|
|
268
270
|
}
|
|
269
271
|
})
|
|
270
272
|
]);
|
|
271
|
-
//# sourceMappingURL=intent-resolver-
|
|
273
|
+
//# sourceMappingURL=intent-resolver-MKNGTBJU.cjs.map
|