@dxos/plugin-client 0.7.4 → 0.7.5-main.9cb18ac

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 (57) hide show
  1. package/dist/lib/browser/chunk-52IJQ35F.mjs +78 -0
  2. package/dist/lib/browser/chunk-52IJQ35F.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-X4QUPYC6.mjs +12 -0
  4. package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +163 -221
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/meta.mjs +1 -5
  9. package/dist/lib/browser/types.mjs +10 -0
  10. package/dist/lib/browser/types.mjs.map +7 -0
  11. package/dist/lib/node/chunk-NFO3ADQC.cjs +98 -0
  12. package/dist/lib/node/chunk-NFO3ADQC.cjs.map +7 -0
  13. package/dist/lib/node/chunk-RUA5KXVW.cjs +35 -0
  14. package/dist/lib/node/chunk-RUA5KXVW.cjs.map +7 -0
  15. package/dist/lib/node/index.cjs +165 -224
  16. package/dist/lib/node/index.cjs.map +3 -3
  17. package/dist/lib/node/meta.cjs +4 -8
  18. package/dist/lib/node/meta.cjs.map +2 -2
  19. package/dist/lib/node/meta.json +1 -1
  20. package/dist/lib/node/types.cjs +32 -0
  21. package/dist/lib/node/types.cjs.map +7 -0
  22. package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs +14 -0
  23. package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +7 -0
  24. package/dist/lib/node-esm/chunk-TI4GNGMM.mjs +79 -0
  25. package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +7 -0
  26. package/dist/lib/node-esm/index.mjs +163 -221
  27. package/dist/lib/node-esm/index.mjs.map +3 -3
  28. package/dist/lib/node-esm/meta.json +1 -1
  29. package/dist/lib/node-esm/meta.mjs +1 -5
  30. package/dist/lib/node-esm/types.mjs +11 -0
  31. package/dist/lib/node-esm/types.mjs.map +7 -0
  32. package/dist/types/src/ClientPlugin.d.ts +2 -35
  33. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  34. package/dist/types/src/components/IdentityDialog.d.ts +1 -0
  35. package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
  36. package/dist/types/src/components/JoinDialog.d.ts +1 -0
  37. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  38. package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -0
  39. package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
  40. package/dist/types/src/meta.d.ts +0 -10
  41. package/dist/types/src/meta.d.ts.map +1 -1
  42. package/dist/types/src/types.d.ts +110 -0
  43. package/dist/types/src/types.d.ts.map +1 -0
  44. package/dist/types/tsconfig.tsbuildinfo +1 -0
  45. package/package.json +22 -13
  46. package/src/ClientPlugin.tsx +111 -200
  47. package/src/components/IdentityDialog.tsx +13 -11
  48. package/src/components/JoinDialog.tsx +13 -19
  49. package/src/components/RecoveryCodeDialog.tsx +3 -1
  50. package/src/meta.ts +0 -14
  51. package/src/types.ts +115 -0
  52. package/dist/lib/browser/chunk-FGUXUNOK.mjs +0 -26
  53. package/dist/lib/browser/chunk-FGUXUNOK.mjs.map +0 -7
  54. package/dist/lib/node/chunk-XYLDQWFV.cjs +0 -51
  55. package/dist/lib/node/chunk-XYLDQWFV.cjs.map +0 -7
  56. package/dist/lib/node-esm/chunk-C6X363FK.mjs +0 -28
  57. package/dist/lib/node-esm/chunk-C6X363FK.mjs.map +0 -7
@@ -29,17 +29,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var node_exports = {};
30
30
  __export(node_exports, {
31
31
  ClientPlugin: () => ClientPlugin,
32
- default: () => src_default,
33
- parseClientPlugin: () => parseClientPlugin
32
+ default: () => src_default
34
33
  });
35
34
  module.exports = __toCommonJS(node_exports);
36
- var import_chunk_XYLDQWFV = require("./chunk-XYLDQWFV.cjs");
35
+ var import_chunk_NFO3ADQC = require("./chunk-NFO3ADQC.cjs");
36
+ var import_chunk_RUA5KXVW = require("./chunk-RUA5KXVW.cjs");
37
37
  var import_react = __toESM(require("react"));
38
38
  var import_app_framework = require("@dxos/app-framework");
39
39
  var import_config = require("@dxos/config");
40
40
  var import_react2 = require("@dxos/echo-signals/react");
41
41
  var import_invariant = require("@dxos/invariant");
42
42
  var import_plugin_graph = require("@dxos/plugin-graph");
43
+ var import_types = require("@dxos/plugin-observability/types");
43
44
  var import_react_client = require("@dxos/react-client");
44
45
  var import_react3 = __toESM(require("react"));
45
46
  var import_app_framework2 = require("@dxos/app-framework");
@@ -48,49 +49,40 @@ var import_react_ui = require("@dxos/react-ui");
48
49
  var import_react4 = require("@dxos/shell/react");
49
50
  var import_react5 = __toESM(require("react"));
50
51
  var import_app_framework3 = require("@dxos/app-framework");
52
+ var import_types2 = require("@dxos/plugin-observability/types");
51
53
  var import_react_ui2 = require("@dxos/react-ui");
52
54
  var import_react6 = require("@dxos/shell/react");
53
55
  var import_react7 = __toESM(require("react"));
54
56
  var import_react_ui3 = require("@dxos/react-ui");
57
+ var IDENTITY_DIALOG = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/IdentityDialog`;
55
58
  var IdentityDialog = (props) => {
56
- const dispatch = (0, import_app_framework2.useIntentDispatcher)();
59
+ const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
57
60
  const client = (0, import_react_client2.useClient)();
58
- const handleDone = (0, import_react3.useCallback)(() => dispatch({
59
- action: import_app_framework2.LayoutAction.SET_LAYOUT,
60
- data: {
61
- element: "dialog",
62
- state: false
63
- }
64
- }), [
61
+ const handleDone = (0, import_react3.useCallback)(() => dispatch((0, import_app_framework2.createIntent)(import_app_framework2.LayoutAction.SetLayout, {
62
+ element: "dialog",
63
+ state: false
64
+ })), [
65
65
  dispatch
66
66
  ]);
67
67
  const handleResetStorage = (0, import_react3.useCallback)(async () => {
68
68
  await client.reset();
69
- await dispatch({
70
- action: import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE
71
- });
69
+ await dispatch((0, import_app_framework2.createIntent)(import_chunk_NFO3ADQC.ClientAction.ResetStorage));
72
70
  }, [
73
71
  dispatch
74
72
  ]);
75
73
  const handleRecover = (0, import_react3.useCallback)(async () => {
76
74
  await client.reset();
77
- await dispatch({
78
- action: import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE,
79
- data: {
80
- target: "recoverIdentity"
81
- }
82
- });
75
+ await dispatch((0, import_app_framework2.createIntent)(import_chunk_NFO3ADQC.ClientAction.ResetStorage, {
76
+ target: "recoverIdentity"
77
+ }));
83
78
  }, [
84
79
  dispatch
85
80
  ]);
86
81
  const handleJoinNewIdentity = (0, import_react3.useCallback)(async () => {
87
82
  await client.reset();
88
- await dispatch({
89
- action: import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE,
90
- data: {
91
- target: "deviceInvitation"
92
- }
93
- });
83
+ await dispatch((0, import_app_framework2.createIntent)(import_chunk_NFO3ADQC.ClientAction.ResetStorage, {
84
+ target: "deviceInvitation"
85
+ }));
94
86
  }, [
95
87
  dispatch
96
88
  ]);
@@ -105,30 +97,22 @@ var IdentityDialog = (props) => {
105
97
  onJoinNewIdentity: handleJoinNewIdentity
106
98
  })));
107
99
  };
100
+ var JOIN_DIALOG = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/JoinDialog`;
108
101
  var JoinDialog = (props) => {
109
- const dispatch = (0, import_app_framework3.useIntentDispatcher)();
110
- const handleCancelResetStorage = (0, import_react5.useCallback)(() => dispatch({
111
- plugin: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
112
- action: import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY
113
- }), [
102
+ const { dispatchPromise: dispatch } = (0, import_app_framework3.useIntentDispatcher)();
103
+ const handleCancelResetStorage = (0, import_react5.useCallback)(() => dispatch((0, import_app_framework3.createIntent)(import_chunk_NFO3ADQC.ClientAction.ShareIdentity)), [
114
104
  dispatch
115
105
  ]);
116
106
  const handleDone = (0, import_react5.useCallback)(async (result) => {
117
107
  if (result?.identityKey) {
118
108
  await Promise.all([
119
- dispatch({
120
- action: import_app_framework3.LayoutAction.SET_LAYOUT,
121
- data: {
122
- element: "dialog",
123
- state: false
124
- }
125
- }),
126
- dispatch({
127
- action: import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
128
- data: {
129
- name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
130
- }
131
- })
109
+ dispatch((0, import_app_framework3.createIntent)(import_app_framework3.LayoutAction.SetLayout, {
110
+ element: "dialog",
111
+ state: false
112
+ })),
113
+ dispatch((0, import_app_framework3.createIntent)(import_types2.ObservabilityAction.SendEvent, {
114
+ name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
115
+ }))
132
116
  ]);
133
117
  }
134
118
  }, [
@@ -147,15 +131,14 @@ var JoinDialog = (props) => {
147
131
  onDone: handleDone
148
132
  }));
149
133
  };
134
+ var RECOVER_CODE_DIALOG = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/RecoveryCodeDialog`;
150
135
  var RecoveryCodeDialog = ({ code }) => {
151
- const { t } = (0, import_react_ui3.useTranslation)(import_chunk_XYLDQWFV.CLIENT_PLUGIN);
136
+ const { t } = (0, import_react_ui3.useTranslation)(import_chunk_RUA5KXVW.CLIENT_PLUGIN);
152
137
  const [confirmation, setConfirmation] = (0, import_react7.useState)(false);
153
138
  const handleConfirmation = (0, import_react7.useCallback)((checked) => setConfirmation(checked), []);
154
139
  return /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Content, {
155
140
  classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
156
- }, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Title, {
157
- classNames: ""
158
- }, t("recovery code dialog title")), /* @__PURE__ */ import_react7.default.createElement("p", {
141
+ }, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ import_react7.default.createElement("p", {
159
142
  className: "py-4"
160
143
  }, t("recovery code dialog description")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Clipboard.Provider, null, /* @__PURE__ */ import_react7.default.createElement(Code, {
161
144
  code
@@ -198,7 +181,7 @@ var Code = ({ code }) => {
198
181
  var translations_default = [
199
182
  {
200
183
  "en-US": {
201
- [import_chunk_XYLDQWFV.CLIENT_PLUGIN]: {
184
+ [import_chunk_RUA5KXVW.CLIENT_PLUGIN]: {
202
185
  "open shell label": "Open HALO",
203
186
  "recovery code dialog title": "Account Recovery",
204
187
  "recovery code dialog description": "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.",
@@ -211,7 +194,6 @@ var translations_default = [
211
194
  }
212
195
  ];
213
196
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/ClientPlugin.tsx";
214
- var parseClientPlugin = (plugin) => (plugin?.provides).client instanceof import_react_client.Client ? plugin : void 0;
215
197
  var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitationParam = "deviceInvitationCode", onClientInitialized, onReady, onReset, ...options }) => {
216
198
  (0, import_react2.registerSignalsRuntime)();
217
199
  let client;
@@ -222,7 +204,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
222
204
  return baseUrl.toString();
223
205
  };
224
206
  return {
225
- meta: import_chunk_XYLDQWFV.meta_default,
207
+ meta: import_chunk_RUA5KXVW.meta_default,
226
208
  initialize: async () => {
227
209
  const config = new import_config.Config(await (0, import_config.Storage)(), (0, import_config.Envs)(), (0, import_config.Local)(), (0, import_config.Defaults)());
228
210
  client = new import_react_client.Client({
@@ -249,7 +231,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
249
231
  }, children)
250
232
  };
251
233
  },
252
- ready: async (plugins) => {
234
+ ready: async ({ plugins }) => {
253
235
  if (error) {
254
236
  throw error;
255
237
  }
@@ -261,47 +243,48 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
261
243
  provides: {
262
244
  translations: translations_default,
263
245
  surface: {
264
- component: ({ data, role, ...rest }) => {
265
- switch (role) {
266
- case "dialog":
267
- if (data.component === "dxos.org/plugin/client/IdentityDialog") {
268
- return /* @__PURE__ */ import_react.default.createElement(IdentityDialog, {
269
- ...data.subject,
270
- createInvitationUrl: createDeviceInvitationUrl
271
- });
272
- } else if (data.component === "dxos.org/plugin/client/JoinDialog") {
273
- return /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject);
274
- } else if (data.component === "dxos.org/plugin/client/RecoveryCodeDialog") {
275
- return /* @__PURE__ */ import_react.default.createElement(RecoveryCodeDialog, data.subject);
276
- }
277
- break;
278
- }
279
- return null;
280
- }
246
+ definitions: () => [
247
+ (0, import_app_framework.createSurface)({
248
+ id: IDENTITY_DIALOG,
249
+ role: "dialog",
250
+ filter: (data) => data.component === IDENTITY_DIALOG,
251
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(IdentityDialog, {
252
+ ...data.subject,
253
+ createInvitationUrl: createDeviceInvitationUrl
254
+ })
255
+ }),
256
+ (0, import_app_framework.createSurface)({
257
+ id: JOIN_DIALOG,
258
+ role: "dialog",
259
+ filter: (data) => data.component === JOIN_DIALOG,
260
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject)
261
+ }),
262
+ (0, import_app_framework.createSurface)({
263
+ id: RECOVER_CODE_DIALOG,
264
+ role: "dialog",
265
+ filter: (data) => data.component === RECOVER_CODE_DIALOG,
266
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(RecoveryCodeDialog, data.subject)
267
+ })
268
+ ]
281
269
  },
282
270
  graph: {
283
271
  builder: (plugins) => {
284
- const intentPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin);
285
- const id = `${import_chunk_XYLDQWFV.CLIENT_PLUGIN}/open-shell`;
272
+ const dispatch = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin)?.provides.intent.dispatchPromise;
273
+ const id = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/open-shell`;
286
274
  return (0, import_plugin_graph.createExtension)({
287
- id: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
275
+ id: import_chunk_RUA5KXVW.CLIENT_PLUGIN,
288
276
  filter: (node) => node.id === "root",
289
277
  actions: () => [
290
278
  {
291
279
  id,
292
280
  data: async () => {
293
- await intentPlugin?.provides.intent.dispatch([
294
- {
295
- plugin: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
296
- action: import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY
297
- }
298
- ]);
281
+ await dispatch?.((0, import_app_framework.createIntent)(import_chunk_NFO3ADQC.ClientAction.ShareIdentity));
299
282
  },
300
283
  properties: {
301
284
  label: [
302
285
  "open shell label",
303
286
  {
304
- ns: import_chunk_XYLDQWFV.CLIENT_PLUGIN
287
+ ns: import_chunk_RUA5KXVW.CLIENT_PLUGIN
305
288
  }
306
289
  ],
307
290
  icon: "ph--address-book--regular",
@@ -319,149 +302,108 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
319
302
  }
320
303
  },
321
304
  intent: {
322
- resolver: async (intent) => {
323
- switch (intent.action) {
324
- case import_chunk_XYLDQWFV.ClientAction.CREATE_IDENTITY: {
325
- const data = await client.halo.createIdentity();
326
- return {
327
- data,
328
- intents: [
329
- [
330
- {
331
- action: import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
332
- data: {
333
- name: "identity.create"
334
- }
335
- }
336
- ]
337
- ]
338
- };
339
- }
340
- case import_chunk_XYLDQWFV.ClientAction.JOIN_IDENTITY: {
341
- return {
342
- data: true,
343
- intents: [
344
- [
345
- {
346
- action: import_app_framework.LayoutAction.SET_LAYOUT,
347
- data: {
348
- element: "dialog",
349
- component: "dxos.org/plugin/client/JoinDialog",
350
- dialogBlockAlign: "start",
351
- subject: {
352
- initialInvitationCode: intent.data?.invitationCode,
353
- initialDisposition: "accept-halo-invitation"
354
- }
355
- }
356
- }
357
- ]
358
- ]
359
- };
360
- }
361
- case import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY: {
362
- return {
363
- data: true,
364
- intents: [
365
- [
366
- {
367
- action: import_app_framework.LayoutAction.SET_LAYOUT,
368
- data: {
369
- element: "dialog",
370
- component: "dxos.org/plugin/client/IdentityDialog",
371
- dialogBlockAlign: "start"
372
- }
373
- }
374
- ],
375
- [
376
- {
377
- action: import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
378
- data: {
379
- name: "identity.share"
380
- }
381
- }
382
- ]
383
- ]
384
- };
385
- }
386
- case import_chunk_XYLDQWFV.ClientAction.RECOVER_IDENTITY: {
387
- return {
388
- data: true,
389
- intents: [
390
- [
391
- {
392
- action: import_app_framework.LayoutAction.SET_LAYOUT,
393
- data: {
394
- element: "dialog",
395
- component: "dxos.org/plugin/client/JoinDialog",
396
- dialogBlockAlign: "start",
397
- subject: {
398
- initialDisposition: "recover-identity"
399
- }
400
- }
401
- }
402
- ]
403
- ]
404
- };
405
- }
406
- case import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE: {
407
- await onReset?.({
408
- target: intent.data?.target
409
- });
410
- return {
411
- data: true
412
- };
413
- }
414
- case import_chunk_XYLDQWFV.ClientAction.CREATE_AGENT: {
415
- (0, import_invariant.invariant)(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
416
- F: __dxlog_file,
417
- L: 283,
418
- S: void 0,
419
- A: [
420
- "client.services.services.EdgeAgentService",
421
- "'Missing EdgeAgentService'"
422
- ]
423
- });
424
- await client.services.services.EdgeAgentService.createAgent(null, {
425
- timeout: 1e4
426
- });
427
- return {
428
- data: true
429
- };
430
- }
431
- case import_chunk_XYLDQWFV.ClientAction.CREATE_RECOVERY_CODE: {
432
- (0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
433
- F: __dxlog_file,
434
- L: 289,
435
- S: void 0,
436
- A: [
437
- "client.services.services.IdentityService",
438
- "'IdentityService not available'"
439
- ]
440
- });
441
- const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
442
- return {
443
- data: true,
444
- intents: [
445
- [
446
- {
447
- action: import_app_framework.LayoutAction.SET_LAYOUT,
448
- data: {
449
- element: "dialog",
450
- dialogBlockAlign: "start",
451
- dialogType: "alert",
452
- state: true,
453
- component: "dxos.org/plugin/client/RecoveryCodeDialog",
454
- subject: {
455
- code: seedphrase
456
- }
457
- }
458
- }
459
- ]
460
- ]
461
- };
462
- }
463
- }
464
- }
305
+ resolvers: () => [
306
+ (0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.CreateIdentity, async () => {
307
+ const data = await client.halo.createIdentity();
308
+ return {
309
+ data,
310
+ intents: [
311
+ (0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
312
+ name: "identity.create"
313
+ })
314
+ ]
315
+ };
316
+ }),
317
+ (0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.JoinIdentity, async (data) => {
318
+ return {
319
+ intents: [
320
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
321
+ element: "dialog",
322
+ component: JOIN_DIALOG,
323
+ dialogBlockAlign: "start",
324
+ subject: {
325
+ initialInvitationCode: data.invitationCode,
326
+ initialDisposition: "accept-halo-invitation"
327
+ }
328
+ })
329
+ ]
330
+ };
331
+ }),
332
+ (0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.ShareIdentity, async () => {
333
+ return {
334
+ intents: [
335
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
336
+ element: "dialog",
337
+ component: IDENTITY_DIALOG,
338
+ dialogBlockAlign: "start"
339
+ }),
340
+ (0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
341
+ name: "identity.share"
342
+ })
343
+ ]
344
+ };
345
+ }),
346
+ (0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.RecoverIdentity, async () => {
347
+ return {
348
+ intents: [
349
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
350
+ element: "dialog",
351
+ component: JOIN_DIALOG,
352
+ dialogBlockAlign: "start",
353
+ subject: {
354
+ initialDisposition: "recover-identity"
355
+ }
356
+ })
357
+ ]
358
+ };
359
+ }),
360
+ (0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.ResetStorage, async (data) => {
361
+ await onReset?.({
362
+ target: data.target
363
+ });
364
+ return {};
365
+ }),
366
+ (0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.CreateAgent, async () => {
367
+ (0, import_invariant.invariant)(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
368
+ F: __dxlog_file,
369
+ L: 203,
370
+ S: void 0,
371
+ A: [
372
+ "client.services.services.EdgeAgentService",
373
+ "'Missing EdgeAgentService'"
374
+ ]
375
+ });
376
+ await client.services.services.EdgeAgentService.createAgent(null, {
377
+ timeout: 1e4
378
+ });
379
+ }),
380
+ (0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.CreateRecoveryCode, async () => {
381
+ (0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
382
+ F: __dxlog_file,
383
+ L: 207,
384
+ S: void 0,
385
+ A: [
386
+ "client.services.services.IdentityService",
387
+ "'IdentityService not available'"
388
+ ]
389
+ });
390
+ const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
391
+ return {
392
+ intents: [
393
+ (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
394
+ element: "dialog",
395
+ dialogBlockAlign: "start",
396
+ dialogType: "alert",
397
+ state: true,
398
+ component: RECOVER_CODE_DIALOG,
399
+ subject: {
400
+ code: seedphrase
401
+ }
402
+ })
403
+ ]
404
+ };
405
+ })
406
+ ]
465
407
  }
466
408
  }
467
409
  };
@@ -469,7 +411,6 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
469
411
  var src_default = ClientPlugin;
470
412
  // Annotate the CommonJS export names for ESM import in node:
471
413
  0 && (module.exports = {
472
- ClientPlugin,
473
- parseClientPlugin
414
+ ClientPlugin
474
415
  });
475
416
  //# sourceMappingURL=index.cjs.map