@dxos/plugin-client 0.7.5-main.b19bfc8 → 0.7.5-main.d9d2d4e

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.
Files changed (90) hide show
  1. package/dist/lib/browser/{chunk-EYBZZHSM.mjs → chunk-HNJZ74DZ.mjs} +19 -9
  2. package/dist/lib/browser/chunk-HNJZ74DZ.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-RGMLBYIF.mjs → chunk-OLUST5AO.mjs} +2 -1
  4. package/dist/lib/browser/{chunk-RGMLBYIF.mjs.map → chunk-OLUST5AO.mjs.map} +3 -3
  5. package/dist/lib/browser/{chunk-GHEQL2E6.mjs → chunk-XK4HM5M7.mjs} +2 -1
  6. package/dist/lib/browser/chunk-XK4HM5M7.mjs.map +7 -0
  7. package/dist/lib/browser/{client-A7YSVURS.mjs → client-UUGITHCW.mjs} +3 -3
  8. package/dist/lib/browser/index.mjs +16 -7
  9. package/dist/lib/browser/index.mjs.map +3 -3
  10. package/dist/lib/browser/{intent-resolver-SSM6WXAW.mjs → intent-resolver-AIUHL34E.mjs} +18 -14
  11. package/dist/lib/browser/{intent-resolver-SSM6WXAW.mjs.map → intent-resolver-AIUHL34E.mjs.map} +3 -3
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/migrations-XODC625X.mjs +21 -0
  14. package/dist/lib/browser/migrations-XODC625X.mjs.map +7 -0
  15. package/dist/lib/browser/{react-context-R3SG55F5.mjs → react-context-JBD7Y3SN.mjs} +2 -2
  16. package/dist/lib/browser/{react-surface-XGOUHVIH.mjs → react-surface-QGPWIUFR.mjs} +2 -2
  17. package/dist/lib/browser/{schema-J4MJIXRP.mjs → schema-Y7ZNXYSL.mjs} +2 -2
  18. package/dist/lib/node/{chunk-XPC4JOPP.cjs → chunk-FR2K56EV.cjs} +5 -4
  19. package/dist/lib/node/{chunk-XPC4JOPP.cjs.map → chunk-FR2K56EV.cjs.map} +3 -3
  20. package/dist/lib/node/{chunk-UHIGZJQL.cjs → chunk-T4K27K2F.cjs} +5 -4
  21. package/dist/lib/node/chunk-T4K27K2F.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-7LVBFGKQ.cjs → chunk-UTG3UR3N.cjs} +16 -6
  23. package/dist/lib/node/chunk-UTG3UR3N.cjs.map +7 -0
  24. package/dist/lib/node/{client-2RQATBB6.cjs → client-5BHSU35T.cjs} +8 -8
  25. package/dist/lib/node/index.cjs +21 -12
  26. package/dist/lib/node/index.cjs.map +3 -3
  27. package/dist/lib/node/{intent-resolver-RIHCW2KJ.cjs → intent-resolver-PWCHHNV3.cjs} +29 -25
  28. package/dist/lib/node/{intent-resolver-RIHCW2KJ.cjs.map → intent-resolver-PWCHHNV3.cjs.map} +3 -3
  29. package/dist/lib/node/meta.json +1 -1
  30. package/dist/lib/node/migrations-YCBZUPWO.cjs +37 -0
  31. package/dist/lib/node/migrations-YCBZUPWO.cjs.map +7 -0
  32. package/dist/lib/node/{react-context-TD6VGBVA.cjs → react-context-MPHNGZHT.cjs} +6 -6
  33. package/dist/lib/node/{react-surface-IY7GXEGU.cjs → react-surface-TPISDIHR.cjs} +20 -20
  34. package/dist/lib/node/{schema-JXJS75HQ.cjs → schema-NMMCMK64.cjs} +7 -7
  35. package/dist/lib/node-esm/{chunk-T35SFKK3.mjs → chunk-3OU2ZXLK.mjs} +2 -1
  36. package/dist/lib/node-esm/chunk-3OU2ZXLK.mjs.map +7 -0
  37. package/dist/lib/node-esm/{chunk-CRF22MJJ.mjs → chunk-SHJBU4QR.mjs} +19 -9
  38. package/dist/lib/node-esm/chunk-SHJBU4QR.mjs.map +7 -0
  39. package/dist/lib/node-esm/{chunk-QR72BXJK.mjs → chunk-XLLNVLWU.mjs} +2 -1
  40. package/dist/lib/node-esm/{chunk-QR72BXJK.mjs.map → chunk-XLLNVLWU.mjs.map} +3 -3
  41. package/dist/lib/node-esm/{client-36DKBSB7.mjs → client-ZDGFGLX4.mjs} +3 -3
  42. package/dist/lib/node-esm/index.mjs +16 -7
  43. package/dist/lib/node-esm/index.mjs.map +3 -3
  44. package/dist/lib/node-esm/{intent-resolver-WWTVE6T6.mjs → intent-resolver-FIXGPH7C.mjs} +18 -14
  45. package/dist/lib/node-esm/{intent-resolver-WWTVE6T6.mjs.map → intent-resolver-FIXGPH7C.mjs.map} +3 -3
  46. package/dist/lib/node-esm/meta.json +1 -1
  47. package/dist/lib/node-esm/migrations-VIEIPYJW.mjs +22 -0
  48. package/dist/lib/node-esm/migrations-VIEIPYJW.mjs.map +7 -0
  49. package/dist/lib/node-esm/{react-context-ZOGDOWJ2.mjs → react-context-KUEOXWWK.mjs} +2 -2
  50. package/dist/lib/node-esm/{react-surface-F3PDFJMV.mjs → react-surface-KBROL4VH.mjs} +2 -2
  51. package/dist/lib/node-esm/{schema-XM4HBLIX.mjs → schema-NE5IYLMD.mjs} +2 -2
  52. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/capabilities.d.ts +3 -1
  54. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/index.d.ts +1 -0
  56. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/migrations.d.ts +4 -0
  59. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  60. package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
  61. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  62. package/dist/types/src/events.d.ts +1 -0
  63. package/dist/types/src/events.d.ts.map +1 -1
  64. package/package.json +19 -19
  65. package/src/ClientPlugin.ts +15 -1
  66. package/src/capabilities/capabilities.ts +3 -1
  67. package/src/capabilities/index.ts +1 -0
  68. package/src/capabilities/intent-resolver.ts +11 -4
  69. package/src/capabilities/migrations.ts +22 -0
  70. package/src/components/IdentityDialog.tsx +3 -1
  71. package/src/components/JoinDialog.tsx +3 -1
  72. package/src/events.ts +1 -0
  73. package/dist/lib/browser/chunk-EYBZZHSM.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-GHEQL2E6.mjs.map +0 -7
  75. package/dist/lib/node/chunk-7LVBFGKQ.cjs.map +0 -7
  76. package/dist/lib/node/chunk-UHIGZJQL.cjs.map +0 -7
  77. package/dist/lib/node-esm/chunk-CRF22MJJ.mjs.map +0 -7
  78. package/dist/lib/node-esm/chunk-T35SFKK3.mjs.map +0 -7
  79. /package/dist/lib/browser/{client-A7YSVURS.mjs.map → client-UUGITHCW.mjs.map} +0 -0
  80. /package/dist/lib/browser/{react-context-R3SG55F5.mjs.map → react-context-JBD7Y3SN.mjs.map} +0 -0
  81. /package/dist/lib/browser/{react-surface-XGOUHVIH.mjs.map → react-surface-QGPWIUFR.mjs.map} +0 -0
  82. /package/dist/lib/browser/{schema-J4MJIXRP.mjs.map → schema-Y7ZNXYSL.mjs.map} +0 -0
  83. /package/dist/lib/node/{client-2RQATBB6.cjs.map → client-5BHSU35T.cjs.map} +0 -0
  84. /package/dist/lib/node/{react-context-TD6VGBVA.cjs.map → react-context-MPHNGZHT.cjs.map} +0 -0
  85. /package/dist/lib/node/{react-surface-IY7GXEGU.cjs.map → react-surface-TPISDIHR.cjs.map} +0 -0
  86. /package/dist/lib/node/{schema-JXJS75HQ.cjs.map → schema-NMMCMK64.cjs.map} +0 -0
  87. /package/dist/lib/node-esm/{client-36DKBSB7.mjs.map → client-ZDGFGLX4.mjs.map} +0 -0
  88. /package/dist/lib/node-esm/{react-context-ZOGDOWJ2.mjs.map → react-context-KUEOXWWK.mjs.map} +0 -0
  89. /package/dist/lib/node-esm/{react-surface-F3PDFJMV.mjs.map → react-surface-KBROL4VH.mjs.map} +0 -0
  90. /package/dist/lib/node-esm/{schema-XM4HBLIX.mjs.map → schema-NE5IYLMD.mjs.map} +0 -0
@@ -26,49 +26,49 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var react_surface_IY7GXEGU_exports = {};
30
- __export(react_surface_IY7GXEGU_exports, {
29
+ var react_surface_TPISDIHR_exports = {};
30
+ __export(react_surface_TPISDIHR_exports, {
31
31
  default: () => react_surface_default
32
32
  });
33
- module.exports = __toCommonJS(react_surface_IY7GXEGU_exports);
34
- var import_chunk_7LVBFGKQ = require("./chunk-7LVBFGKQ.cjs");
33
+ module.exports = __toCommonJS(react_surface_TPISDIHR_exports);
34
+ var import_chunk_UTG3UR3N = require("./chunk-UTG3UR3N.cjs");
35
35
  var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
36
36
  var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
37
37
  var import_react = __toESM(require("react"));
38
38
  var import_app_framework = require("@dxos/app-framework");
39
39
  var react_surface_default = ({ createInvitationUrl }) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
40
40
  (0, import_app_framework.createSurface)({
41
- id: import_chunk_7LVBFGKQ.IDENTITY_DIALOG,
41
+ id: import_chunk_UTG3UR3N.IDENTITY_DIALOG,
42
42
  role: "dialog",
43
- filter: (data) => data.component === import_chunk_7LVBFGKQ.IDENTITY_DIALOG,
44
- component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.IdentityDialog, {
43
+ filter: (data) => data.component === import_chunk_UTG3UR3N.IDENTITY_DIALOG,
44
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_UTG3UR3N.IdentityDialog, {
45
45
  ...data.props,
46
46
  createInvitationUrl
47
47
  })
48
48
  }),
49
49
  (0, import_app_framework.createSurface)({
50
- id: import_chunk_7LVBFGKQ.JOIN_DIALOG,
50
+ id: import_chunk_UTG3UR3N.JOIN_DIALOG,
51
51
  role: "dialog",
52
- filter: (data) => data.component === import_chunk_7LVBFGKQ.JOIN_DIALOG,
53
- component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.JoinDialog, data.props)
52
+ filter: (data) => data.component === import_chunk_UTG3UR3N.JOIN_DIALOG,
53
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_UTG3UR3N.JoinDialog, data.props)
54
54
  }),
55
55
  (0, import_app_framework.createSurface)({
56
- id: import_chunk_7LVBFGKQ.RECOVER_CODE_DIALOG,
56
+ id: import_chunk_UTG3UR3N.RECOVER_CODE_DIALOG,
57
57
  role: "dialog",
58
- filter: (data) => data.component === import_chunk_7LVBFGKQ.RECOVER_CODE_DIALOG,
59
- component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.RecoveryCodeDialog, data.props)
58
+ filter: (data) => data.component === import_chunk_UTG3UR3N.RECOVER_CODE_DIALOG,
59
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_UTG3UR3N.RecoveryCodeDialog, data.props)
60
60
  }),
61
61
  (0, import_app_framework.createSurface)({
62
- id: import_chunk_7LVBFGKQ.RECOVER_SETUP_DIALOG,
62
+ id: import_chunk_UTG3UR3N.RECOVER_SETUP_DIALOG,
63
63
  role: "dialog",
64
- filter: (data) => data.component === import_chunk_7LVBFGKQ.RECOVER_SETUP_DIALOG,
65
- component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.RecoverySetupDialog, null)
64
+ filter: (data) => data.component === import_chunk_UTG3UR3N.RECOVER_SETUP_DIALOG,
65
+ component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_UTG3UR3N.RecoverySetupDialog, null)
66
66
  }),
67
67
  (0, import_app_framework.createSurface)({
68
- id: import_chunk_7LVBFGKQ.MANAGE_CREDENTIALS_DIALOG,
68
+ id: import_chunk_UTG3UR3N.MANAGE_CREDENTIALS_DIALOG,
69
69
  role: "dialog",
70
- filter: (data) => data.component === import_chunk_7LVBFGKQ.MANAGE_CREDENTIALS_DIALOG,
71
- component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.ManageCredentialsDialog, null)
70
+ filter: (data) => data.component === import_chunk_UTG3UR3N.MANAGE_CREDENTIALS_DIALOG,
71
+ component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_UTG3UR3N.ManageCredentialsDialog, null)
72
72
  })
73
73
  ]);
74
- //# sourceMappingURL=react-surface-IY7GXEGU.cjs.map
74
+ //# sourceMappingURL=react-surface-TPISDIHR.cjs.map
@@ -16,24 +16,24 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var schema_JXJS75HQ_exports = {};
20
- __export(schema_JXJS75HQ_exports, {
19
+ var schema_NMMCMK64_exports = {};
20
+ __export(schema_NMMCMK64_exports, {
21
21
  default: () => schema_default
22
22
  });
23
- module.exports = __toCommonJS(schema_JXJS75HQ_exports);
24
- var import_chunk_UHIGZJQL = require("./chunk-UHIGZJQL.cjs");
23
+ module.exports = __toCommonJS(schema_NMMCMK64_exports);
24
+ var import_chunk_T4K27K2F = require("./chunk-T4K27K2F.cjs");
25
25
  var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
26
26
  var import_signals_core = require("@preact/signals-core");
27
27
  var import_app_framework = require("@dxos/app-framework");
28
28
  var schema_default = (context) => {
29
- const client = context.requestCapability(import_chunk_UHIGZJQL.ClientCapabilities.Client);
29
+ const client = context.requestCapability(import_chunk_T4K27K2F.ClientCapabilities.Client);
30
30
  let previous = [];
31
31
  const unsubscribe = (0, import_signals_core.effect)(() => {
32
- const schemas = Array.from(new Set(context.requestCapabilities(import_chunk_UHIGZJQL.ClientCapabilities.Schema).flat()));
32
+ const schemas = Array.from(new Set(context.requestCapabilities(import_chunk_T4K27K2F.ClientCapabilities.Schema).flat()));
33
33
  const newSchemas = schemas.filter((schema) => !previous.includes(schema));
34
34
  previous = schemas;
35
35
  client.addTypes(newSchemas);
36
36
  });
37
37
  return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () => unsubscribe());
38
38
  };
39
- //# sourceMappingURL=schema-JXJS75HQ.cjs.map
39
+ //# sourceMappingURL=schema-NMMCMK64.cjs.map
@@ -9,9 +9,10 @@ var ClientCapabilities;
9
9
  (function(ClientCapabilities2) {
10
10
  ClientCapabilities2.Client = defineCapability(`${CLIENT_PLUGIN}/capability/client`);
11
11
  ClientCapabilities2.Schema = defineCapability(`${CLIENT_PLUGIN}/capability/schema`);
12
+ ClientCapabilities2.Migration = defineCapability(`${CLIENT_PLUGIN}/capability/migration`);
12
13
  })(ClientCapabilities || (ClientCapabilities = {}));
13
14
 
14
15
  export {
15
16
  ClientCapabilities
16
17
  };
17
- //# sourceMappingURL=chunk-T35SFKK3.mjs.map
18
+ //# sourceMappingURL=chunk-3OU2ZXLK.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/capabilities.ts"],
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 Migration = defineCapability<ObjectMigration[]>(`${CLIENT_PLUGIN}/capability/migration`);\n}\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,wBAAwB;;UAOhBC,qBAAAA;sBACFC,SAASC,iBAAyB,GAAGC,aAAAA,oBAAiC;sBACtEC,SAASF,iBAAgC,GAAGC,aAAAA,oBAAiC;sBAC7EE,YAAYH,iBAAoC,GAAGC,aAAAA,uBAAoC;AACtG,GAJiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;",
6
+ "names": ["defineCapability", "ClientCapabilities", "Client", "defineCapability", "CLIENT_PLUGIN", "Schema", "Migration"]
7
+ }
@@ -56,12 +56,13 @@ var ManageCredentialsDialog = () => {
56
56
  import React2, { useCallback } from "react";
57
57
  import { createIntent as createIntent2, LayoutAction, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
58
58
  import { useClient } from "@dxos/react-client";
59
- import { Clipboard, Dialog as Dialog2 } from "@dxos/react-ui";
59
+ import { Clipboard, Dialog as Dialog2, useTranslation as useTranslation2 } from "@dxos/react-ui";
60
60
  import { IdentityPanel } from "@dxos/shell/react";
61
61
  var IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;
62
62
  var IdentityDialog = (props) => {
63
63
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
64
64
  const client = useClient();
65
+ const { t } = useTranslation2(CLIENT_PLUGIN);
65
66
  const handleDone = useCallback(() => dispatch(createIntent2(LayoutAction.UpdateDialog, {
66
67
  part: "dialog",
67
68
  options: {
@@ -104,7 +105,11 @@ var IdentityDialog = (props) => {
104
105
  }, [
105
106
  dispatch
106
107
  ]);
107
- return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
108
+ return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(Dialog2.Title, {
109
+ classNames: "sr-only"
110
+ }, t("manage profile label", {
111
+ ns: "os"
112
+ })), /* @__PURE__ */ React2.createElement(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
108
113
  ...props,
109
114
  doneActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
110
115
  asChild: true
@@ -121,11 +126,12 @@ var IdentityDialog = (props) => {
121
126
  import React3, { useCallback as useCallback2 } from "react";
122
127
  import { createIntent as createIntent3, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
123
128
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
124
- import { Dialog as Dialog3 } from "@dxos/react-ui";
129
+ import { Dialog as Dialog3, useTranslation as useTranslation3 } from "@dxos/react-ui";
125
130
  import { JoinPanel } from "@dxos/shell/react";
126
131
  var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
127
132
  var JoinDialog = (props) => {
128
133
  const { dispatchPromise: dispatch } = useIntentDispatcher3();
134
+ const { t } = useTranslation3(CLIENT_PLUGIN);
129
135
  const handleCancelResetStorage = useCallback2(() => dispatch(createIntent3(ClientAction.ShareIdentity)), [
130
136
  dispatch
131
137
  ]);
@@ -146,7 +152,11 @@ var JoinDialog = (props) => {
146
152
  }, [
147
153
  dispatch
148
154
  ]);
149
- return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(JoinPanel, {
155
+ return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(Dialog3.Title, {
156
+ classNames: "sr-only"
157
+ }, t("join space label", {
158
+ ns: "os"
159
+ })), /* @__PURE__ */ React3.createElement(JoinPanel, {
150
160
  mode: "halo-only",
151
161
  ...props,
152
162
  exitActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
@@ -162,10 +172,10 @@ var JoinDialog = (props) => {
162
172
 
163
173
  // packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx
164
174
  import React4, { useCallback as useCallback3, useState } from "react";
165
- import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
175
+ import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
166
176
  var RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;
167
177
  var RecoveryCodeDialog = ({ code }) => {
168
- const { t } = useTranslation2(CLIENT_PLUGIN);
178
+ const { t } = useTranslation4(CLIENT_PLUGIN);
169
179
  const [confirmation, setConfirmation] = useState(false);
170
180
  const handleConfirmation = useCallback3((checked) => setConfirmation(checked), []);
171
181
  return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
@@ -215,11 +225,11 @@ var Code = ({ code }) => {
215
225
  import { Key as Key2, Receipt as Receipt2 } from "@phosphor-icons/react";
216
226
  import React5, { useMemo as useMemo2 } from "react";
217
227
  import { createIntent as createIntent4, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
218
- import { AlertDialog as AlertDialog2, useTranslation as useTranslation3 } from "@dxos/react-ui";
228
+ import { AlertDialog as AlertDialog2, useTranslation as useTranslation5 } from "@dxos/react-ui";
219
229
  import { BifurcatedAction as BifurcatedAction2 } from "@dxos/shell/react";
220
230
  var RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;
221
231
  var RecoverySetupDialog = () => {
222
- const { t } = useTranslation3(CLIENT_PLUGIN);
232
+ const { t } = useTranslation5(CLIENT_PLUGIN);
223
233
  const { dispatchPromise: dispatch } = useIntentDispatcher4();
224
234
  const actions = useMemo2(() => ({
225
235
  createPasskey: {
@@ -269,4 +279,4 @@ export {
269
279
  RECOVER_SETUP_DIALOG,
270
280
  RecoverySetupDialog
271
281
  };
272
- //# sourceMappingURL=chunk-CRF22MJJ.mjs.map
282
+ //# sourceMappingURL=chunk-SHJBU4QR.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ManageCredentialsDialog.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/components/RecoverySetupDialog.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Receipt, Key } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { useCredentials } from '@dxos/react-client/halo';\nimport { Dialog, Icon, List, ListItem, useTranslation } from '@dxos/react-ui';\nimport { BifurcatedAction, type ActionMenuItem } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const ManageCredentialsDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const credentials = useCredentials();\n const recoveryCredentials = credentials.filter(\n (credential) => credential.subject.assertion['@type'] === 'dxos.halo.credentials.IdentityRecovery',\n );\n\n // TODO(wittjosiah): Reconsile w/ RecoverySetupDialog actions.\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: () => dispatch(createIntent(ClientAction.CreatePasskey)),\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <Dialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <Dialog.Title>{t('manage credentials dialog title')}</Dialog.Title>\n <List classNames='py-4'>\n {recoveryCredentials.map((credential) => (\n <ListItem.Root key={credential.id?.toHex()}>\n <ListItem.Endcap>\n <Icon icon='ph--key--regular' size={5} />\n </ListItem.Endcap>\n <ListItem.Heading>{credential.issuanceDate.toLocaleString()}</ListItem.Heading>\n </ListItem.Root>\n ))}\n </List>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\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 { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog, useTranslation } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { MANAGE_CREDENTIALS_DIALOG } from './ManageCredentialsDialog';\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 const { t } = useTranslation(CLIENT_PLUGIN);\n\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n options: { 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 const handleManageCredentials = useCallback(async () => {\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: MANAGE_CREDENTIALS_DIALOG,\n options: { state: true, blockAlign: 'start' },\n }),\n );\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Dialog.Title classNames='sr-only'>{t('manage profile label', { ns: 'os' })}</Dialog.Title>\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 onManageCredentials={handleManageCredentials}\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, useTranslation } 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 const { t } = useTranslation(CLIENT_PLUGIN);\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.UpdateDialog, { part: 'dialog', options: { 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 <Dialog.Title classNames='sr-only'>{t('join space label', { ns: 'os' })}</Dialog.Title>\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\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\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'>\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", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Key, Receipt } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { AlertDialog, useTranslation } from '@dxos/react-ui';\nimport { type ActionMenuItem, BifurcatedAction } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoverySetupDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: async () => {\n await dispatch(createIntent(ClientAction.CreatePasskey));\n await dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));\n },\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery setup dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery setup dialog description')}</p>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </AlertDialog.Content>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;AAIA,SAASA,SAASC,WAAW;AAC7B,OAAOC,SAASC,eAAe;AAE/B,SAASC,cAAcC,2BAA2B;AAClD,SAASC,sBAAsB;AAC/B,SAASC,QAAQC,MAAMC,MAAMC,UAAUC,sBAAsB;AAC7D,SAASC,wBAA6C;AAK/C,IAAMC,4BAA4B,GAAGC,aAAAA;AAGrC,IAAMC,0BAA0B,MAAA;AACrC,QAAM,EAAEC,EAAC,IAAKC,eAAeH,aAAAA;AAC7B,QAAM,EAAEI,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,cAAcC,eAAAA;AACpB,QAAMC,sBAAsBF,YAAYG,OACtC,CAACC,eAAeA,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AE,CAAA,CAAA;MACrG;IACF;IACAC,oBAAoB;MAClBb,OAAOR,EAAE,4BAAA;MACTS,aAAaT,EAAE,kCAAA;MACfU,MAAMY;MACNV,SAAS,MAAMT,SAASU,cAAaC,aAAaS,kBAAkB,CAAA;IACtE;EACF,IACA;IAACvB;GAAE;AAGL,SACE,gBAAAwB,OAAA,cAACC,aAAYC,SAAO;IAACC,YAAW;KAC9B,gBAAAH,OAAA,cAACC,aAAYG,OAAK,MAAE5B,EAAE,6BAAA,CAAA,GACtB,gBAAAwB,OAAA,cAACK,KAAAA;IAAEC,WAAU;KAAQ9B,EAAE,mCAAA,CAAA,GACvB,gBAAAwB,OAAA,cAACO,OAAAA;IAAID,WAAU;MACf,gBAAAN,OAAA,cAACQ,mBAAAA;IAAiB3B;;AAGxB;",
6
+ "names": ["Receipt", "Key", "React", "useMemo", "createIntent", "useIntentDispatcher", "useCredentials", "Dialog", "Icon", "List", "ListItem", "useTranslation", "BifurcatedAction", "MANAGE_CREDENTIALS_DIALOG", "CLIENT_PLUGIN", "ManageCredentialsDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "credentials", "useCredentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "Dialog", "Content", "classNames", "Title", "List", "map", "ListItem", "Root", "key", "id", "toHex", "Endcap", "Icon", "size", "Heading", "issuanceDate", "toLocaleString", "div", "className", "BifurcatedAction", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "useTranslation", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "t", "useTranslation", "handleDone", "useCallback", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "handleManageCredentials", "subject", "MANAGE_CREDENTIALS_DIALOG", "blockAlign", "React", "Dialog", "Content", "Title", "classNames", "ns", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "onManageCredentials", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "useTranslation", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "t", "useTranslation", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "UpdateDialog", "part", "options", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "Title", "classNames", "ns", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RECOVER_CODE_DIALOG", "CLIENT_PLUGIN", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "useCallback", "checked", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "Clipboard", "Provider", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "asChild", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key", "Key", "Receipt", "React", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "AlertDialog", "useTranslation", "BifurcatedAction", "RECOVER_SETUP_DIALOG", "CLIENT_PLUGIN", "RecoverySetupDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "LayoutAction", "UpdateDialog", "part", "options", "state", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "div", "BifurcatedAction"]
7
+ }
@@ -9,6 +9,7 @@ var ClientEvents;
9
9
  (function(ClientEvents2) {
10
10
  ClientEvents2.ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);
11
11
  ClientEvents2.SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);
12
+ ClientEvents2.SetupMigration = defineEvent(`${CLIENT_PLUGIN}/event/setup-migration`);
12
13
  ClientEvents2.IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);
13
14
  ClientEvents2.SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);
14
15
  })(ClientEvents || (ClientEvents = {}));
@@ -16,4 +17,4 @@ var ClientEvents;
16
17
  export {
17
18
  ClientEvents
18
19
  };
19
- //# sourceMappingURL=chunk-QR72BXJK.mjs.map
20
+ //# sourceMappingURL=chunk-XLLNVLWU.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/events.ts"],
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 IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);\n export const SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);\n}\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,mBAAmB;;UAIXC,eAAAA;gBACFC,cAAcC,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DC,cAAcF,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DE,kBAAkBH,YAAY,GAAGC,aAAAA,yBAAsC;gBACvEG,cAAcJ,YAAY,GAAGC,aAAAA,qBAAkC;AAC9E,GALiBH,iBAAAA,eAAAA,CAAAA,EAAAA;",
6
- "names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "IdentityCreated", "SpacesReady"]
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": ";;;;;;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
+ "names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "SetupMigration", "IdentityCreated", "SpacesReady"]
7
7
  }
@@ -1,10 +1,10 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ClientEvents
4
- } from "./chunk-QR72BXJK.mjs";
4
+ } from "./chunk-XLLNVLWU.mjs";
5
5
  import {
6
6
  ClientCapabilities
7
- } from "./chunk-T35SFKK3.mjs";
7
+ } from "./chunk-3OU2ZXLK.mjs";
8
8
  import "./chunk-HO7WDE7C.mjs";
9
9
 
10
10
  // packages/plugins/plugin-client/src/capabilities/client.ts
@@ -34,4 +34,4 @@ var client_default = async ({ context, onClientInitialized, ...options }) => {
34
34
  export {
35
35
  client_default as default
36
36
  };
37
- //# sourceMappingURL=client-36DKBSB7.mjs.map
37
+ //# sourceMappingURL=client-ZDGFGLX4.mjs.map
@@ -1,10 +1,10 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ClientEvents
4
- } from "./chunk-QR72BXJK.mjs";
4
+ } from "./chunk-XLLNVLWU.mjs";
5
5
  import {
6
6
  ClientCapabilities
7
- } from "./chunk-T35SFKK3.mjs";
7
+ } from "./chunk-3OU2ZXLK.mjs";
8
8
  import {
9
9
  CLIENT_PLUGIN,
10
10
  meta
@@ -16,11 +16,12 @@ import { Capabilities, contributes, defineModule, definePlugin, Events, oneOf }
16
16
  // packages/plugins/plugin-client/src/capabilities/index.ts
17
17
  import { lazy } from "@dxos/app-framework";
18
18
  var AppGraphBuilder = lazy(async () => import("./app-graph-builder-TDYRWNI7.mjs"));
19
- var Client = lazy(async () => import("./client-36DKBSB7.mjs"));
20
- var IntentResolver = lazy(async () => import("./intent-resolver-WWTVE6T6.mjs"));
21
- var ReactContext = lazy(async () => import("./react-context-ZOGDOWJ2.mjs"));
22
- var ReactSurface = lazy(async () => import("./react-surface-F3PDFJMV.mjs"));
23
- var Schema = lazy(async () => import("./schema-XM4HBLIX.mjs"));
19
+ var Client = lazy(async () => import("./client-ZDGFGLX4.mjs"));
20
+ var IntentResolver = lazy(async () => import("./intent-resolver-FIXGPH7C.mjs"));
21
+ var Migrations = lazy(async () => import("./migrations-VIEIPYJW.mjs"));
22
+ var ReactContext = lazy(async () => import("./react-context-KUEOXWWK.mjs"));
23
+ var ReactSurface = lazy(async () => import("./react-surface-KBROL4VH.mjs"));
24
+ var Schema = lazy(async () => import("./schema-NE5IYLMD.mjs"));
24
25
 
25
26
  // packages/plugins/plugin-client/src/translations.ts
26
27
  var translations_default = [
@@ -73,6 +74,14 @@ var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam =
73
74
  ],
74
75
  activate: Schema
75
76
  }),
77
+ defineModule({
78
+ id: `${meta.id}/module/migration`,
79
+ activatesOn: ClientEvents.ClientReady,
80
+ activatesBefore: [
81
+ ClientEvents.SetupMigration
82
+ ],
83
+ activate: Migrations
84
+ }),
76
85
  defineModule({
77
86
  id: `${meta.id}/module/react-context`,
78
87
  activatesOn: Events.Startup,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ClientPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport { Client, AppGraphBuilder, IntentResolver, ReactContext, ReactSurface, Schema } from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\nexport const Schema = lazy(async () => import('./schema'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'recovery setup dialog title': 'Account Recovery',\n 'recovery setup dialog description':\n 'In order to recover your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.',\n 'create passkey label': 'Create Passkey',\n 'create passkey description':\n 'A passkey is a secure and easy to use credential that can be used to recover your account.',\n 'create recovery code label': 'Create Recovery Code',\n 'create recovery code description': 'A recovery code is 12 word phrase representing a private key.',\n 'recovery code dialog title': 'Recovery Code',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\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AGF,KAAKE,EAAE;MACdC,aAAaM,aAAaC;MAC1BI,iBAAiB;QAACL,aAAaM;;MAC/BJ,UAAUK;IACZ,CAAA;IACAf,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOC;MACpBK,UAAUM;IACZ,CAAA;IACAhB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOa;MACpBP,UAAU,MAAMQ,aAAa;QAAE3B;MAAoB,CAAA;IACrD,CAAA;IACAS,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOE;MACpBI,UAAUS;IACZ,CAAA;IACAnB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOgB;MACpBV,UAAU,CAACC,YAAYU,eAAe;QAAEV;QAAStB;MAAQ,CAAA;IAC3D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOkB;MACpBZ,UAAU,MAAMa,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
6
- "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "ReactContext", "ReactSurface", "Schema", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "Client", "activatesBefore", "SetupSchema", "Schema", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport {\n Client,\n AppGraphBuilder,\n IntentResolver,\n Migrations,\n ReactContext,\n ReactSurface,\n Schema,\n} from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/migration`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupMigration],\n activate: Migrations,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const Migrations = lazy(async () => import('./migrations'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\nexport const Schema = lazy(async () => import('./schema'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'recovery setup dialog title': 'Account Recovery',\n 'recovery setup dialog description':\n 'In order to recover your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.',\n 'create passkey label': 'Create Passkey',\n 'create passkey description':\n 'A passkey is a secure and easy to use credential that can be used to recover your account.',\n 'create recovery code label': 'Create Recovery Code',\n 'create recovery code description': 'A recovery code is 12 word phrase representing a private key.',\n 'recovery code dialog title': 'Recovery Code',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,QAAQC,aAAa;;;ACArF,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,SAASD,KAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,iBAAiBF,KAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,aAAaH,KAAK,YAAY,OAAO,2BAAA,CAAA;AAC3C,IAAMI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pBK,UAAUQ;IACZ,CAAA;IACAlB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOe;MACpBT,UAAU,MAAMU,aAAa;QAAE7B;MAAoB,CAAA;IACrD,CAAA;IACAS,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOE;MACpBI,UAAUW;IACZ,CAAA;IACArB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOkB;MACpBZ,UAAU,CAACC,YAAYY,eAAe;QAAEZ;QAAStB;MAAQ,CAAA;IAC3D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
6
+ "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "Migrations", "ReactContext", "ReactSurface", "Schema", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "Client", "activatesBefore", "SetupSchema", "Schema", "SetupMigration", "Migrations", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
7
7
  }
@@ -1,18 +1,18 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ClientEvents
4
- } from "./chunk-QR72BXJK.mjs";
4
+ } from "./chunk-XLLNVLWU.mjs";
5
+ import {
6
+ ClientCapabilities
7
+ } from "./chunk-3OU2ZXLK.mjs";
5
8
  import {
6
9
  IDENTITY_DIALOG,
7
10
  JOIN_DIALOG,
8
11
  RECOVER_CODE_DIALOG
9
- } from "./chunk-CRF22MJJ.mjs";
12
+ } from "./chunk-SHJBU4QR.mjs";
10
13
  import {
11
14
  ClientAction
12
15
  } from "./chunk-QJMF2MWP.mjs";
13
- import {
14
- ClientCapabilities
15
- } from "./chunk-T35SFKK3.mjs";
16
16
  import "./chunk-HO7WDE7C.mjs";
17
17
 
18
18
  // packages/plugins/plugin-client/src/capabilities/intent-resolver.ts
@@ -168,6 +168,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
168
168
  "'Identity not available'"
169
169
  ]
170
170
  });
171
+ const lookupKey = PublicKey.random();
171
172
  const credential = await navigator.credentials.create({
172
173
  publicKey: {
173
174
  challenge: new Uint8Array(),
@@ -176,7 +177,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
176
177
  name: appName
177
178
  },
178
179
  user: {
179
- id: new TextEncoder().encode(identity.did),
180
+ id: lookupKey.asUint8Array(),
180
181
  name: identity.did,
181
182
  displayName: identity.profile?.displayName ?? ""
182
183
  },
@@ -199,7 +200,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
199
200
  });
200
201
  invariant(credential, "Credential not available", {
201
202
  F: __dxlog_file,
202
- L: 161,
203
+ L: 162,
203
204
  S: void 0,
204
205
  A: [
205
206
  "credential",
@@ -210,7 +211,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
210
211
  const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
211
212
  invariant(client.services.services.IdentityService, "IdentityService not available", {
212
213
  F: __dxlog_file,
213
- L: 166,
214
+ L: 167,
214
215
  S: void 0,
215
216
  A: [
216
217
  "client.services.services.IdentityService",
@@ -218,8 +219,11 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
218
219
  ]
219
220
  });
220
221
  await client.services.services.IdentityService.createRecoveryCredential({
221
- recoveryKey,
222
- algorithm
222
+ data: {
223
+ recoveryKey,
224
+ algorithm,
225
+ lookupKey
226
+ }
223
227
  });
224
228
  }
225
229
  }),
@@ -229,7 +233,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
229
233
  const client = context.requestCapability(ClientCapabilities.Client);
230
234
  invariant(client.services.services.IdentityService, "IdentityService not available", {
231
235
  F: __dxlog_file,
232
- L: 175,
236
+ L: 182,
233
237
  S: void 0,
234
238
  A: [
235
239
  "client.services.services.IdentityService",
@@ -244,10 +248,10 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
244
248
  userVerification: "required"
245
249
  }
246
250
  });
247
- const identityDid = new TextDecoder().decode(credential.response.userHandle);
251
+ const lookupKey = PublicKey.from(new Uint8Array(credential.response.userHandle));
248
252
  await client.services.services.IdentityService.recoverIdentity({
249
253
  external: {
250
- identityDid,
254
+ lookupKey,
251
255
  deviceKey,
252
256
  controlFeedKey,
253
257
  signature: Buffer.from(credential.response.signature),
@@ -261,4 +265,4 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
261
265
  export {
262
266
  intent_resolver_default as default
263
267
  };
264
- //# sourceMappingURL=intent-resolver-WWTVE6T6.mjs.map
268
+ //# sourceMappingURL=intent-resolver-FIXGPH7C.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 { PublicKey } from '@dxos/react-client';\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 appName?: string;\n};\n\nexport default ({ context, appName = 'Composer', onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: 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 }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: IDENTITY_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n await onReset?.({ target: data.target });\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: 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 }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: 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.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVER_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: new TextEncoder().encode(identity.did),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({ recoveryKey, algorithm });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const identityDid = new TextDecoder().decode((credential as any).response.userHandle);\n await client.services.services.IdentityService.recoverIdentity({\n external: {\n identityDid,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n });\n },\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAa1B,IAAA,0BAAe,CAAC,EAAEC,SAASC,UAAU,YAAYC,QAAO,MACtDC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,aAAaC;IACrBC,SAAS,YAAA;AACP,YAAMC,UAAUX,QAAQY,kBAAkBR,aAAaS,aAAa;AACpE,YAAMC,SAASd,QAAQY,kBAAkBG,mBAAmBC,MAAM;AAClE,YAAMC,OAAO,MAAMH,OAAOI,KAAKC,eAAc;AAC7C,YAAMR,QAAQS,SAASC,aAAaC,eAAe;AACnD,aAAO;QAAEL;QAAMM,SAAS;UAACC,aAAaC,oBAAoBC,WAAW;YAAEC,MAAM;UAAkB,CAAA;;MAAI;IACrG;EACF,CAAA;EACArB,eAAe;IACbC,QAAQC,aAAaoB;IACrBlB,SAAS,OAAOO,SAAAA;AACd,aAAO;QACLM,SAAS;UACPC,aAAaK,aAAaC,cAAc;YACtCC,MAAM;YACNC,SAASC;YACTC,SAAS;cACPC,YAAY;cACZC,OAAO;gBACLC,uBAAuBpB,KAAKqB;gBAC5BC,oBAAoB;cACtB;YACF;UACF,CAAA;;MAEJ;IACF;EACF,CAAA;EACAjC,eAAe;I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;;;;;AACpD,YAAM,EAAEuC,WAAWC,gBAAgB1B,UAAS,IAC1C,MAAMpD,OAAOiC,SAASA,SAASK,gBAAgByC,yBAAwB;AACzE,YAAMhC,aAAa,MAAMC,UAAUC,YAAYH,IAAI;QACjDK,WAAW;UACTC,WAAW4B,OAAOT,KAAKnB,WAAW,QAAA;UAClC6B,MAAMzB,SAASC;UACfyB,kBAAkB;QACpB;MACF,CAAA;AACA,YAAMC,cAAc,IAAIC,YAAAA,EAAcC,OAAQtC,WAAmByB,SAASc,UAAU;AACpF,YAAMtF,OAAOiC,SAASA,SAASK,gBAAgBiD,gBAAgB;QAC7DC,UAAU;UACRL;UACAN;UACAC;UACAW,WAAWT,OAAOT,KAAMxB,WAAmByB,SAASiB,SAAS;UAC7DC,gBAAgBV,OAAOT,KAAMxB,WAAmByB,SAASmB,cAAc;UACvEC,mBAAmBZ,OAAOT,KAAMxB,WAAmByB,SAASoB,iBAAiB;QAC/E;MACF,CAAA;IACF;EACF,CAAA;CACD;",
6
- "names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "context", "appName", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVER_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "id", "location", "hostname", "user", "TextEncoder", "encode", "did", "displayName", "profile", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "PublicKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "identityDid", "TextDecoder", "decode", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData"]
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 { PublicKey } from '@dxos/react-client';\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 appName?: string;\n};\n\nexport default ({ context, appName = 'Composer', onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: 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 }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: IDENTITY_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n await onReset?.({ target: data.target });\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: 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 }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: 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.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVER_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const lookupKey = PublicKey.random();\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array(),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n await client.services.services.IdentityService.recoverIdentity({\n external: {\n lookupKey,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n });\n },\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAa1B,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;UAC7DC,gBAAgBP,OAAOT,KAAMtB,WAAmBuB,SAASgB,cAAc;UACvEC,mBAAmBT,OAAOT,KAAMtB,WAAmBuB,SAASiB,iBAAiB;QAC/E;MACF,CAAA;IACF;EACF,CAAA;CACD;",
6
+ "names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "context", "appName", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVER_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "id", "location", "hostname", "user", "asUint8Array", "did", "displayName", "profile", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData"]
7
7
  }