@dxos/plugin-client 0.7.4 → 0.7.5-main.937ce75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/lib/browser/chunk-52IJQ35F.mjs +78 -0
  2. package/dist/lib/browser/chunk-52IJQ35F.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-X4QUPYC6.mjs +12 -0
  4. package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +163 -221
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/meta.mjs +1 -5
  9. package/dist/lib/browser/types.mjs +10 -0
  10. package/dist/lib/browser/types.mjs.map +7 -0
  11. package/dist/lib/node/chunk-NFO3ADQC.cjs +98 -0
  12. package/dist/lib/node/chunk-NFO3ADQC.cjs.map +7 -0
  13. package/dist/lib/node/chunk-RUA5KXVW.cjs +35 -0
  14. package/dist/lib/node/chunk-RUA5KXVW.cjs.map +7 -0
  15. package/dist/lib/node/index.cjs +165 -224
  16. package/dist/lib/node/index.cjs.map +3 -3
  17. package/dist/lib/node/meta.cjs +4 -8
  18. package/dist/lib/node/meta.cjs.map +2 -2
  19. package/dist/lib/node/meta.json +1 -1
  20. package/dist/lib/node/types.cjs +32 -0
  21. package/dist/lib/node/types.cjs.map +7 -0
  22. package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs +14 -0
  23. package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +7 -0
  24. package/dist/lib/node-esm/chunk-TI4GNGMM.mjs +79 -0
  25. package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +7 -0
  26. package/dist/lib/node-esm/index.mjs +163 -221
  27. package/dist/lib/node-esm/index.mjs.map +3 -3
  28. package/dist/lib/node-esm/meta.json +1 -1
  29. package/dist/lib/node-esm/meta.mjs +1 -5
  30. package/dist/lib/node-esm/types.mjs +11 -0
  31. package/dist/lib/node-esm/types.mjs.map +7 -0
  32. package/dist/types/src/ClientPlugin.d.ts +2 -35
  33. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  34. package/dist/types/src/components/IdentityDialog.d.ts +1 -0
  35. package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
  36. package/dist/types/src/components/JoinDialog.d.ts +1 -0
  37. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  38. package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -0
  39. package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
  40. package/dist/types/src/meta.d.ts +0 -10
  41. package/dist/types/src/meta.d.ts.map +1 -1
  42. package/dist/types/src/types.d.ts +110 -0
  43. package/dist/types/src/types.d.ts.map +1 -0
  44. package/dist/types/tsconfig.tsbuildinfo +1 -0
  45. package/package.json +22 -13
  46. package/src/ClientPlugin.tsx +111 -200
  47. package/src/components/IdentityDialog.tsx +13 -11
  48. package/src/components/JoinDialog.tsx +13 -19
  49. package/src/components/RecoveryCodeDialog.tsx +3 -1
  50. package/src/meta.ts +0 -14
  51. package/src/types.ts +115 -0
  52. package/dist/lib/browser/chunk-FGUXUNOK.mjs +0 -26
  53. package/dist/lib/browser/chunk-FGUXUNOK.mjs.map +0 -7
  54. package/dist/lib/node/chunk-XYLDQWFV.cjs +0 -51
  55. package/dist/lib/node/chunk-XYLDQWFV.cjs.map +0 -7
  56. package/dist/lib/node-esm/chunk-C6X363FK.mjs +0 -28
  57. package/dist/lib/node-esm/chunk-C6X363FK.mjs.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ClientPlugin.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n LayoutAction,\n parseIntentPlugin,\n resolvePlugin,\n type SurfaceProvides,\n type GraphBuilderProvides,\n type IntentResolverProvides,\n type Plugin,\n type PluginDefinition,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { invariant } from '@dxos/invariant';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { IdentityDialog, JoinDialog, RecoveryCodeDialog, type RecoveryCodeDialogProps } from './components';\nimport meta, { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from './meta';\nimport translations from './translations';\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Used to track app-specific state in spaces.\n */\n appKey: string;\n\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (client: Client) => Promise<void>;\n\n /**\n * Run after the identity has been successfully initialized.\n * Run with client during plugin ready phase.\n */\n onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => Promise<void>;\n};\n\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\n SurfaceProvides &\n TranslationsProvides & {\n client: Client;\n };\n\nexport const parseClientPlugin = (plugin?: Plugin) =>\n (plugin?.provides as any).client instanceof Client ? (plugin as Plugin<ClientPluginProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onClientInitialized,\n onReady,\n onReset,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalsRuntime();\n\n let client: Client;\n let error: unknown = null;\n\n const createDeviceInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return {\n meta,\n initialize: async () => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n client = new Client({ config, ...options });\n\n try {\n await client.initialize();\n await onClientInitialized?.(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 } catch (err) {\n error = err;\n }\n\n return {\n client,\n context: ({ children }) => <ClientProvider client={client}>{children}</ClientProvider>,\n };\n },\n ready: async (plugins) => {\n if (error) {\n throw error;\n }\n\n await onReady?.(client, plugins);\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\n surface: {\n component: ({ data, role, ...rest }) => {\n switch (role) {\n case 'dialog':\n if (data.component === 'dxos.org/plugin/client/IdentityDialog') {\n return (\n <IdentityDialog\n {...(data.subject as IdentityPanelProps)}\n createInvitationUrl={createDeviceInvitationUrl}\n />\n );\n } else if (data.component === 'dxos.org/plugin/client/JoinDialog') {\n return <JoinDialog {...(data.subject as JoinPanelProps)} />;\n } else if (data.component === 'dxos.org/plugin/client/RecoveryCodeDialog') {\n return <RecoveryCodeDialog {...(data.subject as RecoveryCodeDialogProps)} />;\n }\n break;\n }\n\n return null;\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n const id = `${CLIENT_PLUGIN}/open-shell`;\n\n return createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch([\n { plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY },\n ]);\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n testId: 'clientPlugin.openShell',\n },\n },\n ],\n });\n },\n },\n intent: {\n resolver: async (intent) => {\n switch (intent.action) {\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.create',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: intent.data?.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/IdentityDialog',\n dialogBlockAlign: 'start',\n },\n },\n ],\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.share',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RECOVER_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RESET_STORAGE: {\n await onReset?.({ target: intent.data?.target });\n return { data: true };\n }\n\n case ClientAction.CREATE_AGENT: {\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n return { data: true };\n }\n\n case ClientAction.CREATE_RECOVERY_CODE: {\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: 'dxos.org/plugin/client/RecoveryCodeDialog',\n subject: { code: seedphrase },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { ClientAction } from '../meta';\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const dispatch = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE });\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'recoverIdentity' } });\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'deviceInvitation' } });\n }, [dispatch]);\n\n return (\n <Dialog.Content>\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 />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from '../meta';\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const dispatch = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(\n () => dispatch({ plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY }),\n [dispatch],\n );\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n dispatch({\n action: OBSERVABILITY_ACTION,\n data: {\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 <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 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 classNames=''>{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 items-center'>\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 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 'recovery code dialog title': 'Account Recovery',\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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClientPlugin } from './ClientPlugin';\n\nexport default ClientPlugin;\n\nexport * from './ClientPlugin';\n"],
5
- "mappings": ";;;;;;;;AAIA,OAAOA,YAAW;AAElB,SACEC,gBAAAA,eACAC,mBACAC,qBAOK;AACP,SAASC,QAAQC,UAAUC,MAAMC,OAAOC,eAAe;AACvD,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,uBAAkC;AAC3C,SAASC,QAA4BC,sBAAsB;;;ACjB3D,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,cAAcC,2BAA2B;AAClD,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,cAAc;AAClC,SAASC,qBAA8C;AAIhD,IAAMC,iBAAiB,CAACC,UAAAA;AAC7B,QAAMC,WAAWC,oBAAAA;AACjB,QAAMC,SAASC,UAAAA;AAEf,QAAMC,aAAaC,YACjB,MACEL,SAAS;IACPM,QAAQC,aAAaC;IACrBC,MAAM;MACJC,SAAS;MACTC,OAAO;IACT;EACF,CAAA,GACF;IAACX;GAAS;AAGZ,QAAMY,qBAAqBP,YAAY,YAAA;AACrC,UAAMH,OAAOW,MAAK;AAClB,UAAMb,SAAS;MAAEM,QAAQQ,aAAaC;IAAc,CAAA;EACtD,GAAG;IAACf;GAAS;AAEb,QAAMgB,gBAAgBX,YAAY,YAAA;AAChC,UAAMH,OAAOW,MAAK;AAClB,UAAMb,SAAS;MAAEM,QAAQQ,aAAaC;MAAeN,MAAM;QAAEQ,QAAQ;MAAkB;IAAE,CAAA;EAC3F,GAAG;IAACjB;GAAS;AAEb,QAAMkB,wBAAwBb,YAAY,YAAA;AACxC,UAAMH,OAAOW,MAAK;AAClB,UAAMb,SAAS;MAAEM,QAAQQ,aAAaC;MAAeN,MAAM;QAAEQ,QAAQ;MAAmB;IAAE,CAAA;EAC5F,GAAG;IAACjB;GAAS;AAEb,SACE,sBAAA,cAACmB,OAAOC,SAAO,MACb,sBAAA,cAACC,UAAUC,UAAQ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AAS;kBACP;oBACE;sBACEf,QAAQmB,cAAaC;sBACrBzC,MAAM;wBACJ0C,SAAS;wBACT3C,WAAW;wBACX4C,kBAAkB;wBAClBvC,SAAS;0BACPyC,oBAAoB;wBACtB;sBACF;oBACF;;;cAGN;YACF;YAEA,KAAKvB,aAAayB,eAAe;AAC/B,oBAAMpF,UAAU;gBAAEqF,QAAQ7B,OAAOnB,MAAMgD;cAAO,CAAA;AAC9C,qBAAO;gBAAEhD,MAAM;cAAK;YACtB;YAEA,KAAKsB,aAAa2B,cAAc;AAC9BC,wBAAUnG,OAAOoG,SAASA,SAASC,kBAAkB,4BAAA;;;;;;;;;AACrD,oBAAMrG,OAAOoG,SAASA,SAASC,iBAAiBC,YAAY,MAAa;gBAAEC,SAAS;cAAO,CAAA;AAC3F,qBAAO;gBAAEtD,MAAM;cAAK;YACtB;YAEA,KAAKsB,aAAaiC,sBAAsB;AACtCL,wBAAUnG,OAAOoG,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AAEpD,oBAAM,EAAEC,WAAU,IAAK,MAAM1G,OAAOoG,SAASA,SAASK,gBAAgBE,qBAAoB;AAC1F,qBAAO;gBACL1D,MAAM;gBACNoC,SAAS;kBACP;oBACE;sBACEf,QAAQmB,cAAaC;sBACrBzC,MAAM;wBACJ0C,SAAS;wBACTC,kBAAkB;wBAClBgB,YAAY;wBACZC,OAAO;wBACP7D,WAAW;wBACXK,SAAS;0BAAEyD,MAAMJ;wBAAW;sBAC9B;oBACF;;;cAGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;;;AKrTA,IAAA,cAAeK;",
6
- "names": ["React", "LayoutAction", "parseIntentPlugin", "resolvePlugin", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalsRuntime", "invariant", "createExtension", "Client", "ClientProvider", "React", "useCallback", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "IdentityPanel", "IdentityDialog", "props", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "action", "LayoutAction", "SET_LAYOUT", "data", "element", "state", "handleResetStorage", "reset", "ClientAction", "RESET_STORAGE", "handleRecover", "target", "handleJoinNewIdentity", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "React", "useCallback", "LayoutAction", "useIntentDispatcher", "Dialog", "JoinPanel", "JoinDialog", "props", "dispatch", "useIntentDispatcher", "handleCancelResetStorage", "useCallback", "plugin", "CLIENT_PLUGIN", "action", "ClientAction", "SHARE_IDENTITY", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "SET_LAYOUT", "data", "element", "state", "OBSERVABILITY_ACTION", "name", "initialDisposition", "React", "Dialog", "Content", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RecoveryCodeDialog", "code", "t", "useTranslation", "CLIENT_PLUGIN", "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", "CLIENT_PLUGIN", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined", "ClientPlugin", "appKey", "invitationUrl", "window", "location", "origin", "invitationParam", "onClientInitialized", "onReady", "onReset", "options", "registerSignalsRuntime", "error", "createDeviceInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "href", "err", "context", "children", "React", "ClientProvider", "ready", "plugins", "unload", "destroy", "translations", "surface", "component", "data", "role", "rest", "IdentityDialog", "subject", "createInvitationUrl", "JoinDialog", "RecoveryCodeDialog", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "id", "CLIENT_PLUGIN", "createExtension", "filter", "node", "actions", "intent", "dispatch", "action", "ClientAction", "SHARE_IDENTITY", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "CREATE_IDENTITY", "createIdentity", "intents", "OBSERVABILITY_ACTION", "name", "JOIN_IDENTITY", "LayoutAction", "SET_LAYOUT", "element", "dialogBlockAlign", "initialInvitationCode", "initialDisposition", "RECOVER_IDENTITY", "RESET_STORAGE", "target", "CREATE_AGENT", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CREATE_RECOVERY_CODE", "IdentityService", "seedphrase", "createRecoveryPhrase", "dialogType", "state", "code", "ClientPlugin"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n LayoutAction,\n parseIntentPlugin,\n resolvePlugin,\n type PluginDefinition,\n createSurface,\n createIntent,\n createResolver,\n} from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { invariant } from '@dxos/invariant';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { Client, ClientProvider } from '@dxos/react-client';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport {\n IDENTITY_DIALOG,\n IdentityDialog,\n JOIN_DIALOG,\n JoinDialog,\n RECOVER_CODE_DIALOG,\n RecoveryCodeDialog,\n type RecoveryCodeDialogProps,\n} from './components';\nimport meta, { CLIENT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { ClientAction, type ClientPluginOptions, type ClientPluginProvides } from './types';\n\nexport const ClientPlugin = ({\n appKey,\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onClientInitialized,\n onReady,\n onReset,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalsRuntime();\n\n let client: Client;\n let error: unknown = null;\n\n const createDeviceInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return {\n meta,\n initialize: async () => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n client = new Client({ config, ...options });\n\n try {\n await client.initialize();\n await onClientInitialized?.(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 } catch (err) {\n error = err;\n }\n\n return {\n client,\n context: ({ children }) => <ClientProvider client={client}>{children}</ClientProvider>,\n };\n },\n ready: async ({ plugins }) => {\n if (error) {\n throw error;\n }\n\n await onReady?.(client, plugins);\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\n surface: {\n definitions: () => [\n createSurface({\n id: IDENTITY_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: IdentityPanelProps } => data.component === IDENTITY_DIALOG,\n component: ({ data }) => (\n <IdentityDialog {...data.subject} createInvitationUrl={createDeviceInvitationUrl} />\n ),\n }),\n createSurface({\n id: JOIN_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: JoinPanelProps } => data.component === JOIN_DIALOG,\n component: ({ data }) => <JoinDialog {...data.subject} />,\n }),\n createSurface({\n id: RECOVER_CODE_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: RecoveryCodeDialogProps } => data.component === RECOVER_CODE_DIALOG,\n component: ({ data }) => <RecoveryCodeDialog {...data.subject} />,\n }),\n ],\n },\n graph: {\n builder: (plugins) => {\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatchPromise;\n const id = `${CLIENT_PLUGIN}/open-shell`;\n\n return createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id,\n data: async () => {\n await dispatch?.(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n testId: 'clientPlugin.openShell',\n },\n },\n ],\n });\n },\n },\n intent: {\n resolvers: () => [\n createResolver(ClientAction.CreateIdentity, async () => {\n const data = await client.halo.createIdentity();\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n }),\n createResolver(ClientAction.JoinIdentity, async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ShareIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: IDENTITY_DIALOG,\n dialogBlockAlign: 'start',\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n }),\n createResolver(ClientAction.RecoverIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: { initialDisposition: 'recover-identity' } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ResetStorage, async (data) => {\n await onReset?.({ target: data.target });\n return {};\n }),\n createResolver(ClientAction.CreateAgent, async () => {\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n }),\n createResolver(ClientAction.CreateRecoveryCode, async () => {\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: RECOVER_CODE_DIALOG,\n subject: { code: seedphrase },\n }),\n ],\n };\n }),\n ],\n },\n },\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 } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\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\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n 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 return (\n <Dialog.Content>\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 />\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 } 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\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.SetLayout, { element: 'dialog', 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 <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\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 items-center'>\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 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 'recovery code dialog title': 'Account Recovery',\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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClientPlugin } from './ClientPlugin';\n\nexport default ClientPlugin;\n\nexport * from './ClientPlugin';\n"],
5
+ "mappings": ";;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SACEC,gBAAAA,eACAC,mBACAC,eAEAC,eACAC,gBAAAA,eACAC,sBACK;AACP,SAASC,QAAQC,UAAUC,MAAMC,OAAOC,eAAe;AACvD,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,uBAAkC;AAC3C,SAASC,uBAAAA,4BAA2B;AACpC,SAASC,QAAQC,sBAAsB;;;AChBvC,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,cAAcC,cAAcC,2BAA2B;AAChE,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,cAAc;AAClC,SAASC,qBAA8C;AAKhD,IAAMC,kBAAkB,GAAGC,aAAAA;AAE3B,IAAMC,iBAAiB,CAACC,UAAAA;AAC7B,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,SAASC,UAAAA;AAEf,QAAMC,aAAaC,YACjB,MACEL,SACEM,aAAaC,aAAaC,WAAW;IACnCC,SAAS;IACTC,OAAO;EACT,CAAA,CAAA,GAEJ;IAACV;GAAS;AAGZ,QAAMW,qBAAqBN,YAAY,YAAA;AACrC,UAAMH,OAAOU,MAAK;AAClB,UAAMZ,SAASM,aAAaO,aAAaC,YAAY,CAAA;EACvD,GAAG;IAACd;GAAS;AAEb,QAAMe,gBAAgBV,YAAY,YAAA;AAChC,UAAMH,OAAOU,MAAK;AAClB,UAAMZ,SAASM,aAAaO,aAAaC,cAAc;MAAEE,QAAQ;IAAkB,CAAA,CAAA;EACrF,GAAG;IAAChB;GAAS;AAEb,QAAMiB,wBAAwBZ,YAAY,YAAA;AACxC,UAAMH,OAAOU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cAAaqB,cAAaC,WAAW;kBACnCC,SAAS;kBACT1C,WAAWJ;kBACX+C,kBAAkB;gBACpB,CAAA;gBACAxB,cAAaiB,qBAAoBC,WAAW;kBAAEC,MAAM;gBAAiB,CAAA;;YAEzE;UACF,CAAA;UACAN,eAAeZ,aAAa0B,iBAAiB,YAAA;AAC3C,mBAAO;cACLX,SAAS;gBACPhB,cAAaqB,cAAaC,WAAW;kBACnCC,SAAS;kBACT1C,WAAWI;kBACXuC,kBAAkB;kBAClBzC,SAAS;oBAAE2C,oBAAoB;kBAAmB;gBACpD,CAAA;;YAEJ;UACF,CAAA;UACAb,eAAeZ,aAAa2B,cAAc,OAAOhD,SAAAA;AAC/C,kBAAM7C,UAAU;cAAE8F,QAAQjD,KAAKiD;YAAO,CAAA;AACtC,mBAAO,CAAC;UACV,CAAA;UACAhB,eAAeZ,aAAa6B,aAAa,YAAA;AACvCC,sBAAU7F,OAAO8F,SAASA,SAASC,kBAAkB,4BAAA;;;;;;;;;AACrD,kBAAM/F,OAAO8F,SAASA,SAASC,iBAAiBC,YAAY,MAAa;cAAEC,SAAS;YAAO,CAAA;UAC7F,CAAA;UACAtB,eAAeZ,aAAamC,oBAAoB,YAAA;AAC9CL,sBAAU7F,OAAO8F,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AAEpD,kBAAM,EAAEC,WAAU,IAAK,MAAMpG,OAAO8F,SAASA,SAASK,gBAAgBE,qBAAoB;AAC1F,mBAAO;cACLvB,SAAS;gBACPhB,cAAaqB,cAAaC,WAAW;kBACnCC,SAAS;kBACTC,kBAAkB;kBAClBgB,YAAY;kBACZC,OAAO;kBACP5D,WAAWM;kBACXJ,SAAS;oBAAE2D,MAAMJ;kBAAW;gBAC9B,CAAA;;YAEJ;UACF,CAAA;;MAEJ;IACF;EACF;AACF;;;AK5NA,IAAA,cAAeK;",
6
+ "names": ["React", "LayoutAction", "parseIntentPlugin", "resolvePlugin", "createSurface", "createIntent", "createResolver", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalsRuntime", "invariant", "createExtension", "ObservabilityAction", "Client", "ClientProvider", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "createIntent", "LayoutAction", "SetLayout", "element", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "SetLayout", "element", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "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", "CLIENT_PLUGIN", "ClientPlugin", "appKey", "invitationUrl", "window", "location", "origin", "invitationParam", "onClientInitialized", "onReady", "onReset", "options", "registerSignalsRuntime", "client", "error", "createDeviceInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "Client", "reloaded", "on", "halo", "identity", "subscribe", "href", "err", "context", "children", "React", "ClientProvider", "ready", "plugins", "unload", "destroy", "provides", "translations", "surface", "definitions", "createSurface", "id", "IDENTITY_DIALOG", "role", "filter", "data", "component", "IdentityDialog", "subject", "createInvitationUrl", "JOIN_DIALOG", "JoinDialog", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog", "graph", "builder", "dispatch", "resolvePlugin", "parseIntentPlugin", "intent", "dispatchPromise", "CLIENT_PLUGIN", "createExtension", "node", "actions", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "resolvers", "createResolver", "CreateIdentity", "createIdentity", "intents", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "SetLayout", "element", "dialogBlockAlign", "initialInvitationCode", "initialDisposition", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "seedphrase", "createRecoveryPhrase", "dialogType", "state", "code", "ClientPlugin"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":3419,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytes":6572,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytes":6031,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytes":8749,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/plugin-client/src/components/IdentityDialog.tsx","kind":"import-statement","original":"./IdentityDialog"},{"path":"packages/plugins/plugin-client/src/components/JoinDialog.tsx","kind":"import-statement","original":"./JoinDialog"},{"path":"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx","kind":"import-statement","original":"./RecoveryCodeDialog"}],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":2699,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":35879,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-client/src/index.ts":{"bytes":782,"imports":[{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"},{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-client/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":28134},"packages/plugins/plugin-client/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-FGUXUNOK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":9038},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytesInOutput":1642},"packages/plugins/plugin-client/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytesInOutput":1474},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytesInOutput":2729},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":758},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":16316},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-FGUXUNOK.mjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","OBSERVABILITY_ACTION","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":241},"packages/plugins/plugin-client/dist/lib/browser/chunk-FGUXUNOK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1464},"packages/plugins/plugin-client/dist/lib/browser/chunk-FGUXUNOK.mjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","OBSERVABILITY_ACTION","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":1062}},"bytes":1237}}}
1
+ {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":938,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/types.ts":{"bytes":10056,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytes":6849,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-client/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytes":6207,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-client/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytes":8973,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/plugin-client/src/components/IdentityDialog.tsx","kind":"import-statement","original":"./IdentityDialog"},{"path":"packages/plugins/plugin-client/src/components/JoinDialog.tsx","kind":"import-statement","original":"./JoinDialog"},{"path":"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx","kind":"import-statement","original":"./RecoveryCodeDialog"}],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":2699,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":30134,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-client/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-client/src/index.ts":{"bytes":782,"imports":[{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"},{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-client/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":26415},"packages/plugins/plugin-client/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-52IJQ35F.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-X4QUPYC6.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ClientPlugin","default"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":7912},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytesInOutput":1654},"packages/plugins/plugin-client/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytesInOutput":1552},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytesInOutput":2774},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":758},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":15319},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-X4QUPYC6.mjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":161},"packages/plugins/plugin-client/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-52IJQ35F.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-X4QUPYC6.mjs","kind":"import-statement"}],"exports":["ClientAction","parseClientPlugin"],"entryPoint":"packages/plugins/plugin-client/src/types.ts","inputs":{},"bytes":190},"packages/plugins/plugin-client/dist/lib/browser/chunk-52IJQ35F.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5431},"packages/plugins/plugin-client/dist/lib/browser/chunk-52IJQ35F.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-X4QUPYC6.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientAction","parseClientPlugin"],"inputs":{"packages/plugins/plugin-client/src/types.ts":{"bytesInOutput":2064}},"bytes":2261},"packages/plugins/plugin-client/dist/lib/browser/chunk-X4QUPYC6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":447},"packages/plugins/plugin-client/dist/lib/browser/chunk-X4QUPYC6.mjs":{"imports":[],"exports":["CLIENT_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":108}},"bytes":243}}}
@@ -1,13 +1,9 @@
1
1
  import {
2
2
  CLIENT_PLUGIN,
3
- ClientAction,
4
- OBSERVABILITY_ACTION,
5
3
  meta_default
6
- } from "./chunk-FGUXUNOK.mjs";
4
+ } from "./chunk-X4QUPYC6.mjs";
7
5
  export {
8
6
  CLIENT_PLUGIN,
9
- ClientAction,
10
- OBSERVABILITY_ACTION,
11
7
  meta_default as default
12
8
  };
13
9
  //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ ClientAction,
3
+ parseClientPlugin
4
+ } from "./chunk-52IJQ35F.mjs";
5
+ import "./chunk-X4QUPYC6.mjs";
6
+ export {
7
+ ClientAction,
8
+ parseClientPlugin
9
+ };
10
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_NFO3ADQC_exports = {};
20
+ __export(chunk_NFO3ADQC_exports, {
21
+ ClientAction: () => ClientAction,
22
+ parseClientPlugin: () => parseClientPlugin
23
+ });
24
+ module.exports = __toCommonJS(chunk_NFO3ADQC_exports);
25
+ var import_chunk_RUA5KXVW = require("./chunk-RUA5KXVW.cjs");
26
+ var import_echo_schema = require("@dxos/echo-schema");
27
+ var import_react_client = require("@dxos/react-client");
28
+ var IdentitySchema = import_echo_schema.S.Struct({
29
+ identityKey: import_echo_schema.S.instanceOf(import_react_client.PublicKey),
30
+ spaceKey: import_echo_schema.S.optional(import_echo_schema.S.instanceOf(import_react_client.PublicKey)),
31
+ profile: import_echo_schema.S.optional(import_echo_schema.S.Struct({
32
+ displayName: import_echo_schema.S.optional(import_echo_schema.S.String),
33
+ avatarCid: import_echo_schema.S.optional(import_echo_schema.S.String),
34
+ data: import_echo_schema.S.optional(import_echo_schema.S.Record({
35
+ key: import_echo_schema.S.String,
36
+ value: import_echo_schema.S.Any
37
+ }))
38
+ }))
39
+ });
40
+ var CLIENT_ACTION = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/action`;
41
+ var ClientAction;
42
+ (function(ClientAction2) {
43
+ class CreateIdentity extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/create-identity`, {
44
+ input: import_echo_schema.S.Struct({
45
+ displayName: import_echo_schema.S.optional(import_echo_schema.S.String)
46
+ }),
47
+ output: IdentitySchema
48
+ }) {
49
+ }
50
+ ClientAction2.CreateIdentity = CreateIdentity;
51
+ class JoinIdentity extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
52
+ input: import_echo_schema.S.Struct({
53
+ invitationCode: import_echo_schema.S.String
54
+ }),
55
+ output: import_echo_schema.S.Void
56
+ }) {
57
+ }
58
+ ClientAction2.JoinIdentity = JoinIdentity;
59
+ class ShareIdentity extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/share-identity`, {
60
+ input: import_echo_schema.S.Void,
61
+ output: import_echo_schema.S.Void
62
+ }) {
63
+ }
64
+ ClientAction2.ShareIdentity = ShareIdentity;
65
+ class RecoverIdentity extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/recover-identity`, {
66
+ input: import_echo_schema.S.Void,
67
+ output: import_echo_schema.S.Void
68
+ }) {
69
+ }
70
+ ClientAction2.RecoverIdentity = RecoverIdentity;
71
+ class ResetStorage extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/reset-storage`, {
72
+ input: import_echo_schema.S.Struct({
73
+ target: import_echo_schema.S.optional(import_echo_schema.S.String)
74
+ }),
75
+ output: import_echo_schema.S.Void
76
+ }) {
77
+ }
78
+ ClientAction2.ResetStorage = ResetStorage;
79
+ class CreateAgent extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/create-agent`, {
80
+ input: import_echo_schema.S.Void,
81
+ output: import_echo_schema.S.Void
82
+ }) {
83
+ }
84
+ ClientAction2.CreateAgent = CreateAgent;
85
+ class CreateRecoveryCode extends import_echo_schema.S.TaggedClass()(`${CLIENT_ACTION}/create-recovery-code`, {
86
+ input: import_echo_schema.S.Void,
87
+ output: import_echo_schema.S.Void
88
+ }) {
89
+ }
90
+ ClientAction2.CreateRecoveryCode = CreateRecoveryCode;
91
+ })(ClientAction || (ClientAction = {}));
92
+ var parseClientPlugin = (plugin) => (plugin?.provides).client instanceof import_react_client.Client ? plugin : void 0;
93
+ // Annotate the CommonJS export names for ESM import in node:
94
+ 0 && (module.exports = {
95
+ ClientAction,
96
+ parseClientPlugin
97
+ });
98
+ //# sourceMappingURL=chunk-NFO3ADQC.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type GraphBuilderProvides,\n type IntentResolverProvides,\n type Plugin,\n type SurfaceProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { Client, PublicKey, type ClientOptions } from '@dxos/react-client';\n\nimport { CLIENT_PLUGIN } from './meta';\n\n// TODO(wittjosiah): Factor out. Generate?\nconst IdentitySchema = S.Struct({\n identityKey: S.instanceOf(PublicKey),\n spaceKey: S.optional(S.instanceOf(PublicKey)),\n profile: S.optional(\n S.Struct({\n displayName: S.optional(S.String),\n avatarCid: S.optional(S.String),\n data: S.optional(S.Record({ key: S.String, value: S.Any })),\n }),\n ),\n});\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport namespace ClientAction {\n export class CreateIdentity extends S.TaggedClass<CreateIdentity>()(`${CLIENT_ACTION}/create-identity`, {\n input: S.Struct({\n displayName: S.optional(S.String),\n }),\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends S.TaggedClass<JoinIdentity>()(`${CLIENT_ACTION}/join-identity`, {\n input: S.Struct({\n invitationCode: S.String,\n }),\n output: S.Void,\n }) {}\n\n export class ShareIdentity extends S.TaggedClass<ShareIdentity>()(`${CLIENT_ACTION}/share-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RecoverIdentity extends S.TaggedClass<RecoverIdentity>()(`${CLIENT_ACTION}/recover-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class ResetStorage extends S.TaggedClass<ResetStorage>()(`${CLIENT_ACTION}/reset-storage`, {\n input: S.Struct({\n target: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class CreateAgent extends S.TaggedClass<CreateAgent>()(`${CLIENT_ACTION}/create-agent`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreateRecoveryCode extends S.TaggedClass<CreateRecoveryCode>()(`${CLIENT_ACTION}/create-recovery-code`, {\n input: S.Void,\n output: S.Void,\n }) {}\n}\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Used to track app-specific state in spaces.\n */\n appKey: string;\n\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (client: Client) => Promise<void>;\n\n /**\n * Run after the identity has been successfully initialized.\n * Run with client during plugin ready phase.\n */\n onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => Promise<void>;\n};\n\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\n SurfaceProvides &\n TranslationsProvides & {\n client: Client;\n };\n\nexport const parseClientPlugin = (plugin?: Plugin) =>\n (plugin?.provides as any).client instanceof Client ? (plugin as Plugin<ClientPluginProvides>) : undefined;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,yBAAkB;AAClB,0BAAsD;AAKtD,IAAMA,iBAAiBC,qBAAEC,OAAO;EAC9BC,aAAaF,qBAAEG,WAAWC,6BAAAA;EAC1BC,UAAUL,qBAAEM,SAASN,qBAAEG,WAAWC,6BAAAA,CAAAA;EAClCG,SAASP,qBAAEM,SACTN,qBAAEC,OAAO;IACPO,aAAaR,qBAAEM,SAASN,qBAAES,MAAM;IAChCC,WAAWV,qBAAEM,SAASN,qBAAES,MAAM;IAC9BE,MAAMX,qBAAEM,SAASN,qBAAEY,OAAO;MAAEC,KAAKb,qBAAES;MAAQK,OAAOd,qBAAEe;IAAI,CAAA,CAAA;EAC1D,CAAA,CAAA;AAEJ,CAAA;AAEA,IAAMC,gBAAgB,GAAGC,mCAAAA;;UACRC,eAAAA;EACR,MAAMC,uBAAuBnB,qBAAEoB,YAAW,EAAmB,GAAGJ,aAAAA,oBAAiC;IACtGK,OAAOrB,qBAAEC,OAAO;MACdO,aAAaR,qBAAEM,SAASN,qBAAES,MAAM;IAClC,CAAA;IACAa,QAAQvB;EACV,CAAA,EAAA;EAAI;gBALSoB,iBAAAA;EAON,MAAMI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"spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "CLIENT_ACTION", "CLIENT_PLUGIN", "ClientAction", "CreateIdentity", "TaggedClass", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "CreateRecoveryCode", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined"]
7
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_RUA5KXVW_exports = {};
20
+ __export(chunk_RUA5KXVW_exports, {
21
+ CLIENT_PLUGIN: () => CLIENT_PLUGIN,
22
+ meta_default: () => meta_default
23
+ });
24
+ module.exports = __toCommonJS(chunk_RUA5KXVW_exports);
25
+ var CLIENT_PLUGIN = "dxos.org/plugin/client";
26
+ var meta_default = {
27
+ id: CLIENT_PLUGIN,
28
+ name: "Client"
29
+ };
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ CLIENT_PLUGIN,
33
+ meta_default
34
+ });
35
+ //# sourceMappingURL=chunk-RUA5KXVW.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 default {\n id: CLIENT_PLUGIN,\n name: 'Client',\n} satisfies PluginMeta;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,gBAAgB;AAE7B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;",
6
+ "names": ["CLIENT_PLUGIN", "id", "name"]
7
+ }