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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/lib/browser/{chunk-EYBZZHSM.mjs → chunk-HNJZ74DZ.mjs} +19 -9
  2. package/dist/lib/browser/chunk-HNJZ74DZ.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-RGMLBYIF.mjs → chunk-OLUST5AO.mjs} +2 -1
  4. package/dist/lib/browser/{chunk-RGMLBYIF.mjs.map → chunk-OLUST5AO.mjs.map} +3 -3
  5. package/dist/lib/browser/{chunk-GHEQL2E6.mjs → chunk-XK4HM5M7.mjs} +2 -1
  6. package/dist/lib/browser/chunk-XK4HM5M7.mjs.map +7 -0
  7. package/dist/lib/browser/{client-A7YSVURS.mjs → client-UUGITHCW.mjs} +3 -3
  8. package/dist/lib/browser/index.mjs +16 -7
  9. package/dist/lib/browser/index.mjs.map +3 -3
  10. package/dist/lib/browser/{intent-resolver-SSM6WXAW.mjs → intent-resolver-AIUHL34E.mjs} +18 -14
  11. package/dist/lib/browser/{intent-resolver-SSM6WXAW.mjs.map → intent-resolver-AIUHL34E.mjs.map} +3 -3
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/migrations-XODC625X.mjs +21 -0
  14. package/dist/lib/browser/migrations-XODC625X.mjs.map +7 -0
  15. package/dist/lib/browser/{react-context-R3SG55F5.mjs → react-context-JBD7Y3SN.mjs} +2 -2
  16. package/dist/lib/browser/{react-surface-XGOUHVIH.mjs → react-surface-QGPWIUFR.mjs} +2 -2
  17. package/dist/lib/browser/{schema-J4MJIXRP.mjs → schema-Y7ZNXYSL.mjs} +2 -2
  18. package/dist/lib/node/{chunk-XPC4JOPP.cjs → chunk-FR2K56EV.cjs} +5 -4
  19. package/dist/lib/node/{chunk-XPC4JOPP.cjs.map → chunk-FR2K56EV.cjs.map} +3 -3
  20. package/dist/lib/node/{chunk-UHIGZJQL.cjs → chunk-T4K27K2F.cjs} +5 -4
  21. package/dist/lib/node/chunk-T4K27K2F.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-7LVBFGKQ.cjs → chunk-UTG3UR3N.cjs} +16 -6
  23. package/dist/lib/node/chunk-UTG3UR3N.cjs.map +7 -0
  24. package/dist/lib/node/{client-2RQATBB6.cjs → client-5BHSU35T.cjs} +8 -8
  25. package/dist/lib/node/index.cjs +21 -12
  26. package/dist/lib/node/index.cjs.map +3 -3
  27. package/dist/lib/node/{intent-resolver-RIHCW2KJ.cjs → intent-resolver-PWCHHNV3.cjs} +29 -25
  28. package/dist/lib/node/{intent-resolver-RIHCW2KJ.cjs.map → intent-resolver-PWCHHNV3.cjs.map} +3 -3
  29. package/dist/lib/node/meta.json +1 -1
  30. package/dist/lib/node/migrations-YCBZUPWO.cjs +37 -0
  31. package/dist/lib/node/migrations-YCBZUPWO.cjs.map +7 -0
  32. package/dist/lib/node/{react-context-TD6VGBVA.cjs → react-context-MPHNGZHT.cjs} +6 -6
  33. package/dist/lib/node/{react-surface-IY7GXEGU.cjs → react-surface-TPISDIHR.cjs} +20 -20
  34. package/dist/lib/node/{schema-JXJS75HQ.cjs → schema-NMMCMK64.cjs} +7 -7
  35. package/dist/lib/node-esm/{chunk-T35SFKK3.mjs → chunk-3OU2ZXLK.mjs} +2 -1
  36. package/dist/lib/node-esm/chunk-3OU2ZXLK.mjs.map +7 -0
  37. package/dist/lib/node-esm/{chunk-CRF22MJJ.mjs → chunk-SHJBU4QR.mjs} +19 -9
  38. package/dist/lib/node-esm/chunk-SHJBU4QR.mjs.map +7 -0
  39. package/dist/lib/node-esm/{chunk-QR72BXJK.mjs → chunk-XLLNVLWU.mjs} +2 -1
  40. package/dist/lib/node-esm/{chunk-QR72BXJK.mjs.map → chunk-XLLNVLWU.mjs.map} +3 -3
  41. package/dist/lib/node-esm/{client-36DKBSB7.mjs → client-ZDGFGLX4.mjs} +3 -3
  42. package/dist/lib/node-esm/index.mjs +16 -7
  43. package/dist/lib/node-esm/index.mjs.map +3 -3
  44. package/dist/lib/node-esm/{intent-resolver-WWTVE6T6.mjs → intent-resolver-FIXGPH7C.mjs} +18 -14
  45. package/dist/lib/node-esm/{intent-resolver-WWTVE6T6.mjs.map → intent-resolver-FIXGPH7C.mjs.map} +3 -3
  46. package/dist/lib/node-esm/meta.json +1 -1
  47. package/dist/lib/node-esm/migrations-VIEIPYJW.mjs +22 -0
  48. package/dist/lib/node-esm/migrations-VIEIPYJW.mjs.map +7 -0
  49. package/dist/lib/node-esm/{react-context-ZOGDOWJ2.mjs → react-context-KUEOXWWK.mjs} +2 -2
  50. package/dist/lib/node-esm/{react-surface-F3PDFJMV.mjs → react-surface-KBROL4VH.mjs} +2 -2
  51. package/dist/lib/node-esm/{schema-XM4HBLIX.mjs → schema-NE5IYLMD.mjs} +2 -2
  52. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/capabilities.d.ts +3 -1
  54. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/index.d.ts +1 -0
  56. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/migrations.d.ts +4 -0
  59. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  60. package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
  61. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  62. package/dist/types/src/events.d.ts +1 -0
  63. package/dist/types/src/events.d.ts.map +1 -1
  64. package/package.json +19 -19
  65. package/src/ClientPlugin.ts +15 -1
  66. package/src/capabilities/capabilities.ts +3 -1
  67. package/src/capabilities/index.ts +1 -0
  68. package/src/capabilities/intent-resolver.ts +11 -4
  69. package/src/capabilities/migrations.ts +22 -0
  70. package/src/components/IdentityDialog.tsx +3 -1
  71. package/src/components/JoinDialog.tsx +3 -1
  72. package/src/events.ts +1 -0
  73. package/dist/lib/browser/chunk-EYBZZHSM.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-GHEQL2E6.mjs.map +0 -7
  75. package/dist/lib/node/chunk-7LVBFGKQ.cjs.map +0 -7
  76. package/dist/lib/node/chunk-UHIGZJQL.cjs.map +0 -7
  77. package/dist/lib/node-esm/chunk-CRF22MJJ.mjs.map +0 -7
  78. package/dist/lib/node-esm/chunk-T35SFKK3.mjs.map +0 -7
  79. /package/dist/lib/browser/{client-A7YSVURS.mjs.map → client-UUGITHCW.mjs.map} +0 -0
  80. /package/dist/lib/browser/{react-context-R3SG55F5.mjs.map → react-context-JBD7Y3SN.mjs.map} +0 -0
  81. /package/dist/lib/browser/{react-surface-XGOUHVIH.mjs.map → react-surface-QGPWIUFR.mjs.map} +0 -0
  82. /package/dist/lib/browser/{schema-J4MJIXRP.mjs.map → schema-Y7ZNXYSL.mjs.map} +0 -0
  83. /package/dist/lib/node/{client-2RQATBB6.cjs.map → client-5BHSU35T.cjs.map} +0 -0
  84. /package/dist/lib/node/{react-context-TD6VGBVA.cjs.map → react-context-MPHNGZHT.cjs.map} +0 -0
  85. /package/dist/lib/node/{react-surface-IY7GXEGU.cjs.map → react-surface-TPISDIHR.cjs.map} +0 -0
  86. /package/dist/lib/node/{schema-JXJS75HQ.cjs.map → schema-NMMCMK64.cjs.map} +0 -0
  87. /package/dist/lib/node-esm/{client-36DKBSB7.mjs.map → client-ZDGFGLX4.mjs.map} +0 -0
  88. /package/dist/lib/node-esm/{react-context-ZOGDOWJ2.mjs.map → react-context-KUEOXWWK.mjs.map} +0 -0
  89. /package/dist/lib/node-esm/{react-surface-F3PDFJMV.mjs.map → react-surface-KBROL4VH.mjs.map} +0 -0
  90. /package/dist/lib/node-esm/{schema-XM4HBLIX.mjs.map → schema-NE5IYLMD.mjs.map} +0 -0
@@ -55,12 +55,13 @@ var ManageCredentialsDialog = () => {
55
55
  import React2, { useCallback } from "react";
56
56
  import { createIntent as createIntent2, LayoutAction, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
57
57
  import { useClient } from "@dxos/react-client";
58
- import { Clipboard, Dialog as Dialog2 } from "@dxos/react-ui";
58
+ import { Clipboard, Dialog as Dialog2, useTranslation as useTranslation2 } from "@dxos/react-ui";
59
59
  import { IdentityPanel } from "@dxos/shell/react";
60
60
  var IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;
61
61
  var IdentityDialog = (props) => {
62
62
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
63
63
  const client = useClient();
64
+ const { t } = useTranslation2(CLIENT_PLUGIN);
64
65
  const handleDone = useCallback(() => dispatch(createIntent2(LayoutAction.UpdateDialog, {
65
66
  part: "dialog",
66
67
  options: {
@@ -103,7 +104,11 @@ var IdentityDialog = (props) => {
103
104
  }, [
104
105
  dispatch
105
106
  ]);
106
- return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
107
+ return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(Dialog2.Title, {
108
+ classNames: "sr-only"
109
+ }, t("manage profile label", {
110
+ ns: "os"
111
+ })), /* @__PURE__ */ React2.createElement(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
107
112
  ...props,
108
113
  doneActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
109
114
  asChild: true
@@ -120,11 +125,12 @@ var IdentityDialog = (props) => {
120
125
  import React3, { useCallback as useCallback2 } from "react";
121
126
  import { createIntent as createIntent3, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
122
127
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
123
- import { Dialog as Dialog3 } from "@dxos/react-ui";
128
+ import { Dialog as Dialog3, useTranslation as useTranslation3 } from "@dxos/react-ui";
124
129
  import { JoinPanel } from "@dxos/shell/react";
125
130
  var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
126
131
  var JoinDialog = (props) => {
127
132
  const { dispatchPromise: dispatch } = useIntentDispatcher3();
133
+ const { t } = useTranslation3(CLIENT_PLUGIN);
128
134
  const handleCancelResetStorage = useCallback2(() => dispatch(createIntent3(ClientAction.ShareIdentity)), [
129
135
  dispatch
130
136
  ]);
@@ -145,7 +151,11 @@ var JoinDialog = (props) => {
145
151
  }, [
146
152
  dispatch
147
153
  ]);
148
- return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(JoinPanel, {
154
+ return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(Dialog3.Title, {
155
+ classNames: "sr-only"
156
+ }, t("join space label", {
157
+ ns: "os"
158
+ })), /* @__PURE__ */ React3.createElement(JoinPanel, {
149
159
  mode: "halo-only",
150
160
  ...props,
151
161
  exitActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
@@ -161,10 +171,10 @@ var JoinDialog = (props) => {
161
171
 
162
172
  // packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx
163
173
  import React4, { useCallback as useCallback3, useState } from "react";
164
- import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
174
+ import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
165
175
  var RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;
166
176
  var RecoveryCodeDialog = ({ code }) => {
167
- const { t } = useTranslation2(CLIENT_PLUGIN);
177
+ const { t } = useTranslation4(CLIENT_PLUGIN);
168
178
  const [confirmation, setConfirmation] = useState(false);
169
179
  const handleConfirmation = useCallback3((checked) => setConfirmation(checked), []);
170
180
  return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
@@ -214,11 +224,11 @@ var Code = ({ code }) => {
214
224
  import { Key as Key2, Receipt as Receipt2 } from "@phosphor-icons/react";
215
225
  import React5, { useMemo as useMemo2 } from "react";
216
226
  import { createIntent as createIntent4, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
217
- import { AlertDialog as AlertDialog2, useTranslation as useTranslation3 } from "@dxos/react-ui";
227
+ import { AlertDialog as AlertDialog2, useTranslation as useTranslation5 } from "@dxos/react-ui";
218
228
  import { BifurcatedAction as BifurcatedAction2 } from "@dxos/shell/react";
219
229
  var RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;
220
230
  var RecoverySetupDialog = () => {
221
- const { t } = useTranslation3(CLIENT_PLUGIN);
231
+ const { t } = useTranslation5(CLIENT_PLUGIN);
222
232
  const { dispatchPromise: dispatch } = useIntentDispatcher4();
223
233
  const actions = useMemo2(() => ({
224
234
  createPasskey: {
@@ -268,4 +278,4 @@ export {
268
278
  RECOVER_SETUP_DIALOG,
269
279
  RecoverySetupDialog
270
280
  };
271
- //# sourceMappingURL=chunk-EYBZZHSM.mjs.map
281
+ //# sourceMappingURL=chunk-HNJZ74DZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ManageCredentialsDialog.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/components/RecoverySetupDialog.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Receipt, Key } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { useCredentials } from '@dxos/react-client/halo';\nimport { Dialog, Icon, List, ListItem, useTranslation } from '@dxos/react-ui';\nimport { BifurcatedAction, type ActionMenuItem } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const ManageCredentialsDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const credentials = useCredentials();\n const recoveryCredentials = credentials.filter(\n (credential) => credential.subject.assertion['@type'] === 'dxos.halo.credentials.IdentityRecovery',\n );\n\n // TODO(wittjosiah): Reconsile w/ RecoverySetupDialog actions.\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: () => dispatch(createIntent(ClientAction.CreatePasskey)),\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <Dialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <Dialog.Title>{t('manage credentials dialog title')}</Dialog.Title>\n <List classNames='py-4'>\n {recoveryCredentials.map((credential) => (\n <ListItem.Root key={credential.id?.toHex()}>\n <ListItem.Endcap>\n <Icon icon='ph--key--regular' size={5} />\n </ListItem.Endcap>\n <ListItem.Heading>{credential.issuanceDate.toLocaleString()}</ListItem.Heading>\n </ListItem.Root>\n ))}\n </List>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog, useTranslation } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { MANAGE_CREDENTIALS_DIALOG } from './ManageCredentialsDialog';\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n const { t } = useTranslation(CLIENT_PLUGIN);\n\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n options: { state: false },\n }),\n ),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage));\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'recoverIdentity' }));\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'deviceInvitation' }));\n }, [dispatch]);\n\n const handleManageCredentials = useCallback(async () => {\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: MANAGE_CREDENTIALS_DIALOG,\n options: { state: true, blockAlign: 'start' },\n }),\n );\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Dialog.Title classNames='sr-only'>{t('manage profile label', { ns: 'os' })}</Dialog.Title>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n onManageCredentials={handleManageCredentials}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog, useTranslation } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { t } = useTranslation(CLIENT_PLUGIN);\n\n const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } })),\n dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <Dialog.Title classNames='sr-only'>{t('join space label', { ns: 'os' })}</Dialog.Title>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport const RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Key, Receipt } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { AlertDialog, useTranslation } from '@dxos/react-ui';\nimport { type ActionMenuItem, BifurcatedAction } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoverySetupDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: async () => {\n await dispatch(createIntent(ClientAction.CreatePasskey));\n await dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));\n },\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery setup dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery setup dialog description')}</p>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </AlertDialog.Content>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;AAIA,SAASA,SAASC,WAAW;AAC7B,OAAOC,SAASC,eAAe;AAE/B,SAASC,cAAcC,2BAA2B;AAClD,SAASC,sBAAsB;AAC/B,SAASC,QAAQC,MAAMC,MAAMC,UAAUC,sBAAsB;AAC7D,SAASC,wBAA6C;AAK/C,IAAMC,4BAA4B,GAAGC,aAAAA;AAGrC,IAAMC,0BAA0B,MAAA;AACrC,QAAM,EAAEC,EAAC,IAAKC,eAAeH,aAAAA;AAC7B,QAAM,EAAEI,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,cAAcC,eAAAA;AACpB,QAAMC,sBAAsBF,YAAYG,OACtC,CAACC,eAAeA,WAAWC,QAAQC,UAAU,OAAA,MAAa,wCAAA;AAI5D,QAAMC,UAA0CC,QAC9C,OAAO;IACLC,eAAe;MACbC,OAAOf,EAAE,sBAAA;MACTgB,aAAahB,EAAE,4BAAA;;MAEfiB,MAAMC;MACNC,S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E;EACF,IACA;IAACvB;GAAE;AAGL,SACE,gBAAAwB,OAAA,cAACC,aAAYC,SAAO;IAACC,YAAW;KAC9B,gBAAAH,OAAA,cAACC,aAAYG,OAAK,MAAE5B,EAAE,6BAAA,CAAA,GACtB,gBAAAwB,OAAA,cAACK,KAAAA;IAAEC,WAAU;KAAQ9B,EAAE,mCAAA,CAAA,GACvB,gBAAAwB,OAAA,cAACO,OAAAA;IAAID,WAAU;MACf,gBAAAN,OAAA,cAACQ,mBAAAA;IAAiB3B;;AAGxB;",
6
+ "names": ["Receipt", "Key", "React", "useMemo", "createIntent", "useIntentDispatcher", "useCredentials", "Dialog", "Icon", "List", "ListItem", "useTranslation", "BifurcatedAction", "MANAGE_CREDENTIALS_DIALOG", "CLIENT_PLUGIN", "ManageCredentialsDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "credentials", "useCredentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "Dialog", "Content", "classNames", "Title", "List", "map", "ListItem", "Root", "key", "id", "toHex", "Endcap", "Icon", "size", "Heading", "issuanceDate", "toLocaleString", "div", "className", "BifurcatedAction", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "useTranslation", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "t", "useTranslation", "handleDone", "useCallback", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "handleManageCredentials", "subject", "MANAGE_CREDENTIALS_DIALOG", "blockAlign", "React", "Dialog", "Content", "Title", "classNames", "ns", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "onManageCredentials", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "useTranslation", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "t", "useTranslation", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "UpdateDialog", "part", "options", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "Title", "classNames", "ns", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RECOVER_CODE_DIALOG", "CLIENT_PLUGIN", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "useCallback", "checked", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "Clipboard", "Provider", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "asChild", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key", "Key", "Receipt", "React", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "AlertDialog", "useTranslation", "BifurcatedAction", "RECOVER_SETUP_DIALOG", "CLIENT_PLUGIN", "RecoverySetupDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "LayoutAction", "UpdateDialog", "part", "options", "state", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "div", "BifurcatedAction"]
7
+ }
@@ -8,6 +8,7 @@ var ClientEvents;
8
8
  (function(ClientEvents2) {
9
9
  ClientEvents2.ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);
10
10
  ClientEvents2.SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);
11
+ ClientEvents2.SetupMigration = defineEvent(`${CLIENT_PLUGIN}/event/setup-migration`);
11
12
  ClientEvents2.IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);
12
13
  ClientEvents2.SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);
13
14
  })(ClientEvents || (ClientEvents = {}));
@@ -15,4 +16,4 @@ var ClientEvents;
15
16
  export {
16
17
  ClientEvents
17
18
  };
18
- //# sourceMappingURL=chunk-RGMLBYIF.mjs.map
19
+ //# sourceMappingURL=chunk-OLUST5AO.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/events.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport namespace ClientEvents {\n export const ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);\n export const SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);\n export const IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);\n export const SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,mBAAmB;;UAIXC,eAAAA;gBACFC,cAAcC,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DC,cAAcF,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DE,kBAAkBH,YAAY,GAAGC,aAAAA,yBAAsC;gBACvEG,cAAcJ,YAAY,GAAGC,aAAAA,qBAAkC;AAC9E,GALiBH,iBAAAA,eAAAA,CAAAA,EAAAA;",
6
- "names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "IdentityCreated", "SpacesReady"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport namespace ClientEvents {\n export const ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);\n export const SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);\n export const SetupMigration = defineEvent(`${CLIENT_PLUGIN}/event/setup-migration`);\n export const IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);\n export const SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);\n}\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,mBAAmB;;UAIXC,eAAAA;gBACFC,cAAcC,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DC,cAAcF,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DE,iBAAiBH,YAAY,GAAGC,aAAAA,wBAAqC;gBACrEG,kBAAkBJ,YAAY,GAAGC,aAAAA,yBAAsC;gBACvEI,cAAcL,YAAY,GAAGC,aAAAA,qBAAkC;AAC9E,GANiBH,iBAAAA,eAAAA,CAAAA,EAAAA;",
6
+ "names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "SetupMigration", "IdentityCreated", "SpacesReady"]
7
7
  }
@@ -8,9 +8,10 @@ var ClientCapabilities;
8
8
  (function(ClientCapabilities2) {
9
9
  ClientCapabilities2.Client = defineCapability(`${CLIENT_PLUGIN}/capability/client`);
10
10
  ClientCapabilities2.Schema = defineCapability(`${CLIENT_PLUGIN}/capability/schema`);
11
+ ClientCapabilities2.Migration = defineCapability(`${CLIENT_PLUGIN}/capability/migration`);
11
12
  })(ClientCapabilities || (ClientCapabilities = {}));
12
13
 
13
14
  export {
14
15
  ClientCapabilities
15
16
  };
16
- //# sourceMappingURL=chunk-GHEQL2E6.mjs.map
17
+ //# sourceMappingURL=chunk-XK4HM5M7.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/capabilities.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type Client } from '@dxos/client';\nimport { type ObjectMigration } from '@dxos/client/echo';\nimport { type TypedObject } from '@dxos/echo-schema';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport namespace ClientCapabilities {\n export const Client = defineCapability<Client>(`${CLIENT_PLUGIN}/capability/client`);\n export const Schema = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/schema`);\n export const Migration = defineCapability<ObjectMigration[]>(`${CLIENT_PLUGIN}/capability/migration`);\n}\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,wBAAwB;;UAOhBC,qBAAAA;sBACFC,SAASC,iBAAyB,GAAGC,aAAAA,oBAAiC;sBACtEC,SAASF,iBAAgC,GAAGC,aAAAA,oBAAiC;sBAC7EE,YAAYH,iBAAoC,GAAGC,aAAAA,uBAAoC;AACtG,GAJiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;",
6
+ "names": ["defineCapability", "ClientCapabilities", "Client", "defineCapability", "CLIENT_PLUGIN", "Schema", "Migration"]
7
+ }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-RGMLBYIF.mjs";
3
+ } from "./chunk-OLUST5AO.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-GHEQL2E6.mjs";
6
+ } from "./chunk-XK4HM5M7.mjs";
7
7
  import "./chunk-NHIL4T3L.mjs";
8
8
 
9
9
  // packages/plugins/plugin-client/src/capabilities/client.ts
@@ -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-A7YSVURS.mjs.map
36
+ //# sourceMappingURL=client-UUGITHCW.mjs.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-RGMLBYIF.mjs";
3
+ } from "./chunk-OLUST5AO.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-GHEQL2E6.mjs";
6
+ } from "./chunk-XK4HM5M7.mjs";
7
7
  import {
8
8
  CLIENT_PLUGIN,
9
9
  meta
@@ -15,11 +15,12 @@ import { Capabilities, contributes, defineModule, definePlugin, Events, oneOf }
15
15
  // packages/plugins/plugin-client/src/capabilities/index.ts
16
16
  import { lazy } from "@dxos/app-framework";
17
17
  var AppGraphBuilder = lazy(async () => import("./app-graph-builder-ON64R7SO.mjs"));
18
- var Client = lazy(async () => import("./client-A7YSVURS.mjs"));
19
- var IntentResolver = lazy(async () => import("./intent-resolver-SSM6WXAW.mjs"));
20
- var ReactContext = lazy(async () => import("./react-context-R3SG55F5.mjs"));
21
- var ReactSurface = lazy(async () => import("./react-surface-XGOUHVIH.mjs"));
22
- var Schema = lazy(async () => import("./schema-J4MJIXRP.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"));
23
24
 
24
25
  // packages/plugins/plugin-client/src/translations.ts
25
26
  var translations_default = [
@@ -72,6 +73,14 @@ var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam =
72
73
  ],
73
74
  activate: Schema
74
75
  }),
76
+ defineModule({
77
+ id: `${meta.id}/module/migration`,
78
+ activatesOn: ClientEvents.ClientReady,
79
+ activatesBefore: [
80
+ ClientEvents.SetupMigration
81
+ ],
82
+ activate: Migrations
83
+ }),
75
84
  defineModule({
76
85
  id: `${meta.id}/module/react-context`,
77
86
  activatesOn: Events.Startup,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ClientPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport { Client, AppGraphBuilder, IntentResolver, ReactContext, ReactSurface, Schema } from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\nexport const Schema = lazy(async () => import('./schema'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'recovery setup dialog title': 'Account Recovery',\n 'recovery setup dialog description':\n 'In order to recover your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.',\n 'create passkey label': 'Create Passkey',\n 'create passkey description':\n 'A passkey is a secure and easy to use credential that can be used to recover your account.',\n 'create recovery code label': 'Create Recovery Code',\n 'create recovery code description': 'A recovery code is 12 word phrase representing a private key.',\n 'recovery code dialog title': 'Recovery Code',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\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,eAAeH,KAAK,YAAY,OAAO,8BAAA,CAA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;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOE;MACpBI,UAAUS;IACZ,CAAA;IACAnB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOgB;MACpBV,UAAU,CAACC,YAAYU,eAAe;QAAEV;QAAStB;MAAQ,CAAA;IAC3D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOkB;MACpBZ,UAAU,MAAMa,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
6
- "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "ReactContext", "ReactSurface", "Schema", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "Client", "activatesBefore", "SetupSchema", "Schema", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport {\n Client,\n AppGraphBuilder,\n IntentResolver,\n Migrations,\n ReactContext,\n ReactSurface,\n Schema,\n} from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: Schema,\n }),\n defineModule({\n id: `${meta.id}/module/migration`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupMigration],\n activate: Migrations,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const Migrations = lazy(async () => import('./migrations'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\nexport const Schema = lazy(async () => import('./schema'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'recovery setup dialog title': 'Account Recovery',\n 'recovery setup dialog description':\n 'In order to recover your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.',\n 'create passkey label': 'Create Passkey',\n 'create passkey description':\n 'A passkey is a secure and easy to use credential that can be used to recover your account.',\n 'create recovery code label': 'Create Recovery Code',\n 'create recovery code description': 'A recovery code is 12 word phrase representing a private key.',\n 'recovery code dialog title': 'Recovery Code',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,QAAQC,aAAa;;;ACArF,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,SAASD,KAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,iBAAiBF,KAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,aAAaH,KAAK,YAAY,OAAO,2BAAA,CAAA;AAC3C,IAAMI,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,8BAA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YAAYY,eAAe;QAAEZ;QAAStB;MAAQ,CAAA;IAC3D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
6
+ "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "Migrations", "ReactContext", "ReactSurface", "Schema", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "Client", "activatesBefore", "SetupSchema", "Schema", "SetupMigration", "Migrations", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
7
7
  }
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-RGMLBYIF.mjs";
3
+ } from "./chunk-OLUST5AO.mjs";
4
+ import {
5
+ ClientCapabilities
6
+ } from "./chunk-XK4HM5M7.mjs";
4
7
  import {
5
8
  IDENTITY_DIALOG,
6
9
  JOIN_DIALOG,
7
10
  RECOVER_CODE_DIALOG
8
- } from "./chunk-EYBZZHSM.mjs";
11
+ } from "./chunk-HNJZ74DZ.mjs";
9
12
  import {
10
13
  ClientAction
11
14
  } from "./chunk-7DPLXOMO.mjs";
12
- import {
13
- ClientCapabilities
14
- } from "./chunk-GHEQL2E6.mjs";
15
15
  import "./chunk-NHIL4T3L.mjs";
16
16
 
17
17
  // packages/plugins/plugin-client/src/capabilities/intent-resolver.ts
@@ -167,6 +167,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
167
167
  "'Identity not available'"
168
168
  ]
169
169
  });
170
+ const lookupKey = PublicKey.random();
170
171
  const credential = await navigator.credentials.create({
171
172
  publicKey: {
172
173
  challenge: new Uint8Array(),
@@ -175,7 +176,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
175
176
  name: appName
176
177
  },
177
178
  user: {
178
- id: new TextEncoder().encode(identity.did),
179
+ id: lookupKey.asUint8Array(),
179
180
  name: identity.did,
180
181
  displayName: identity.profile?.displayName ?? ""
181
182
  },
@@ -198,7 +199,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
198
199
  });
199
200
  invariant(credential, "Credential not available", {
200
201
  F: __dxlog_file,
201
- L: 161,
202
+ L: 162,
202
203
  S: void 0,
203
204
  A: [
204
205
  "credential",
@@ -209,7 +210,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
209
210
  const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
210
211
  invariant(client.services.services.IdentityService, "IdentityService not available", {
211
212
  F: __dxlog_file,
212
- L: 166,
213
+ L: 167,
213
214
  S: void 0,
214
215
  A: [
215
216
  "client.services.services.IdentityService",
@@ -217,8 +218,11 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
217
218
  ]
218
219
  });
219
220
  await client.services.services.IdentityService.createRecoveryCredential({
220
- recoveryKey,
221
- algorithm
221
+ data: {
222
+ recoveryKey,
223
+ algorithm,
224
+ lookupKey
225
+ }
222
226
  });
223
227
  }
224
228
  }),
@@ -228,7 +232,7 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
228
232
  const client = context.requestCapability(ClientCapabilities.Client);
229
233
  invariant(client.services.services.IdentityService, "IdentityService not available", {
230
234
  F: __dxlog_file,
231
- L: 175,
235
+ L: 182,
232
236
  S: void 0,
233
237
  A: [
234
238
  "client.services.services.IdentityService",
@@ -243,10 +247,10 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
243
247
  userVerification: "required"
244
248
  }
245
249
  });
246
- const identityDid = new TextDecoder().decode(credential.response.userHandle);
250
+ const lookupKey = PublicKey.from(new Uint8Array(credential.response.userHandle));
247
251
  await client.services.services.IdentityService.recoverIdentity({
248
252
  external: {
249
- identityDid,
253
+ lookupKey,
250
254
  deviceKey,
251
255
  controlFeedKey,
252
256
  signature: Buffer.from(credential.response.signature),
@@ -260,4 +264,4 @@ var intent_resolver_default = ({ context, appName = "Composer", onReset }) => co
260
264
  export {
261
265
  intent_resolver_default as default
262
266
  };
263
- //# sourceMappingURL=intent-resolver-SSM6WXAW.mjs.map
267
+ //# sourceMappingURL=intent-resolver-AIUHL34E.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { IDENTITY_DIALOG, JOIN_DIALOG, RECOVER_CODE_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { ClientAction, type ClientPluginOptions } from '../types';\n\ntype IntentResolverOptions = Pick<ClientPluginOptions, 'onReset'> & {\n context: PluginsContext;\n appName?: string;\n};\n\nexport default ({ context, appName = 'Composer', onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: async () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\n await manager.activate(ClientEvents.IdentityCreated);\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n },\n }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: IDENTITY_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n await onReset?.({ target: data.target });\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n },\n }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVER_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: new TextEncoder().encode(identity.did),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({ recoveryKey, algorithm });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const identityDid = new TextDecoder().decode((credential as any).response.userHandle);\n await client.services.services.IdentityService.recoverIdentity({\n external: {\n identityDid,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n });\n },\n }),\n ]);\n"],
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BiD,gBAAgB;QAC7DC,UAAU;UACRL;UACAN;UACAC;UACAW,WAAWT,OAAOT,KAAMxB,WAAmByB,SAASiB,SAAS;UAC7DC,gBAAgBV,OAAOT,KAAMxB,WAAmByB,SAASmB,cAAc;UACvEC,mBAAmBZ,OAAOT,KAAMxB,WAAmByB,SAASoB,iBAAiB;QAC/E;MACF,CAAA;IACF;EACF,CAAA;CACD;",
6
- "names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "context", "appName", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVER_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "id", "location", "hostname", "user", "TextEncoder", "encode", "did", "displayName", "profile", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "PublicKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "identityDid", "TextDecoder", "decode", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { IDENTITY_DIALOG, JOIN_DIALOG, RECOVER_CODE_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { ClientAction, type ClientPluginOptions } from '../types';\n\ntype IntentResolverOptions = Pick<ClientPluginOptions, 'onReset'> & {\n context: PluginsContext;\n appName?: string;\n};\n\nexport default ({ context, appName = 'Composer', onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: async () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\n await manager.activate(ClientEvents.IdentityCreated);\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n },\n }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: IDENTITY_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n await onReset?.({ target: data.target });\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n },\n }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVER_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const lookupKey = PublicKey.random();\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array(),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n await client.services.services.IdentityService.recoverIdentity({\n external: {\n lookupKey,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n });\n },\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAa1B,IAAA,0BAAe,CAAC,EAAEC,SAASC,UAAU,YAAYC,QAAO,MACtDC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,aAAaC;IACrBC,SAAS,YAAA;AACP,YAAMC,UAAUX,QAAQY,kBAAkBR,aAAaS,aAAa;AACpE,YAAMC,SAASd,QAAQY,kBAAkBG,mBAAmBC,MAAM;AAClE,YAAMC,OAAO,MAAMH,OAAOI,KAAKC,eAAc;AAC7C,YAAMR,QAAQS,SAASC,aAAaC,eAAe;AACnD,aAAO;QAAEL;QAAMM,SAAS;UAACC,aAAaC,oBAA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G,sBAAqB,MAAO,KAAK,UAAU;AAG1F5C,gBAAUhC,OAAOiC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAMtC,OAAOiC,SAASA,SAASK,gBAAgBE,yBAAyB;QACtErC,MAAM;UACJoE;UACAI;UACA5B;QACF;MACF,CAAA;IACF;EACF,CAAA;EACAvD,eAAe;IACbC,QAAQC,aAAamF;IACrBjF,SAAS,YAAA;AACP,YAAMI,SAASd,QAAQY,kBAAkBG,mBAAmBC,MAAM;AAElE8B,gBAAUhC,OAAOiC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAM,EAAEwC,WAAWC,gBAAgBxB,UAAS,IAC1C,MAAMvD,OAAOiC,SAASA,SAASK,gBAAgB0C,yBAAwB;AACzE,YAAM9B,aAAa,MAAMC,UAAUC,YAAYN,IAAI;QACjDQ,WAAW;UACTC,WAAW0B,OAAOT,KAAKjB,WAAW,QAAA;UAClC2B,MAAMvB,SAASC;UACfuB,kBAAkB;QACpB;MACF,CAAA;AACA,YAAMpC,YAAYC,UAAUwB,KAAK,IAAIhB,WAAYN,WAAmBuB,SAASW,UAAU,CAAA;AACvF,YAAMpF,OAAOiC,SAASA,SAASK,gBAAgB+C,gBAAgB;QAC7DC,UAAU;UACRvC;UACA+B;UACAC;UACAQ,WAAWN,OAAOT,KAAMtB,WAAmBuB,SAASc,SAAS;UAC7DC,gBAAgBP,OAAOT,KAAMtB,WAAmBuB,SAASgB,cAAc;UACvEC,mBAAmBT,OAAOT,KAAMtB,WAAmBuB,SAASiB,iBAAiB;QAC/E;MACF,CAAA;IACF;EACF,CAAA;CACD;",
6
+ "names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "context", "appName", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVER_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "id", "location", "hostname", "user", "asUint8Array", "did", "displayName", "profile", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData"]
7
7
  }