@dxos/plugin-client 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc
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.
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/ClientPlugin.mjs +10 -0
- package/dist/lib/neutral/ClientPlugin.node.mjs +1029 -0
- package/dist/lib/neutral/ClientPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ClientPlugin.workerd.mjs +16 -0
- package/dist/lib/neutral/ClientPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/DevicesContainer-6MWNUC3I.mjs +262 -0
- package/dist/lib/neutral/DevicesContainer-6MWNUC3I.mjs.map +7 -0
- package/dist/lib/neutral/JoinDialog-2NXAKPLP.mjs +53 -0
- package/dist/lib/neutral/JoinDialog-2NXAKPLP.mjs.map +7 -0
- package/dist/lib/neutral/ProfileContainer-VPX3FPWG.mjs +168 -0
- package/dist/lib/neutral/ProfileContainer-VPX3FPWG.mjs.map +7 -0
- package/dist/lib/neutral/RecoveryCodeDialog-GBRH6ZSA.mjs +59 -0
- package/dist/lib/neutral/RecoveryCodeDialog-GBRH6ZSA.mjs.map +7 -0
- package/dist/lib/neutral/RecoveryCredentialsContainer-IPBGDMIA.mjs +51 -0
- package/dist/lib/neutral/RecoveryCredentialsContainer-IPBGDMIA.mjs.map +7 -0
- package/dist/lib/neutral/ResetDialog-VXOIHJXP.mjs +54 -0
- package/dist/lib/neutral/ResetDialog-VXOIHJXP.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-IK34U2RQ.mjs +117 -0
- package/dist/lib/neutral/app-graph-builder-IK34U2RQ.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +28 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +13 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IYPUD3DP.mjs +62 -0
- package/dist/lib/neutral/chunk-IYPUD3DP.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-JVKCYW5O.mjs +8 -0
- package/dist/lib/neutral/chunk-JVKCYW5O.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ZRVMXLDR.mjs → neutral/chunk-KJGNSH3K.mjs} +6 -3
- package/dist/lib/neutral/chunk-KJGNSH3K.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-VENKFPBC.mjs → neutral/chunk-M37DHX5L.mjs} +36 -16
- package/dist/lib/neutral/chunk-M37DHX5L.mjs.map +7 -0
- package/dist/lib/neutral/chunk-RPMM5NKJ.mjs +175 -0
- package/dist/lib/neutral/chunk-RPMM5NKJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VAIJSQYA.mjs +12 -0
- package/dist/lib/neutral/chunk-VAIJSQYA.mjs.map +7 -0
- package/dist/lib/neutral/client-7JBIGMTX.mjs +62 -0
- package/dist/lib/neutral/client-7JBIGMTX.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +19 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-agent-JV3EM3TV.mjs +26 -0
- package/dist/lib/neutral/create-agent-JV3EM3TV.mjs.map +7 -0
- package/dist/lib/neutral/create-identity-GNGOTH6D.mjs +30 -0
- package/dist/lib/neutral/create-identity-GNGOTH6D.mjs.map +7 -0
- package/dist/lib/neutral/create-passkey-NCP4XA7C.mjs +81 -0
- package/dist/lib/neutral/create-passkey-NCP4XA7C.mjs.map +7 -0
- package/dist/lib/neutral/create-recovery-code-L5LA3GAP.mjs +36 -0
- package/dist/lib/neutral/create-recovery-code-L5LA3GAP.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +23 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/join-identity-3W6PJLKN.mjs +27 -0
- package/dist/lib/neutral/join-identity-3W6PJLKN.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/migrations-7FTW55ER.mjs +23 -0
- package/dist/lib/neutral/migrations-7FTW55ER.mjs.map +7 -0
- package/dist/lib/neutral/navigation-handler-TA4S74CF.mjs +46 -0
- package/dist/lib/neutral/navigation-handler-TA4S74CF.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-E3HB7E2T.mjs +13 -0
- package/dist/lib/neutral/operation-handler-E3HB7E2T.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +12 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +17 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-context-B5LXMHVM.mjs +23 -0
- package/dist/lib/neutral/react-context-B5LXMHVM.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-VSBYVQL7.mjs +60 -0
- package/dist/lib/neutral/react-surface-VSBYVQL7.mjs.map +7 -0
- package/dist/lib/neutral/recover-identity-KL6QY4GI.mjs +26 -0
- package/dist/lib/neutral/recover-identity-KL6QY4GI.mjs.map +7 -0
- package/dist/lib/neutral/redeem-passkey-NDEWSJTM.mjs +66 -0
- package/dist/lib/neutral/redeem-passkey-NDEWSJTM.mjs.map +7 -0
- package/dist/lib/neutral/redeem-token-YLWAVFXD.mjs +29 -0
- package/dist/lib/neutral/redeem-token-YLWAVFXD.mjs.map +7 -0
- package/dist/lib/neutral/reset-storage-OBHEGA6Z.mjs +26 -0
- package/dist/lib/neutral/reset-storage-OBHEGA6Z.mjs.map +7 -0
- package/dist/lib/neutral/schema-defs-6XJAJAQT.mjs +51 -0
- package/dist/lib/neutral/schema-defs-6XJAJAQT.mjs.map +7 -0
- package/dist/lib/neutral/share-identity-JQ5SL3J2.mjs +31 -0
- package/dist/lib/neutral/share-identity-JQ5SL3J2.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +26 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +74 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/ClientPlugin.d.ts +4 -2
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/ClientPlugin.node.d.ts +5 -0
- package/dist/types/src/ClientPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ClientPlugin.test.d.ts +2 -0
- package/dist/types/src/ClientPlugin.test.d.ts.map +1 -0
- package/dist/types/src/ClientPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ClientPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts +6 -7
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +28 -15
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +3 -2
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/navigation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +15 -0
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +21 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +4 -2
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +4 -3
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +3 -2
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/commands/config/index.d.ts +5 -0
- package/dist/types/src/commands/config/index.d.ts.map +1 -0
- package/dist/types/src/commands/config/view.d.ts +5 -0
- package/dist/types/src/commands/config/view.d.ts.map +1 -0
- package/dist/types/src/commands/device/index.d.ts +7 -0
- package/dist/types/src/commands/device/index.d.ts.map +1 -0
- package/dist/types/src/commands/device/info/index.d.ts +2 -0
- package/dist/types/src/commands/device/info/index.d.ts.map +1 -0
- package/dist/types/src/commands/device/info/info.d.ts +7 -0
- package/dist/types/src/commands/device/info/info.d.ts.map +1 -0
- package/dist/types/src/commands/device/info/info.test.d.ts +2 -0
- package/dist/types/src/commands/device/info/info.test.d.ts.map +1 -0
- package/dist/types/src/commands/device/list/index.d.ts +2 -0
- package/dist/types/src/commands/device/list/index.d.ts.map +1 -0
- package/dist/types/src/commands/device/list/list.d.ts +7 -0
- package/dist/types/src/commands/device/list/list.d.ts.map +1 -0
- package/dist/types/src/commands/device/list/list.test.d.ts +2 -0
- package/dist/types/src/commands/device/list/list.test.d.ts.map +1 -0
- package/dist/types/src/commands/device/update/index.d.ts +2 -0
- package/dist/types/src/commands/device/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/device/update/update.d.ts +11 -0
- package/dist/types/src/commands/device/update/update.d.ts.map +1 -0
- package/dist/types/src/commands/device/util.d.ts +16 -0
- package/dist/types/src/commands/device/util.d.ts.map +1 -0
- package/dist/types/src/commands/edge/index.d.ts +5 -0
- package/dist/types/src/commands/edge/index.d.ts.map +1 -0
- package/dist/types/src/commands/edge/status.d.ts +7 -0
- package/dist/types/src/commands/edge/status.d.ts.map +1 -0
- package/dist/types/src/commands/halo/create/create.d.ts +15 -0
- package/dist/types/src/commands/halo/create/create.d.ts.map +1 -0
- package/dist/types/src/commands/halo/create/create.test.d.ts +2 -0
- package/dist/types/src/commands/halo/create/create.test.d.ts.map +1 -0
- package/dist/types/src/commands/halo/create/index.d.ts +2 -0
- package/dist/types/src/commands/halo/create/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/credential/add/add.d.ts +13 -0
- package/dist/types/src/commands/halo/credential/add/add.d.ts.map +1 -0
- package/dist/types/src/commands/halo/credential/add/index.d.ts +2 -0
- package/dist/types/src/commands/halo/credential/add/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/credential/index.d.ts +12 -0
- package/dist/types/src/commands/halo/credential/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/credential/list/index.d.ts +2 -0
- package/dist/types/src/commands/halo/credential/list/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/credential/list/list.d.ts +19 -0
- package/dist/types/src/commands/halo/credential/list/list.d.ts.map +1 -0
- package/dist/types/src/commands/halo/credential/list/list.test.d.ts +2 -0
- package/dist/types/src/commands/halo/credential/list/list.test.d.ts.map +1 -0
- package/dist/types/src/commands/halo/identity/identity.d.ts +7 -0
- package/dist/types/src/commands/halo/identity/identity.d.ts.map +1 -0
- package/dist/types/src/commands/halo/identity/identity.test.d.ts +2 -0
- package/dist/types/src/commands/halo/identity/identity.test.d.ts.map +1 -0
- package/dist/types/src/commands/halo/identity/index.d.ts +2 -0
- package/dist/types/src/commands/halo/identity/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/index.d.ts +3 -0
- package/dist/types/src/commands/halo/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/join/index.d.ts +2 -0
- package/dist/types/src/commands/halo/join/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/join/join.d.ts +8 -0
- package/dist/types/src/commands/halo/join/join.d.ts.map +1 -0
- package/dist/types/src/commands/halo/join/join.test.d.ts +2 -0
- package/dist/types/src/commands/halo/join/join.test.d.ts.map +1 -0
- package/dist/types/src/commands/halo/keys/index.d.ts +2 -0
- package/dist/types/src/commands/halo/keys/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/keys/keys.d.ts +7 -0
- package/dist/types/src/commands/halo/keys/keys.d.ts.map +1 -0
- package/dist/types/src/commands/halo/keys/keys.test.d.ts +2 -0
- package/dist/types/src/commands/halo/keys/keys.test.d.ts.map +1 -0
- package/dist/types/src/commands/halo/recover/index.d.ts +2 -0
- package/dist/types/src/commands/halo/recover/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/recover/recover.d.ts +7 -0
- package/dist/types/src/commands/halo/recover/recover.d.ts.map +1 -0
- package/dist/types/src/commands/halo/recover/recover.test.d.ts +2 -0
- package/dist/types/src/commands/halo/recover/recover.test.d.ts.map +1 -0
- package/dist/types/src/commands/halo/seed/index.d.ts +2 -0
- package/dist/types/src/commands/halo/seed/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/seed/seed.d.ts +7 -0
- package/dist/types/src/commands/halo/seed/seed.d.ts.map +1 -0
- package/dist/types/src/commands/halo/share/index.d.ts +2 -0
- package/dist/types/src/commands/halo/share/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/share/share.d.ts +15 -0
- package/dist/types/src/commands/halo/share/share.d.ts.map +1 -0
- package/dist/types/src/commands/halo/update/index.d.ts +2 -0
- package/dist/types/src/commands/halo/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/halo/update/update.d.ts +11 -0
- package/dist/types/src/commands/halo/update/update.d.ts.map +1 -0
- package/dist/types/src/commands/halo/update/update.test.d.ts +2 -0
- package/dist/types/src/commands/halo/update/update.test.d.ts.map +1 -0
- package/dist/types/src/commands/halo/util.d.ts +13 -0
- package/dist/types/src/commands/halo/util.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts +6 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/profile/create.d.ts +10 -0
- package/dist/types/src/commands/profile/create.d.ts.map +1 -0
- package/dist/types/src/commands/profile/delete.d.ts +8 -0
- package/dist/types/src/commands/profile/delete.d.ts.map +1 -0
- package/dist/types/src/commands/profile/import.d.ts +17 -0
- package/dist/types/src/commands/profile/import.d.ts.map +1 -0
- package/dist/types/src/commands/profile/index.d.ts +19 -0
- package/dist/types/src/commands/profile/index.d.ts.map +1 -0
- package/dist/types/src/commands/profile/inspect.d.ts +13 -0
- package/dist/types/src/commands/profile/inspect.d.ts.map +1 -0
- package/dist/types/src/commands/profile/list.d.ts +6 -0
- package/dist/types/src/commands/profile/list.d.ts.map +1 -0
- package/dist/types/src/commands/profile/reset.d.ts +8 -0
- package/dist/types/src/commands/profile/reset.d.ts.map +1 -0
- package/dist/types/src/commands/profile/util.d.ts +24 -0
- package/dist/types/src/commands/profile/util.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +4 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts +184 -0
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/index.d.ts +2 -0
- package/dist/types/src/containers/DevicesContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/JoinDialog}/JoinDialog.d.ts +0 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +15 -0
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts +2 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts +14 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ProfileContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.d.ts +0 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts +16 -0
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts +4 -0
- package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts +14 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts +2 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts +9 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts +19 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ResetDialog/index.d.ts +4 -0
- package/dist/types/src/containers/ResetDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-agent.d.ts +5 -0
- package/dist/types/src/operations/create-agent.d.ts.map +1 -0
- package/dist/types/src/operations/create-identity.d.ts +5 -0
- package/dist/types/src/operations/create-identity.d.ts.map +1 -0
- package/dist/types/src/operations/create-passkey.d.ts +5 -0
- package/dist/types/src/operations/create-passkey.d.ts.map +1 -0
- package/dist/types/src/operations/create-recovery-code.d.ts +5 -0
- package/dist/types/src/operations/create-recovery-code.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +36 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/join-identity.d.ts +5 -0
- package/dist/types/src/operations/join-identity.d.ts.map +1 -0
- package/dist/types/src/operations/recover-identity.d.ts +5 -0
- package/dist/types/src/operations/recover-identity.d.ts.map +1 -0
- package/dist/types/src/operations/redeem-passkey.d.ts +5 -0
- package/dist/types/src/operations/redeem-passkey.d.ts.map +1 -0
- package/dist/types/src/operations/redeem-token.d.ts +5 -0
- package/dist/types/src/operations/redeem-token.d.ts.map +1 -0
- package/dist/types/src/operations/reset-storage.d.ts +5 -0
- package/dist/types/src/operations/reset-storage.d.ts.map +1 -0
- package/dist/types/src/operations/share-identity.d.ts +5 -0
- package/dist/types/src/operations/share-identity.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/initializeIdentity.d.ts +13 -0
- package/dist/types/src/testing/initializeIdentity.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -48
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +9 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +9 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +36 -31
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +126 -56
- package/src/ClientPlugin.node.ts +33 -0
- package/src/ClientPlugin.test.ts +29 -0
- package/src/ClientPlugin.ts +55 -59
- package/src/ClientPlugin.workerd.ts +16 -0
- package/src/capabilities/app-graph-builder.ts +86 -104
- package/src/capabilities/client.ts +66 -30
- package/src/capabilities/index.ts +14 -10
- package/src/capabilities/migrations.ts +22 -17
- package/src/capabilities/navigation-handler/index.ts +9 -0
- package/src/capabilities/navigation-handler/navigation-handler.ts +64 -0
- package/src/capabilities/node.ts +13 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-context.tsx +17 -13
- package/src/capabilities/react-surface.tsx +52 -49
- package/src/capabilities/schema-defs.ts +52 -25
- package/src/commands/config/index.ts +12 -0
- package/src/commands/config/view.ts +29 -0
- package/src/commands/device/index.ts +14 -0
- package/src/commands/device/info/index.ts +5 -0
- package/src/commands/device/info/info.test.ts +28 -0
- package/src/commands/device/info/info.ts +48 -0
- package/src/commands/device/list/index.ts +5 -0
- package/src/commands/device/list/list.test.ts +30 -0
- package/src/commands/device/list/list.ts +28 -0
- package/src/commands/device/update/index.ts +5 -0
- package/src/commands/device/update/update.ts +68 -0
- package/src/commands/device/util.ts +55 -0
- package/src/commands/edge/index.ts +12 -0
- package/src/commands/edge/status.ts +46 -0
- package/src/commands/halo/create/create.test.ts +56 -0
- package/src/commands/halo/create/create.ts +82 -0
- package/src/commands/halo/create/index.ts +5 -0
- package/src/commands/halo/credential/add/add.ts +97 -0
- package/src/commands/halo/credential/add/index.ts +5 -0
- package/src/commands/halo/credential/index.ts +13 -0
- package/src/commands/halo/credential/list/index.ts +5 -0
- package/src/commands/halo/credential/list/list.test.ts +27 -0
- package/src/commands/halo/credential/list/list.ts +115 -0
- package/src/commands/halo/identity/identity.test.ts +40 -0
- package/src/commands/halo/identity/identity.ts +45 -0
- package/src/commands/halo/identity/index.ts +5 -0
- package/src/commands/halo/index.ts +21 -0
- package/src/commands/halo/join/index.ts +5 -0
- package/src/commands/halo/join/join.test.ts +10 -0
- package/src/commands/halo/join/join.ts +87 -0
- package/src/commands/halo/keys/index.ts +5 -0
- package/src/commands/halo/keys/keys.test.ts +29 -0
- package/src/commands/halo/keys/keys.ts +40 -0
- package/src/commands/halo/recover/index.ts +5 -0
- package/src/commands/halo/recover/recover.test.ts +10 -0
- package/src/commands/halo/recover/recover.ts +44 -0
- package/src/commands/halo/seed/index.ts +5 -0
- package/src/commands/halo/seed/seed.ts +36 -0
- package/src/commands/halo/share/index.ts +5 -0
- package/src/commands/halo/share/share.ts +97 -0
- package/src/commands/halo/update/index.ts +5 -0
- package/src/commands/halo/update/update.test.ts +28 -0
- package/src/commands/halo/update/update.ts +67 -0
- package/src/commands/halo/util.ts +18 -0
- package/src/commands/index.ts +9 -0
- package/src/commands/profile/create.ts +90 -0
- package/src/commands/profile/delete.ts +36 -0
- package/src/commands/profile/import.ts +101 -0
- package/src/commands/profile/index.ts +17 -0
- package/src/commands/profile/inspect.ts +64 -0
- package/src/commands/profile/list.ts +55 -0
- package/src/commands/profile/reset.ts +45 -0
- package/src/commands/profile/util.ts +48 -0
- package/src/components/index.ts +0 -7
- package/src/constants.ts +9 -0
- package/src/{components → containers/DevicesContainer}/DevicesContainer.stories.tsx +15 -10
- package/src/{components → containers/DevicesContainer}/DevicesContainer.tsx +85 -90
- package/src/containers/DevicesContainer/index.ts +5 -0
- package/src/containers/JoinDialog/JoinDialog.stories.tsx +43 -0
- package/src/containers/JoinDialog/JoinDialog.tsx +56 -0
- package/src/containers/JoinDialog/index.ts +5 -0
- package/src/{components → containers/ProfileContainer}/ProfileContainer.stories.tsx +4 -4
- package/src/{components → containers/ProfileContainer}/ProfileContainer.tsx +66 -60
- package/src/containers/ProfileContainer/index.ts +5 -0
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.stories.tsx +4 -4
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.tsx +28 -27
- package/src/containers/RecoveryCodeDialog/index.ts +8 -0
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.tsx +47 -0
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx +66 -0
- package/src/containers/RecoveryCredentialsContainer/index.ts +5 -0
- package/src/containers/ResetDialog/ResetDialog.stories.tsx +73 -0
- package/src/containers/ResetDialog/ResetDialog.tsx +52 -0
- package/src/containers/ResetDialog/index.ts +8 -0
- package/src/containers/index.ts +15 -0
- package/src/index.ts +2 -5
- package/src/meta.ts +4 -3
- package/src/operations/create-agent.ts +26 -0
- package/src/operations/create-identity.ts +29 -0
- package/src/operations/create-passkey.ts +88 -0
- package/src/operations/create-recovery-code.ts +34 -0
- package/src/operations/definitions.ts +107 -0
- package/src/operations/index.ts +20 -0
- package/src/operations/join-identity.ts +28 -0
- package/src/operations/recover-identity.ts +28 -0
- package/src/operations/redeem-passkey.ts +85 -0
- package/src/operations/redeem-token.ts +31 -0
- package/src/operations/reset-storage.ts +27 -0
- package/src/operations/share-identity.ts +26 -0
- package/src/plugin.ts +11 -0
- package/src/testing/index.ts +8 -0
- package/src/testing/initializeIdentity.ts +24 -0
- package/src/translations.ts +57 -44
- package/src/types/capabilities.ts +16 -0
- package/src/types/events.ts +15 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +28 -20
- package/dist/lib/browser/app-graph-builder-KCCH45OW.mjs +0 -124
- package/dist/lib/browser/app-graph-builder-KCCH45OW.mjs.map +0 -7
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs +0 -19
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs.map +0 -7
- package/dist/lib/browser/chunk-N5UR2HOE.mjs +0 -18
- package/dist/lib/browser/chunk-N5UR2HOE.mjs.map +0 -7
- package/dist/lib/browser/chunk-RDIG75CA.mjs +0 -110
- package/dist/lib/browser/chunk-RDIG75CA.mjs.map +0 -7
- package/dist/lib/browser/chunk-SCNW6KMG.mjs +0 -686
- package/dist/lib/browser/chunk-SCNW6KMG.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZRVMXLDR.mjs.map +0 -7
- package/dist/lib/browser/client-O7U3MQ6J.mjs +0 -43
- package/dist/lib/browser/client-O7U3MQ6J.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -156
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-SPZU2X4O.mjs +0 -305
- package/dist/lib/browser/intent-resolver-SPZU2X4O.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/migrations-FQYDKKYO.mjs +0 -23
- package/dist/lib/browser/migrations-FQYDKKYO.mjs.map +0 -7
- package/dist/lib/browser/react-context-QCKETSRF.mjs +0 -24
- package/dist/lib/browser/react-context-QCKETSRF.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SLGNIGL6.mjs +0 -66
- package/dist/lib/browser/react-surface-SLGNIGL6.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-SPPWTZRH.mjs +0 -25
- package/dist/lib/browser/schema-defs-SPPWTZRH.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/app-graph-builder-B5IOYV4W.mjs +0 -125
- package/dist/lib/node-esm/app-graph-builder-B5IOYV4W.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6ANOJ7ZM.mjs +0 -19
- package/dist/lib/node-esm/chunk-6ANOJ7ZM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs +0 -20
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QT3EQXDU.mjs +0 -17
- package/dist/lib/node-esm/chunk-QT3EQXDU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RHMYXMKB.mjs +0 -687
- package/dist/lib/node-esm/chunk-RHMYXMKB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VENKFPBC.mjs.map +0 -7
- package/dist/lib/node-esm/client-6MTNT7M6.mjs +0 -44
- package/dist/lib/node-esm/client-6MTNT7M6.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -157
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4HEQTR5X.mjs +0 -306
- package/dist/lib/node-esm/intent-resolver-4HEQTR5X.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/migrations-2D5ENOAB.mjs +0 -24
- package/dist/lib/node-esm/migrations-2D5ENOAB.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-ZVUDFBCH.mjs +0 -25
- package/dist/lib/node-esm/react-context-ZVUDFBCH.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-FFOAE7HL.mjs +0 -67
- package/dist/lib/node-esm/react-surface-FFOAE7HL.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-FIV7SETB.mjs +0 -26
- package/dist/lib/node-esm/schema-defs-FIV7SETB.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- package/dist/types/src/capabilities/capabilities.d.ts +0 -9
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -8
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/DevicesContainer.d.ts.map +0 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts +0 -227
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
- package/dist/types/src/components/ProfileContainer.d.ts.map +0 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts +0 -60
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +0 -62
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +0 -60
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResetDialog.d.ts +0 -7
- package/dist/types/src/components/ResetDialog.d.ts.map +0 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +0 -65
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -8
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/intent-resolver.ts +0 -251
- package/src/components/JoinDialog.tsx +0 -53
- package/src/components/RecoveryCredentialsContainer.stories.tsx +0 -42
- package/src/components/RecoveryCredentialsContainer.tsx +0 -70
- package/src/components/ResetDialog.stories.tsx +0 -52
- package/src/components/ResetDialog.tsx +0 -49
- package/src/events.ts +0 -15
- /package/dist/lib/{browser/types/index.mjs.map → neutral/ClientPlugin.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/DevicesContainer}/DevicesContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/ProfileContainer}/ProfileContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.d.ts +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Options from '@effect/cli/Options';
|
|
7
|
+
import * as Console from 'effect/Console';
|
|
8
|
+
import * as Duration from 'effect/Duration';
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
import * as Option from 'effect/Option';
|
|
11
|
+
|
|
12
|
+
import { CommandConfig, Common, FormBuilder, getSpace, printList } from '@dxos/cli-util';
|
|
13
|
+
import { ClientService } from '@dxos/client';
|
|
14
|
+
import type { Credential } from '@dxos/client/halo';
|
|
15
|
+
import { type Key } from '@dxos/echo';
|
|
16
|
+
|
|
17
|
+
const mapCredentials = (credentials: Credential[]) => {
|
|
18
|
+
return credentials.map((credential) => ({
|
|
19
|
+
id: credential.id?.toHex() ?? '<unknown>',
|
|
20
|
+
issuer: credential.issuer?.toHex() ?? '<unknown>',
|
|
21
|
+
subject: credential.subject?.id?.toHex() ?? '<unknown>',
|
|
22
|
+
type: credential.subject.assertion['@type'],
|
|
23
|
+
assertion: credential.subject.assertion,
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const printCredential = (credential: Credential) => {
|
|
28
|
+
const type = credential.subject.assertion['@type'] ?? '<unknown>';
|
|
29
|
+
return FormBuilder.make({ title: type }).pipe(
|
|
30
|
+
FormBuilder.option('id', Option.fromNullable(credential.id?.truncate())),
|
|
31
|
+
FormBuilder.option('issuer', Option.fromNullable(credential.issuer?.truncate())),
|
|
32
|
+
FormBuilder.option('subject', Option.fromNullable(credential.subject?.id?.truncate())),
|
|
33
|
+
FormBuilder.build,
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const handler = Effect.fn(function* ({
|
|
38
|
+
type,
|
|
39
|
+
spaceId,
|
|
40
|
+
timeout,
|
|
41
|
+
delay,
|
|
42
|
+
}: {
|
|
43
|
+
type: Option.Option<string>;
|
|
44
|
+
spaceId: Option.Option<Key.SpaceId>;
|
|
45
|
+
timeout: number;
|
|
46
|
+
delay: number;
|
|
47
|
+
}) {
|
|
48
|
+
const { json } = yield* CommandConfig;
|
|
49
|
+
const client = yield* ClientService;
|
|
50
|
+
let credentials: Credential[];
|
|
51
|
+
|
|
52
|
+
if (Option.isSome(spaceId)) {
|
|
53
|
+
// If space ID was provided, get credentials from that space.
|
|
54
|
+
const space = yield* getSpace(spaceId.value);
|
|
55
|
+
credentials = yield* Effect.tryPromise(() => space.internal.getCredentials());
|
|
56
|
+
} else {
|
|
57
|
+
// Get credentials from HALO
|
|
58
|
+
const identity = client.halo.identity;
|
|
59
|
+
if (!identity) {
|
|
60
|
+
if (json) {
|
|
61
|
+
yield* Console.log(JSON.stringify({ error: 'Profile not initialized' }, null, 2));
|
|
62
|
+
} else {
|
|
63
|
+
yield* Console.log('Profile not initialized.');
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Wait for at least one credential
|
|
69
|
+
const latch = yield* Effect.makeLatch();
|
|
70
|
+
const subscription = client.halo.credentials.subscribe((creds) => {
|
|
71
|
+
if (creds.length > 0) {
|
|
72
|
+
Effect.runSync(latch.open);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
yield* latch.await.pipe(
|
|
77
|
+
Effect.timeout(Duration.millis(timeout)),
|
|
78
|
+
Effect.catchAll(() => Effect.void),
|
|
79
|
+
Effect.ensuring(
|
|
80
|
+
Effect.sync(() => {
|
|
81
|
+
subscription.unsubscribe();
|
|
82
|
+
}),
|
|
83
|
+
),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// Wait a bit more to ensure all credentials are loaded
|
|
87
|
+
yield* Effect.sleep(Duration.millis(delay));
|
|
88
|
+
|
|
89
|
+
credentials = client.halo.queryCredentials({ type: Option.getOrUndefined(type) });
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (json) {
|
|
93
|
+
yield* Console.log(JSON.stringify(mapCredentials(credentials), null, 2));
|
|
94
|
+
} else {
|
|
95
|
+
const formatted = credentials.map(printCredential);
|
|
96
|
+
yield* Console.log(printList(formatted));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export const list = Command.make(
|
|
101
|
+
'list',
|
|
102
|
+
{
|
|
103
|
+
type: Options.text('type').pipe(Options.withDescription('Filter by credential type.'), Options.optional),
|
|
104
|
+
spaceId: Common.spaceId.pipe(Options.withDescription('Space ID to show credentials from.'), Options.optional),
|
|
105
|
+
timeout: Options.integer('timeout').pipe(
|
|
106
|
+
Options.withDescription('Time in milliseconds to wait for at least one credential before listing.'),
|
|
107
|
+
Options.withDefault(500),
|
|
108
|
+
),
|
|
109
|
+
delay: Options.integer('delay').pipe(
|
|
110
|
+
Options.withDescription('Delay in milliseconds before listing.'),
|
|
111
|
+
Options.withDefault(250),
|
|
112
|
+
),
|
|
113
|
+
},
|
|
114
|
+
handler,
|
|
115
|
+
).pipe(Command.withDescription('List HALO credentials.'));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
9
|
+
import { ClientService } from '@dxos/client';
|
|
10
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
|
+
|
|
12
|
+
import { handler } from './identity';
|
|
13
|
+
|
|
14
|
+
describe('halo identity', () => {
|
|
15
|
+
it('should log if identity is not initialized', () =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
yield* handler();
|
|
18
|
+
const logger = yield* TestConsole.TestConsole;
|
|
19
|
+
const logs = logger.logs;
|
|
20
|
+
expect(logs).toHaveLength(1);
|
|
21
|
+
expect(TestConsole.extractJsonString(logs[0])).toEqual(
|
|
22
|
+
JSON.stringify({ error: 'Identity not initialized' }, null, 2),
|
|
23
|
+
);
|
|
24
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
25
|
+
|
|
26
|
+
it('should print identity if initialized', () =>
|
|
27
|
+
Effect.gen(function* () {
|
|
28
|
+
const client = yield* ClientService;
|
|
29
|
+
yield* Effect.tryPromise(() => client.halo.createIdentity({ displayName: 'Test' }));
|
|
30
|
+
yield* handler();
|
|
31
|
+
const logger = yield* TestConsole.TestConsole;
|
|
32
|
+
const logs = logger.logs;
|
|
33
|
+
expect(logs).toHaveLength(1);
|
|
34
|
+
const parsedIdentity = TestConsole.parseJson(logs[0]);
|
|
35
|
+
expect(parsedIdentity).toEqual({
|
|
36
|
+
identityKey: client.halo.identity.get()?.identityKey.toHex(),
|
|
37
|
+
displayName: client.halo.identity.get()?.profile?.displayName,
|
|
38
|
+
});
|
|
39
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
40
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Console from 'effect/Console';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
|
|
9
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
10
|
+
import { print } from '@dxos/cli-util';
|
|
11
|
+
import { ClientService } from '@dxos/client';
|
|
12
|
+
|
|
13
|
+
import { printIdentity } from '../util';
|
|
14
|
+
|
|
15
|
+
export const handler = Effect.fn(function* () {
|
|
16
|
+
const { json } = yield* CommandConfig;
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
const identity = client.halo.identity.get();
|
|
19
|
+
if (!identity) {
|
|
20
|
+
if (json) {
|
|
21
|
+
yield* Console.log(JSON.stringify({ error: 'Identity not initialized' }, null, 2));
|
|
22
|
+
} else {
|
|
23
|
+
yield* Console.log('Identity not initialized.');
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
if (json) {
|
|
27
|
+
yield* Console.log(
|
|
28
|
+
JSON.stringify(
|
|
29
|
+
{
|
|
30
|
+
identityKey: identity.identityKey.toHex(),
|
|
31
|
+
displayName: identity.profile?.displayName,
|
|
32
|
+
},
|
|
33
|
+
null,
|
|
34
|
+
2,
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
yield* Console.log(print(printIdentity(identity)));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const identity = Command.make('identity', {}, handler).pipe(
|
|
44
|
+
Command.withDescription('Get the current identity.'),
|
|
45
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { create } from './create';
|
|
8
|
+
import { credential } from './credential';
|
|
9
|
+
import { identity } from './identity';
|
|
10
|
+
// TODO(wittjosiah): Omitted currently due to p2p networking not working in bun.
|
|
11
|
+
// import { join } from './join';
|
|
12
|
+
import { keys } from './keys';
|
|
13
|
+
import { recover } from './recover';
|
|
14
|
+
import { seed } from './seed';
|
|
15
|
+
// import { share } from './share';
|
|
16
|
+
import { update } from './update';
|
|
17
|
+
|
|
18
|
+
export const halo: Command.Command<any, any, any, any> = Command.make('halo').pipe(
|
|
19
|
+
Command.withDescription('Manage HALO identity.'),
|
|
20
|
+
Command.withSubcommands([create, credential, identity, keys, recover, seed, update]),
|
|
21
|
+
);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Args from '@effect/cli/Args';
|
|
6
|
+
import * as Command from '@effect/cli/Command';
|
|
7
|
+
import * as Prompt from '@effect/cli/Prompt';
|
|
8
|
+
import * as Console from 'effect/Console';
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
import * as Match from 'effect/Match';
|
|
11
|
+
|
|
12
|
+
import { CommandConfig, print } from '@dxos/cli-util';
|
|
13
|
+
import { type Client, ClientService } from '@dxos/client';
|
|
14
|
+
import { type AuthenticatingInvitationObservable, Invitation, InvitationEncoder } from '@dxos/client/invitations';
|
|
15
|
+
import { invariant } from '@dxos/invariant';
|
|
16
|
+
|
|
17
|
+
import { printIdentity } from '../util';
|
|
18
|
+
|
|
19
|
+
export const join = Command.make(
|
|
20
|
+
'join',
|
|
21
|
+
{
|
|
22
|
+
invitationCode: Args.text({ name: 'invitationCode' }).pipe(Args.withDescription('The invitation code.')),
|
|
23
|
+
},
|
|
24
|
+
Effect.fn(function* ({ invitationCode }) {
|
|
25
|
+
const { json } = yield* CommandConfig;
|
|
26
|
+
const client = yield* ClientService;
|
|
27
|
+
// TODO(wittjosiah): How to surface this error to the user cleanly?
|
|
28
|
+
invariant(!client.halo.identity.get(), 'Identity already exists');
|
|
29
|
+
|
|
30
|
+
const identity = yield* sendInvitation({ client, invitationCode });
|
|
31
|
+
if (!identity) {
|
|
32
|
+
if (json) {
|
|
33
|
+
yield* Console.log(JSON.stringify({ error: 'Failed to join identity' }, null, 2));
|
|
34
|
+
} else {
|
|
35
|
+
yield* Console.log('Failed to join identity');
|
|
36
|
+
}
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (json) {
|
|
41
|
+
yield* Console.log(
|
|
42
|
+
JSON.stringify(
|
|
43
|
+
{
|
|
44
|
+
identityKey: identity.identityKey.toHex(),
|
|
45
|
+
displayName: identity.profile?.displayName,
|
|
46
|
+
},
|
|
47
|
+
null,
|
|
48
|
+
2,
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
} else {
|
|
52
|
+
yield* Console.log(print(printIdentity(identity)));
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
).pipe(Command.withDescription('Join an existing identity using an invitation code.'));
|
|
56
|
+
|
|
57
|
+
const sendInvitation = Effect.fn(function* ({
|
|
58
|
+
client,
|
|
59
|
+
invitationCode: encoded,
|
|
60
|
+
}: {
|
|
61
|
+
client: Client;
|
|
62
|
+
invitationCode: string;
|
|
63
|
+
}) {
|
|
64
|
+
if (encoded.startsWith('http') || encoded.startsWith('socket')) {
|
|
65
|
+
const searchProps = new URL(encoded).searchParams;
|
|
66
|
+
encoded = searchProps.get('deviceInvitationCode') ?? encoded;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const invitationCode = InvitationEncoder.decode(encoded);
|
|
70
|
+
const invitation = client.halo.join(invitationCode);
|
|
71
|
+
yield* waitForState(invitation, Invitation.State.READY_FOR_AUTHENTICATION);
|
|
72
|
+
|
|
73
|
+
const authCode = yield* Prompt.text({ message: 'Enter the authentication code' }).pipe(Prompt.run);
|
|
74
|
+
yield* Effect.tryPromise(() => invitation.authenticate(authCode));
|
|
75
|
+
yield* waitForState(invitation, Invitation.State.SUCCESS);
|
|
76
|
+
return client.halo.identity.get();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const waitForState = (invitation: AuthenticatingInvitationObservable, state: Invitation.State) =>
|
|
80
|
+
Effect.gen(function* () {
|
|
81
|
+
const latch = yield* Effect.makeLatch();
|
|
82
|
+
const subscription = invitation.subscribe((invitation) => {
|
|
83
|
+
Match.value(invitation.state).pipe(Match.when(state, () => Effect.runSync(latch.open)));
|
|
84
|
+
});
|
|
85
|
+
yield* latch.await;
|
|
86
|
+
subscription.unsubscribe();
|
|
87
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
9
|
+
import { ClientService } from '@dxos/client';
|
|
10
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
|
+
|
|
12
|
+
import { handler } from './keys';
|
|
13
|
+
|
|
14
|
+
describe('halo keys', () => {
|
|
15
|
+
it('should show HALO keys', () =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
yield* Effect.tryPromise(() => client.halo.createIdentity());
|
|
19
|
+
yield* handler();
|
|
20
|
+
const logger = yield* TestConsole.TestConsole;
|
|
21
|
+
const logs = logger.logs;
|
|
22
|
+
expect(logs).toHaveLength(1);
|
|
23
|
+
const parsed = TestConsole.parseJson<{ identityKey?: string; deviceKey?: string }>(logs[0]);
|
|
24
|
+
expect(parsed).toHaveProperty('identityKey');
|
|
25
|
+
expect(parsed).toHaveProperty('deviceKey');
|
|
26
|
+
expect(parsed.identityKey).toBe(client.halo.identity.get()?.identityKey.toHex());
|
|
27
|
+
expect(parsed.deviceKey).toBe(client.halo.device?.deviceKey.toHex());
|
|
28
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
29
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Console from 'effect/Console';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
|
|
10
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
11
|
+
import { FormBuilder, print } from '@dxos/cli-util';
|
|
12
|
+
import { ClientService } from '@dxos/client';
|
|
13
|
+
|
|
14
|
+
export const handler = Effect.fn(function* () {
|
|
15
|
+
const { json } = yield* CommandConfig;
|
|
16
|
+
const client = yield* ClientService;
|
|
17
|
+
const identity = client.halo.identity.get();
|
|
18
|
+
const device = client.halo.device;
|
|
19
|
+
|
|
20
|
+
if (json) {
|
|
21
|
+
yield* Console.log(
|
|
22
|
+
JSON.stringify(
|
|
23
|
+
{
|
|
24
|
+
identityKey: identity?.identityKey.toHex(),
|
|
25
|
+
deviceKey: device?.deviceKey.toHex(),
|
|
26
|
+
},
|
|
27
|
+
null,
|
|
28
|
+
2,
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
} else {
|
|
32
|
+
const builder = FormBuilder.make({ title: 'HALO Keys' }).pipe(
|
|
33
|
+
FormBuilder.option('identityKey', Option.fromNullable(identity?.identityKey.truncate())),
|
|
34
|
+
FormBuilder.option('deviceKey', Option.fromNullable(device?.deviceKey.truncate())),
|
|
35
|
+
);
|
|
36
|
+
yield* Console.log(print(FormBuilder.build(builder)));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const keys = Command.make('keys', {}, handler).pipe(Command.withDescription('Show HALO keys.'));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Args from '@effect/cli/Args';
|
|
6
|
+
import * as Command from '@effect/cli/Command';
|
|
7
|
+
import * as Console from 'effect/Console';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
|
|
10
|
+
import { CommandConfig, print } from '@dxos/cli-util';
|
|
11
|
+
import { ClientService } from '@dxos/client';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
13
|
+
|
|
14
|
+
import { printIdentity } from '../util';
|
|
15
|
+
|
|
16
|
+
export const recover = Command.make(
|
|
17
|
+
'recover',
|
|
18
|
+
{
|
|
19
|
+
recoveryCode: Args.text({ name: 'recoveryCode' }).pipe(Args.withDescription('The recovery code seed phrase.')),
|
|
20
|
+
},
|
|
21
|
+
Effect.fn(function* ({ recoveryCode }) {
|
|
22
|
+
const { json } = yield* CommandConfig;
|
|
23
|
+
const client = yield* ClientService;
|
|
24
|
+
// TODO(wittjosiah): How to surface this error to the user cleanly?
|
|
25
|
+
invariant(!client.halo.identity.get(), 'Identity already exists');
|
|
26
|
+
|
|
27
|
+
const identity = yield* Effect.tryPromise(() => client.halo.recoverIdentity({ recoveryCode }));
|
|
28
|
+
if (json) {
|
|
29
|
+
yield* Console.log(
|
|
30
|
+
JSON.stringify(
|
|
31
|
+
{
|
|
32
|
+
identityKey: identity.identityKey.toHex(),
|
|
33
|
+
displayName: identity.profile?.displayName,
|
|
34
|
+
},
|
|
35
|
+
null,
|
|
36
|
+
2,
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
} else {
|
|
40
|
+
yield* Console.log('Identity recovered successfully');
|
|
41
|
+
yield* Console.log(print(printIdentity(identity)));
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
).pipe(Command.withDescription('Recover an existing identity using a recovery code.'));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Console from 'effect/Console';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
|
|
9
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
10
|
+
import { ClientService } from '@dxos/client';
|
|
11
|
+
|
|
12
|
+
export const handler = Effect.fn(function* () {
|
|
13
|
+
const { json } = yield* CommandConfig;
|
|
14
|
+
const client = yield* ClientService;
|
|
15
|
+
const identityService = client.services.services.IdentityService;
|
|
16
|
+
if (!identityService) {
|
|
17
|
+
if (json) {
|
|
18
|
+
yield* Console.log(JSON.stringify({ error: 'IdentityService not found' }, null, 2));
|
|
19
|
+
} else {
|
|
20
|
+
yield* Console.log('IdentityService not found.');
|
|
21
|
+
}
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const result = yield* Effect.tryPromise(() => identityService.createRecoveryCredential({}));
|
|
26
|
+
|
|
27
|
+
if (json) {
|
|
28
|
+
yield* Console.log(JSON.stringify({ recoveryCode: result.recoveryCode }, null, 2));
|
|
29
|
+
} else {
|
|
30
|
+
yield* Console.log(result.recoveryCode);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const seed = Command.make('seed', {}, handler).pipe(
|
|
35
|
+
Command.withDescription('Generate a seedphrase that can be used for identity recovery.'),
|
|
36
|
+
);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Options from '@effect/cli/Options';
|
|
7
|
+
import * as Console from 'effect/Console';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
|
|
10
|
+
import { CommandConfig, copyToClipboard, openBrowser, print } from '@dxos/cli-util';
|
|
11
|
+
import { FormBuilder } from '@dxos/cli-util';
|
|
12
|
+
import { ClientService } from '@dxos/client';
|
|
13
|
+
import { Invitation, InvitationEncoder, hostInvitation } from '@dxos/client/invitations';
|
|
14
|
+
|
|
15
|
+
export const handler = Effect.fn(function* ({
|
|
16
|
+
lifetime,
|
|
17
|
+
open,
|
|
18
|
+
host,
|
|
19
|
+
}: {
|
|
20
|
+
lifetime: number;
|
|
21
|
+
open: boolean;
|
|
22
|
+
host: string;
|
|
23
|
+
}) {
|
|
24
|
+
const { json } = yield* CommandConfig;
|
|
25
|
+
const client = yield* ClientService;
|
|
26
|
+
|
|
27
|
+
// Always use persistent and delegated (auth required) due to P2P limitations
|
|
28
|
+
const observable = client.halo.share({
|
|
29
|
+
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
30
|
+
persistent: true,
|
|
31
|
+
lifetime,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const invitation = yield* hostInvitation({
|
|
35
|
+
observable,
|
|
36
|
+
callbacks: {
|
|
37
|
+
onConnecting: (invitation) =>
|
|
38
|
+
Effect.gen(function* () {
|
|
39
|
+
const invitationCode = InvitationEncoder.encode(invitation);
|
|
40
|
+
const authCode = invitation.authCode!;
|
|
41
|
+
|
|
42
|
+
// Copy auth code to clipboard
|
|
43
|
+
yield* copyToClipboard(authCode).pipe(Effect.catchAll(() => Effect.void));
|
|
44
|
+
|
|
45
|
+
if (!json) {
|
|
46
|
+
yield* Console.log(`\nSecret: ${authCode} (copied to clipboard)\n`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (open) {
|
|
50
|
+
const url = new URL(host);
|
|
51
|
+
url.searchParams.append('deviceInvitationCode', invitationCode);
|
|
52
|
+
yield* openBrowser(url.toString()).pipe(Effect.catchAll(() => Effect.void));
|
|
53
|
+
} else if (!json) {
|
|
54
|
+
yield* Console.log(`\nInvitation: ${invitationCode}\n`);
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
waitForSuccess: true,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (json) {
|
|
62
|
+
yield* Console.log(
|
|
63
|
+
JSON.stringify(
|
|
64
|
+
{
|
|
65
|
+
invitationCode: InvitationEncoder.encode(invitation),
|
|
66
|
+
authCode: invitation.authCode,
|
|
67
|
+
state: Invitation.State[invitation.state],
|
|
68
|
+
},
|
|
69
|
+
null,
|
|
70
|
+
2,
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
} else {
|
|
74
|
+
const builder = FormBuilder.make({ title: 'HALO Invitation' }).pipe(
|
|
75
|
+
FormBuilder.set('invitationCode', InvitationEncoder.encode(invitation)),
|
|
76
|
+
FormBuilder.set('authCode', invitation.authCode ?? '<none>'),
|
|
77
|
+
FormBuilder.set('state', Invitation.State[invitation.state]),
|
|
78
|
+
);
|
|
79
|
+
yield* Console.log(print(FormBuilder.build(builder)));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const share = Command.make(
|
|
84
|
+
'share',
|
|
85
|
+
{
|
|
86
|
+
lifetime: Options.integer('lifetime').pipe(
|
|
87
|
+
Options.withDescription('Lifetime of the invitation in seconds.'),
|
|
88
|
+
Options.withDefault(12 * 60 * 60), // 12 hours - HALO invitations are typically shorter-lived
|
|
89
|
+
),
|
|
90
|
+
open: Options.boolean('open', { ifPresent: true }).pipe(Options.withDescription('Open browser with invitation.')),
|
|
91
|
+
host: Options.text('host').pipe(
|
|
92
|
+
Options.withDescription('Application Host URL.'),
|
|
93
|
+
Options.withDefault('https://composer.space'),
|
|
94
|
+
),
|
|
95
|
+
},
|
|
96
|
+
handler,
|
|
97
|
+
).pipe(Command.withDescription('Create HALO (device) invitation.'));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
9
|
+
import { ClientService } from '@dxos/client';
|
|
10
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
|
+
|
|
12
|
+
import { handler } from './update';
|
|
13
|
+
|
|
14
|
+
describe('halo update', () => {
|
|
15
|
+
it('should update identity display name', () =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
yield* Effect.tryPromise(() => client.halo.createIdentity());
|
|
19
|
+
yield* handler({ displayName: 'Updated Name' });
|
|
20
|
+
const logger = yield* TestConsole.TestConsole;
|
|
21
|
+
const logs = logger.logs;
|
|
22
|
+
expect(logs).toHaveLength(1);
|
|
23
|
+
const parsed = TestConsole.parseJson<{ identityKey: string; displayName: string }>(logs[0]);
|
|
24
|
+
expect(parsed).toHaveProperty('identityKey');
|
|
25
|
+
expect(parsed).toHaveProperty('displayName', 'Updated Name');
|
|
26
|
+
expect(parsed.identityKey).toBe(client.halo.identity.get()?.identityKey.toHex());
|
|
27
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
28
|
+
});
|