@dxos/plugin-client 0.8.2-staging.7ac8446 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{app-graph-builder-WAS4YZNA.mjs → app-graph-builder-CBRN2DMK.mjs} +36 -32
- package/dist/lib/browser/app-graph-builder-CBRN2DMK.mjs.map +7 -0
- package/dist/lib/browser/chunk-DCUIJY75.mjs +694 -0
- package/dist/lib/browser/chunk-DCUIJY75.mjs.map +7 -0
- package/dist/lib/browser/chunk-IA3AVM4I.mjs +111 -0
- package/dist/lib/browser/chunk-IA3AVM4I.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BGY6BSUC.mjs → chunk-PSSNS4C6.mjs} +2 -2
- package/dist/lib/{node-esm/chunk-K3KGGSJZ.mjs.map → browser/chunk-PSSNS4C6.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-4PLF3BEB.mjs → chunk-UCVFWBKT.mjs} +2 -2
- package/dist/lib/{node-esm/chunk-BP56BGZR.mjs.map → browser/chunk-UCVFWBKT.mjs.map} +1 -1
- package/dist/lib/browser/{client-LV67Q3R7.mjs → client-NMS3MSFP.mjs} +5 -4
- package/dist/lib/browser/client-NMS3MSFP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -12
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-NCISOZW4.mjs → intent-resolver-KGM6A3BF.mjs} +14 -14
- package/dist/lib/browser/intent-resolver-KGM6A3BF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/migrations-QRQV6ZAM.mjs +23 -0
- package/dist/lib/browser/migrations-QRQV6ZAM.mjs.map +7 -0
- package/dist/lib/browser/{react-context-WEH7SL4I.mjs → react-context-IE2O2OYK.mjs} +2 -2
- package/dist/lib/browser/{react-surface-J7SZR2J6.mjs → react-surface-CKZHHWY3.mjs} +3 -3
- package/dist/lib/browser/schema-defs-DNRDVQQJ.mjs +25 -0
- package/dist/lib/browser/schema-defs-DNRDVQQJ.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-PXOJZJO5.cjs → app-graph-builder-BEEYM3A5.cjs} +45 -41
- package/dist/lib/node/app-graph-builder-BEEYM3A5.cjs.map +7 -0
- package/dist/lib/node/chunk-73HHNJMV.cjs +719 -0
- package/dist/lib/node/chunk-73HHNJMV.cjs.map +7 -0
- package/dist/lib/node/chunk-BL6EBWOS.cjs +131 -0
- package/dist/lib/node/chunk-BL6EBWOS.cjs.map +7 -0
- package/dist/lib/node/{chunk-ZVQIICEN.cjs → chunk-CIYUKY3J.cjs} +5 -5
- package/dist/lib/node/{chunk-ZVQIICEN.cjs.map → chunk-CIYUKY3J.cjs.map} +1 -1
- package/dist/lib/node/{chunk-W64EOF2B.cjs → chunk-DNKJCPU7.cjs} +5 -5
- package/dist/lib/node/{chunk-W64EOF2B.cjs.map → chunk-DNKJCPU7.cjs.map} +1 -1
- package/dist/lib/node/{client-BKTGRBYM.cjs → client-Q3EQS4HA.cjs} +10 -9
- package/dist/lib/node/client-Q3EQS4HA.cjs.map +7 -0
- package/dist/lib/node/index.cjs +19 -19
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-U2576ALY.cjs → intent-resolver-Q4QBA5B2.cjs} +34 -34
- package/dist/lib/node/intent-resolver-Q4QBA5B2.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{migrations-TGNI4FVL.cjs → migrations-6FEWMF7U.cjs} +12 -10
- package/dist/lib/node/migrations-6FEWMF7U.cjs.map +7 -0
- package/dist/lib/node/{react-context-SF3M3YLR.cjs → react-context-JS7Y5ZOK.cjs} +6 -6
- package/dist/lib/node/{react-surface-BSTIXMER.cjs → react-surface-GHKLUOKW.cjs} +24 -24
- package/dist/lib/node/{schema-INQ72F54.cjs → schema-defs-TA52ARBO.cjs} +14 -12
- package/dist/lib/node/schema-defs-TA52ARBO.cjs.map +7 -0
- package/dist/lib/node/types.cjs +3 -3
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-KIN6NWFI.mjs → app-graph-builder-OZEAAKNT.mjs} +36 -32
- package/dist/lib/node-esm/app-graph-builder-OZEAAKNT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-K3KGGSJZ.mjs → chunk-37E3EI46.mjs} +2 -2
- package/dist/lib/{browser/chunk-BGY6BSUC.mjs.map → node-esm/chunk-37E3EI46.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-BP56BGZR.mjs → chunk-FJYSQRBO.mjs} +2 -2
- package/dist/lib/{browser/chunk-4PLF3BEB.mjs.map → node-esm/chunk-FJYSQRBO.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-STGGUFV2.mjs +112 -0
- package/dist/lib/node-esm/chunk-STGGUFV2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ULXZABZ4.mjs +695 -0
- package/dist/lib/node-esm/chunk-ULXZABZ4.mjs.map +7 -0
- package/dist/lib/node-esm/{client-QQD6WFOB.mjs → client-EBFQZRSF.mjs} +5 -4
- package/dist/lib/node-esm/client-EBFQZRSF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +12 -12
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-G25U4UGI.mjs → intent-resolver-2GCG4LCE.mjs} +14 -14
- package/dist/lib/node-esm/intent-resolver-2GCG4LCE.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-IVGATGZR.mjs → migrations-AK43ZE6G.mjs} +9 -7
- package/dist/lib/node-esm/migrations-AK43ZE6G.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-EAKKTE5A.mjs → react-context-6N7NMUJE.mjs} +2 -2
- package/dist/lib/node-esm/{react-surface-ZPI7T4EM.mjs → react-surface-UCUL26AF.mjs} +3 -3
- package/dist/lib/node-esm/schema-defs-O2KQQXJH.mjs +26 -0
- package/dist/lib/node-esm/schema-defs-O2KQQXJH.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts +3 -3
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -181
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +2 -2
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +4 -0
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- package/dist/types/src/components/DevicesContainer.d.ts +4 -3
- package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/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 +59 -53
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -26
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +94 -76
- package/src/capabilities/client.ts +4 -3
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/intent-resolver.ts +11 -11
- package/src/capabilities/migrations.ts +14 -11
- package/src/capabilities/schema-defs.ts +29 -0
- package/src/components/DevicesContainer.stories.tsx +7 -3
- package/src/components/DevicesContainer.tsx +85 -61
- package/src/components/ProfileContainer.stories.tsx +1 -1
- package/src/components/ProfileContainer.tsx +30 -21
- package/src/components/RecoveryCodeDialog.stories.tsx +1 -1
- package/src/components/RecoveryCredentialsContainer.stories.tsx +2 -2
- package/src/components/RecoveryCredentialsContainer.tsx +48 -46
- package/src/components/ResetDialog.stories.tsx +7 -1
- package/src/translations.ts +2 -2
- package/src/types.ts +60 -47
- package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +0 -7
- package/dist/lib/browser/chunk-AN7FJKIJ.mjs +0 -105
- package/dist/lib/browser/chunk-AN7FJKIJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-XZ4TQC56.mjs +0 -619
- package/dist/lib/browser/chunk-XZ4TQC56.mjs.map +0 -7
- package/dist/lib/browser/client-LV67Q3R7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-NCISOZW4.mjs.map +0 -7
- package/dist/lib/browser/migrations-3DWFOL5Q.mjs +0 -21
- package/dist/lib/browser/migrations-3DWFOL5Q.mjs.map +0 -7
- package/dist/lib/browser/schema-JQAT6Q7S.mjs +0 -23
- package/dist/lib/browser/schema-JQAT6Q7S.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +0 -7
- package/dist/lib/node/chunk-3JE5BFCT.cjs +0 -644
- package/dist/lib/node/chunk-3JE5BFCT.cjs.map +0 -7
- package/dist/lib/node/chunk-FROKBEVH.cjs +0 -125
- package/dist/lib/node/chunk-FROKBEVH.cjs.map +0 -7
- package/dist/lib/node/client-BKTGRBYM.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-U2576ALY.cjs.map +0 -7
- package/dist/lib/node/migrations-TGNI4FVL.cjs.map +0 -7
- package/dist/lib/node/schema-INQ72F54.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs +0 -106
- package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LZN2UNN7.mjs +0 -620
- package/dist/lib/node-esm/chunk-LZN2UNN7.mjs.map +0 -7
- package/dist/lib/node-esm/client-QQD6WFOB.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-G25U4UGI.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-IVGATGZR.mjs.map +0 -7
- package/dist/lib/node-esm/schema-OK7HY3JJ.mjs +0 -24
- package/dist/lib/node-esm/schema-OK7HY3JJ.mjs.map +0 -7
- package/dist/types/src/capabilities/schema.d.ts +0 -4
- package/dist/types/src/capabilities/schema.d.ts.map +0 -1
- package/src/capabilities/schema.ts +0 -26
- /package/dist/lib/browser/{react-context-WEH7SL4I.mjs.map → react-context-IE2O2OYK.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-J7SZR2J6.mjs.map → react-surface-CKZHHWY3.mjs.map} +0 -0
- /package/dist/lib/node/{react-context-SF3M3YLR.cjs.map → react-context-JS7Y5ZOK.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-BSTIXMER.cjs.map → react-surface-GHKLUOKW.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-context-EAKKTE5A.mjs.map → react-context-6N7NMUJE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-ZPI7T4EM.mjs.map → react-surface-UCUL26AF.mjs.map} +0 -0
|
@@ -16,24 +16,26 @@ 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_defs_TA52ARBO_exports = {};
|
|
20
|
+
__export(schema_defs_TA52ARBO_exports, {
|
|
21
|
+
default: () => schema_defs_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(schema_defs_TA52ARBO_exports);
|
|
24
|
+
var import_chunk_CIYUKY3J = require("./chunk-CIYUKY3J.cjs");
|
|
25
25
|
var import_chunk_DJKWB5L6 = require("./chunk-DJKWB5L6.cjs");
|
|
26
|
-
var import_signals_core = require("@preact/signals-core");
|
|
27
26
|
var import_app_framework = require("@dxos/app-framework");
|
|
28
|
-
var
|
|
29
|
-
const
|
|
27
|
+
var schema_defs_default = (context) => {
|
|
28
|
+
const registry = context.getCapability(import_app_framework.Capabilities.RxRegistry);
|
|
29
|
+
const client = context.getCapability(import_chunk_CIYUKY3J.ClientCapabilities.Client);
|
|
30
30
|
let previous = [];
|
|
31
|
-
const
|
|
32
|
-
const schemas = Array.from(new Set(
|
|
31
|
+
const cancel = registry.subscribe(context.capabilities(import_chunk_CIYUKY3J.ClientCapabilities.Schema), (_schemas) => {
|
|
32
|
+
const schemas = Array.from(new Set(_schemas.flat()));
|
|
33
33
|
const newSchemas = schemas.filter((schema) => !previous.includes(schema));
|
|
34
34
|
previous = schemas;
|
|
35
35
|
client.addTypes(newSchemas);
|
|
36
|
+
}, {
|
|
37
|
+
immediate: true
|
|
36
38
|
});
|
|
37
|
-
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () =>
|
|
39
|
+
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () => cancel());
|
|
38
40
|
};
|
|
39
|
-
//# sourceMappingURL=schema-
|
|
41
|
+
//# sourceMappingURL=schema-defs-TA52ARBO.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/schema-defs.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\n\nimport { ClientCapabilities } from './capabilities';\n\nexport default (context: PluginContext) => {\n const registry = context.getCapability(Capabilities.RxRegistry);\n const client = context.getCapability(ClientCapabilities.Client);\n\n // TODO(wittjosiah): Unregister schemas when they are disabled.\n let previous: TypedObject[] = [];\n const cancel = registry.subscribe(\n context.capabilities(ClientCapabilities.Schema),\n (_schemas) => {\n const schemas = Array.from(new Set(_schemas.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 { immediate: true },\n );\n\n return contributes(Capabilities.Null, null, () => cancel());\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA8D;AAK9D,IAAA,sBAAe,CAACA,YAAAA;AACd,QAAMC,WAAWD,QAAQE,cAAcC,kCAAaC,UAAU;AAC9D,QAAMC,SAASL,QAAQE,cAAcI,yCAAmBC,MAAM;AAG9D,MAAIC,WAA0B,CAAA;AAC9B,QAAMC,SAASR,SAASS,UACtBV,QAAQW,aAAaL,yCAAmBM,MAAM,GAC9C,CAACC,aAAAA;AACC,UAAMC,UAAUC,MAAMC,KAAK,IAAIC,IAAIJ,SAASK,KAAI,CAAA,CAAA;AAEhD,UAAMC,aAAaL,QAAQM,OAAO,CAACC,WAAW,CAACb,SAASc,SAASD,MAAAA,CAAAA;AACjEb,eAAWM;AACXT,WAAOkB,SAASJ,UAAAA;EAClB,GACA;IAAEK,WAAW;EAAK,CAAA;AAGpB,aAAOC,kCAAYtB,kCAAauB,MAAM,MAAM,MAAMjB,OAAAA,CAAAA;AACpD;",
|
|
6
|
+
"names": ["context", "registry", "getCapability", "Capabilities", "RxRegistry", "client", "ClientCapabilities", "Client", "previous", "cancel", "subscribe", "capabilities", "Schema", "_schemas", "schemas", "Array", "from", "Set", "flat", "newSchemas", "filter", "schema", "includes", "addTypes", "immediate", "contributes", "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_BL6EBWOS.Account,
|
|
22
|
+
ClientAction: () => import_chunk_BL6EBWOS.ClientAction
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(types_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_BL6EBWOS = require("./chunk-BL6EBWOS.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-BL6EBWOS.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
|
}
|
|
@@ -1,51 +1,55 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ClientCapabilities
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-37E3EI46.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Account,
|
|
7
7
|
ClientAction
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-STGGUFV2.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";
|
|
14
16
|
import { createIntent } from "@dxos/app-framework";
|
|
15
17
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
16
|
-
import { createExtension,
|
|
18
|
+
import { createExtension, rxFromObservable, ROOT_ID } from "@dxos/plugin-graph";
|
|
17
19
|
import { ConnectionState } from "@dxos/react-client/mesh";
|
|
18
20
|
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
19
21
|
id: CLIENT_PLUGIN,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
id: `${CLIENT_PLUGIN}/open-user-account`,
|
|
26
|
+
data: async () => {
|
|
27
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
28
|
+
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
29
|
+
},
|
|
30
|
+
properties: {
|
|
31
|
+
label: [
|
|
32
|
+
"open user account label",
|
|
33
|
+
{
|
|
34
|
+
ns: CLIENT_PLUGIN
|
|
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+>"
|
|
33
44
|
}
|
|
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+>"
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
],
|
|
45
|
-
connector: () => {
|
|
46
|
-
const client = context.
|
|
47
|
-
const identity = client.halo.identity
|
|
48
|
-
const status =
|
|
47
|
+
];
|
|
48
|
+
}), Option.getOrElse(() => []))),
|
|
49
|
+
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
50
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
51
|
+
const identity = get(rxFromObservable(client.halo.identity));
|
|
52
|
+
const status = get(rxFromObservable(client.mesh.networkStatus));
|
|
49
53
|
return [
|
|
50
54
|
{
|
|
51
55
|
id: Account.id,
|
|
@@ -63,7 +67,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
63
67
|
userId: identity?.identityKey.toHex(),
|
|
64
68
|
hue: identity?.profile?.data?.hue,
|
|
65
69
|
emoji: identity?.profile?.data?.emoji,
|
|
66
|
-
status: status
|
|
70
|
+
status: status.swarm === ConnectionState.OFFLINE ? "error" : "active"
|
|
67
71
|
},
|
|
68
72
|
nodes: [
|
|
69
73
|
{
|
|
@@ -112,9 +116,9 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
112
116
|
]
|
|
113
117
|
}
|
|
114
118
|
];
|
|
115
|
-
}
|
|
119
|
+
}), Option.getOrElse(() => [])))
|
|
116
120
|
}));
|
|
117
121
|
export {
|
|
118
122
|
app_graph_builder_default as default
|
|
119
123
|
};
|
|
120
|
-
//# sourceMappingURL=app-graph-builder-
|
|
124
|
+
//# sourceMappingURL=app-graph-builder-OZEAAKNT.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 { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { createIntent } from '@dxos/app-framework';\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\nimport { createExtension, rxFromObservable, ROOT_ID } from '@dxos/plugin-graph';\nimport { ConnectionState } from '@dxos/react-client/mesh';\n\nimport { ClientCapabilities } from './capabilities';\nimport { CLIENT_PLUGIN } from '../meta';\nimport { Account, ClientAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: CLIENT_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n return [\n {\n id: `${CLIENT_PLUGIN}/open-user-account`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open user account label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--user--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const client = context.getCapability(ClientCapabilities.Client);\n const identity = get(rxFromObservable(client.halo.identity));\n const status = get(rxFromObservable(client.mesh.networkStatus));\n\n return [\n {\n id: Account.id,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['account label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--user--regular',\n disposition: 'user-account',\n // NOTE: This currently needs to be the identity key because the fallback is generated from hex.\n userId: identity?.identityKey.toHex(),\n hue: identity?.profile?.data?.hue,\n emoji: identity?.profile?.data?.emoji,\n status: status.swarm === ConnectionState.OFFLINE ? 'error' : 'active',\n },\n nodes: [\n {\n id: Account.Profile,\n data: Account.Profile,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['profile label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--user--regular',\n },\n },\n {\n id: Account.Devices,\n data: Account.Devices,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['devices label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--devices--regular',\n testId: 'clientPlugin.devices',\n },\n },\n {\n id: Account.Security,\n data: Account.Security,\n type: CLIENT_PLUGIN,\n properties: {\n label: ['security label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--key--regular',\n },\n },\n ],\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,oBAAoB;AAC7B,SAASC,cAAcC,mBAAuC;AAC9D,SAASC,iBAAiBC,kBAAkBC,eAAe;AAC3D,SAASC,uBAAuB;AAMhC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,MAAA;AACT,WAAO;MACL;QACEb,IAAI,GAAGC,aAAAA;QACPa,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKrB,QAAQsB,cAAcpB,aAAaqB,gBAAgB;AACzF,gBAAMF,SAASG,aAAaC,aAAaC,aAAa,CAAA;QACxD;QACAC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIvB;YAAc;;UACvDwB,MAAM;UACNC,aAAa;UACbC,YAAY;YACVC,OAAO;;YAEPC,SAAS;YACTC,OAAO;UACT;QACF;MACF;;EAEJ,CAAA,GACAtB,OAAOuB,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAG/BC,WAAW,CAAC7B,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,MAAA;AACT,UAAMoB,SAAStC,QAAQsB,cAAciB,mBAAmBC,MAAM;AAC9D,UAAMC,WAAW9B,IAAI+B,iBAAiBJ,OAAOK,KAAKF,QAAQ,CAAA;AAC1D,UAAMG,SAASjC,IAAI+B,iBAAiBJ,OAAOO,KAAKC,aAAa,CAAA;AAE7D,WAAO;MACL;QACEzC,IAAI0C,QAAQ1C;QACZ2C,MAAM1C;QACNqB,YAAY;UACVC,OAAO;YAAC;YAAiB;cAAEC,IAAIvB;YAAc;;UAC7CwB,MAAM;UACNC,aAAa;;UAEbkB,QAAQR,UAAUS,YAAYC,MAAAA;UAC9BC,KAAKX,UAAUY,SAASlC,MAAMiC;UAC9BE,OAAOb,UAAUY,SAASlC,MAAMmC;UAChCV,QAAQA,OAAOW,UAAUC,gBAAgBC,UAAU,UAAU;QAC/D;QACAC,OAAO;UACL;YACErD,IAAI0C,QAAQY;YACZxC,MAAM4B,QAAQY;YACdX,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAIvB;gBAAc;;cAC7CwB,MAAM;YACR;UACF;UACA;YACEzB,IAAI0C,QAAQa;YACZzC,MAAM4B,QAAQa;YACdZ,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAIvB;gBAAc;;cAC7CwB,MAAM;cACN+B,QAAQ;YACV;UACF;UACA;YACExD,IAAI0C,QAAQe;YACZ3C,MAAM4B,QAAQe;YACdd,MAAM1C;YACNqB,YAAY;cACVC,OAAO;gBAAC;gBAAkB;kBAAEC,IAAIvB;gBAAc;;cAC9CwB,MAAM;YACR;UACF;;MAEJ;;EAEJ,CAAA,GACAjB,OAAOuB,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Rx", "Option", "pipe", "createIntent", "Capabilities", "contributes", "createExtension", "rxFromObservable", "ROOT_ID", "ConnectionState", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "CLIENT_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "linux", "getOrElse", "connector", "client", "ClientCapabilities", "Client", "identity", "rxFromObservable", "halo", "status", "mesh", "networkStatus", "Account", "type", "userId", "identityKey", "toHex", "hue", "profile", "emoji", "swarm", "ConnectionState", "OFFLINE", "nodes", "Profile", "Devices", "testId", "Security"]
|
|
7
|
+
}
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-client/src/capabilities/capabilities.ts
|
|
7
7
|
import { defineCapability } from "@dxos/app-framework";
|
|
8
|
-
var ClientCapabilities;
|
|
9
8
|
(function(ClientCapabilities2) {
|
|
10
9
|
ClientCapabilities2.Client = defineCapability(`${CLIENT_PLUGIN}/capability/client`);
|
|
11
10
|
ClientCapabilities2.Schema = defineCapability(`${CLIENT_PLUGIN}/capability/schema`);
|
|
12
11
|
ClientCapabilities2.SchemaWhiteList = defineCapability(`${CLIENT_PLUGIN}/capability/schema-whitelist`);
|
|
13
12
|
ClientCapabilities2.Migration = defineCapability(`${CLIENT_PLUGIN}/capability/migration`);
|
|
14
13
|
})(ClientCapabilities || (ClientCapabilities = {}));
|
|
14
|
+
var ClientCapabilities;
|
|
15
15
|
|
|
16
16
|
export {
|
|
17
17
|
ClientCapabilities
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-37E3EI46.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type Client } from '@dxos/client';\nimport { type ObjectMigration } from '@dxos/client/echo';\nimport { type TypedObject } from '@dxos/echo-schema';\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 export const SchemaWhiteList = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/schema-whitelist`);\n export const Migration = defineCapability<ObjectMigration[]>(`${CLIENT_PLUGIN}/capability/migration`);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,wBAAwB;UAOhBC,qBAAAA;sBACFC,SAASC,iBAAyB,GAAGC,aAAAA,oBAAiC;sBACtEC,SAASF,iBAAgC,GAAGC,aAAAA,oBAAiC;sBAC7EE,kBAAkBH,iBAAgC,GAAGC,aAAAA,8BAA2C;sBAChGG,YAAYJ,iBAAoC,GAAGC,aAAAA,uBAAoC;AACtG,GALiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;;",
|
|
6
6
|
"names": ["defineCapability", "ClientCapabilities", "Client", "defineCapability", "CLIENT_PLUGIN", "Schema", "SchemaWhiteList", "Migration"]
|
|
7
7
|
}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-client/src/events.ts
|
|
7
7
|
import { defineEvent } from "@dxos/app-framework";
|
|
8
|
-
var ClientEvents;
|
|
9
8
|
(function(ClientEvents2) {
|
|
10
9
|
ClientEvents2.ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);
|
|
11
10
|
ClientEvents2.SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);
|
|
@@ -13,8 +12,9 @@ var ClientEvents;
|
|
|
13
12
|
ClientEvents2.IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);
|
|
14
13
|
ClientEvents2.SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);
|
|
15
14
|
})(ClientEvents || (ClientEvents = {}));
|
|
15
|
+
var ClientEvents;
|
|
16
16
|
|
|
17
17
|
export {
|
|
18
18
|
ClientEvents
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-FJYSQRBO.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/events.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport namespace ClientEvents {\n export const ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);\n export const SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);\n export const SetupMigration = defineEvent(`${CLIENT_PLUGIN}/event/setup-migration`);\n export const IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);\n export const SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,mBAAmB;UAIXC,eAAAA;gBACFC,cAAcC,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DC,cAAcF,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DE,iBAAiBH,YAAY,GAAGC,aAAAA,wBAAqC;gBACrEG,kBAAkBJ,YAAY,GAAGC,aAAAA,yBAAsC;gBACvEI,cAAcL,YAAY,GAAGC,aAAAA,qBAAkC;AAC9E,GANiBH,iBAAAA,eAAAA,CAAAA,EAAAA;;",
|
|
6
6
|
"names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "SetupMigration", "IdentityCreated", "SpacesReady"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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 { Schema } from "effect";
|
|
8
|
+
import { PublicKey } from "@dxos/react-client";
|
|
9
|
+
var IdentitySchema = Schema.Struct({
|
|
10
|
+
identityKey: Schema.instanceOf(PublicKey),
|
|
11
|
+
spaceKey: Schema.optional(Schema.instanceOf(PublicKey)),
|
|
12
|
+
profile: Schema.optional(Schema.Struct({
|
|
13
|
+
displayName: Schema.optional(Schema.String),
|
|
14
|
+
avatarCid: Schema.optional(Schema.String),
|
|
15
|
+
data: Schema.optional(Schema.Record({
|
|
16
|
+
key: Schema.String,
|
|
17
|
+
value: Schema.Any
|
|
18
|
+
}))
|
|
19
|
+
}))
|
|
20
|
+
});
|
|
21
|
+
var CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
|
|
22
|
+
(function(ClientAction2) {
|
|
23
|
+
const ProfileSchema = Schema.Struct({
|
|
24
|
+
displayName: Schema.optional(Schema.String),
|
|
25
|
+
avatarCid: Schema.optional(Schema.String),
|
|
26
|
+
data: Schema.optional(Schema.Record({
|
|
27
|
+
key: Schema.String,
|
|
28
|
+
value: Schema.Any
|
|
29
|
+
}))
|
|
30
|
+
});
|
|
31
|
+
class CreateIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-identity`, {
|
|
32
|
+
input: ProfileSchema,
|
|
33
|
+
output: IdentitySchema
|
|
34
|
+
}) {
|
|
35
|
+
}
|
|
36
|
+
ClientAction2.CreateIdentity = CreateIdentity;
|
|
37
|
+
class JoinIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
|
|
38
|
+
input: Schema.Struct({
|
|
39
|
+
invitationCode: Schema.optional(Schema.String)
|
|
40
|
+
}),
|
|
41
|
+
output: Schema.Void
|
|
42
|
+
}) {
|
|
43
|
+
}
|
|
44
|
+
ClientAction2.JoinIdentity = JoinIdentity;
|
|
45
|
+
class ShareIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/share-identity`, {
|
|
46
|
+
input: Schema.Void,
|
|
47
|
+
output: Schema.Void
|
|
48
|
+
}) {
|
|
49
|
+
}
|
|
50
|
+
ClientAction2.ShareIdentity = ShareIdentity;
|
|
51
|
+
class RecoverIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/recover-identity`, {
|
|
52
|
+
input: Schema.Void,
|
|
53
|
+
output: Schema.Void
|
|
54
|
+
}) {
|
|
55
|
+
}
|
|
56
|
+
ClientAction2.RecoverIdentity = RecoverIdentity;
|
|
57
|
+
class ResetStorage extends Schema.TaggedClass()(`${CLIENT_ACTION}/reset-storage`, {
|
|
58
|
+
input: Schema.Struct({
|
|
59
|
+
mode: Schema.optional(Schema.String)
|
|
60
|
+
}),
|
|
61
|
+
output: Schema.Void
|
|
62
|
+
}) {
|
|
63
|
+
}
|
|
64
|
+
ClientAction2.ResetStorage = ResetStorage;
|
|
65
|
+
class CreateAgent extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-agent`, {
|
|
66
|
+
input: Schema.Void,
|
|
67
|
+
output: Schema.Void
|
|
68
|
+
}) {
|
|
69
|
+
}
|
|
70
|
+
ClientAction2.CreateAgent = CreateAgent;
|
|
71
|
+
class CreateRecoveryCode extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-recovery-code`, {
|
|
72
|
+
input: Schema.Void,
|
|
73
|
+
output: Schema.Void
|
|
74
|
+
}) {
|
|
75
|
+
}
|
|
76
|
+
ClientAction2.CreateRecoveryCode = CreateRecoveryCode;
|
|
77
|
+
class CreatePasskey extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-passkey`, {
|
|
78
|
+
input: Schema.Void,
|
|
79
|
+
output: Schema.Void
|
|
80
|
+
}) {
|
|
81
|
+
}
|
|
82
|
+
ClientAction2.CreatePasskey = CreatePasskey;
|
|
83
|
+
class RedeemPasskey extends Schema.TaggedClass()(`${CLIENT_ACTION}/redeem-passkey`, {
|
|
84
|
+
input: Schema.Void,
|
|
85
|
+
output: Schema.Void
|
|
86
|
+
}) {
|
|
87
|
+
}
|
|
88
|
+
ClientAction2.RedeemPasskey = RedeemPasskey;
|
|
89
|
+
class RedeemToken extends Schema.TaggedClass()(`${CLIENT_ACTION}/redeem-token`, {
|
|
90
|
+
input: Schema.Struct({
|
|
91
|
+
token: Schema.String
|
|
92
|
+
}),
|
|
93
|
+
output: Schema.Void
|
|
94
|
+
}) {
|
|
95
|
+
}
|
|
96
|
+
ClientAction2.RedeemToken = RedeemToken;
|
|
97
|
+
})(ClientAction || (ClientAction = {}));
|
|
98
|
+
(function(Account2) {
|
|
99
|
+
const _id = "dxos.org.plugin.client.account";
|
|
100
|
+
Account2.id = `!${_id}`;
|
|
101
|
+
Account2.Profile = `${_id}.profile`;
|
|
102
|
+
Account2.Devices = `${_id}.devices`;
|
|
103
|
+
Account2.Security = `${_id}.security`;
|
|
104
|
+
})(Account || (Account = {}));
|
|
105
|
+
var ClientAction;
|
|
106
|
+
var Account;
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
ClientAction,
|
|
110
|
+
Account
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=chunk-STGGUFV2.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 { Schema } from 'effect';\n\nimport { type PluginContext } from '@dxos/app-framework';\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 = Schema.Struct({\n identityKey: Schema.instanceOf(PublicKey),\n spaceKey: Schema.optional(Schema.instanceOf(PublicKey)),\n profile: Schema.optional(\n Schema.Struct({\n displayName: Schema.optional(Schema.String),\n avatarCid: Schema.optional(Schema.String),\n data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n ),\n});\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport namespace ClientAction {\n const ProfileSchema = Schema.Struct({\n displayName: Schema.optional(Schema.String),\n avatarCid: Schema.optional(Schema.String),\n data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n });\n\n export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${CLIENT_ACTION}/create-identity`, {\n input: ProfileSchema,\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${CLIENT_ACTION}/join-identity`, {\n input: Schema.Struct({\n invitationCode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${CLIENT_ACTION}/share-identity`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${CLIENT_ACTION}/recover-identity`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${CLIENT_ACTION}/reset-storage`, {\n input: Schema.Struct({\n mode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${CLIENT_ACTION}/create-agent`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class CreateRecoveryCode extends Schema.TaggedClass<CreateRecoveryCode>()(\n `${CLIENT_ACTION}/create-recovery-code`,\n {\n input: Schema.Void,\n output: Schema.Void,\n },\n ) {}\n\n export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${CLIENT_ACTION}/create-passkey`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${CLIENT_ACTION}/redeem-passkey`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${CLIENT_ACTION}/redeem-token`, {\n input: Schema.Struct({\n token: Schema.String,\n }),\n output: Schema.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: PluginContext, client: Client) => MaybePromise<void>;\n\n /**\n * Called when spaces are ready.\n */\n onSpacesReady?: (context: PluginContext, 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": ["Schema", "PublicKey", "IdentitySchema", "Schema", "Struct", "identityKey", "instanceOf", "PublicKey", "spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "CLIENT_ACTION", "CLIENT_PLUGIN", "ClientAction", "ProfileSchema", "CreateIdentity", "TaggedClass", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "mode", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey", "RedeemToken", "token", "Account", "_id", "id", "Profile", "Devices", "Security"]
|
|
7
|
+
}
|