@dxos/plugin-client 0.8.4-main.c1de068 → 0.8.4-main.e098934

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 (104) hide show
  1. package/dist/lib/browser/{app-graph-builder-JNIES5L4.mjs → app-graph-builder-ENKIVZWH.mjs} +3 -3
  2. package/dist/lib/browser/app-graph-builder-ENKIVZWH.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-SV3MHIKI.mjs → chunk-FOCQEA72.mjs} +16 -25
  4. package/dist/lib/browser/chunk-FOCQEA72.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-RMHBOY3Y.mjs → chunk-HLWIF3AW.mjs} +1 -1
  6. package/dist/lib/browser/{chunk-RMHBOY3Y.mjs.map → chunk-HLWIF3AW.mjs.map} +2 -2
  7. package/dist/lib/browser/{client-SKVKXPLY.mjs → client-F73MIXMT.mjs} +9 -3
  8. package/dist/lib/browser/client-F73MIXMT.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +8 -8
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/{intent-resolver-LNPLD5CA.mjs → intent-resolver-LNPFUWU5.mjs} +11 -11
  12. package/dist/lib/browser/intent-resolver-LNPFUWU5.mjs.map +7 -0
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/{migrations-D76RCG72.mjs → migrations-YJSO7JXY.mjs} +1 -1
  15. package/dist/lib/{node-esm/migrations-YISDI7LF.mjs.map → browser/migrations-YJSO7JXY.mjs.map} +2 -2
  16. package/dist/lib/browser/{react-context-YWVPZUMU.mjs → react-context-QBXCHNH2.mjs} +1 -1
  17. package/dist/lib/browser/{react-context-YWVPZUMU.mjs.map → react-context-QBXCHNH2.mjs.map} +2 -2
  18. package/dist/lib/browser/{react-surface-QFZTDNLS.mjs → react-surface-3AH7INFU.mjs} +4 -4
  19. package/dist/lib/browser/{react-surface-QFZTDNLS.mjs.map → react-surface-3AH7INFU.mjs.map} +3 -3
  20. package/dist/lib/browser/{schema-defs-HKW6VNZB.mjs → schema-defs-AMSX6T3B.mjs} +1 -1
  21. package/dist/lib/{node-esm/schema-defs-5ZNI63RW.mjs.map → browser/schema-defs-AMSX6T3B.mjs.map} +2 -2
  22. package/dist/lib/browser/types/index.mjs +1 -1
  23. package/dist/lib/node-esm/{app-graph-builder-SWFB4FID.mjs → app-graph-builder-D4XJCLPN.mjs} +3 -3
  24. package/dist/lib/node-esm/app-graph-builder-D4XJCLPN.mjs.map +7 -0
  25. package/dist/lib/node-esm/{chunk-5V3RCXZV.mjs → chunk-JG6AFSFU.mjs} +1 -1
  26. package/dist/lib/node-esm/{chunk-5V3RCXZV.mjs.map → chunk-JG6AFSFU.mjs.map} +2 -2
  27. package/dist/lib/node-esm/{chunk-FBYODKEL.mjs → chunk-MUWDSQ65.mjs} +16 -25
  28. package/dist/lib/node-esm/chunk-MUWDSQ65.mjs.map +7 -0
  29. package/dist/lib/node-esm/{client-SLL6GDC2.mjs → client-A7CNP37P.mjs} +9 -3
  30. package/dist/lib/node-esm/client-A7CNP37P.mjs.map +7 -0
  31. package/dist/lib/node-esm/index.mjs +8 -8
  32. package/dist/lib/node-esm/index.mjs.map +3 -3
  33. package/dist/lib/node-esm/{intent-resolver-L7C6YRWV.mjs → intent-resolver-C4INMPH7.mjs} +11 -11
  34. package/dist/lib/node-esm/intent-resolver-C4INMPH7.mjs.map +7 -0
  35. package/dist/lib/node-esm/meta.json +1 -1
  36. package/dist/lib/node-esm/{migrations-YISDI7LF.mjs → migrations-UOEK7HB7.mjs} +1 -1
  37. package/dist/lib/{browser/migrations-D76RCG72.mjs.map → node-esm/migrations-UOEK7HB7.mjs.map} +2 -2
  38. package/dist/lib/node-esm/{react-context-EEHS4S3L.mjs → react-context-JIH7YBFI.mjs} +1 -1
  39. package/dist/lib/node-esm/{react-context-EEHS4S3L.mjs.map → react-context-JIH7YBFI.mjs.map} +2 -2
  40. package/dist/lib/node-esm/{react-surface-2K6W37R4.mjs → react-surface-4TMUCPEW.mjs} +4 -4
  41. package/dist/lib/node-esm/{react-surface-2K6W37R4.mjs.map → react-surface-4TMUCPEW.mjs.map} +3 -3
  42. package/dist/lib/node-esm/{schema-defs-5ZNI63RW.mjs → schema-defs-4UTKKRTF.mjs} +1 -1
  43. package/dist/lib/{browser/schema-defs-HKW6VNZB.mjs.map → node-esm/schema-defs-4UTKKRTF.mjs.map} +2 -2
  44. package/dist/lib/node-esm/types/index.mjs +1 -1
  45. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  46. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/client.d.ts +1 -1
  48. package/dist/types/src/capabilities/client.d.ts.map +1 -1
  49. package/dist/types/src/capabilities/index.d.ts +8 -8
  50. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  52. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/migrations.d.ts +1 -1
  54. package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/react-context.d.ts +2 -2
  56. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  58. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  59. package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
  60. package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
  61. package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
  62. package/dist/types/src/components/DevicesContainer.stories.d.ts +225 -4
  63. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
  64. package/dist/types/src/components/ProfileContainer.d.ts.map +1 -1
  65. package/dist/types/src/components/ProfileContainer.stories.d.ts +57 -4
  66. package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
  67. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +59 -4
  68. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
  69. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -1
  70. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +58 -4
  71. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
  72. package/dist/types/src/components/ResetDialog.stories.d.ts +59 -3
  73. package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
  74. package/dist/types/src/types/schema.d.ts +9 -3
  75. package/dist/types/src/types/schema.d.ts.map +1 -1
  76. package/dist/types/tsconfig.tsbuildinfo +1 -1
  77. package/package.json +29 -27
  78. package/src/ClientPlugin.ts +2 -2
  79. package/src/capabilities/app-graph-builder.ts +4 -3
  80. package/src/capabilities/client.ts +6 -4
  81. package/src/capabilities/intent-resolver.ts +5 -4
  82. package/src/capabilities/migrations.ts +1 -1
  83. package/src/capabilities/react-context.tsx +2 -1
  84. package/src/capabilities/react-surface.tsx +3 -3
  85. package/src/capabilities/schema-defs.ts +1 -1
  86. package/src/components/DevicesContainer.stories.tsx +8 -7
  87. package/src/components/DevicesContainer.tsx +54 -65
  88. package/src/components/JoinDialog.tsx +1 -1
  89. package/src/components/ProfileContainer.stories.tsx +7 -6
  90. package/src/components/ProfileContainer.tsx +19 -22
  91. package/src/components/RecoveryCodeDialog.stories.tsx +8 -7
  92. package/src/components/RecoveryCredentialsContainer.stories.tsx +8 -7
  93. package/src/components/RecoveryCredentialsContainer.tsx +44 -47
  94. package/src/components/ResetDialog.stories.tsx +7 -6
  95. package/src/components/ResetDialog.tsx +1 -1
  96. package/src/types/schema.ts +3 -3
  97. package/dist/lib/browser/app-graph-builder-JNIES5L4.mjs.map +0 -7
  98. package/dist/lib/browser/chunk-SV3MHIKI.mjs.map +0 -7
  99. package/dist/lib/browser/client-SKVKXPLY.mjs.map +0 -7
  100. package/dist/lib/browser/intent-resolver-LNPLD5CA.mjs.map +0 -7
  101. package/dist/lib/node-esm/app-graph-builder-SWFB4FID.mjs.map +0 -7
  102. package/dist/lib/node-esm/chunk-FBYODKEL.mjs.map +0 -7
  103. package/dist/lib/node-esm/client-SLL6GDC2.mjs.map +0 -7
  104. package/dist/lib/node-esm/intent-resolver-L7C6YRWV.mjs.map +0 -7
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ClientAction
4
- } from "./chunk-5V3RCXZV.mjs";
4
+ } from "./chunk-JG6AFSFU.mjs";
5
5
  import {
6
6
  CLIENT_PLUGIN
7
7
  } from "./chunk-SZLX4BVJ.mjs";
@@ -16,9 +16,8 @@ import { useClient, useMulticastObservable } from "@dxos/react-client";
16
16
  import { useDevices } from "@dxos/react-client/halo";
17
17
  import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
18
18
  import { useNetworkStatus } from "@dxos/react-client/mesh";
19
- import { Button, Clipboard, IconButton, List, useId, useTranslation, Icon } from "@dxos/react-ui";
19
+ import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from "@dxos/react-ui";
20
20
  import { ControlFrame, ControlFrameItem, ControlGroup, ControlItem, ControlPage, ControlSection } from "@dxos/react-ui-form";
21
- import { StackItem } from "@dxos/react-ui-stack";
22
21
  import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from "@dxos/shell/react";
23
22
  import { hexToEmoji } from "@dxos/util";
24
23
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/components/DevicesContainer.tsx";
@@ -42,9 +41,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
42
41
  })), [
43
42
  dispatch
44
43
  ]);
45
- return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(StackItem.Content, {
46
- classNames: "block overflow-y-auto"
47
- }, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
44
+ return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
48
45
  title: t("devices verbose label", {
49
46
  ns: CLIENT_PLUGIN
50
47
  }),
@@ -99,7 +96,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
99
96
  variant: "destructive",
100
97
  onClick: handleJoinNewIdentity,
101
98
  "data-testid": "devicesContainer.joinExisting"
102
- }, t("join new identity label"))))))));
99
+ }, t("join new identity label")))))));
103
100
  } finally {
104
101
  _effect.f();
105
102
  }
@@ -120,7 +117,7 @@ var DeviceInvitation = (props) => {
120
117
  authCode: invitation3.authCode
121
118
  }), void 0, {
122
119
  F: __dxlog_file,
123
- L: 139,
120
+ L: 128,
124
121
  S: void 0,
125
122
  C: (f, a) => f(...a)
126
123
  });
@@ -302,7 +299,7 @@ var InvitationComplete = ({ statusValue }) => {
302
299
  // src/components/JoinDialog.tsx
303
300
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
304
301
  import React2, { useCallback as useCallback2 } from "react";
305
- import { createIntent as createIntent2, LayoutAction, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
302
+ import { LayoutAction, createIntent as createIntent2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
306
303
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
307
304
  import { Dialog, useTranslation as useTranslation2 } from "@dxos/react-ui";
308
305
  import { JoinPanel } from "@dxos/shell/react";
@@ -361,10 +358,9 @@ import { debounce } from "@dxos/async";
361
358
  import { useClient as useClient2 } from "@dxos/react-client";
362
359
  import { useIdentity } from "@dxos/react-client/halo";
363
360
  import { ButtonGroup, Clipboard as Clipboard2, Input, useTranslation as useTranslation3 } from "@dxos/react-ui";
364
- import { Form, ControlItem as ControlItem2, ControlItemInput, ControlSection as ControlSection2, ControlPage as ControlPage2 } from "@dxos/react-ui-form";
361
+ import { ControlItem as ControlItem2, ControlItemInput, ControlPage as ControlPage2, ControlSection as ControlSection2, Form } from "@dxos/react-ui-form";
365
362
  import { EmojiPickerBlock, HuePicker } from "@dxos/react-ui-pickers";
366
- import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
367
- import { hexToHue, hexToEmoji as hexToEmoji2 } from "@dxos/util";
363
+ import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
368
364
  var getDefaultHueValue = (identity) => hexToHue(identity?.identityKey.toHex() ?? "0");
369
365
  var getDefaultEmojiValue = (identity) => hexToEmoji2(identity?.identityKey.toHex() ?? "0");
370
366
  var getHueValue = (identity) => identity?.profile?.data?.hue || getDefaultHueValue(identity);
@@ -475,9 +471,7 @@ var ProfileContainer = () => {
475
471
  }), [
476
472
  t
477
473
  ]);
478
- return /* @__PURE__ */ React3.createElement(StackItem2.Content, {
479
- classNames: "block overflow-y-auto"
480
- }, /* @__PURE__ */ React3.createElement(ControlPage2, null, /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(ControlSection2, {
474
+ return /* @__PURE__ */ React3.createElement(ControlPage2, null, /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(ControlSection2, {
481
475
  title: t("profile label"),
482
476
  description: t("profile description")
483
477
  }, /* @__PURE__ */ React3.createElement(Form, {
@@ -486,9 +480,9 @@ var ProfileContainer = () => {
486
480
  autoSave: true,
487
481
  onSave: handleSave,
488
482
  Custom: customElements,
489
- classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content] gap-4",
483
+ classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]",
490
484
  outerSpacing: false
491
- })))));
485
+ }))));
492
486
  } finally {
493
487
  _effect.f();
494
488
  }
@@ -575,9 +569,8 @@ import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking"
575
569
  import React5 from "react";
576
570
  import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
577
571
  import { useCredentials } from "@dxos/react-client/halo";
578
- import { Icon as Icon2, IconButton as IconButton2, List as List2, ListItem, useTranslation as useTranslation5, Message } from "@dxos/react-ui";
572
+ import { Icon as Icon2, IconButton as IconButton2, List as List2, ListItem, Message, useTranslation as useTranslation5 } from "@dxos/react-ui";
579
573
  import { ControlGroup as ControlGroup2, ControlItem as ControlItem3, ControlPage as ControlPage3, ControlSection as ControlSection3 } from "@dxos/react-ui-form";
580
- import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
581
574
  var MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;
582
575
  var RecoveryCredentialsContainer = () => {
583
576
  var _effect = _useSignals5();
@@ -586,9 +579,7 @@ var RecoveryCredentialsContainer = () => {
586
579
  const { dispatchPromise: dispatch } = useIntentDispatcher3();
587
580
  const credentials = useCredentials();
588
581
  const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
589
- return /* @__PURE__ */ React5.createElement(StackItem3.Content, {
590
- classNames: "block overflow-y-auto"
591
- }, /* @__PURE__ */ React5.createElement(ControlPage3, null, /* @__PURE__ */ React5.createElement(ControlSection3, {
582
+ return /* @__PURE__ */ React5.createElement(ControlPage3, null, /* @__PURE__ */ React5.createElement(ControlSection3, {
592
583
  title: t("recovery setup dialog title"),
593
584
  description: t("recovery setup dialog description")
594
585
  }, /* @__PURE__ */ React5.createElement(ControlGroup2, null, /* @__PURE__ */ React5.createElement(ControlItem3, {
@@ -623,7 +614,7 @@ var RecoveryCredentialsContainer = () => {
623
614
  }, /* @__PURE__ */ React5.createElement(ListItem.Endcap, null, /* @__PURE__ */ React5.createElement(Icon2, {
624
615
  icon: "ph--key--regular",
625
616
  size: 5
626
- })), /* @__PURE__ */ React5.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString())))))));
617
+ })), /* @__PURE__ */ React5.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString()))))));
627
618
  } finally {
628
619
  _effect.f();
629
620
  }
@@ -632,7 +623,7 @@ var RecoveryCredentialsContainer = () => {
632
623
  // src/components/ResetDialog.tsx
633
624
  import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
634
625
  import React6, { useCallback as useCallback5 } from "react";
635
- import { createIntent as createIntent4, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
626
+ import { LayoutAction as LayoutAction2, createIntent as createIntent4, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
636
627
  import { useClient as useClient3 } from "@dxos/react-client";
637
628
  import { Dialog as Dialog2, useTranslation as useTranslation6 } from "@dxos/react-ui";
638
629
  import { ConfirmReset } from "@dxos/shell/react";
@@ -693,4 +684,4 @@ export {
693
684
  RESET_DIALOG,
694
685
  ResetDialog
695
686
  };
696
- //# sourceMappingURL=chunk-FBYODKEL.mjs.map
687
+ //# sourceMappingURL=chunk-MUWDSQ65.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/DevicesContainer.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/ProfileContainer.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/components/RecoveryCredentialsContainer.tsx", "../../../src/components/ResetDialog.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { QR } from 'react-qr-rounded';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\nimport { useClient, useMulticastObservable } from '@dxos/react-client';\nimport { type Device, useDevices } from '@dxos/react-client/halo';\nimport { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';\nimport { useNetworkStatus } from '@dxos/react-client/mesh';\nimport { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from '@dxos/react-ui';\nimport {\n ControlFrame,\n ControlFrameItem,\n ControlGroup,\n ControlItem,\n ControlPage,\n ControlSection,\n} from '@dxos/react-ui-form';\nimport { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from '@dxos/shell/react';\nimport { hexToEmoji } from '@dxos/util';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport type DevicesContainerProps = {\n createInvitationUrl?: (invitationCode: string) => string;\n};\n\nexport const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps) => {\n const { t } = useTranslation('os');\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const devices = useDevices();\n const { swarm: connectionState } = useNetworkStatus();\n\n const handleResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ResetStorage)), [dispatch]);\n\n const handleRecover = useCallback(\n () => dispatch(createIntent(ClientAction.ResetStorage, { mode: 'recover' })),\n [dispatch],\n );\n\n const handleJoinNewIdentity = useCallback(\n () => dispatch(createIntent(ClientAction.ResetStorage, { mode: 'join new identity' })),\n [dispatch],\n );\n\n return (\n <Clipboard.Provider>\n <ControlPage>\n <ControlSection\n title={t('devices verbose label', { ns: CLIENT_PLUGIN })}\n description={t('devices description', { ns: CLIENT_PLUGIN })}\n >\n <ControlFrame>\n <ControlFrameItem title={t('devices label', { ns: CLIENT_PLUGIN })}>\n <List>\n {devices.map((device: Device) => {\n return (\n <DeviceListItem key={device.deviceKey.toHex()} device={device} connectionState={connectionState} />\n );\n })}\n </List>\n </ControlFrameItem>\n {createInvitationUrl && (\n <ControlFrameItem title='Add device'>\n <DeviceInvitation createInvitationUrl={createInvitationUrl} />\n </ControlFrameItem>\n )}\n </ControlFrame>\n </ControlSection>\n <ControlSection\n title={t('danger zone title', { ns: CLIENT_PLUGIN })}\n description={t('danger zone description', { ns: CLIENT_PLUGIN })}\n >\n <ControlGroup>\n <ControlItem\n title={t('reset device label')}\n description={t('reset device description', { ns: CLIENT_PLUGIN })}\n >\n <Button variant='destructive' onClick={handleResetStorage} data-testid='devicesContainer.reset'>\n {t('reset device label')}\n </Button>\n </ControlItem>\n <ControlItem\n title={t('recover identity label')}\n description={t('recover identity description', { ns: CLIENT_PLUGIN })}\n >\n <Button variant='destructive' onClick={handleRecover} data-testid='devicesContainer.recover'>\n {t('recover identity label')}\n </Button>\n </ControlItem>\n <ControlItem\n title={t('join new identity label')}\n description={t('join new identity description', { ns: CLIENT_PLUGIN })}\n >\n <Button variant='destructive' onClick={handleJoinNewIdentity} data-testid='devicesContainer.joinExisting'>\n {t('join new identity label')}\n </Button>\n </ControlItem>\n </ControlGroup>\n </ControlSection>\n </ControlPage>\n </Clipboard.Provider>\n );\n};\n\ntype DeviceInvitationProps = {\n invitation?: CancellableInvitationObservable;\n createInvitationUrl: (invitationCode: string) => string;\n onInvitationDone: () => void;\n onInvitationCreate: () => void;\n};\n\nconst DeviceInvitation = (props: Pick<DeviceInvitationProps, 'createInvitationUrl'>) => {\n const client = useClient();\n const [invitation, setInvitation] = useState<CancellableInvitationObservable>();\n\n const onInvitationCreate = useCallback(() => {\n const invitation = client.halo.share();\n if (client.config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {\n const subscription = invitation.subscribe((invitation: Invitation) => {\n const invitationCode = InvitationEncoder.encode(invitation);\n if (invitation.state === Invitation.State.CONNECTING) {\n log.info(JSON.stringify({ invitationCode, authCode: invitation.authCode }));\n subscription.unsubscribe();\n }\n });\n }\n setInvitation(invitation);\n }, [client]);\n\n const onInvitationDone = useCallback(() => {\n setInvitation(undefined);\n }, []);\n\n if (invitation) {\n return <DeviceInvitationImpl {...props} {...{ invitation, onInvitationCreate, onInvitationDone }} />;\n } else {\n return <InvitationSection {...props} {...{ onInvitationCreate, onInvitationDone }} />;\n }\n};\n\nconst DeviceInvitationImpl = ({\n invitation: invitationObservable,\n createInvitationUrl,\n onInvitationDone,\n onInvitationCreate,\n}: DeviceInvitationProps) => {\n const invitation = useMulticastObservable(invitationObservable!);\n const url = createInvitationUrl(InvitationEncoder.encode(invitation));\n\n useEffect(() => {\n if (invitation.state >= Invitation.State.SUCCESS) {\n onInvitationDone();\n }\n }, [invitation.state]);\n\n return <InvitationSection {...invitation} {...{ url, onInvitationDone, onInvitationCreate }} />;\n};\n\ntype InvitationComponentProps = Partial<\n Pick<Invitation, 'authCode' | 'invitationId'> &\n Pick<DeviceInvitationProps, 'onInvitationDone' | 'onInvitationCreate'> & {\n state: number;\n url: string;\n }\n>;\n\nconst InvitationSection = ({\n state = -1,\n authCode,\n invitationId = 'never',\n url = 'never',\n onInvitationDone = () => {},\n onInvitationCreate = () => {},\n}: InvitationComponentProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const activeView =\n state < 0\n ? 'init'\n : state >= Invitation.State.CANCELLED\n ? 'complete'\n : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode\n ? 'auth-code'\n : 'qr-code';\n return activeView === 'init' ? (\n <>\n <p className='text-description mbe-2'>{t('add device description')}</p>\n <IconButton\n icon='ph--plus--regular'\n label={t('create device invitation label')}\n disabled={state >= 0}\n classNames='is-full'\n data-testid='devicesContainer.createInvitation'\n onClick={onInvitationCreate}\n />\n </>\n ) : (\n <Viewport.Root activeView={activeView}>\n <Viewport.Views>\n <Viewport.View id='init'>\n {/* This view intentionally left blank while conditionally rendering the viewport. */}\n </Viewport.View>\n <Viewport.View id='complete'>\n <InvitationComplete statusValue={state} />\n </Viewport.View>\n <Viewport.View id='auth-code'>\n <InvitationAuthCode id={invitationId} code={authCode ?? 'never'} onCancel={onInvitationDone} />\n </Viewport.View>\n <Viewport.View id='qr-code'>\n <InvitationQR id={invitationId} url={url} onCancel={onInvitationDone} />\n </Viewport.View>\n </Viewport.Views>\n </Viewport.Root>\n );\n};\n\nconst InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel: () => void }) => {\n const { t } = useTranslation('os');\n const qrLabel = useId('devices-container__qr-code');\n const emoji = hexToEmoji(id);\n return (\n <>\n <p className='text-description'>{t('qr code description', { ns: CLIENT_PLUGIN })}</p>\n <div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>\n <div role='none' className='is-full aspect-square relative text-description'>\n <QR\n rounding={100}\n backgroundColor='transparent'\n color='currentColor'\n aria-labelledby={qrLabel}\n errorCorrectionLevel='Q'\n cutout={true}\n >\n {url ?? 'never'}\n </QR>\n <Centered>\n <Emoji text={emoji} />\n </Centered>\n </div>\n <span id={qrLabel} className='sr-only'>\n {t('qr label')}\n </span>\n </div>\n {/* TODO(burdon): Factor out button bar */}\n <div className='flex justify-center'>\n <div className='flex gap-2'>\n <Clipboard.Button value={url ?? 'never'} />\n <Button variant='ghost' onClick={onCancel}>\n {t('cancel label')}\n </Button>\n </div>\n </div>\n </>\n );\n};\n\nconst InvitationAuthCode = ({ id, code, onCancel }: { id: string; code: string; onCancel: () => void }) => {\n const { t } = useTranslation('os');\n const emoji = hexToEmoji(id);\n\n return (\n <>\n <p className='text-description'>{t('auth other device emoji message')}</p>\n {emoji && <Emoji text={emoji} className='mli-auto mlb-2 text-center' />}\n <p className='text-description'>{t('auth code message')}</p>\n <AuthCode code={code} large classNames='mli-auto mlb-2 text-center grow' />\n <Button variant='ghost' onClick={onCancel}>\n {t('cancel label')}\n </Button>\n </>\n );\n};\n\nconst InvitationComplete = ({ statusValue }: { statusValue: number }) => {\n return statusValue > 0 ? (\n <Icon icon='ph--check--regular' size={6} classNames='m-1.5' />\n ) : (\n <Icon icon='ph--x--regular' size={6} classNames='m-1.5' />\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, createIntent, 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 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';\n\nimport { debounce } from '@dxos/async';\nimport { useClient } from '@dxos/react-client';\nimport { type Identity, useIdentity } from '@dxos/react-client/halo';\nimport { ButtonGroup, Clipboard, Input, useTranslation } from '@dxos/react-ui';\nimport {\n ControlItem,\n ControlItemInput,\n ControlPage,\n ControlSection,\n Form,\n type InputComponent,\n} from '@dxos/react-ui-form';\nimport { EmojiPickerBlock, HuePicker } from '@dxos/react-ui-pickers';\nimport { hexToEmoji, hexToHue } from '@dxos/util';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\n// TODO(thure): Factor out?\nconst getDefaultHueValue = (identity: Identity | null) => hexToHue(identity?.identityKey.toHex() ?? '0');\nconst getDefaultEmojiValue = (identity: Identity | null) => hexToEmoji(identity?.identityKey.toHex() ?? '0');\nconst getHueValue = (identity: Identity | null) => identity?.profile?.data?.hue || getDefaultHueValue(identity);\nconst getEmojiValue = (identity: Identity | null) => identity?.profile?.data?.emoji || getDefaultEmojiValue(identity);\n\nexport const ProfileContainer = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const client = useClient();\n const identity = useIdentity();\n const [displayName, setDisplayNameDirectly] = useState(identity?.profile?.displayName ?? '');\n const [emoji, setEmojiDirectly] = useState<string>(getEmojiValue(identity));\n const [hue, setHueDirectly] = useState<string>(getHueValue(identity));\n\n const updateProfile = useMemo(\n () =>\n debounce(\n (profile: Partial<Profile>) =>\n client.halo.updateProfile({\n displayName: profile.displayName,\n data: {\n emoji: profile.emoji,\n hue: profile.hue,\n },\n }),\n 2_000,\n ),\n [],\n );\n\n const handleSave = useCallback(\n (profile: Profile) => {\n setDisplayNameDirectly(profile.displayName);\n setEmojiDirectly(profile.emoji);\n setHueDirectly(profile.hue);\n void updateProfile(profile);\n },\n [identity],\n );\n\n const values = useMemo(\n () => ({\n displayName,\n emoji,\n hue,\n did: identity?.did,\n }),\n [identity, displayName, emoji, hue],\n );\n\n // TODO(wittjosiah): Integrate descriptions with the form schema.\n const customElements: Partial<Record<string, InputComponent>> = useMemo(\n () => ({\n displayName: ({ type, label, getValue, onValueChange }) => {\n const handleChange = useCallback(\n ({ target: { value } }: ChangeEvent<HTMLInputElement>) => onValueChange(type, value),\n [onValueChange, type],\n );\n return (\n <ControlItemInput title={label} description={t('display name description')}>\n <Input.TextInput\n value={getValue()}\n onChange={handleChange}\n placeholder={t('display name input placeholder')}\n classNames='min-is-64'\n />\n </ControlItemInput>\n );\n },\n emoji: ({ type, label, getValue, onValueChange }) => {\n const handleChange = useCallback((nextEmoji: string) => onValueChange(type, nextEmoji), [onValueChange, type]);\n const handleEmojiReset = useCallback(\n () => onValueChange(type, getDefaultEmojiValue(identity)),\n [onValueChange, type],\n );\n return (\n <ControlItem title={label} description={t('icon description')}>\n <EmojiPickerBlock\n triggerVariant='default'\n emoji={getValue()}\n onChangeEmoji={handleChange}\n onClickClear={handleEmojiReset}\n classNames='justify-self-end'\n />\n </ControlItem>\n );\n },\n hue: ({ type, label, getValue, onValueChange }) => {\n const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);\n const handleHueReset = useCallback(\n () => onValueChange(type, getDefaultHueValue(identity)),\n [onValueChange, type],\n );\n return (\n <ControlItem title={label} description={t('hue description')}>\n <HuePicker\n value={getValue()}\n onChange={handleChange}\n onReset={handleHueReset}\n classNames='[--hue-preview-size:1.5rem] justify-self-end'\n />\n </ControlItem>\n );\n },\n // TODO(wittjosiah): We need text input annotations for disabled and copyable.\n did: ({ label, getValue }) => {\n return (\n <ControlItemInput title={label} description={t('did description')}>\n <ButtonGroup>\n <Input.TextInput value={getValue()} disabled classNames='min-is-64' />\n <Clipboard.IconButton value={getValue() ?? ''} />\n </ButtonGroup>\n </ControlItemInput>\n );\n },\n }),\n [t],\n );\n\n return (\n <ControlPage>\n <Clipboard.Provider>\n <ControlSection title={t('profile label')} description={t('profile description')}>\n <Form\n schema={ProfileSchema}\n values={values}\n autoSave\n onSave={handleSave}\n Custom={customElements}\n classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'\n outerSpacing={false}\n />\n </ControlSection>\n </Clipboard.Provider>\n </ControlPage>\n );\n};\n\n// TODO(wittjosiah): Integrate annotations with translations.\nconst ProfileSchema = Schema.Struct({\n displayName: Schema.String.annotations({ title: 'Display name' }),\n emoji: Schema.String.annotations({ title: 'Avatar' }),\n hue: Schema.String.annotations({ title: 'Color' }),\n did: Schema.String.annotations({ title: 'DID' }),\n});\ntype Profile = Schema.Schema.Type<typeof ProfileSchema>;\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 RECOVERY_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2'>\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 React from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { useCredentials } from '@dxos/react-client/halo';\nimport { Icon, IconButton, List, ListItem, Message, useTranslation } from '@dxos/react-ui';\nimport { ControlGroup, ControlItem, ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;\n\nexport const RecoveryCredentialsContainer = () => {\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 return (\n <ControlPage>\n <ControlSection title={t('recovery setup dialog title')} description={t('recovery setup dialog description')}>\n <ControlGroup>\n <ControlItem title={t('create passkey label')} description={t('create passkey description')}>\n <IconButton\n label={t('create passkey label')}\n icon='ph--key--duotone'\n variant='primary'\n size={5}\n onClick={() => dispatch(createIntent(ClientAction.CreatePasskey))}\n />\n </ControlItem>\n <ControlItem title={t('create recovery code label')} description={t('create recovery code description')}>\n <IconButton\n label={t('create recovery code label')}\n icon='ph--receipt--duotone'\n variant='default'\n size={5}\n onClick={() => dispatch(createIntent(ClientAction.CreateRecoveryCode))}\n />\n </ControlItem>\n </ControlGroup>\n </ControlSection>\n <ControlSection title={t('credentials list label')}>\n {recoveryCredentials.length < 1 ? (\n <Message.Root valence='error' classNames='container-max-width'>\n <Message.Title icon='ph--shield-warning--duotone'>{t('no credentials title')}</Message.Title>\n <Message.Content>{t('no credentials message')}</Message.Content>\n </Message.Root>\n ) : (\n <List classNames='container-max-width pli-2'>\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 )}\n </ControlSection>\n </ControlPage>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Dialog, useTranslation } from '@dxos/react-ui';\nimport { ConfirmReset, type ConfirmResetProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { type ClientPluginOptions } from '../types';\n\nexport const RESET_DIALOG = `${CLIENT_PLUGIN}/ResetDialog`;\n\nexport type ResetDialogProps = Pick<ConfirmResetProps, 'mode'> & Pick<ClientPluginOptions, 'onReset'>;\n\nexport const ResetDialog = ({ mode, onReset }: ResetDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n\n const handleReset = useCallback(async () => {\n await client.reset();\n const target =\n mode === 'join new identity' ? 'deviceInvitation' : mode === 'recover' ? 'recoverIdentity' : undefined;\n await onReset?.({ target });\n }, [dispatch, client, mode, onReset]);\n\n const handleCancel = useCallback(() => {\n void dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n options: { state: false },\n }),\n );\n }, [dispatch]);\n\n // TODO(wittjosiah): Add the sr-only translations.\n // TODO(wittjosiah): Add missing descriptions to other dialogs.\n return (\n <Dialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <Dialog.Title classNames='sr-only'>{t('reset dialog title')}</Dialog.Title>\n <Dialog.Description classNames='sr-only'>{t('reset dialog description')}</Dialog.Description>\n <ConfirmReset active mode={mode} onConfirm={handleReset} onCancel={handleCancel} />\n </Dialog.Content>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;AAIA,OAAOA,SAASC,aAAaC,WAAWC,gBAAgB;AACxD,SAASC,UAAU;AAEnB,SAASC,cAAcC,2BAA2B;AAClD,SAASC,WAAW;AACpB,SAASC,WAAWC,8BAA8B;AAClD,SAAsBC,kBAAkB;AACxC,SAA+CC,YAAYC,yBAAyB;AACpF,SAASC,wBAAwB;AACjC,SAASC,QAAQC,WAAWC,MAAMC,YAAYC,MAAMC,OAAOC,sBAAsB;AACjF,SACEC,cACAC,kBACAC,cACAC,aAC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UAAUhB;;;;;AAGzE;",
6
+ "names": ["React", "useCallback", "useEffect", "useState", "QR", "createIntent", "useIntentDispatcher", "log", "useClient", "useMulticastObservable", "useDevices", "Invitation", "InvitationEncoder", "useNetworkStatus", "Button", "Clipboard", "Icon", "IconButton", "List", "useId", "useTranslation", "ControlFrame", "ControlFrameItem", "ControlGroup", "ControlItem", "ControlPage", "ControlSection", "AuthCode", "Centered", "DeviceListItem", "Emoji", "Viewport", "hexToEmoji", "DevicesContainer", "createInvitationUrl", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "devices", "useDevices", "swarm", "connectionState", "useNetworkStatus", "handleResetStorage", "useCallback", "createIntent", "ClientAction", "ResetStorage", "handleRecover", "mode", "handleJoinNewIdentity", "Clipboard", "Provider", "ControlPage", "ControlSection", "title", "ns", "CLIENT_PLUGIN", "description", "ControlFrame", "ControlFrameItem", "List", "map", "device", "DeviceListItem", "key", "deviceKey", "toHex", "DeviceInvitation", "ControlGroup", "ControlItem", "Button", "variant", "onClick", "data-testid", "props", "client", "useClient", "invitation", "setInvitation", "useState", "onInvitationCreate", "halo", "share", "config", "values", "runtime", "app", "env", "DX_ENVIRONMENT", "subscription", "subscribe", "invitationCode", "InvitationEncoder", "encode", "state", "Invitation", "State", "CONNECTING", "log", "info", "JSON", "stringify", "authCode", "unsubscribe", "onInvitationDone", "undefined", "DeviceInvitationImpl", "InvitationSection", "invitationObservable", "useMulticastObservable", "url", "useEffect", "SUCCESS", "invitationId", "activeView", "CANCELLED", "READY_FOR_AUTHENTICATION", "p", "className", "IconButton", "icon", "label", "disabled", "classNames", "Viewport", "Root", "Views", "View", "id", "InvitationComplete", "statusValue", "InvitationAuthCode", "code", "onCancel", "InvitationQR", "qrLabel", "useId", "emoji", "hexToEmoji", "div", "role", "QR", "rounding", "backgroundColor", "color", "aria-labelledby", "errorCorrectionLevel", "cutout", "Centered", "Emoji", "text", "span", "value", "AuthCode", "large", "Icon", "size", "React", "useCallback", "LayoutAction", "createIntent", "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", "Schema", "React", "useCallback", "useMemo", "useState", "debounce", "useClient", "useIdentity", "ButtonGroup", "Clipboard", "Input", "useTranslation", "ControlItem", "ControlItemInput", "ControlPage", "ControlSection", "Form", "EmojiPickerBlock", "HuePicker", "hexToEmoji", "hexToHue", "getDefaultHueValue", "identity", "hexToHue", "identityKey", "toHex", "getDefaultEmojiValue", "hexToEmoji", "getHueValue", "profile", "data", "hue", "getEmojiValue", "emoji", "ProfileContainer", "t", "useTranslation", "CLIENT_PLUGIN", "client", "useClient", "useIdentity", "displayName", "setDisplayNameDirectly", "useState", "setEmojiDirectly", "setHueDirectly", "updateProfile", "useMemo", "debounce", "halo", "handleSave", "useCallback", "values", "did", "customElements", "type", "label", "getValue", "onValueChange", "handleChange", "target", "value", "React", "ControlItemInput", "title", "description", "Input", "TextInput", "onChange", "placeholder", "classNames", "nextEmoji", "handleEmojiReset", "ControlItem", "EmojiPickerBlock", "triggerVariant", "onChangeEmoji", "onClickClear", "nextHue", "handleHueReset", "HuePicker", "onReset", "ButtonGroup", "disabled", "Clipboard", "IconButton", "ControlPage", "Provider", "ControlSection", "Form", "schema", "ProfileSchema", "autoSave", "onSave", "Custom", "outerSpacing", "Schema", "Struct", "String", "annotations", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RECOVERY_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", "React", "createIntent", "useIntentDispatcher", "useCredentials", "Icon", "IconButton", "List", "ListItem", "Message", "useTranslation", "ControlGroup", "ControlItem", "ControlPage", "ControlSection", "MANAGE_CREDENTIALS_DIALOG", "CLIENT_PLUGIN", "RecoveryCredentialsContainer", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "credentials", "useCredentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "React", "ControlPage", "ControlSection", "title", "description", "ControlGroup", "ControlItem", "IconButton", "label", "icon", "variant", "size", "onClick", "createIntent", "ClientAction", "CreatePasskey", "CreateRecoveryCode", "length", "Message", "Root", "valence", "classNames", "Title", "Content", "List", "map", "ListItem", "key", "id", "toHex", "Endcap", "Icon", "Heading", "issuanceDate", "toLocaleString", "React", "useCallback", "LayoutAction", "createIntent", "useIntentDispatcher", "useClient", "Dialog", "useTranslation", "ConfirmReset", "RESET_DIALOG", "CLIENT_PLUGIN", "ResetDialog", "mode", "onReset", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "handleReset", "useCallback", "reset", "target", "undefined", "handleCancel", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "React", "Dialog", "Content", "classNames", "Title", "Description", "ConfirmReset", "active", "onConfirm", "onCancel"]
7
+ }
@@ -13,7 +13,10 @@ import { Client } from "@dxos/react-client";
13
13
  var client_default = async ({ context, onClientInitialized, onSpacesReady, ...options }) => {
14
14
  const client = new Client(options);
15
15
  await client.initialize();
16
- await onClientInitialized?.(context, client);
16
+ await onClientInitialized?.({
17
+ context,
18
+ client
19
+ });
17
20
  client.reloaded.on(() => {
18
21
  client.halo.identity.subscribe(async (identity) => {
19
22
  if (identity) {
@@ -24,7 +27,10 @@ var client_default = async ({ context, onClientInitialized, onSpacesReady, ...op
24
27
  const subscription = client.spaces.isReady.subscribe(async (ready) => {
25
28
  if (ready) {
26
29
  await context.activatePromise(ClientEvents.SpacesReady);
27
- await onSpacesReady?.(context, client);
30
+ await onSpacesReady?.({
31
+ context,
32
+ client
33
+ });
28
34
  }
29
35
  });
30
36
  return contributes(ClientCapabilities.Client, client, async () => {
@@ -35,4 +41,4 @@ var client_default = async ({ context, onClientInitialized, onSpacesReady, ...op
35
41
  export {
36
42
  client_default as default
37
43
  };
38
- //# sourceMappingURL=client-SLL6GDC2.mjs.map
44
+ //# sourceMappingURL=client-A7CNP37P.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/client.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type PluginContext, contributes } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\nimport { ClientCapabilities } from './capabilities';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginContext;\n};\n\nexport default async ({ context, onClientInitialized, onSpacesReady, ...options }: ClientCapabilityOptions) => {\n const client = new Client(options);\n await client.initialize();\n await onClientInitialized?.({ context, client });\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n\n // TODO(burdon): The callback isn't called?\n const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activatePromise(ClientEvents.SpacesReady);\n await onSpacesReady?.({ context, client });\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;;AAIA,SAA6BA,mBAAmB;AAChD,SAASC,cAAc;AAWvB,IAAA,iBAAe,OAAO,EAAEC,SAASC,qBAAqBC,eAAe,GAAGC,QAAAA,MAAkC;AACxG,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAML,sBAAsB;IAAED;IAASI;EAAO,CAAA;AAG9CA,SAAOG,SAASC,GAAG,MAAA;AACjBJ,WAAOK,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,UAAIA,UAAU;AACZE,eAAOC,SAASC,OAAOF,OAAOC,SAASE;MACzC;IACF,CAAA;EACF,CAAA;AAGA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMnB,QAAQoB,gBAAgBC,aAAaC,WAAW;AACtD,YAAMpB,gBAAgB;QAAEF;QAASI;MAAO,CAAA;IAC1C;EACF,CAAA;AAEA,SAAOmB,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
6
+ "names": ["contributes", "Client", "context", "onClientInitialized", "onSpacesReady", "options", "client", "Client", "initialize", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activatePromise", "ClientEvents", "SpacesReady", "contributes", "ClientCapabilities", "unsubscribe", "destroy"]
7
+ }
@@ -11,17 +11,17 @@ import {
11
11
  } from "./chunk-SZLX4BVJ.mjs";
12
12
 
13
13
  // src/ClientPlugin.ts
14
- import { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from "@dxos/app-framework";
14
+ import { Capabilities, Events, contributes, defineModule, definePlugin, oneOf } from "@dxos/app-framework";
15
15
 
16
16
  // src/capabilities/index.ts
17
17
  import { lazy } from "@dxos/app-framework";
18
- var AppGraphBuilder = lazy(async () => import("./app-graph-builder-SWFB4FID.mjs"));
19
- var Client = lazy(async () => import("./client-SLL6GDC2.mjs"));
20
- var IntentResolver = lazy(async () => import("./intent-resolver-L7C6YRWV.mjs"));
21
- var Migrations = lazy(async () => import("./migrations-YISDI7LF.mjs"));
22
- var ReactContext = lazy(async () => import("./react-context-EEHS4S3L.mjs"));
23
- var ReactSurface = lazy(async () => import("./react-surface-2K6W37R4.mjs"));
24
- var SchemaDefs = lazy(async () => import("./schema-defs-5ZNI63RW.mjs"));
18
+ var AppGraphBuilder = lazy(async () => import("./app-graph-builder-D4XJCLPN.mjs"));
19
+ var Client = lazy(async () => import("./client-A7CNP37P.mjs"));
20
+ var IntentResolver = lazy(async () => import("./intent-resolver-C4INMPH7.mjs"));
21
+ var Migrations = lazy(async () => import("./migrations-UOEK7HB7.mjs"));
22
+ var ReactContext = lazy(async () => import("./react-context-JIH7YBFI.mjs"));
23
+ var ReactSurface = lazy(async () => import("./react-surface-4TMUCPEW.mjs"));
24
+ var SchemaDefs = lazy(async () => import("./schema-defs-4UTKKRTF.mjs"));
25
25
 
26
26
  // src/translations.ts
27
27
  var translations = [
@@ -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 {\n Client,\n AppGraphBuilder,\n IntentResolver,\n Migrations,\n ReactContext,\n ReactSurface,\n SchemaDefs,\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: SchemaDefs,\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, onReset }),\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 }),\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 SchemaDefs = lazy(async () => import('./schema-defs'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'account label': 'User Account',\n 'profile label': 'Profile',\n 'profile description': 'You can adjust how your user settings here.',\n 'devices label': 'Devices',\n 'devices verbose label': 'Manage devices',\n 'add device description':\n 'Authenticating another device is a two-step process. To get started, create a code using the button below.',\n 'devices description':\n 'You can add and remove devices, configure your agent in the cloud, reset this device, or log in as a different identity here.',\n 'create device invitation label': 'Create code',\n 'qr code description':\n 'Scan this QR code using the device you want to log in to, or copy the URL and share it with the new device.',\n 'security label': 'Security',\n 'reset device description': 'Log out from this device, erasing all the data on this device.',\n 'join new identity description':\n 'Log out from this device, erasing all the data currently on this device, and use a QR code or URL to log in.',\n 'recover identity description':\n 'Log out from this device, erasing all the data currently on this device, and use a passkey or recovery code to log in.',\n 'danger zone title': 'Log out',\n 'danger zone description':\n 'Because Composer is decentralized, logging out entails erasing all the data on this device. If you have any data on this device that you’d like to keep, you can log in on a separate device using a passkey or complete a peer-to-peer device invitation above.',\n 'display name label': 'Display name',\n 'display name description': 'Your name as it appears in the app.',\n 'display name input placeholder': 'Enter a name',\n 'icon label': 'Avatar',\n 'icon description': 'The emoji used to represent you in the app.',\n 'hue label': 'Color',\n 'hue description':\n 'The color used to represent you in the app, including as your avatar’s background, your cursor as it appears to others, and the messages you send in group threads.',\n 'did label': 'DID',\n 'did description': 'Your unique ID.',\n 'open user account label': 'Open user account',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'credentials list label': 'Recovery credentials',\n 'no credentials title': 'WARNING: There is currently no way to recover your account.',\n 'no credentials message': 'Create a recovery credential above to secure your account.',\n 'recovery setup dialog title': 'Account Security',\n 'recovery setup dialog description':\n 'In order to maintain access to 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 // TODO(wittjosiah): At link to user-focused passkey information.\n // Something like https://www.tomsguide.com/news/what-are-passkeys.\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] as const satisfies Resource[];\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,eAAeJ,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMK,eAAeL,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMM,aAAaN,KAAK,YAAY,OAAO,4BAAA,CAAA;;;ACJ3C,IAAMO,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,iBAAiB;QACjB,iBAAiB;QACjB,uBAAuB;QACvB,iBAAiB;QACjB,yBAAyB;QACzB,0BACE;QACF,uBACE;QACF,kCAAkC;QAClC,uBACE;QACF,kBAAkB;QAClB,4BAA4B;QAC5B,iCACE;QACF,gCACE;QACF,qBAAqB;QACrB,2BACE;QACF,sBAAsB;QACtB,4BAA4B;QAC5B,kCAAkC;QAClC,cAAc;QACd,oBAAoB;QACpB,aAAa;QACb,mBACE;QACF,aAAa;QACb,mBAAmB;QACnB,2BAA2B;QAC3B,mCAAmC;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AAGF,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;MAAQ,CAAA;IAClD,CAAA;IACAX,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,YAAAA;IACzD,CAAA;GACD;AACH;",
6
- "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "Migrations", "ReactContext", "ReactSurface", "SchemaDefs", "translations", "meta", "id", "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", "SchemaDefs", "SetupMigration", "Migrations", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, Events, contributes, defineModule, definePlugin, oneOf } from '@dxos/app-framework';\n\nimport {\n AppGraphBuilder,\n Client,\n IntentResolver,\n Migrations,\n ReactContext,\n ReactSurface,\n SchemaDefs,\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: SchemaDefs,\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, onReset }),\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 }),\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 SchemaDefs = lazy(async () => import('./schema-defs'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'account label': 'User Account',\n 'profile label': 'Profile',\n 'profile description': 'You can adjust how your user settings here.',\n 'devices label': 'Devices',\n 'devices verbose label': 'Manage devices',\n 'add device description':\n 'Authenticating another device is a two-step process. To get started, create a code using the button below.',\n 'devices description':\n 'You can add and remove devices, configure your agent in the cloud, reset this device, or log in as a different identity here.',\n 'create device invitation label': 'Create code',\n 'qr code description':\n 'Scan this QR code using the device you want to log in to, or copy the URL and share it with the new device.',\n 'security label': 'Security',\n 'reset device description': 'Log out from this device, erasing all the data on this device.',\n 'join new identity description':\n 'Log out from this device, erasing all the data currently on this device, and use a QR code or URL to log in.',\n 'recover identity description':\n 'Log out from this device, erasing all the data currently on this device, and use a passkey or recovery code to log in.',\n 'danger zone title': 'Log out',\n 'danger zone description':\n 'Because Composer is decentralized, logging out entails erasing all the data on this device. If you have any data on this device that you’d like to keep, you can log in on a separate device using a passkey or complete a peer-to-peer device invitation above.',\n 'display name label': 'Display name',\n 'display name description': 'Your name as it appears in the app.',\n 'display name input placeholder': 'Enter a name',\n 'icon label': 'Avatar',\n 'icon description': 'The emoji used to represent you in the app.',\n 'hue label': 'Color',\n 'hue description':\n 'The color used to represent you in the app, including as your avatar’s background, your cursor as it appears to others, and the messages you send in group threads.',\n 'did label': 'DID',\n 'did description': 'Your unique ID.',\n 'open user account label': 'Open user account',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'credentials list label': 'Recovery credentials',\n 'no credentials title': 'WARNING: There is currently no way to recover your account.',\n 'no credentials message': 'Create a recovery credential above to secure your account.',\n 'recovery setup dialog title': 'Account Security',\n 'recovery setup dialog description':\n 'In order to maintain access to 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 // TODO(wittjosiah): At link to user-focused passkey information.\n // Something like https://www.tomsguide.com/news/what-are-passkeys.\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] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAIA,SAASA,cAAcC,QAAQC,aAAaC,cAAcC,cAAcC,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,eAAeJ,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMK,eAAeL,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMM,aAAaN,KAAK,YAAY,OAAO,4BAAA,CAAA;;;ACJ3C,IAAMO,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,iBAAiB;QACjB,iBAAiB;QACjB,uBAAuB;QACvB,iBAAiB;QACjB,yBAAyB;QACzB,0BACE;QACF,uBACE;QACF,kCAAkC;QAClC,uBACE;QACF,kBAAkB;QAClB,4BAA4B;QAC5B,iCACE;QACF,gCACE;QACF,qBAAqB;QACrB,2BACE;QACF,sBAAsB;QACtB,4BAA4B;QAC5B,kCAAkC;QAClC,cAAc;QACd,oBAAoB;QACpB,aAAa;QACb,mBACE;QACF,aAAa;QACb,mBAAmB;QACnB,2BAA2B;QA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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;MAAQ,CAAA;IAClD,CAAA;IACAX,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,YAAAA;IACzD,CAAA;GACD;AACH;",
6
+ "names": ["Capabilities", "Events", "contributes", "defineModule", "definePlugin", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "Migrations", "ReactContext", "ReactSurface", "SchemaDefs", "translations", "meta", "id", "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", "SchemaDefs", "SetupMigration", "Migrations", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
7
7
  }
@@ -9,16 +9,16 @@ import {
9
9
  JOIN_DIALOG,
10
10
  RECOVERY_CODE_DIALOG,
11
11
  RESET_DIALOG
12
- } from "./chunk-FBYODKEL.mjs";
12
+ } from "./chunk-MUWDSQ65.mjs";
13
13
  import {
14
14
  Account,
15
15
  ClientAction
16
- } from "./chunk-5V3RCXZV.mjs";
16
+ } from "./chunk-JG6AFSFU.mjs";
17
17
  import "./chunk-SZLX4BVJ.mjs";
18
18
 
19
19
  // src/capabilities/intent-resolver.ts
20
20
  import { pipe } from "effect";
21
- import { Capabilities, chain, contributes, createIntent, createResolver, LayoutAction } from "@dxos/app-framework";
21
+ import { Capabilities, LayoutAction, chain, contributes, createIntent, createResolver } from "@dxos/app-framework";
22
22
  import { invariant } from "@dxos/invariant";
23
23
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
24
24
  import { PublicKey } from "@dxos/react-client";
@@ -127,7 +127,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
127
127
  const client = context.getCapability(ClientCapabilities.Client);
128
128
  invariant(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
129
129
  F: __dxlog_file,
130
- L: 136,
130
+ L: 137,
131
131
  S: void 0,
132
132
  A: [
133
133
  "client.services.services.EdgeAgentService",
@@ -145,7 +145,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
145
145
  const client = context.getCapability(ClientCapabilities.Client);
146
146
  invariant(client.services.services.IdentityService, "IdentityService not available", {
147
147
  F: __dxlog_file,
148
- L: 144,
148
+ L: 145,
149
149
  S: void 0,
150
150
  A: [
151
151
  "client.services.services.IdentityService",
@@ -177,7 +177,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
177
177
  const identity = client.halo.identity.get();
178
178
  invariant(identity, "Identity not available", {
179
179
  F: __dxlog_file,
180
- L: 167,
180
+ L: 168,
181
181
  S: void 0,
182
182
  A: [
183
183
  "identity",
@@ -216,7 +216,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
216
216
  });
217
217
  invariant(credential, "Credential not available", {
218
218
  F: __dxlog_file,
219
- L: 192,
219
+ L: 193,
220
220
  S: void 0,
221
221
  A: [
222
222
  "credential",
@@ -227,7 +227,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
227
227
  const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
228
228
  invariant(client.services.services.IdentityService, "IdentityService not available", {
229
229
  F: __dxlog_file,
230
- L: 197,
230
+ L: 198,
231
231
  S: void 0,
232
232
  A: [
233
233
  "client.services.services.IdentityService",
@@ -249,7 +249,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
249
249
  const client = context.getCapability(ClientCapabilities.Client);
250
250
  invariant(client.services.services.IdentityService, "IdentityService not available", {
251
251
  F: __dxlog_file,
252
- L: 212,
252
+ L: 213,
253
253
  S: void 0,
254
254
  A: [
255
255
  "client.services.services.IdentityService",
@@ -285,7 +285,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
285
285
  const client = context.getCapability(ClientCapabilities.Client);
286
286
  invariant(client.services.services.IdentityService, "IdentityService not available", {
287
287
  F: __dxlog_file,
288
- L: 243,
288
+ L: 244,
289
289
  S: void 0,
290
290
  A: [
291
291
  "client.services.services.IdentityService",
@@ -303,4 +303,4 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
303
303
  export {
304
304
  intent_resolver_default as default
305
305
  };
306
- //# sourceMappingURL=intent-resolver-L7C6YRWV.mjs.map
306
+ //# sourceMappingURL=intent-resolver-C4INMPH7.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { pipe } from 'effect';\n\nimport {\n Capabilities,\n LayoutAction,\n type PluginContext,\n chain,\n contributes,\n createIntent,\n createResolver,\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 { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { Account, ClientAction } from '../types';\n\nimport { ClientCapabilities } from './capabilities';\n\ntype IntentResolverOptions = {\n context: PluginContext;\n appName?: string;\n};\n\nconst RECOVER_IDENTITY_RPC_TIMEOUT = 20_000;\n\nexport default ({ context, appName = 'Composer' }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: async (profile) => {\n const manager = context.getCapability(Capabilities.PluginManager);\n const client = context.getCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity(profile);\n await manager.activate(ClientEvents.IdentityCreated);\n return {\n data,\n intents: [\n createIntent(ObservabilityAction.SendEvent, {\n name: 'identity.create',\n }),\n ],\n };\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 pipe(\n createIntent(LayoutAction.SwitchWorkspace, {\n part: 'workspace',\n subject: Account.id,\n }),\n chain(LayoutAction.Open, {\n part: 'main',\n subject: [Account.Profile],\n }),\n ),\n createIntent(ObservabilityAction.SendEvent, {\n name: 'identity.share',\n }),\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 return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RESET_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n mode: data.mode ?? 'reset storage',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: async () => {\n const client = context.getCapability(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.getCapability(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: RECOVERY_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.getCapability(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() as Uint8Array<ArrayBuffer>,\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.getCapability(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 {\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 { timeout: RECOVER_IDENTITY_RPC_TIMEOUT },\n );\n },\n }),\n createResolver({\n intent: ClientAction.RedeemToken,\n resolve: async (data) => {\n const client = context.getCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.recoverIdentity(\n { token: data.token },\n { timeout: RECOVER_IDENTITY_RPC_TIMEOUT },\n );\n },\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAIA,SAASA,YAAY;AAErB,SACEC,cACAC,cAEAC,OACAC,aACAC,cACAC,sBACK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAc1B,IAAMC,+BAA+B;AAErC,IAAA,0BAAe,CAAC,EAAEC,SAASC,UAAU,WAAU,MAC7CC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,aAAaC;IACrBC,SAAS,OAAOC,YAAAA;AACd,YAAMC,UAAUX,QAAQY,cAAcT,aAAaU,aAAa;AAChE,YAAMC,SAASd,QAAQY,cAAcG,mBAAmBC,MAAM;AAC9D,YAAMC,OAAO,MAAMH,OAAOI,KAAKC,eAAeT,OAAAA;AAC9C,YAAMC,QAAQS,SAASC,aA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;MACF,GACA;QAAEpD,SAAS1D;MAA6B,CAAA;IAE5C;EACF,CAAA;EACAM,eAAe;IACbC,QAAQC,aAAauG;IACrBrG,SAAS,OAAOQ,SAAAA;AACd,YAAMH,SAASd,QAAQY,cAAcG,mBAAmBC,MAAM;AAE9DqC,gBAAUvC,OAAOwC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAM7C,OAAOwC,SAASA,SAASK,gBAAgB6C,gBAC7C;QAAEO,OAAO9F,KAAK8F;MAAM,GACpB;QAAEtD,SAAS1D;MAA6B,CAAA;IAE5C;EACF,CAAA;CACD;",
6
+ "names": ["pipe", "Capabilities", "LayoutAction", "chain", "contributes", "createIntent", "createResolver", "invariant", "ObservabilityAction", "PublicKey", "RECOVER_IDENTITY_RPC_TIMEOUT", "context", "appName", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "profile", "manager", "getCapability", "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", "pipe", "SwitchWorkspace", "Account", "id", "chain", "Open", "Profile", "RecoverIdentity", "ResetStorage", "RESET_DIALOG", "mode", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVERY_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "location", "hostname", "user", "asUint8Array", "did", "displayName", "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", "RedeemToken", "token"]
7
+ }