@dxos/plugin-client 0.7.5-main.9d2a38b → 0.7.5-main.e94eead
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-6LOTDB4T.mjs → app-graph-builder-ON64R7SO.mjs} +2 -2
- package/dist/lib/browser/{chunk-E3OUNOEL.mjs → chunk-7DPLXOMO.mjs} +14 -2
- package/dist/lib/browser/chunk-7DPLXOMO.mjs.map +7 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs +271 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SVBQRT7I.mjs → chunk-GHEQL2E6.mjs} +1 -2
- package/dist/lib/browser/{chunk-SVBQRT7I.mjs.map → chunk-GHEQL2E6.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-R4Q6H7RD.mjs → chunk-RGMLBYIF.mjs} +2 -2
- package/dist/lib/browser/{chunk-R4Q6H7RD.mjs.map → chunk-RGMLBYIF.mjs.map} +2 -2
- package/dist/lib/browser/{client-25GYH6TN.mjs → client-A7YSVURS.mjs} +4 -13
- package/dist/lib/browser/client-A7YSVURS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +28 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-A6SKE7WJ.mjs +267 -0
- package/dist/lib/browser/intent-resolver-A6SKE7WJ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-M3RT6SSG.mjs → react-context-R3SG55F5.mjs} +2 -2
- package/dist/lib/browser/{react-surface-XXONPG5T.mjs → react-surface-XGOUHVIH.mjs} +23 -7
- package/dist/lib/browser/react-surface-XGOUHVIH.mjs.map +7 -0
- package/dist/lib/browser/schema-J4MJIXRP.mjs +23 -0
- 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-JCND3P6G.cjs → app-graph-builder-RW7ESEX3.cjs} +6 -6
- package/dist/lib/node/chunk-7LVBFGKQ.cjs +299 -0
- package/dist/lib/node/chunk-7LVBFGKQ.cjs.map +7 -0
- package/dist/lib/node/{chunk-NVYWMDF3.cjs → chunk-TREVKZCJ.cjs} +17 -5
- package/dist/lib/node/chunk-TREVKZCJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-3OB25QN2.cjs → chunk-UHIGZJQL.cjs} +4 -5
- package/dist/lib/node/{chunk-3OB25QN2.cjs.map → chunk-UHIGZJQL.cjs.map} +3 -3
- package/dist/lib/node/{chunk-IXVWJCYB.cjs → chunk-XPC4JOPP.cjs} +5 -5
- package/dist/lib/node/{chunk-IXVWJCYB.cjs.map → chunk-XPC4JOPP.cjs.map} +2 -2
- package/dist/lib/node/{client-52L4TUYU.cjs → client-2RQATBB6.cjs} +9 -18
- package/dist/lib/node/client-2RQATBB6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +30 -17
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/intent-resolver-DKQHARC2.cjs +275 -0
- package/dist/lib/node/intent-resolver-DKQHARC2.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-context-B2DNULH4.cjs → react-context-TD6VGBVA.cjs} +6 -6
- package/dist/lib/node/{react-surface-7USN5NOO.cjs → react-surface-IY7GXEGU.cjs} +28 -16
- package/dist/lib/node/react-surface-IY7GXEGU.cjs.map +7 -0
- package/dist/lib/node/schema-JXJS75HQ.cjs +39 -0
- 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-ZLGKFBLY.mjs → app-graph-builder-TDYRWNI7.mjs} +2 -2
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs +272 -0
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-74T33KTB.mjs → chunk-QJMF2MWP.mjs} +14 -2
- package/dist/lib/node-esm/chunk-QJMF2MWP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-73M5MK5Q.mjs → chunk-QR72BXJK.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-73M5MK5Q.mjs.map → chunk-QR72BXJK.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-OBGRL3DF.mjs → chunk-T35SFKK3.mjs} +1 -2
- package/dist/lib/node-esm/{chunk-OBGRL3DF.mjs.map → chunk-T35SFKK3.mjs.map} +3 -3
- package/dist/lib/node-esm/{client-K52NWOUN.mjs → client-36DKBSB7.mjs} +4 -13
- package/dist/lib/node-esm/client-36DKBSB7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +28 -15
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-HFYRSXUG.mjs +268 -0
- package/dist/lib/node-esm/intent-resolver-HFYRSXUG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-context-IGEHJQK5.mjs → react-context-ZOGDOWJ2.mjs} +2 -2
- package/dist/lib/node-esm/{react-surface-CXLBCMPN.mjs → react-surface-F3PDFJMV.mjs} +23 -7
- package/dist/lib/node-esm/react-surface-F3PDFJMV.mjs.map +7 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs +24 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.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 +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/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +119 -117
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
- package/dist/types/src/capabilities/intent-resolver.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/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 +3 -0
- package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +1 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +8 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +1 -0
- 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 +3 -0
- package/dist/types/src/components/RecoverySetupDialog.d.ts.map +1 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +8 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +17 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +23 -17
- package/src/ClientPlugin.ts +11 -6
- package/src/capabilities/capabilities.ts +0 -1
- package/src/capabilities/client.ts +1 -9
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +171 -67
- package/src/capabilities/react-surface.tsx +21 -6
- package/src/capabilities/schema.ts +26 -0
- package/src/components/IdentityDialog.tsx +15 -3
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/ManageCredentialsDialog.stories.tsx +57 -0
- package/src/components/ManageCredentialsDialog.tsx +64 -0
- package/src/components/RecoveryCodeDialog.stories.tsx +5 -5
- package/src/components/RecoveryCodeDialog.tsx +2 -1
- package/src/components/RecoverySetupDialog.stories.tsx +77 -0
- package/src/components/RecoverySetupDialog.tsx +52 -0
- package/src/components/index.ts +1 -0
- package/src/events.ts +1 -1
- package/src/translations.ts +10 -1
- package/src/types.ts +11 -1
- package/dist/lib/browser/chunk-6IF6PREG.mjs +0 -158
- package/dist/lib/browser/chunk-6IF6PREG.mjs.map +0 -7
- package/dist/lib/browser/chunk-E3OUNOEL.mjs.map +0 -7
- package/dist/lib/browser/client-25GYH6TN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-IWWLWOZD.mjs +0 -132
- package/dist/lib/browser/intent-resolver-IWWLWOZD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-XXONPG5T.mjs.map +0 -7
- package/dist/lib/node/chunk-N3U7KVO3.cjs +0 -186
- package/dist/lib/node/chunk-N3U7KVO3.cjs.map +0 -7
- package/dist/lib/node/chunk-NVYWMDF3.cjs.map +0 -7
- package/dist/lib/node/client-52L4TUYU.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-H3Y64MIP.cjs +0 -140
- package/dist/lib/node/intent-resolver-H3Y64MIP.cjs.map +0 -7
- package/dist/lib/node/react-surface-7USN5NOO.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-74T33KTB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EHGD3UJH.mjs +0 -159
- package/dist/lib/node-esm/chunk-EHGD3UJH.mjs.map +0 -7
- package/dist/lib/node-esm/client-K52NWOUN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JCKD6R6L.mjs +0 -133
- package/dist/lib/node-esm/intent-resolver-JCKD6R6L.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-CXLBCMPN.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-6LOTDB4T.mjs.map → app-graph-builder-ON64R7SO.mjs.map} +0 -0
- /package/dist/lib/browser/{react-context-M3RT6SSG.mjs.map → react-context-R3SG55F5.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-JCND3P6G.cjs.map → app-graph-builder-RW7ESEX3.cjs.map} +0 -0
- /package/dist/lib/node/{react-context-B2DNULH4.cjs.map → react-context-TD6VGBVA.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-ZLGKFBLY.mjs.map → app-graph-builder-TDYRWNI7.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-context-IGEHJQK5.mjs.map → react-context-ZOGDOWJ2.mjs.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { IDENTITY_DIALOG, JOIN_DIALOG, RECOVER_CODE_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { ClientAction, type ClientPluginOptions } from '../types';\n\ntype IntentResolverOptions = Pick<ClientPluginOptions, 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default ({ context, onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver(ClientAction.CreateIdentity, async () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\n await manager.activate(ClientEvents.IdentityCreated);\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n }),\n createResolver(ClientAction.JoinIdentity, async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ShareIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: IDENTITY_DIALOG,\n dialogBlockAlign: 'start',\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n }),\n createResolver(ClientAction.RecoverIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: { initialDisposition: 'recover-identity' } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ResetStorage, async (data) => {\n await onReset?.({ target: data.target });\n return {};\n }),\n createResolver(ClientAction.CreateAgent, async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n }),\n createResolver(ClientAction.CreateRecoveryCode, async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: RECOVER_CODE_DIALOG,\n subject: { code: seedphrase },\n }),\n ],\n };\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,iBAAiB;AAC1B,S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vC,UAAM9B,SAASX,QAAQS,kBAAkBG,mBAAmBC,MAAM;AAClE6B,cAAU/B,OAAOgC,SAASA,SAASC,kBAAkB,4BAAA;;;;;;;;;AACrD,UAAMjC,OAAOgC,SAASA,SAASC,iBAAiBC,YAAY,MAAa;MAAEC,SAAS;IAAO,CAAA;EAC7F,CAAA;EACAzC,eAAeC,aAAayC,oBAAoB,YAAA;AAC9C,UAAMpC,SAASX,QAAQS,kBAAkBG,mBAAmBC,MAAM;AAClE6B,cAAU/B,OAAOgC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AAEpD,UAAM,EAAEC,WAAU,IAAK,MAAMtC,OAAOgC,SAASA,SAASK,gBAAgBE,qBAAoB;AAC1F,WAAO;MACL9B,SAAS;QACPC,aAAaK,aAAaC,WAAW;UACnCC,SAAS;UACTG,kBAAkB;UAClBoB,YAAY;UACZC,OAAO;UACPvB,WAAWwB;UACXrB,SAAS;YAAEsB,MAAML;UAAW;QAC9B,CAAA;;IAEJ;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "context", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "ClientAction", "CreateIdentity", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "SetLayout", "element", "component", "JOIN_DIALOG", "dialogBlockAlign", "subject", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "seedphrase", "createRecoveryPhrase", "dialogType", "state", "RECOVER_CODE_DIALOG", "code"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createSurface, Capabilities, contributes } from '@dxos/app-framework';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport {\n IDENTITY_DIALOG,\n IdentityDialog,\n JOIN_DIALOG,\n JoinDialog,\n RECOVER_CODE_DIALOG,\n RecoveryCodeDialog,\n type RecoveryCodeDialogProps,\n} from '../components';\n\ntype ReactSurfaceOptions = {\n createInvitationUrl: (invitationCode: string) => string;\n};\n\nexport default ({ createInvitationUrl }: ReactSurfaceOptions) =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: IDENTITY_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: IdentityPanelProps } => data.component === IDENTITY_DIALOG,\n component: ({ data }) => <IdentityDialog {...data.subject} createInvitationUrl={createInvitationUrl} />,\n }),\n createSurface({\n id: JOIN_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: JoinPanelProps } => data.component === JOIN_DIALOG,\n component: ({ data }) => <JoinDialog {...data.subject} />,\n }),\n createSurface({\n id: RECOVER_CODE_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: RecoveryCodeDialogProps } => data.component === RECOVER_CODE_DIALOG,\n component: ({ data }) => <RecoveryCodeDialog {...data.subject} />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,eAAeC,cAAcC,mBAAmB;AAiBzD,IAAA,wBAAe,CAAC,EAAEC,oBAAmB,MACnCC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC;IACJC,MAAM;IACNC,QAAQ,CAACC,SAAkDA,KAAKC,cAAcJ;IAC9EI,WAAW,CAAC,EAAED,KAAI,MAAO,sBAAA,cAACE,gBAAAA;MAAgB,GAAGF,KAAKG;MAASZ;;EAC7D,CAAA;EACAI,cAAc;IACZC,IAAIQ;IACJN,MAAM;IACNC,QAAQ,CAACC,SAA8CA,KAAKC,cAAcG;IAC1EH,WAAW,CAAC,EAAED,KAAI,MAAO,sBAAA,cAACK,YAAeL,KAAKG,OAAO;EACvD,CAAA;EACAR,cAAc;IACZC,IAAIU;IACJR,MAAM;IACNC,QAAQ,CAACC,SAAuDA,KAAKC,cAAcK;IACnFL,WAAW,CAAC,EAAED,KAAI,MAAO,sBAAA,cAACO,oBAAuBP,KAAKG,OAAO;EAC/D,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "createSurface", "Capabilities", "contributes", "createInvitationUrl", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "IDENTITY_DIALOG", "role", "filter", "data", "component", "IdentityDialog", "subject", "JOIN_DIALOG", "JoinDialog", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog"]
|
|
7
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var chunk_N3U7KVO3_exports = {};
|
|
30
|
-
__export(chunk_N3U7KVO3_exports, {
|
|
31
|
-
IDENTITY_DIALOG: () => IDENTITY_DIALOG,
|
|
32
|
-
IdentityDialog: () => IdentityDialog,
|
|
33
|
-
JOIN_DIALOG: () => JOIN_DIALOG,
|
|
34
|
-
JoinDialog: () => JoinDialog,
|
|
35
|
-
RECOVER_CODE_DIALOG: () => RECOVER_CODE_DIALOG,
|
|
36
|
-
RecoveryCodeDialog: () => RecoveryCodeDialog
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(chunk_N3U7KVO3_exports);
|
|
39
|
-
var import_chunk_NVYWMDF3 = require("./chunk-NVYWMDF3.cjs");
|
|
40
|
-
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
41
|
-
var import_react = __toESM(require("react"));
|
|
42
|
-
var import_app_framework = require("@dxos/app-framework");
|
|
43
|
-
var import_react_client = require("@dxos/react-client");
|
|
44
|
-
var import_react_ui = require("@dxos/react-ui");
|
|
45
|
-
var import_react2 = require("@dxos/shell/react");
|
|
46
|
-
var import_react3 = __toESM(require("react"));
|
|
47
|
-
var import_app_framework2 = require("@dxos/app-framework");
|
|
48
|
-
var import_types = require("@dxos/plugin-observability/types");
|
|
49
|
-
var import_react_ui2 = require("@dxos/react-ui");
|
|
50
|
-
var import_react4 = require("@dxos/shell/react");
|
|
51
|
-
var import_react5 = __toESM(require("react"));
|
|
52
|
-
var import_react_ui3 = require("@dxos/react-ui");
|
|
53
|
-
var IDENTITY_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/IdentityDialog`;
|
|
54
|
-
var IdentityDialog = (props) => {
|
|
55
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
|
|
56
|
-
const client = (0, import_react_client.useClient)();
|
|
57
|
-
const handleDone = (0, import_react.useCallback)(() => dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
58
|
-
element: "dialog",
|
|
59
|
-
state: false
|
|
60
|
-
})), [
|
|
61
|
-
dispatch
|
|
62
|
-
]);
|
|
63
|
-
const handleResetStorage = (0, import_react.useCallback)(async () => {
|
|
64
|
-
await client.reset();
|
|
65
|
-
await dispatch((0, import_app_framework.createIntent)(import_chunk_NVYWMDF3.ClientAction.ResetStorage));
|
|
66
|
-
}, [
|
|
67
|
-
dispatch
|
|
68
|
-
]);
|
|
69
|
-
const handleRecover = (0, import_react.useCallback)(async () => {
|
|
70
|
-
await client.reset();
|
|
71
|
-
await dispatch((0, import_app_framework.createIntent)(import_chunk_NVYWMDF3.ClientAction.ResetStorage, {
|
|
72
|
-
target: "recoverIdentity"
|
|
73
|
-
}));
|
|
74
|
-
}, [
|
|
75
|
-
dispatch
|
|
76
|
-
]);
|
|
77
|
-
const handleJoinNewIdentity = (0, import_react.useCallback)(async () => {
|
|
78
|
-
await client.reset();
|
|
79
|
-
await dispatch((0, import_app_framework.createIntent)(import_chunk_NVYWMDF3.ClientAction.ResetStorage, {
|
|
80
|
-
target: "deviceInvitation"
|
|
81
|
-
}));
|
|
82
|
-
}, [
|
|
83
|
-
dispatch
|
|
84
|
-
]);
|
|
85
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react.default.createElement(import_react_ui.Clipboard.Provider, null, /* @__PURE__ */ import_react.default.createElement(import_react2.IdentityPanel, {
|
|
86
|
-
...props,
|
|
87
|
-
doneActionParent: /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Close, {
|
|
88
|
-
asChild: true
|
|
89
|
-
}),
|
|
90
|
-
onDone: handleDone,
|
|
91
|
-
onResetStorage: handleResetStorage,
|
|
92
|
-
onRecover: handleRecover,
|
|
93
|
-
onJoinNewIdentity: handleJoinNewIdentity
|
|
94
|
-
})));
|
|
95
|
-
};
|
|
96
|
-
var JOIN_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/JoinDialog`;
|
|
97
|
-
var JoinDialog = (props) => {
|
|
98
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
|
|
99
|
-
const handleCancelResetStorage = (0, import_react3.useCallback)(() => dispatch((0, import_app_framework2.createIntent)(import_chunk_NVYWMDF3.ClientAction.ShareIdentity)), [
|
|
100
|
-
dispatch
|
|
101
|
-
]);
|
|
102
|
-
const handleDone = (0, import_react3.useCallback)(async (result) => {
|
|
103
|
-
if (result?.identityKey) {
|
|
104
|
-
await Promise.all([
|
|
105
|
-
dispatch((0, import_app_framework2.createIntent)(import_app_framework2.LayoutAction.SetLayout, {
|
|
106
|
-
element: "dialog",
|
|
107
|
-
state: false
|
|
108
|
-
})),
|
|
109
|
-
dispatch((0, import_app_framework2.createIntent)(import_types.ObservabilityAction.SendEvent, {
|
|
110
|
-
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
111
|
-
}))
|
|
112
|
-
]);
|
|
113
|
-
}
|
|
114
|
-
}, [
|
|
115
|
-
dispatch
|
|
116
|
-
]);
|
|
117
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Content, null, /* @__PURE__ */ import_react3.default.createElement(import_react4.JoinPanel, {
|
|
118
|
-
mode: "halo-only",
|
|
119
|
-
...props,
|
|
120
|
-
exitActionParent: /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Close, {
|
|
121
|
-
asChild: true
|
|
122
|
-
}),
|
|
123
|
-
doneActionParent: /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Close, {
|
|
124
|
-
asChild: true
|
|
125
|
-
}),
|
|
126
|
-
onCancelResetStorage: handleCancelResetStorage,
|
|
127
|
-
onDone: handleDone
|
|
128
|
-
}));
|
|
129
|
-
};
|
|
130
|
-
var RECOVER_CODE_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/RecoveryCodeDialog`;
|
|
131
|
-
var RecoveryCodeDialog = ({ code }) => {
|
|
132
|
-
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_OIFPM5ZW.CLIENT_PLUGIN);
|
|
133
|
-
const [confirmation, setConfirmation] = (0, import_react5.useState)(false);
|
|
134
|
-
const handleConfirmation = (0, import_react5.useCallback)((checked) => setConfirmation(checked), []);
|
|
135
|
-
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.AlertDialog.Content, {
|
|
136
|
-
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
137
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
138
|
-
className: "py-4"
|
|
139
|
-
}, t("recovery code dialog description")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Clipboard.Provider, null, /* @__PURE__ */ import_react5.default.createElement(Code, {
|
|
140
|
-
code
|
|
141
|
-
})), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
142
|
-
className: "flex flex-col py-4 gap-2"
|
|
143
|
-
}, /* @__PURE__ */ import_react5.default.createElement("p", null, t("recovery code dialog warning 1")), /* @__PURE__ */ import_react5.default.createElement("p", null, t("recovery code dialog warning 2"))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
144
|
-
className: "flex items-center gap-2 pbe-4"
|
|
145
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.Checkbox, {
|
|
146
|
-
"data-testid": "recoveryCode.confirm",
|
|
147
|
-
checked: confirmation,
|
|
148
|
-
onCheckedChange: handleConfirmation
|
|
149
|
-
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
150
|
-
className: "flex justify-end"
|
|
151
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.AlertDialog.Action, {
|
|
152
|
-
asChild: true
|
|
153
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Button, {
|
|
154
|
-
"data-testid": "recoveryCode.continue",
|
|
155
|
-
variant: "primary",
|
|
156
|
-
disabled: !confirmation
|
|
157
|
-
}, t("continue label")))));
|
|
158
|
-
};
|
|
159
|
-
var Code = ({ code }) => {
|
|
160
|
-
const words = code.split(" ");
|
|
161
|
-
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
162
|
-
className: "relative p-2 border border-separator rounded group"
|
|
163
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Clipboard.IconButton, {
|
|
164
|
-
value: code,
|
|
165
|
-
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
166
|
-
}), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
167
|
-
className: "grid grid-cols-4"
|
|
168
|
-
}, words.map((word, i) => /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
169
|
-
key: i,
|
|
170
|
-
className: "flex items-center p-2 gap-2 items-center"
|
|
171
|
-
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
172
|
-
className: "w-4 text-xs text-center text-subdued"
|
|
173
|
-
}, i + 1), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
174
|
-
className: "text-sm"
|
|
175
|
-
}, word)))));
|
|
176
|
-
};
|
|
177
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
178
|
-
0 && (module.exports = {
|
|
179
|
-
IDENTITY_DIALOG,
|
|
180
|
-
IdentityDialog,
|
|
181
|
-
JOIN_DIALOG,
|
|
182
|
-
JoinDialog,
|
|
183
|
-
RECOVER_CODE_DIALOG,
|
|
184
|
-
RecoveryCodeDialog
|
|
185
|
-
});
|
|
186
|
-
//# sourceMappingURL=chunk-N3U7KVO3.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n state: false,\n }),\n ),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage));\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'recoverIdentity' }));\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'deviceInvitation' }));\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch(createIntent(LayoutAction.SetLayout, { element: 'dialog', state: false })),\n dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport const RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2 items-center'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAmC;AAEnC,2BAAgE;AAChE,0BAA0B;AAC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,MAAMI,IAAI,CAACC,MAAMC,MAChB9D,8BAAAA,QAAA,cAAC6C,OAAAA;IAAIkB,KAAKD;IAAGnB,WAAU;KACrB3C,8BAAAA,QAAA,cAAC6C,OAAAA;IAAIF,WAAU;KAAwCmB,IAAI,CAAA,GAC3D9D,8BAAAA,QAAA,cAAC6C,OAAAA;IAAIF,WAAU;KAAWkB,IAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAMtC;",
|
|
6
|
-
"names": ["import_react", "import_app_framework", "import_react_ui", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "createIntent", "LayoutAction", "SetLayout", "element", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "React", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "JOIN_DIALOG", "JoinDialog", "handleCancelResetStorage", "ShareIdentity", "result", "identityKey", "Promise", "all", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "JoinPanel", "mode", "exitActionParent", "onCancelResetStorage", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "checked", "AlertDialog", "classNames", "Title", "p", "className", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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.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\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,qBAAES;IACpB,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;AAIf,GAzCiBb,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"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/client.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default async ({ context, onClientInitialized, ...options }: ClientCapabilityOptions) => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n const client = new Client({ config, ...options });\n\n await client.initialize();\n await onClientInitialized?.(context, client);\n\n const systemSchemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.SystemSchema).flat()));\n const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));\n client.addTypes(systemSchemas);\n client.addTypes(schemas);\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n\n const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activate(ClientEvents.SpacesReady);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAiD;AACjD,oBAAuD;AACvD,0BAAuB;AAUvB,IAAA,iBAAe,OAAO,EAAEA,SAASC,qBAAqB,GAAGC,QAAAA,MAAkC;AACzF,QAAMC,SAAS,IAAIC,qBAAO,UAAMC,uBAAAA,OAAWC,oBAAAA,OAAQC,qBAAAA,OAASC,wBAAAA,CAAAA;AAC5D,QAAMC,SAAS,IAAIC,2BAAO;IAAEP;IAAQ,GAAGD;EAAQ,CAAA;AAE/C,QAAMO,OAAOE,WAAU;AACvB,QAAMV,sBAAsBD,SAASS,MAAAA;AAErC,QAAMG,gBAAgBC,MAAMC,KAAK,IAAIC,IAAIf,QAAQgB,oBAAoBC,yCAAmBC,YAAY,EAAEC,KAAI,CAAA,CAAA;AAC1G,QAAMC,UAAUP,MAAMC,KAAK,IAAIC,IAAIf,QAAQgB,oBAAoBC,yCAAmBI,MAAM,EAAEF,KAAI,CAAA,CAAA;AAC9FV,SAAOa,SAASV,aAAAA;AAChBH,SAAOa,SAASF,OAAAA;AAGhBX,SAAOc,SAASC,GAAG,MAAA;AACjBf,WAAOgB,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,UAAIA,UAAU;AACZE,eAAOC,SAASC,OAAOF,OAAOC,SAASE;MACzC;IACF,CAAA;EACF,CAAA;AAEA,QAAMC,eAAevB,OAAOwB,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMnC,QAAQoC,SAASC,mCAAaC,WAAW;IACjD;EACF,CAAA;AAEA,aAAOC,kCAAYtB,yCAAmBP,QAAQD,QAAQ,YAAA;AACpDuB,iBAAaQ,YAAW;AACxB,UAAM/B,OAAOgC,QAAO;EACtB,CAAA;AACF;",
|
|
6
|
-
"names": ["context", "onClientInitialized", "options", "config", "Config", "Storage", "Envs", "Local", "Defaults", "client", "Client", "initialize", "systemSchemas", "Array", "from", "Set", "requestCapabilities", "ClientCapabilities", "SystemSchema", "flat", "schemas", "Schema", "addTypes", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activate", "ClientEvents", "SpacesReady", "contributes", "unsubscribe", "destroy"]
|
|
7
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var intent_resolver_H3Y64MIP_exports = {};
|
|
20
|
-
__export(intent_resolver_H3Y64MIP_exports, {
|
|
21
|
-
default: () => intent_resolver_default
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(intent_resolver_H3Y64MIP_exports);
|
|
24
|
-
var import_chunk_IXVWJCYB = require("./chunk-IXVWJCYB.cjs");
|
|
25
|
-
var import_chunk_3OB25QN2 = require("./chunk-3OB25QN2.cjs");
|
|
26
|
-
var import_chunk_N3U7KVO3 = require("./chunk-N3U7KVO3.cjs");
|
|
27
|
-
var import_chunk_NVYWMDF3 = require("./chunk-NVYWMDF3.cjs");
|
|
28
|
-
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
29
|
-
var import_app_framework = require("@dxos/app-framework");
|
|
30
|
-
var import_invariant = require("@dxos/invariant");
|
|
31
|
-
var import_types = require("@dxos/plugin-observability/types");
|
|
32
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/capabilities/intent-resolver.ts";
|
|
33
|
-
var intent_resolver_default = ({ context, onReset }) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.IntentResolver, [
|
|
34
|
-
(0, import_app_framework.createResolver)(import_chunk_NVYWMDF3.ClientAction.CreateIdentity, async () => {
|
|
35
|
-
const manager = context.requestCapability(import_app_framework.Capabilities.PluginManager);
|
|
36
|
-
const client = context.requestCapability(import_chunk_3OB25QN2.ClientCapabilities.Client);
|
|
37
|
-
const data = await client.halo.createIdentity();
|
|
38
|
-
await manager.activate(import_chunk_IXVWJCYB.ClientEvents.IdentityCreated);
|
|
39
|
-
return {
|
|
40
|
-
data,
|
|
41
|
-
intents: [
|
|
42
|
-
(0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
|
|
43
|
-
name: "identity.create"
|
|
44
|
-
})
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
}),
|
|
48
|
-
(0, import_app_framework.createResolver)(import_chunk_NVYWMDF3.ClientAction.JoinIdentity, async (data) => {
|
|
49
|
-
return {
|
|
50
|
-
intents: [
|
|
51
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
52
|
-
element: "dialog",
|
|
53
|
-
component: import_chunk_N3U7KVO3.JOIN_DIALOG,
|
|
54
|
-
dialogBlockAlign: "start",
|
|
55
|
-
subject: {
|
|
56
|
-
initialInvitationCode: data.invitationCode,
|
|
57
|
-
initialDisposition: "accept-halo-invitation"
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
]
|
|
61
|
-
};
|
|
62
|
-
}),
|
|
63
|
-
(0, import_app_framework.createResolver)(import_chunk_NVYWMDF3.ClientAction.ShareIdentity, async () => {
|
|
64
|
-
return {
|
|
65
|
-
intents: [
|
|
66
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
67
|
-
element: "dialog",
|
|
68
|
-
component: import_chunk_N3U7KVO3.IDENTITY_DIALOG,
|
|
69
|
-
dialogBlockAlign: "start"
|
|
70
|
-
}),
|
|
71
|
-
(0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
|
|
72
|
-
name: "identity.share"
|
|
73
|
-
})
|
|
74
|
-
]
|
|
75
|
-
};
|
|
76
|
-
}),
|
|
77
|
-
(0, import_app_framework.createResolver)(import_chunk_NVYWMDF3.ClientAction.RecoverIdentity, async () => {
|
|
78
|
-
return {
|
|
79
|
-
intents: [
|
|
80
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
81
|
-
element: "dialog",
|
|
82
|
-
component: import_chunk_N3U7KVO3.JOIN_DIALOG,
|
|
83
|
-
dialogBlockAlign: "start",
|
|
84
|
-
subject: {
|
|
85
|
-
initialDisposition: "recover-identity"
|
|
86
|
-
}
|
|
87
|
-
})
|
|
88
|
-
]
|
|
89
|
-
};
|
|
90
|
-
}),
|
|
91
|
-
(0, import_app_framework.createResolver)(import_chunk_NVYWMDF3.ClientAction.ResetStorage, async (data) => {
|
|
92
|
-
await onReset?.({
|
|
93
|
-
target: data.target
|
|
94
|
-
});
|
|
95
|
-
return {};
|
|
96
|
-
}),
|
|
97
|
-
(0, import_app_framework.createResolver)(import_chunk_NVYWMDF3.ClientAction.CreateAgent, async () => {
|
|
98
|
-
const client = context.requestCapability(import_chunk_3OB25QN2.ClientCapabilities.Client);
|
|
99
|
-
(0, import_invariant.invariant)(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
100
|
-
F: __dxlog_file,
|
|
101
|
-
L: 80,
|
|
102
|
-
S: void 0,
|
|
103
|
-
A: [
|
|
104
|
-
"client.services.services.EdgeAgentService",
|
|
105
|
-
"'Missing EdgeAgentService'"
|
|
106
|
-
]
|
|
107
|
-
});
|
|
108
|
-
await client.services.services.EdgeAgentService.createAgent(null, {
|
|
109
|
-
timeout: 1e4
|
|
110
|
-
});
|
|
111
|
-
}),
|
|
112
|
-
(0, import_app_framework.createResolver)(import_chunk_NVYWMDF3.ClientAction.CreateRecoveryCode, async () => {
|
|
113
|
-
const client = context.requestCapability(import_chunk_3OB25QN2.ClientCapabilities.Client);
|
|
114
|
-
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
115
|
-
F: __dxlog_file,
|
|
116
|
-
L: 85,
|
|
117
|
-
S: void 0,
|
|
118
|
-
A: [
|
|
119
|
-
"client.services.services.IdentityService",
|
|
120
|
-
"'IdentityService not available'"
|
|
121
|
-
]
|
|
122
|
-
});
|
|
123
|
-
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
124
|
-
return {
|
|
125
|
-
intents: [
|
|
126
|
-
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
127
|
-
element: "dialog",
|
|
128
|
-
dialogBlockAlign: "start",
|
|
129
|
-
dialogType: "alert",
|
|
130
|
-
state: true,
|
|
131
|
-
component: import_chunk_N3U7KVO3.RECOVER_CODE_DIALOG,
|
|
132
|
-
subject: {
|
|
133
|
-
code: seedphrase
|
|
134
|
-
}
|
|
135
|
-
})
|
|
136
|
-
]
|
|
137
|
-
};
|
|
138
|
-
})
|
|
139
|
-
]);
|
|
140
|
-
//# sourceMappingURL=intent-resolver-H3Y64MIP.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { IDENTITY_DIALOG, JOIN_DIALOG, RECOVER_CODE_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { ClientAction, type ClientPluginOptions } from '../types';\n\ntype IntentResolverOptions = Pick<ClientPluginOptions, 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default ({ context, onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver(ClientAction.CreateIdentity, async () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\n await manager.activate(ClientEvents.IdentityCreated);\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n }),\n createResolver(ClientAction.JoinIdentity, async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ShareIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: IDENTITY_DIALOG,\n dialogBlockAlign: 'start',\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n }),\n createResolver(ClientAction.RecoverIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: { initialDisposition: 'recover-identity' } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ResetStorage, async (data) => {\n await onReset?.({ target: data.target });\n return {};\n }),\n createResolver(ClientAction.CreateAgent, async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n }),\n createResolver(ClientAction.CreateRecoveryCode, async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: RECOVER_CODE_DIALOG,\n subject: { code: seedphrase },\n }),\n ],\n };\n }),\n ]);\n"],
|
|
5
|
-
"mappings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Q1B,KAAK0B;IAAO,CAAA;AACtC,WAAO,CAAC;EACV,CAAA;MACAnC,qCAAeC,mCAAamC,aAAa,YAAA;AACvC,UAAM9B,SAASX,QAAQS,kBAAkBG,yCAAmBC,MAAM;AAClE6B,oCAAU/B,OAAOgC,SAASA,SAASC,kBAAkB,4BAAA;;;;;;;;;AACrD,UAAMjC,OAAOgC,SAASA,SAASC,iBAAiBC,YAAY,MAAa;MAAEC,SAAS;IAAO,CAAA;EAC7F,CAAA;MACAzC,qCAAeC,mCAAayC,oBAAoB,YAAA;AAC9C,UAAMpC,SAASX,QAAQS,kBAAkBG,yCAAmBC,MAAM;AAClE6B,oCAAU/B,OAAOgC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AAEpD,UAAM,EAAEC,WAAU,IAAK,MAAMtC,OAAOgC,SAASA,SAASK,gBAAgBE,qBAAoB;AAC1F,WAAO;MACL9B,SAAS;YACPC,mCAAaK,kCAAaC,WAAW;UACnCC,SAAS;UACTG,kBAAkB;UAClBoB,YAAY;UACZC,OAAO;UACPvB,WAAWwB;UACXrB,SAAS;YAAEsB,MAAML;UAAW;QAC9B,CAAA;;IAEJ;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["context", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "ClientAction", "CreateIdentity", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "SetLayout", "element", "component", "JOIN_DIALOG", "dialogBlockAlign", "subject", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "seedphrase", "createRecoveryPhrase", "dialogType", "state", "RECOVER_CODE_DIALOG", "code"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createSurface, Capabilities, contributes } from '@dxos/app-framework';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport {\n IDENTITY_DIALOG,\n IdentityDialog,\n JOIN_DIALOG,\n JoinDialog,\n RECOVER_CODE_DIALOG,\n RecoveryCodeDialog,\n type RecoveryCodeDialogProps,\n} from '../components';\n\ntype ReactSurfaceOptions = {\n createInvitationUrl: (invitationCode: string) => string;\n};\n\nexport default ({ createInvitationUrl }: ReactSurfaceOptions) =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: IDENTITY_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: IdentityPanelProps } => data.component === IDENTITY_DIALOG,\n component: ({ data }) => <IdentityDialog {...data.subject} createInvitationUrl={createInvitationUrl} />,\n }),\n createSurface({\n id: JOIN_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: JoinPanelProps } => data.component === JOIN_DIALOG,\n component: ({ data }) => <JoinDialog {...data.subject} />,\n }),\n createSurface({\n id: RECOVER_CODE_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: RecoveryCodeDialogProps } => data.component === RECOVER_CODE_DIALOG,\n component: ({ data }) => <RecoveryCodeDialog {...data.subject} />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAyD;AAiBzD,IAAA,wBAAe,CAAC,EAAEA,oBAAmB,UACnCC,kCAAYC,kCAAaC,cAAc;MACrCC,oCAAc;IACZC,IAAIC;IACJC,MAAM;IACNC,QAAQ,CAACC,SAAkDA,KAAKC,cAAcJ;IAC9EI,WAAW,CAAC,EAAED,KAAI,MAAO,6BAAAE,QAAA,cAACC,sCAAAA;MAAgB,GAAGH,KAAKI;MAASb;;EAC7D,CAAA;MACAI,oCAAc;IACZC,IAAIS;IACJP,MAAM;IACNC,QAAQ,CAACC,SAA8CA,KAAKC,cAAcI;IAC1EJ,WAAW,CAAC,EAAED,KAAI,MAAO,6BAAAE,QAAA,cAACI,kCAAeN,KAAKI,OAAO;EACvD,CAAA;MACAT,oCAAc;IACZC,IAAIW;IACJT,MAAM;IACNC,QAAQ,CAACC,SAAuDA,KAAKC,cAAcM;IACnFN,WAAW,CAAC,EAAED,KAAI,MAAO,6BAAAE,QAAA,cAACM,0CAAuBR,KAAKI,OAAO;EAC/D,CAAA;CACD;",
|
|
6
|
-
"names": ["createInvitationUrl", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "IDENTITY_DIALOG", "role", "filter", "data", "component", "React", "IdentityDialog", "subject", "JOIN_DIALOG", "JoinDialog", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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.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\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,SAASA,SAAS;AAClB,SAAsBC,iBAAqC;AAM3D,IAAMC,iBAAiBC,EAAEC,OAAO;EAC9BC,aAAaF,EAAEG,WAAWC,SAAAA;EAC1BC,UAAUL,EAAEM,SAASN,EAAEG,WAAWC,SAAAA,CAAAA;EAClCG,SAASP,EAAEM,SACTN,EAAEC,OAAO;IACPO,aAAaR,EAAEM,SAASN,EAAES,MAA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OrB,EAAEyB;IACTH,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSK,cAAAA;EAKN,MAAMC,2BAA2B/B,EAAEoB,YAAW,EAAuB,GAAGJ,aAAAA,yBAAsC;IACnHK,OAAOrB,EAAEyB;IACTH,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSM,qBAAAA;AAIf,GAzCiBb,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
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", "target", "CreateAgent", "CreateRecoveryCode"]
|
|
7
|
-
}
|