@dxos/plugin-client 0.8.1-main.ba2dec9 → 0.8.1-staging.31c3ee1

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 (176) hide show
  1. package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs +119 -0
  2. package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-OLUST5AO.mjs → chunk-4PLF3BEB.mjs} +2 -2
  4. package/dist/lib/browser/{chunk-7DPLXOMO.mjs → chunk-AN7FJKIJ.mjs} +21 -4
  5. package/dist/lib/browser/{chunk-7DPLXOMO.mjs.map → chunk-AN7FJKIJ.mjs.map} +3 -3
  6. package/dist/lib/browser/{chunk-XK4HM5M7.mjs → chunk-BGY6BSUC.mjs} +3 -2
  7. package/dist/lib/browser/{chunk-XK4HM5M7.mjs.map → chunk-BGY6BSUC.mjs.map} +3 -3
  8. package/dist/lib/browser/chunk-CAM6IWZ2.mjs +619 -0
  9. package/dist/lib/browser/chunk-CAM6IWZ2.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-NHIL4T3L.mjs → chunk-MCEXD5XH.mjs} +1 -1
  11. package/dist/lib/browser/{chunk-NHIL4T3L.mjs.map → chunk-MCEXD5XH.mjs.map} +2 -2
  12. package/dist/lib/browser/{client-UUGITHCW.mjs → client-LV67Q3R7.mjs} +5 -5
  13. package/dist/lib/browser/{client-UUGITHCW.mjs.map → client-LV67Q3R7.mjs.map} +3 -3
  14. package/dist/lib/browser/index.mjs +51 -22
  15. package/dist/lib/browser/index.mjs.map +2 -2
  16. package/dist/lib/browser/{intent-resolver-AIUHL34E.mjs → intent-resolver-JAQCJLKQ.mjs} +65 -27
  17. package/dist/lib/browser/intent-resolver-JAQCJLKQ.mjs.map +7 -0
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/{migrations-XODC625X.mjs → migrations-3DWFOL5Q.mjs} +3 -3
  20. package/dist/lib/browser/{react-context-JBD7Y3SN.mjs → react-context-WEH7SL4I.mjs} +3 -3
  21. package/dist/lib/browser/react-surface-M6Q6RT3Q.mjs +66 -0
  22. package/dist/lib/browser/react-surface-M6Q6RT3Q.mjs.map +7 -0
  23. package/dist/lib/browser/{schema-Y7ZNXYSL.mjs → schema-JQAT6Q7S.mjs} +3 -3
  24. package/dist/lib/browser/types.mjs +4 -2
  25. package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs +130 -0
  26. package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +7 -0
  27. package/dist/lib/node/chunk-ARZVO2AR.cjs +644 -0
  28. package/dist/lib/node/chunk-ARZVO2AR.cjs.map +7 -0
  29. package/dist/lib/node/{chunk-OIFPM5ZW.cjs → chunk-DJKWB5L6.cjs} +4 -4
  30. package/dist/lib/node/{chunk-OIFPM5ZW.cjs.map → chunk-DJKWB5L6.cjs.map} +2 -2
  31. package/dist/lib/node/{chunk-TREVKZCJ.cjs → chunk-FROKBEVH.cjs} +25 -7
  32. package/dist/lib/node/chunk-FROKBEVH.cjs.map +7 -0
  33. package/dist/lib/node/{chunk-FR2K56EV.cjs → chunk-W64EOF2B.cjs} +10 -10
  34. package/dist/lib/node/{chunk-T4K27K2F.cjs → chunk-ZVQIICEN.cjs} +9 -8
  35. package/dist/lib/node/{chunk-T4K27K2F.cjs.map → chunk-ZVQIICEN.cjs.map} +3 -3
  36. package/dist/lib/node/{client-5BHSU35T.cjs → client-BKTGRBYM.cjs} +9 -9
  37. package/dist/lib/node/{client-5BHSU35T.cjs.map → client-BKTGRBYM.cjs.map} +3 -3
  38. package/dist/lib/node/index.cjs +70 -41
  39. package/dist/lib/node/index.cjs.map +2 -2
  40. package/dist/lib/node/{intent-resolver-PWCHHNV3.cjs → intent-resolver-Y73DGA7F.cjs} +81 -44
  41. package/dist/lib/node/intent-resolver-Y73DGA7F.cjs.map +7 -0
  42. package/dist/lib/node/meta.json +1 -1
  43. package/dist/lib/node/{migrations-YCBZUPWO.cjs → migrations-TGNI4FVL.cjs} +8 -8
  44. package/dist/lib/node/{react-context-MPHNGZHT.cjs → react-context-SF3M3YLR.cjs} +8 -8
  45. package/dist/lib/node/{react-surface-TPISDIHR.cjs → react-surface-KWTTP7ZX.cjs} +34 -26
  46. package/dist/lib/node/react-surface-KWTTP7ZX.cjs.map +7 -0
  47. package/dist/lib/node/{schema-NMMCMK64.cjs → schema-INQ72F54.cjs} +8 -8
  48. package/dist/lib/node/types.cjs +5 -3
  49. package/dist/lib/node/types.cjs.map +2 -2
  50. package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs +120 -0
  51. package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-6WHEPWQD.mjs +620 -0
  53. package/dist/lib/node-esm/chunk-6WHEPWQD.mjs.map +7 -0
  54. package/dist/lib/node-esm/{chunk-QJMF2MWP.mjs → chunk-AD5W5QCQ.mjs} +21 -4
  55. package/dist/lib/node-esm/{chunk-QJMF2MWP.mjs.map → chunk-AD5W5QCQ.mjs.map} +3 -3
  56. package/dist/lib/node-esm/{chunk-XLLNVLWU.mjs → chunk-BP56BGZR.mjs} +2 -2
  57. package/dist/lib/node-esm/{chunk-HO7WDE7C.mjs → chunk-HM7VB4ZV.mjs} +1 -1
  58. package/dist/lib/node-esm/{chunk-HO7WDE7C.mjs.map → chunk-HM7VB4ZV.mjs.map} +2 -2
  59. package/dist/lib/node-esm/{chunk-3OU2ZXLK.mjs → chunk-K3KGGSJZ.mjs} +3 -2
  60. package/dist/lib/node-esm/{chunk-3OU2ZXLK.mjs.map → chunk-K3KGGSJZ.mjs.map} +3 -3
  61. package/dist/lib/node-esm/{client-ZDGFGLX4.mjs → client-QQD6WFOB.mjs} +5 -5
  62. package/dist/lib/node-esm/{client-ZDGFGLX4.mjs.map → client-QQD6WFOB.mjs.map} +3 -3
  63. package/dist/lib/node-esm/index.mjs +51 -22
  64. package/dist/lib/node-esm/index.mjs.map +2 -2
  65. package/dist/lib/node-esm/{intent-resolver-FIXGPH7C.mjs → intent-resolver-K3CA4JRC.mjs} +65 -27
  66. package/dist/lib/node-esm/intent-resolver-K3CA4JRC.mjs.map +7 -0
  67. package/dist/lib/node-esm/meta.json +1 -1
  68. package/dist/lib/node-esm/{migrations-VIEIPYJW.mjs → migrations-IVGATGZR.mjs} +3 -3
  69. package/dist/lib/node-esm/{react-context-KUEOXWWK.mjs → react-context-EAKKTE5A.mjs} +3 -3
  70. package/dist/lib/node-esm/react-surface-ORRNXP2X.mjs +67 -0
  71. package/dist/lib/node-esm/react-surface-ORRNXP2X.mjs.map +7 -0
  72. package/dist/lib/node-esm/{schema-NE5IYLMD.mjs → schema-OK7HY3JJ.mjs} +3 -3
  73. package/dist/lib/node-esm/types.mjs +4 -2
  74. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/capabilities.d.ts +1 -0
  76. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/index.d.ts +4 -4
  78. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -3
  80. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  81. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  82. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  83. package/dist/types/src/components/DevicesContainer.d.ts +5 -0
  84. package/dist/types/src/components/DevicesContainer.d.ts.map +1 -0
  85. package/dist/types/src/components/DevicesContainer.stories.d.ts +8 -0
  86. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -0
  87. package/dist/types/src/components/ProfileContainer.d.ts +3 -0
  88. package/dist/types/src/components/ProfileContainer.d.ts.map +1 -0
  89. package/dist/types/src/components/ProfileContainer.stories.d.ts +8 -0
  90. package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -0
  91. package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -1
  92. package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
  93. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +4 -0
  94. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -0
  95. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +8 -0
  96. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
  97. package/dist/types/src/components/ResetDialog.d.ts +7 -0
  98. package/dist/types/src/components/ResetDialog.d.ts.map +1 -0
  99. package/dist/types/src/components/ResetDialog.stories.d.ts +10 -0
  100. package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -0
  101. package/dist/types/src/components/index.d.ts +4 -2
  102. package/dist/types/src/components/index.d.ts.map +1 -1
  103. package/dist/types/src/meta.d.ts +2 -4
  104. package/dist/types/src/meta.d.ts.map +1 -1
  105. package/dist/types/src/translations.d.ts +28 -1
  106. package/dist/types/src/translations.d.ts.map +1 -1
  107. package/dist/types/src/types.d.ts +17 -1
  108. package/dist/types/src/types.d.ts.map +1 -1
  109. package/package.json +26 -19
  110. package/src/ClientPlugin.ts +2 -2
  111. package/src/capabilities/app-graph-builder.ts +62 -6
  112. package/src/capabilities/capabilities.ts +1 -0
  113. package/src/capabilities/client.ts +1 -1
  114. package/src/capabilities/intent-resolver.ts +68 -23
  115. package/src/capabilities/react-surface.tsx +32 -24
  116. package/src/components/DevicesContainer.stories.tsx +45 -0
  117. package/src/components/DevicesContainer.tsx +268 -0
  118. package/src/components/ProfileContainer.stories.tsx +29 -0
  119. package/src/components/ProfileContainer.tsx +163 -0
  120. package/src/components/RecoveryCodeDialog.stories.tsx +2 -2
  121. package/src/components/RecoveryCodeDialog.tsx +1 -2
  122. package/src/components/{ManageCredentialsDialog.stories.tsx → RecoveryCredentialsContainer.stories.tsx} +4 -17
  123. package/src/components/RecoveryCredentialsContainer.tsx +74 -0
  124. package/src/components/ResetDialog.stories.tsx +47 -0
  125. package/src/components/ResetDialog.tsx +49 -0
  126. package/src/components/index.ts +4 -2
  127. package/src/meta.ts +2 -2
  128. package/src/translations.ts +45 -9
  129. package/src/types.ts +20 -1
  130. package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs +0 -44
  131. package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs.map +0 -7
  132. package/dist/lib/browser/chunk-HNJZ74DZ.mjs +0 -281
  133. package/dist/lib/browser/chunk-HNJZ74DZ.mjs.map +0 -7
  134. package/dist/lib/browser/intent-resolver-AIUHL34E.mjs.map +0 -7
  135. package/dist/lib/browser/react-surface-QGPWIUFR.mjs +0 -57
  136. package/dist/lib/browser/react-surface-QGPWIUFR.mjs.map +0 -7
  137. package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs +0 -58
  138. package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs.map +0 -7
  139. package/dist/lib/node/chunk-TREVKZCJ.cjs.map +0 -7
  140. package/dist/lib/node/chunk-UTG3UR3N.cjs +0 -309
  141. package/dist/lib/node/chunk-UTG3UR3N.cjs.map +0 -7
  142. package/dist/lib/node/intent-resolver-PWCHHNV3.cjs.map +0 -7
  143. package/dist/lib/node/react-surface-TPISDIHR.cjs.map +0 -7
  144. package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs +0 -45
  145. package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs.map +0 -7
  146. package/dist/lib/node-esm/chunk-SHJBU4QR.mjs +0 -282
  147. package/dist/lib/node-esm/chunk-SHJBU4QR.mjs.map +0 -7
  148. package/dist/lib/node-esm/intent-resolver-FIXGPH7C.mjs.map +0 -7
  149. package/dist/lib/node-esm/react-surface-KBROL4VH.mjs +0 -58
  150. package/dist/lib/node-esm/react-surface-KBROL4VH.mjs.map +0 -7
  151. package/dist/types/src/components/IdentityDialog.d.ts +0 -5
  152. package/dist/types/src/components/IdentityDialog.d.ts.map +0 -1
  153. package/dist/types/src/components/ManageCredentialsDialog.d.ts +0 -4
  154. package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +0 -1
  155. package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +0 -8
  156. package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +0 -1
  157. package/dist/types/src/components/RecoverySetupDialog.d.ts +0 -4
  158. package/dist/types/src/components/RecoverySetupDialog.d.ts.map +0 -1
  159. package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +0 -8
  160. package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +0 -1
  161. package/src/components/IdentityDialog.tsx +0 -75
  162. package/src/components/ManageCredentialsDialog.tsx +0 -64
  163. package/src/components/RecoverySetupDialog.stories.tsx +0 -77
  164. package/src/components/RecoverySetupDialog.tsx +0 -52
  165. /package/dist/lib/browser/{chunk-OLUST5AO.mjs.map → chunk-4PLF3BEB.mjs.map} +0 -0
  166. /package/dist/lib/browser/{migrations-XODC625X.mjs.map → migrations-3DWFOL5Q.mjs.map} +0 -0
  167. /package/dist/lib/browser/{react-context-JBD7Y3SN.mjs.map → react-context-WEH7SL4I.mjs.map} +0 -0
  168. /package/dist/lib/browser/{schema-Y7ZNXYSL.mjs.map → schema-JQAT6Q7S.mjs.map} +0 -0
  169. /package/dist/lib/node/{chunk-FR2K56EV.cjs.map → chunk-W64EOF2B.cjs.map} +0 -0
  170. /package/dist/lib/node/{migrations-YCBZUPWO.cjs.map → migrations-TGNI4FVL.cjs.map} +0 -0
  171. /package/dist/lib/node/{react-context-MPHNGZHT.cjs.map → react-context-SF3M3YLR.cjs.map} +0 -0
  172. /package/dist/lib/node/{schema-NMMCMK64.cjs.map → schema-INQ72F54.cjs.map} +0 -0
  173. /package/dist/lib/node-esm/{chunk-XLLNVLWU.mjs.map → chunk-BP56BGZR.mjs.map} +0 -0
  174. /package/dist/lib/node-esm/{migrations-VIEIPYJW.mjs.map → migrations-IVGATGZR.mjs.map} +0 -0
  175. /package/dist/lib/node-esm/{react-context-KUEOXWWK.mjs.map → react-context-EAKKTE5A.mjs.map} +0 -0
  176. /package/dist/lib/node-esm/{schema-NE5IYLMD.mjs.map → schema-OK7HY3JJ.mjs.map} +0 -0
@@ -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 { Check, X } from '@phosphor-icons/react';\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, IconButton, List, useId, useTranslation } from '@dxos/react-ui';\nimport { ControlFrame, ControlFrameItem, ControlGroup, ControlItem, ControlSection } from '@dxos/react-ui-form';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { getSize, mx } from '@dxos/react-ui-theme';\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 const DevicesContainer = ({\n createInvitationUrl,\n}: {\n createInvitationUrl: (invitationCode: string) => string;\n}) => {\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 <StackItem.Content classNames='p-2 block overflow-y-auto'>\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 <ControlFrameItem title='Add device'>\n <DeviceInvitation createInvitationUrl={createInvitationUrl} />\n </ControlFrameItem>\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 </StackItem.Content>\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 <Clipboard.Provider>\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 <Clipboard.Button value={url ?? 'never'} />\n </div>\n <Button variant='ghost' onClick={onCancel}>\n {t('cancel label')}\n </Button>\n </Clipboard.Provider>\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 ? <Check className={mx('m-1.5', getSize(6))} /> : <X className={mx('m-1.5', getSize(6))} />;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog, useTranslation } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { t } = useTranslation(CLIENT_PLUGIN);\n\n const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } })),\n dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <Dialog.Title classNames='sr-only'>{t('join space label', { ns: 'os' })}</Dialog.Title>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema as S } 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 { Form, type InputComponent, ControlItem, ControlItemInput, ControlSection } from '@dxos/react-ui-form';\nimport { EmojiPickerBlock, HuePicker } from '@dxos/react-ui-pickers';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { hexToHue, hexToEmoji } 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 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 <StackItem.Content classNames='p-2 block overflow-y-auto'>\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='p-0 container-max-width [&_[role=\"form\"]]:grid [&_[role=\"form\"]]:grid-cols-1 md:[&_[role=\"form\"]]:grid-cols-[1fr_min-content] [&_[role=\"form\"]]:gap-4'\n />\n </ControlSection>\n </Clipboard.Provider>\n </StackItem.Content>\n );\n};\n\n// TODO(wittjosiah): Integrate annotations with translations.\nconst ProfileSchema = S.Struct({\n displayName: S.String.annotations({ title: 'Display name' }),\n emoji: S.String.annotations({ title: 'Avatar' }),\n hue: S.String.annotations({ title: 'Color' }),\n did: S.String.annotations({ title: 'DID' }),\n});\ntype Profile = S.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, useTranslation, Message } from '@dxos/react-ui';\nimport { ControlGroup, ControlItem, ControlSection } from '@dxos/react-ui-form';\nimport { StackItem } from '@dxos/react-ui-stack';\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 <StackItem.Content classNames='p-2 block overflow-y-auto'>\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' className='container-max-width'>\n <Message.Title>\n <Icon icon='ph--shield-warning--duotone' size={5} classNames='inline-block align-top mbs-px mie-1' />\n {t('no credentials title')}\n </Message.Title>\n <Message.Body>{t('no credentials message')}</Message.Body>\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 </StackItem.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { 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,SAASA,OAAOC,SAAS;AACzB,OAAOC,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,YAAYC,MAAMC,OAAOC,sBAAsB;AAC3E,SAASC,cAAcC,kBAAkBC,cAAcC,aAAaC,sBAAsB;AAC1F,SAASC,iBAAiB;AAC1B,SAASC,SAASC,UAAU;AAC5B,SAASC,UAAUC,UAAUC,gBAAgBC,OAAOC,gBAAgB;AACpE,SAASC,kBAAkB;;AAKpB,IAAMC,mBAAmB,CAAC,EAC/BC,oBAAmB,MAGpB;AACC,QAAM,EAAEC,EAAC,IAAKC,eAAe,IAAA;AAC7B,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,UAAUC,WAAAA;AAChB,QAAM,EAAEC,OAAOC,gBAAe,IAAKC,iBAAAA;AAEnC,QAA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Ac,CAAC,EAAEC,MAAMC,QAAO,MAAoB;AAC7D,QAAM,EAAEC,EAAC,IAAKC,gBAAeL,aAAAA;AAC7B,QAAM,EAAEM,iBAAiBC,SAAQ,IAAKC,qBAAAA;AACtC,QAAMC,SAASC,WAAAA;AAEf,QAAMC,cAAcC,aAAY,YAAA;AAC9B,UAAMH,OAAOI,MAAK;AAClB,UAAMC,SACJZ,SAAS,sBAAsB,qBAAqBA,SAAS,YAAY,oBAAoBa;AAC/F,UAAMZ,UAAU;MAAEW;IAAO,CAAA;EAC3B,GAAG;IAACP;IAAUE;IAAQP;IAAMC;GAAQ;AAEpC,QAAMa,eAAeJ,aAAY,MAAA;AAC/B,SAAKL,SACHU,cAAaC,cAAaC,cAAc;MACtCC,MAAM;MACNC,SAAS;QAAEC,OAAO;MAAM;IAC1B,CAAA,CAAA;EAEJ,GAAG;IAACf;GAAS;AAIb,SACE,gBAAAgB,OAAA,cAACC,QAAOC,SAAO;IAACC,YAAW;KACzB,gBAAAH,OAAA,cAACC,QAAOG,OAAK;IAACD,YAAW;KAAWtB,EAAE,oBAAA,CAAA,GACtC,gBAAAmB,OAAA,cAACC,QAAOI,aAAW;IAACF,YAAW;KAAWtB,EAAE,0BAAA,CAAA,GAC5C,gBAAAmB,OAAA,cAACM,cAAAA;IAAaC,QAAAA;IAAO5B;IAAY6B,WAAWpB;IAAaqB,UAAUhB;;AAGzE;",
6
+ "names": ["Check", "X", "React", "useCallback", "useEffect", "useState", "QR", "createIntent", "useIntentDispatcher", "log", "useClient", "useMulticastObservable", "useDevices", "Invitation", "InvitationEncoder", "useNetworkStatus", "Button", "Clipboard", "IconButton", "List", "useId", "useTranslation", "ControlFrame", "ControlFrameItem", "ControlGroup", "ControlItem", "ControlSection", "StackItem", "getSize", "mx", "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", "StackItem", "Content", "classNames", "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", "Viewport", "Root", "Views", "View", "id", "InvitationComplete", "statusValue", "InvitationAuthCode", "code", "onCancel", "InvitationQR", "qrLabel", "useId", "emoji", "hexToEmoji", "Clipboard", "Provider", "div", "role", "QR", "rounding", "backgroundColor", "color", "aria-labelledby", "errorCorrectionLevel", "cutout", "Centered", "Emoji", "text", "span", "value", "AuthCode", "large", "Check", "mx", "getSize", "X", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "useTranslation", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "t", "useTranslation", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "UpdateDialog", "part", "options", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "Title", "classNames", "ns", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "Schema", "S", "React", "useCallback", "useMemo", "useState", "debounce", "useClient", "useIdentity", "ButtonGroup", "Clipboard", "Input", "useTranslation", "Form", "ControlItem", "ControlItemInput", "ControlSection", "EmojiPickerBlock", "HuePicker", "StackItem", "hexToHue", "hexToEmoji", "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", "StackItem", "Content", "Provider", "ControlSection", "Form", "schema", "ProfileSchema", "autoSave", "onSave", "Custom", "S", "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", "useTranslation", "Message", "ControlGroup", "ControlItem", "ControlSection", "StackItem", "MANAGE_CREDENTIALS_DIALOG", "CLIENT_PLUGIN", "RecoveryCredentialsContainer", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "credentials", "useCredentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "React", "StackItem", "Content", "classNames", "ControlSection", "title", "description", "ControlGroup", "ControlItem", "IconButton", "label", "icon", "variant", "size", "onClick", "createIntent", "ClientAction", "CreatePasskey", "CreateRecoveryCode", "length", "Message", "Root", "valence", "className", "Title", "Icon", "Body", "List", "map", "ListItem", "key", "id", "toHex", "Endcap", "Heading", "issuanceDate", "toLocaleString", "React", "useCallback", "createIntent", "LayoutAction", "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
+ }
@@ -9,4 +9,4 @@ export {
9
9
  CLIENT_PLUGIN,
10
10
  meta
11
11
  };
12
- //# sourceMappingURL=chunk-NHIL4T3L.mjs.map
12
+ //# sourceMappingURL=chunk-MCEXD5XH.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CLIENT_PLUGIN = 'dxos.org/plugin/client';\n\nexport const meta = {\n id: CLIENT_PLUGIN,\n name: 'Client',\n} satisfies PluginMeta;\n"],
5
- "mappings": ";AAMO,IAAMA,gBAAgB;AAEtB,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;AACR;",
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CLIENT_PLUGIN = 'dxos.org/plugin/client';\n\nexport const meta: PluginMeta = {\n id: CLIENT_PLUGIN,\n name: 'Client',\n};\n"],
5
+ "mappings": ";AAMO,IAAMA,gBAAgB;AAEtB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;",
6
6
  "names": ["CLIENT_PLUGIN", "meta", "id", "name"]
7
7
  }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-OLUST5AO.mjs";
3
+ } from "./chunk-4PLF3BEB.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-XK4HM5M7.mjs";
7
- import "./chunk-NHIL4T3L.mjs";
6
+ } from "./chunk-BGY6BSUC.mjs";
7
+ import "./chunk-MCEXD5XH.mjs";
8
8
 
9
9
  // packages/plugins/plugin-client/src/capabilities/client.ts
10
10
  import { contributes } from "@dxos/app-framework";
@@ -22,7 +22,7 @@ var client_default = async ({ context, onClientInitialized, ...options }) => {
22
22
  });
23
23
  const subscription = client.spaces.isReady.subscribe(async (ready) => {
24
24
  if (ready) {
25
- await context.activate(ClientEvents.SpacesReady);
25
+ await context.activatePromise(ClientEvents.SpacesReady);
26
26
  }
27
27
  });
28
28
  return contributes(ClientCapabilities.Client, client, async () => {
@@ -33,4 +33,4 @@ var client_default = async ({ context, onClientInitialized, ...options }) => {
33
33
  export {
34
34
  client_default as default
35
35
  };
36
- //# sourceMappingURL=client-UUGITHCW.mjs.map
36
+ //# sourceMappingURL=client-LV67Q3R7.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/client.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default async ({ context, onClientInitialized, ...options }: ClientCapabilityOptions) => {\n const 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 const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activate(ClientEvents.SpacesReady);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAASA,mBAAwC;AACjD,SAASC,cAAc;AAUvB,IAAA,iBAAe,OAAO,EAAEC,SAASC,qBAAqB,GAAGC,QAAAA,MAAkC;AACzF,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAMJ,sBAAsBD,SAASG,MAAAA;AAGrCA,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;AAEA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMlB,QAAQmB,SAASC,aAAaC,WAAW;IACjD;EACF,CAAA;AAEA,SAAOC,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
6
- "names": ["contributes", "Client", "context", "onClientInitialized", "options", "client", "Client", "initialize", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activate", "ClientEvents", "SpacesReady", "contributes", "ClientCapabilities", "unsubscribe", "destroy"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default async ({ context, onClientInitialized, ...options }: ClientCapabilityOptions) => {\n const 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 const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activatePromise(ClientEvents.SpacesReady);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;AAIA,SAASA,mBAAwC;AACjD,SAASC,cAAc;AAUvB,IAAA,iBAAe,OAAO,EAAEC,SAASC,qBAAqB,GAAGC,QAAAA,MAAkC;AACzF,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAMJ,sBAAsBD,SAASG,MAAAA;AAGrCA,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;AAEA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMlB,QAAQmB,gBAAgBC,aAAaC,WAAW;IACxD;EACF,CAAA;AAEA,SAAOC,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
6
+ "names": ["contributes", "Client", "context", "onClientInitialized", "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
7
  }
@@ -1,45 +1,74 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-OLUST5AO.mjs";
3
+ } from "./chunk-4PLF3BEB.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-XK4HM5M7.mjs";
6
+ } from "./chunk-BGY6BSUC.mjs";
7
7
  import {
8
8
  CLIENT_PLUGIN,
9
9
  meta
10
- } from "./chunk-NHIL4T3L.mjs";
10
+ } from "./chunk-MCEXD5XH.mjs";
11
11
 
12
12
  // packages/plugins/plugin-client/src/ClientPlugin.ts
13
13
  import { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from "@dxos/app-framework";
14
14
 
15
15
  // packages/plugins/plugin-client/src/capabilities/index.ts
16
16
  import { lazy } from "@dxos/app-framework";
17
- var AppGraphBuilder = lazy(async () => import("./app-graph-builder-ON64R7SO.mjs"));
18
- var Client = lazy(async () => import("./client-UUGITHCW.mjs"));
19
- var IntentResolver = lazy(async () => import("./intent-resolver-AIUHL34E.mjs"));
20
- var Migrations = lazy(async () => import("./migrations-XODC625X.mjs"));
21
- var ReactContext = lazy(async () => import("./react-context-JBD7Y3SN.mjs"));
22
- var ReactSurface = lazy(async () => import("./react-surface-QGPWIUFR.mjs"));
23
- var Schema = lazy(async () => import("./schema-Y7ZNXYSL.mjs"));
17
+ var AppGraphBuilder = lazy(async () => import("./app-graph-builder-WAS4YZNA.mjs"));
18
+ var Client = lazy(async () => import("./client-LV67Q3R7.mjs"));
19
+ var IntentResolver = lazy(async () => import("./intent-resolver-JAQCJLKQ.mjs"));
20
+ var Migrations = lazy(async () => import("./migrations-3DWFOL5Q.mjs"));
21
+ var ReactContext = lazy(async () => import("./react-context-WEH7SL4I.mjs"));
22
+ var ReactSurface = lazy(async () => import("./react-surface-M6Q6RT3Q.mjs"));
23
+ var Schema = lazy(async () => import("./schema-JQAT6Q7S.mjs"));
24
24
 
25
25
  // packages/plugins/plugin-client/src/translations.ts
26
26
  var translations_default = [
27
27
  {
28
28
  "en-US": {
29
29
  [CLIENT_PLUGIN]: {
30
- "open shell label": "Open HALO",
30
+ "account label": "User Account",
31
+ "profile label": "Profile",
32
+ "profile description": "You can adjust how you\u2019re represented in Composer here.",
33
+ "devices label": "Devices",
34
+ "devices verbose label": "Manage devices",
35
+ "add device description": "Authenticating another device is a two-step process. To get started, create a code using the button below.",
36
+ "devices description": "You can add and remove devices, configure your agent in the cloud, reset this device, or log in as a different identity here.",
37
+ "create device invitation label": "Create code",
38
+ "qr code description": "Scan this QR code using the device you want to log in to, or copy the URL and share it with the new device.",
39
+ "security label": "Security",
40
+ "reset device description": "Log out from this device, erasing all the data on this\xA0device.",
41
+ "join new identity description": "Log out from this device, erasing all the data currently on this device, and use a QR code or URL to log\xA0in.",
42
+ "recover identity description": "Log out from this device, erasing all the data currently on this device, and use a passkey or recovery code to log\xA0in.",
43
+ "danger zone title": "Log out",
44
+ "danger zone description": "Because Composer is decentralized, logging out entails erasing all the data on this device. If you have any data on this device that you\u2019d like to keep, you can log in on a separate device using a passkey or complete a peer-to-peer\xA0device invitation above.",
45
+ "display name label": "Display name",
46
+ "display name description": "Your name as it appears in the app.",
47
+ "display name input placeholder": "Enter a name",
48
+ "icon label": "Avatar",
49
+ "icon description": "The emoji used to represent you in the app.",
50
+ "hue label": "Color",
51
+ "hue description": "The color used to represent you in the app, including as your avatar\u2019s background, your cursor as it appears to others, and the messages you send in group threads.",
52
+ "did label": "DID",
53
+ "did description": "Your unique ID.",
54
+ "open user account label": "Open user account",
31
55
  "manage credentials dialog title": "Manage Account Recovery",
32
- "recovery setup dialog title": "Account Recovery",
33
- "recovery setup dialog description": "In order to recover your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.",
56
+ "credentials list label": "Recovery credentials",
57
+ "no credentials title": "There\u2019s no way to recover your account\xA0yet.",
58
+ "no credentials message": "Create a recovery credential above to secure your\xA0account.",
59
+ "recovery setup dialog title": "Account Security",
60
+ "recovery setup dialog description": "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\xA0manager.",
34
61
  "create passkey label": "Create Passkey",
35
- "create passkey description": "A passkey is a secure and easy to use credential that can be used to recover your account.",
62
+ // TODO(wittjosiah): At link to user-focused passkey information.
63
+ // Something like https://www.tomsguide.com/news/what-are-passkeys.
64
+ "create passkey description": "A passkey is a secure and easy to use credential that can be used to recover your\xA0account.",
36
65
  "create recovery code label": "Create Recovery Code",
37
- "create recovery code description": "A recovery code is 12 word phrase representing a private key.",
66
+ "create recovery code description": "A recovery code is 12 word phrase representing a private\xA0key.",
38
67
  "recovery code dialog title": "Recovery Code",
39
- "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.",
40
- "recovery code dialog warning 1": "NOTE: This code will not be displayed again.",
41
- "recovery code dialog warning 2": "It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.",
42
- "recovery code confirmation label": "Please confirm you have saved the code.",
68
+ "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\xA0devices.",
69
+ "recovery code dialog warning 1": "NOTE: This code will not be displayed\xA0again.",
70
+ "recovery code dialog warning 2": "It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your\xA0account.",
71
+ "recovery code confirmation label": "Please confirm you have saved the\xA0code.",
43
72
  "continue label": "Continue"
44
73
  }
45
74
  }
@@ -90,7 +119,8 @@ var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam =
90
119
  id: `${meta.id}/module/react-surface`,
91
120
  activatesOn: Events.SetupReactSurface,
92
121
  activate: () => ReactSurface({
93
- createInvitationUrl
122
+ createInvitationUrl,
123
+ onReset
94
124
  })
95
125
  }),
96
126
  defineModule({
@@ -102,8 +132,7 @@ var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam =
102
132
  id: `${meta.id}/module/intent-resolver`,
103
133
  activatesOn: Events.SetupIntentResolver,
104
134
  activate: (context) => IntentResolver({
105
- context,
106
- onReset
135
+ context
107
136
  })
108
137
  }),
109
138
  defineModule({
@@ -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 Schema,\n} from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/migration`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupMigration],\n activate: Migrations,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const Migrations = lazy(async () => import('./migrations'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\nexport const Schema = lazy(async () => import('./schema'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'recovery setup dialog title': 'Account Recovery',\n 'recovery setup dialog description':\n 'In order to recover your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.',\n 'create passkey label': 'Create Passkey',\n 'create passkey description':\n 'A passkey is a secure and easy to use credential that can be used to recover your account.',\n 'create recovery code label': 'Create Recovery Code',\n 'create recovery code description': 'A recovery code is 12 word phrase representing a private key.',\n 'recovery code dialog title': 'Recovery Code',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n"],
5
- "mappings": ";;;;;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,QAAQC,aAAa;;;ACArF,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,SAASD,KAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,iBAAiBF,KAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,aAAaH,KAAK,YAAY,OAAO,2BAAA,CAAA;AAC3C,IAAMI,eAAeJ,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMK,eAAeL,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMM,SAASN,KAAK,YAAY,OAAO,uBAAA,CAAA;;;ACN9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACO,aAAAA,GAAgB;QACf,oBAAoB;QACpB,mCAAmC;QACnC,+BAA+B;QAC/B,qCACE;QACF,wBAAwB;QACxB,8BACE;QACF,8BAA8B;QAC9B,oCAAoC;QACpC,8BAA8B;QAC9B,oCACE;QACF,kCAAkC;QAClC,kCACE;QACF,oCAAoC;QACpC,kBAAkB;MACpB;IACF;EACF;;;;AFVK,IAAMC,eAAe,CAAC,EAC3BC,gBAAgBC,OAAOC,SAASC,QAChCC,kBAAkB,wBAClBC,SACA,GAAGC,QAAAA,MACiB;AACpB,QAAMC,sBAAsB,CAACC,mBAAAA;AAC3B,UAAMC,UAAU,IAAIC,IAAIV,aAAAA;AACxBS,YAAQE,aAAaC,IAAIR,iBAAiBI,cAAAA;AAC1C,WAAOC,QAAQI,SAAQ;EACzB;AAEA,SAAOC,aAAaC,MAAM;IACxBC,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaC,MAAMC,OAAOC,SAASD,OAAOE,aAAa;MACvDC,gBAAgB;QAACC,aAAaC;;MAC9BC,UAAU,CAACC,YAAYC,OAAO;QAAE,GAAGtB;QAASqB;MAAQ,CAAA;IACtD,CAAA;IACAX,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaM,aAAaC;MAC1BI,iBAAiB;QAACL,aAAaM;;MAC/BJ,UAAUK;IACZ,CAAA;IACAf,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaM,aAAaC;MAC1BI,iBAAiB;QAACL,aAAaQ;;MAC/BN,UAAUO;IACZ,CAAA;IACAjB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOC;MACpBK,UAAUQ;IACZ,CAAA;IACAlB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOe;MACpBT,UAAU,MAAMU,aAAa;QAAE7B;MAAoB,CAAA;IACrD,CAAA;IACAS,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOE;MACpBI,UAAUW;IACZ,CAAA;IACArB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOkB;MACpBZ,UAAU,CAACC,YAAYY,eAAe;QAAEZ;QAAStB;MAAQ,CAAA;IAC3D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport {\n Client,\n AppGraphBuilder,\n IntentResolver,\n Migrations,\n ReactContext,\n ReactSurface,\n Schema,\n} from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/migration`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupMigration],\n activate: Migrations,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl, 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 Schema = lazy(async () => import('./schema'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'account label': 'User Account',\n 'profile label': 'Profile',\n 'profile description': 'You can adjust how you’re represented in Composer 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': 'There’s no way to recover your account yet.',\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];\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,SAASN,KAAK,YAAY,OAAO,uBAAA,CAAA;;;ACN9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACO,aAAAA,GAAgB;QACf,iBAAiB;QACjB,iBAAiB;QACjB,uBAAuB;QACvB,iBAAiB;QACjB,yBAAyB;QACzB,0BACE;QACF,uBACE;QACF,kCAAkC;QAClC,uBACE;QACF,kBAAkB;QA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dC,aAAaE,OAAOC;MACpBK,UAAUQ;IACZ,CAAA;IACAlB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOe;MACpBT,UAAU,MAAMU,aAAa;QAAE7B;QAAqBF;MAAQ,CAAA;IAC9D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOE;MACpBI,UAAUW;IACZ,CAAA;IACArB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOkB;MACpBZ,UAAU,CAACC,YAAYY,eAAe;QAAEZ;MAAQ,CAAA;IAClD,CAAA;IACAX,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
6
6
  "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "Migrations", "ReactContext", "ReactSurface", "Schema", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "Client", "activatesBefore", "SetupSchema", "Schema", "SetupMigration", "Migrations", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
7
7
  }
@@ -1,26 +1,29 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-OLUST5AO.mjs";
3
+ } from "./chunk-4PLF3BEB.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-XK4HM5M7.mjs";
6
+ } from "./chunk-BGY6BSUC.mjs";
7
7
  import {
8
- IDENTITY_DIALOG,
9
8
  JOIN_DIALOG,
10
- RECOVER_CODE_DIALOG
11
- } from "./chunk-HNJZ74DZ.mjs";
9
+ RECOVERY_CODE_DIALOG,
10
+ RESET_DIALOG
11
+ } from "./chunk-CAM6IWZ2.mjs";
12
12
  import {
13
+ Account,
13
14
  ClientAction
14
- } from "./chunk-7DPLXOMO.mjs";
15
- import "./chunk-NHIL4T3L.mjs";
15
+ } from "./chunk-AN7FJKIJ.mjs";
16
+ import "./chunk-MCEXD5XH.mjs";
16
17
 
17
18
  // packages/plugins/plugin-client/src/capabilities/intent-resolver.ts
18
- import { Capabilities, contributes, createIntent, createResolver, LayoutAction } from "@dxos/app-framework";
19
+ import { pipe } from "effect";
20
+ import { Capabilities, chain, contributes, createIntent, createResolver, LayoutAction } from "@dxos/app-framework";
19
21
  import { invariant } from "@dxos/invariant";
20
22
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
21
23
  import { PublicKey } from "@dxos/react-client";
22
24
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/capabilities/intent-resolver.ts";
23
- var intent_resolver_default = ({ context, appName = "Composer", onReset }) => contributes(Capabilities.IntentResolver, [
25
+ var RECOVER_IDENTITY_RPC_TIMEOUT = 2e4;
26
+ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes(Capabilities.IntentResolver, [
24
27
  createResolver({
25
28
  intent: ClientAction.CreateIdentity,
26
29
  resolve: async () => {
@@ -63,13 +66,15 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
63
66
  resolve: async () => {
64
67
  return {
65
68
  intents: [
66
- createIntent(LayoutAction.UpdateDialog, {
67
- part: "dialog",
68
- subject: IDENTITY_DIALOG,
69
- options: {
70
- blockAlign: "start"
71
- }
72
- }),
69
+ pipe(createIntent(LayoutAction.SwitchWorkspace, {
70
+ part: "workspace",
71
+ subject: Account.id
72
+ }), chain(LayoutAction.Open, {
73
+ part: "main",
74
+ subject: [
75
+ Account.Profile
76
+ ]
77
+ })),
73
78
  createIntent(ObservabilityAction.SendEvent, {
74
79
  name: "identity.share"
75
80
  })
@@ -99,9 +104,20 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
99
104
  createResolver({
100
105
  intent: ClientAction.ResetStorage,
101
106
  resolve: async (data) => {
102
- await onReset?.({
103
- target: data.target
104
- });
107
+ return {
108
+ intents: [
109
+ createIntent(LayoutAction.UpdateDialog, {
110
+ part: "dialog",
111
+ subject: RESET_DIALOG,
112
+ options: {
113
+ blockAlign: "start",
114
+ props: {
115
+ mode: data.mode ?? "reset storage"
116
+ }
117
+ }
118
+ })
119
+ ]
120
+ };
105
121
  }
106
122
  }),
107
123
  createResolver({
@@ -110,7 +126,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
110
126
  const client = context.requestCapability(ClientCapabilities.Client);
111
127
  invariant(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
112
128
  F: __dxlog_file,
113
- L: 106,
129
+ L: 136,
114
130
  S: void 0,
115
131
  A: [
116
132
  "client.services.services.EdgeAgentService",
@@ -128,7 +144,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
128
144
  const client = context.requestCapability(ClientCapabilities.Client);
129
145
  invariant(client.services.services.IdentityService, "IdentityService not available", {
130
146
  F: __dxlog_file,
131
- L: 114,
147
+ L: 144,
132
148
  S: void 0,
133
149
  A: [
134
150
  "client.services.services.IdentityService",
@@ -140,7 +156,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
140
156
  intents: [
141
157
  createIntent(LayoutAction.UpdateDialog, {
142
158
  part: "dialog",
143
- subject: RECOVER_CODE_DIALOG,
159
+ subject: RECOVERY_CODE_DIALOG,
144
160
  options: {
145
161
  blockAlign: "start",
146
162
  type: "alert",
@@ -160,7 +176,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
160
176
  const identity = client.halo.identity.get();
161
177
  invariant(identity, "Identity not available", {
162
178
  F: __dxlog_file,
163
- L: 137,
179
+ L: 167,
164
180
  S: void 0,
165
181
  A: [
166
182
  "identity",
@@ -199,7 +215,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
199
215
  });
200
216
  invariant(credential, "Credential not available", {
201
217
  F: __dxlog_file,
202
- L: 162,
218
+ L: 192,
203
219
  S: void 0,
204
220
  A: [
205
221
  "credential",
@@ -210,7 +226,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
210
226
  const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
211
227
  invariant(client.services.services.IdentityService, "IdentityService not available", {
212
228
  F: __dxlog_file,
213
- L: 167,
229
+ L: 197,
214
230
  S: void 0,
215
231
  A: [
216
232
  "client.services.services.IdentityService",
@@ -232,7 +248,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
232
248
  const client = context.requestCapability(ClientCapabilities.Client);
233
249
  invariant(client.services.services.IdentityService, "IdentityService not available", {
234
250
  F: __dxlog_file,
235
- L: 182,
251
+ L: 212,
236
252
  S: void 0,
237
253
  A: [
238
254
  "client.services.services.IdentityService",
@@ -257,6 +273,28 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
257
273
  clientDataJson: Buffer.from(credential.response.clientDataJSON),
258
274
  authenticatorData: Buffer.from(credential.response.authenticatorData)
259
275
  }
276
+ }, {
277
+ timeout: RECOVER_IDENTITY_RPC_TIMEOUT
278
+ });
279
+ }
280
+ }),
281
+ createResolver({
282
+ intent: ClientAction.RedeemToken,
283
+ resolve: async (data) => {
284
+ const client = context.requestCapability(ClientCapabilities.Client);
285
+ invariant(client.services.services.IdentityService, "IdentityService not available", {
286
+ F: __dxlog_file,
287
+ L: 243,
288
+ S: void 0,
289
+ A: [
290
+ "client.services.services.IdentityService",
291
+ "'IdentityService not available'"
292
+ ]
293
+ });
294
+ await client.services.services.IdentityService.recoverIdentity({
295
+ token: data.token
296
+ }, {
297
+ timeout: RECOVER_IDENTITY_RPC_TIMEOUT
260
298
  });
261
299
  }
262
300
  })
@@ -264,4 +302,4 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
264
302
  export {
265
303
  intent_resolver_default as default
266
304
  };
267
- //# sourceMappingURL=intent-resolver-AIUHL34E.mjs.map
305
+ //# sourceMappingURL=intent-resolver-JAQCJLKQ.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 chain,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { Account, ClientAction } from '../types';\n\ntype IntentResolverOptions = {\n context: PluginsContext;\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 () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\n await manager.activate(ClientEvents.IdentityCreated);\n return {\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.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n },\n }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: 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.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const lookupKey = PublicKey.random();\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array(),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n await client.services.services.IdentityService.recoverIdentity(\n {\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.requestCapability(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,OACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAa1B,IAAMC,+BAA+B;AAErC,IAAA,0BAAe,CAAC,EAAEC,SAASC,UAAU,WAAU,MAC7CC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,aAAaC;IACrBC,SAAS,YAAA;AACP,YAAMC,UAAUV,QAAQW,kBAAkBR,aAAaS,aAAa;AACpE,YAAMC,SAASb,QAAQW,kBAAkBG,mBAAmBC,MAAM;AAClE,YAAMC,OAAO,MAAMH,OAAOI,KAAKC,eAAc;AAC7C,YAAMR,QAAQS,SAASC,aAAaC,eAAe;AACnD,aAAO;QACLL;QACAM,SAAS;UACPC,aAAaC,oBAAoBC,WAAW;YAC1CC,MAAM;UACR,CAAA;;MAEJ;IACF;EACF,CAAA;EACArB,eAAe;IACbC,QAAQC,aAAaoB;IACrBlB,SAAS,OAAOO,SAAAA;AACd,aAAO;QACLM,SAAS;UACPC,aAAaK,aAAaC,cAAc;YACtCC,MAAM;YACNC,SAASC;YACTC,SAAS;cACPC,YAAY;cACZC,OAAO;gBACLC,uBAAuBpB,KAAKqB;gBAC5BC,oBAAoB;cACtB;YACF;UACF,CAAA;;MAEJ;IACF;EACF,CAAA;EACAjC,eAAe;IACbC,Q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contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "RECOVER_IDENTITY_RPC_TIMEOUT", "context", "appName", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "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", "profile", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData", "RedeemToken", "token"]
7
+ }