@dxos/plugin-client 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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/dist/lib/browser/DevicesContainer-46MEG3F5.mjs +268 -0
- package/dist/lib/browser/DevicesContainer-46MEG3F5.mjs.map +7 -0
- package/dist/lib/browser/JoinDialog-2RCYK4O5.mjs +59 -0
- package/dist/lib/browser/JoinDialog-2RCYK4O5.mjs.map +7 -0
- package/dist/lib/browser/ProfileContainer-XYRCOQ5I.mjs +171 -0
- package/dist/lib/browser/ProfileContainer-XYRCOQ5I.mjs.map +7 -0
- package/dist/lib/browser/RecoveryCodeDialog-EX2CLFND.mjs +60 -0
- package/dist/lib/browser/RecoveryCodeDialog-EX2CLFND.mjs.map +7 -0
- package/dist/lib/browser/RecoveryCredentialsContainer-RWTEIHOB.mjs +57 -0
- package/dist/lib/browser/RecoveryCredentialsContainer-RWTEIHOB.mjs.map +7 -0
- package/dist/lib/browser/ResetDialog-W24FOWBQ.mjs +52 -0
- package/dist/lib/browser/ResetDialog-W24FOWBQ.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-QJWFLYZE.mjs +121 -0
- package/dist/lib/browser/app-graph-builder-QJWFLYZE.mjs.map +7 -0
- package/dist/lib/browser/chunk-4XYOOXAH.mjs +18 -0
- package/dist/lib/browser/chunk-4XYOOXAH.mjs.map +7 -0
- package/dist/lib/browser/chunk-DPAXDXMK.mjs +283 -0
- package/dist/lib/browser/chunk-DPAXDXMK.mjs.map +7 -0
- package/dist/lib/browser/chunk-N2GMSVDQ.mjs +15 -0
- package/dist/lib/browser/chunk-N2GMSVDQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-VYX3ROUX.mjs +15 -0
- package/dist/lib/browser/chunk-VYX3ROUX.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +1051 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/client-Z25GQ5YC.mjs +86 -0
- package/dist/lib/browser/client-Z25GQ5YC.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +77 -84
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/migrations-HLHRMOW6.mjs +25 -0
- package/dist/lib/browser/migrations-HLHRMOW6.mjs.map +7 -0
- package/dist/lib/browser/operation-resolver-6QW3BKA5.mjs +299 -0
- package/dist/lib/browser/operation-resolver-6QW3BKA5.mjs.map +7 -0
- package/dist/lib/browser/react-context-E7TAJMDK.mjs +26 -0
- package/dist/lib/browser/react-context-E7TAJMDK.mjs.map +7 -0
- package/dist/lib/browser/react-surface-L5A2LBFE.mjs +77 -0
- package/dist/lib/browser/react-surface-L5A2LBFE.mjs.map +7 -0
- package/dist/lib/browser/schema-defs-5WDZWVEI.mjs +28 -0
- package/dist/lib/browser/schema-defs-5WDZWVEI.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -4
- package/dist/lib/node-esm/DevicesContainer-WQ3DQA45.mjs +269 -0
- package/dist/lib/node-esm/DevicesContainer-WQ3DQA45.mjs.map +7 -0
- package/dist/lib/node-esm/JoinDialog-KLTNJY5F.mjs +60 -0
- package/dist/lib/node-esm/JoinDialog-KLTNJY5F.mjs.map +7 -0
- package/dist/lib/node-esm/ProfileContainer-XI425QK5.mjs +172 -0
- package/dist/lib/node-esm/ProfileContainer-XI425QK5.mjs.map +7 -0
- package/dist/lib/node-esm/RecoveryCodeDialog-AISRNJUM.mjs +61 -0
- package/dist/lib/node-esm/RecoveryCodeDialog-AISRNJUM.mjs.map +7 -0
- package/dist/lib/node-esm/RecoveryCredentialsContainer-3TKQRPQK.mjs +58 -0
- package/dist/lib/node-esm/RecoveryCredentialsContainer-3TKQRPQK.mjs.map +7 -0
- package/dist/lib/node-esm/ResetDialog-GGBWSQZO.mjs +54 -0
- package/dist/lib/node-esm/ResetDialog-GGBWSQZO.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-6JD6BZAI.mjs +122 -0
- package/dist/lib/node-esm/app-graph-builder-6JD6BZAI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H2CCMM4Z.mjs +20 -0
- package/dist/lib/node-esm/chunk-H2CCMM4Z.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HKSNTZF5.mjs +16 -0
- package/dist/lib/node-esm/chunk-HKSNTZF5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RGULICLJ.mjs +17 -0
- package/dist/lib/node-esm/chunk-RGULICLJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VEUNEDN5.mjs +284 -0
- package/dist/lib/node-esm/chunk-VEUNEDN5.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +1052 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/client-5AIPYSBT.mjs +87 -0
- package/dist/lib/node-esm/client-5AIPYSBT.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +77 -84
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/migrations-O5KG2GGN.mjs +26 -0
- package/dist/lib/node-esm/migrations-O5KG2GGN.mjs.map +7 -0
- package/dist/lib/node-esm/operation-resolver-GSH7AOTZ.mjs +300 -0
- package/dist/lib/node-esm/operation-resolver-GSH7AOTZ.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-4SZYNSIS.mjs → react-context-OMJSBS23.mjs} +9 -7
- package/dist/lib/node-esm/react-context-OMJSBS23.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-N3BSPMMX.mjs +78 -0
- package/dist/lib/node-esm/react-surface-N3BSPMMX.mjs.map +7 -0
- package/dist/lib/node-esm/schema-defs-ENOYSDP3.mjs +29 -0
- package/dist/lib/node-esm/schema-defs-ENOYSDP3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -4
- package/dist/types/src/ClientPlugin.d.ts +2 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/client/client.d.ts +8 -0
- package/dist/types/src/capabilities/client/client.d.ts.map +1 -0
- package/dist/types/src/capabilities/client/index.d.ts +18 -0
- package/dist/types/src/capabilities/client/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +7 -19
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations/index.d.ts +3 -0
- package/dist/types/src/capabilities/migrations/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +8 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
- package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +9 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-defs/index.d.ts +3 -0
- package/dist/types/src/capabilities/schema-defs/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts +5 -0
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts.map +1 -0
- package/dist/types/src/cli/commands/config/index.d.ts +5 -0
- package/dist/types/src/cli/commands/config/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/config/view.d.ts +5 -0
- package/dist/types/src/cli/commands/config/view.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/index.d.ts +7 -0
- package/dist/types/src/cli/commands/device/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/info/index.d.ts +2 -0
- package/dist/types/src/cli/commands/device/info/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/info/info.d.ts +7 -0
- package/dist/types/src/cli/commands/device/info/info.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/info/info.test.d.ts +2 -0
- package/dist/types/src/cli/commands/device/info/info.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/list/index.d.ts +2 -0
- package/dist/types/src/cli/commands/device/list/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/list/list.d.ts +7 -0
- package/dist/types/src/cli/commands/device/list/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/list/list.test.d.ts +2 -0
- package/dist/types/src/cli/commands/device/list/list.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/update/index.d.ts +2 -0
- package/dist/types/src/cli/commands/device/update/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/update/update.d.ts +11 -0
- package/dist/types/src/cli/commands/device/update/update.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/util.d.ts +16 -0
- package/dist/types/src/cli/commands/device/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/edge/index.d.ts +5 -0
- package/dist/types/src/cli/commands/edge/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/edge/status.d.ts +7 -0
- package/dist/types/src/cli/commands/edge/status.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/create/create.d.ts +15 -0
- package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/create/create.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/create/create.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/create/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/create/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/add/add.d.ts +13 -0
- package/dist/types/src/cli/commands/halo/credential/add/add.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/add/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/credential/add/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/index.d.ts +12 -0
- package/dist/types/src/cli/commands/halo/credential/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/list/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/credential/list/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.d.ts +19 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/identity/identity.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/identity/identity.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/identity/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/identity/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/index.d.ts +3 -0
- package/dist/types/src/cli/commands/halo/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/join/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/join/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/join/join.d.ts +8 -0
- package/dist/types/src/cli/commands/halo/join/join.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/join/join.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/join/join.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/keys/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/keys/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/keys/keys.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/keys/keys.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/recover/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/recover/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/recover/recover.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/recover/recover.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/seed/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/seed/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/seed/seed.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/seed/seed.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/share/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/share/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/share/share.d.ts +15 -0
- package/dist/types/src/cli/commands/halo/share/share.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/update/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/update/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/update/update.d.ts +11 -0
- package/dist/types/src/cli/commands/halo/update/update.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/update/update.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/update/update.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/util.d.ts +13 -0
- package/dist/types/src/cli/commands/halo/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/index.d.ts +6 -0
- package/dist/types/src/cli/commands/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/create.d.ts +9 -0
- package/dist/types/src/cli/commands/profile/create.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/delete.d.ts +8 -0
- package/dist/types/src/cli/commands/profile/delete.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/import.d.ts +17 -0
- package/dist/types/src/cli/commands/profile/import.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/index.d.ts +19 -0
- package/dist/types/src/cli/commands/profile/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/inspect.d.ts +13 -0
- package/dist/types/src/cli/commands/profile/inspect.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/list.d.ts +6 -0
- package/dist/types/src/cli/commands/profile/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/reset.d.ts +8 -0
- package/dist/types/src/cli/commands/profile/reset.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/util.d.ts +24 -0
- package/dist/types/src/cli/commands/profile/util.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +4 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/cli/testing/test-console.d.ts +37 -0
- package/dist/types/src/cli/testing/test-console.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/{components → containers/DevicesContainer}/DevicesContainer.stories.d.ts +10 -54
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/index.d.ts +3 -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/index.d.ts +3 -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 +3 -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 +3 -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 +1 -2
- 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/translations.d.ts +2 -48
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +10 -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 +169 -11
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -38
- package/src/ClientPlugin.ts +45 -55
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +96 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/client/client.ts +77 -0
- package/src/capabilities/client/index.ts +7 -0
- package/src/capabilities/index.ts +7 -11
- package/src/capabilities/migrations/index.ts +7 -0
- package/src/capabilities/migrations/migrations.ts +30 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +247 -0
- package/src/capabilities/react-context/index.ts +7 -0
- package/src/capabilities/react-context/react-context.tsx +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +74 -0
- package/src/capabilities/schema-defs/index.ts +7 -0
- package/src/capabilities/schema-defs/schema-defs.ts +36 -0
- package/src/cli/commands/config/index.ts +12 -0
- package/src/cli/commands/config/view.ts +26 -0
- package/src/cli/commands/device/index.ts +14 -0
- package/src/cli/commands/device/info/index.ts +5 -0
- package/src/cli/commands/device/info/info.test.ts +29 -0
- package/src/cli/commands/device/info/info.ts +50 -0
- package/src/cli/commands/device/list/index.ts +5 -0
- package/src/cli/commands/device/list/list.test.ts +31 -0
- package/src/cli/commands/device/list/list.ts +30 -0
- package/src/cli/commands/device/update/index.ts +5 -0
- package/src/cli/commands/device/update/update.ts +70 -0
- package/src/cli/commands/device/util.ts +55 -0
- package/src/cli/commands/edge/index.ts +12 -0
- package/src/cli/commands/edge/status.ts +45 -0
- package/src/cli/commands/halo/create/create.test.ts +52 -0
- package/src/cli/commands/halo/create/create.ts +75 -0
- package/src/cli/commands/halo/create/index.ts +5 -0
- package/src/cli/commands/halo/credential/add/add.ts +97 -0
- package/src/cli/commands/halo/credential/add/index.ts +5 -0
- package/src/cli/commands/halo/credential/index.ts +13 -0
- package/src/cli/commands/halo/credential/list/index.ts +5 -0
- package/src/cli/commands/halo/credential/list/list.test.ts +28 -0
- package/src/cli/commands/halo/credential/list/list.ts +118 -0
- package/src/cli/commands/halo/identity/identity.test.ts +40 -0
- package/src/cli/commands/halo/identity/identity.ts +46 -0
- package/src/cli/commands/halo/identity/index.ts +5 -0
- package/src/cli/commands/halo/index.ts +21 -0
- package/src/cli/commands/halo/join/index.ts +5 -0
- package/src/cli/commands/halo/join/join.test.ts +10 -0
- package/src/cli/commands/halo/join/join.ts +87 -0
- package/src/cli/commands/halo/keys/index.ts +5 -0
- package/src/cli/commands/halo/keys/keys.test.ts +29 -0
- package/src/cli/commands/halo/keys/keys.ts +42 -0
- package/src/cli/commands/halo/recover/index.ts +5 -0
- package/src/cli/commands/halo/recover/recover.test.ts +10 -0
- package/src/cli/commands/halo/recover/recover.ts +44 -0
- package/src/cli/commands/halo/seed/index.ts +5 -0
- package/src/cli/commands/halo/seed/seed.ts +38 -0
- package/src/cli/commands/halo/share/index.ts +5 -0
- package/src/cli/commands/halo/share/share.ts +97 -0
- package/src/cli/commands/halo/update/index.ts +5 -0
- package/src/cli/commands/halo/update/update.test.ts +29 -0
- package/src/cli/commands/halo/update/update.ts +69 -0
- package/src/cli/commands/halo/util.ts +18 -0
- package/src/cli/commands/index.ts +9 -0
- package/src/cli/commands/profile/create.ts +87 -0
- package/src/cli/commands/profile/delete.ts +33 -0
- package/src/cli/commands/profile/import.ts +101 -0
- package/src/cli/commands/profile/index.ts +17 -0
- package/src/cli/commands/profile/inspect.ts +64 -0
- package/src/cli/commands/profile/list.ts +54 -0
- package/src/cli/commands/profile/reset.ts +45 -0
- package/src/cli/commands/profile/util.ts +48 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +34 -0
- package/src/cli/testing/test-console.ts +88 -0
- package/src/components/index.ts +0 -7
- package/src/constants.ts +9 -0
- package/src/{components → containers/DevicesContainer}/DevicesContainer.stories.tsx +14 -10
- package/src/{components → containers/DevicesContainer}/DevicesContainer.tsx +59 -65
- package/src/containers/DevicesContainer/index.ts +7 -0
- package/src/containers/JoinDialog/JoinDialog.tsx +53 -0
- package/src/containers/JoinDialog/index.ts +7 -0
- package/src/{components → containers/ProfileContainer}/ProfileContainer.stories.tsx +4 -4
- package/src/{components → containers/ProfileContainer}/ProfileContainer.tsx +65 -59
- package/src/containers/ProfileContainer/index.ts +7 -0
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.stories.tsx +4 -4
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.tsx +27 -26
- package/src/containers/RecoveryCodeDialog/index.ts +8 -0
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.tsx +46 -0
- package/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.tsx +22 -24
- package/src/containers/RecoveryCredentialsContainer/index.ts +7 -0
- package/src/containers/ResetDialog/ResetDialog.stories.tsx +73 -0
- package/src/containers/ResetDialog/ResetDialog.tsx +50 -0
- package/src/containers/ResetDialog/index.ts +8 -0
- package/src/containers/index.ts +15 -0
- package/src/index.ts +1 -2
- package/src/meta.ts +7 -2
- package/src/translations.ts +6 -3
- 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 +127 -9
- package/dist/lib/browser/app-graph-builder-LUY3BJGC.mjs +0 -124
- package/dist/lib/browser/app-graph-builder-LUY3BJGC.mjs.map +0 -7
- package/dist/lib/browser/chunk-C7B7NM2G.mjs +0 -686
- package/dist/lib/browser/chunk-C7B7NM2G.mjs.map +0 -7
- package/dist/lib/browser/chunk-PFY3EQPI.mjs +0 -18
- package/dist/lib/browser/chunk-PFY3EQPI.mjs.map +0 -7
- package/dist/lib/browser/chunk-QB3D2P4J.mjs +0 -10
- package/dist/lib/browser/chunk-QB3D2P4J.mjs.map +0 -7
- package/dist/lib/browser/chunk-TRA2GP4M.mjs +0 -110
- package/dist/lib/browser/chunk-TRA2GP4M.mjs.map +0 -7
- package/dist/lib/browser/chunk-VTC4GIND.mjs +0 -19
- package/dist/lib/browser/chunk-VTC4GIND.mjs.map +0 -7
- package/dist/lib/browser/client-5PWEJ3U6.mjs +0 -43
- package/dist/lib/browser/client-5PWEJ3U6.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-L5NVP2G3.mjs +0 -305
- package/dist/lib/browser/intent-resolver-L5NVP2G3.mjs.map +0 -7
- package/dist/lib/browser/migrations-MWQCO5KY.mjs +0 -23
- package/dist/lib/browser/migrations-MWQCO5KY.mjs.map +0 -7
- package/dist/lib/browser/react-context-S4SRYUVY.mjs +0 -24
- package/dist/lib/browser/react-context-S4SRYUVY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6PV7RVQN.mjs +0 -66
- package/dist/lib/browser/react-surface-6PV7RVQN.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-E3USCMH3.mjs +0 -25
- package/dist/lib/browser/schema-defs-E3USCMH3.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-S3BVB3IU.mjs +0 -125
- package/dist/lib/node-esm/app-graph-builder-S3BVB3IU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4MPOOMDQ.mjs +0 -111
- package/dist/lib/node-esm/chunk-4MPOOMDQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H73VVAMA.mjs +0 -687
- package/dist/lib/node-esm/chunk-H73VVAMA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K5IFPSCL.mjs +0 -20
- package/dist/lib/node-esm/chunk-K5IFPSCL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QE4LPI2A.mjs +0 -12
- package/dist/lib/node-esm/chunk-QE4LPI2A.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UYDFBGYA.mjs +0 -19
- package/dist/lib/node-esm/chunk-UYDFBGYA.mjs.map +0 -7
- package/dist/lib/node-esm/client-ODN7EBTY.mjs +0 -44
- package/dist/lib/node-esm/client-ODN7EBTY.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3JZIPI6F.mjs +0 -306
- package/dist/lib/node-esm/intent-resolver-3JZIPI6F.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-ARXHGBH5.mjs +0 -24
- package/dist/lib/node-esm/migrations-ARXHGBH5.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-4SZYNSIS.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-BOST4EH2.mjs +0 -67
- package/dist/lib/node-esm/react-surface-BOST4EH2.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-ATH5YBDR.mjs +0 -26
- package/dist/lib/node-esm/schema-defs-ATH5YBDR.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- 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/client.d.ts +0 -9
- package/dist/types/src/capabilities/client.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/capabilities/migrations.d.ts +0 -4
- package/dist/types/src/capabilities/migrations.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context.d.ts +0 -8
- package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -8
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
- package/dist/types/src/capabilities/schema-defs.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.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/app-graph-builder.ts +0 -115
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/client.ts +0 -43
- package/src/capabilities/intent-resolver.ts +0 -251
- package/src/capabilities/migrations.ts +0 -25
- package/src/capabilities/react-context.tsx +0 -21
- package/src/capabilities/react-surface.tsx +0 -67
- package/src/capabilities/schema-defs.ts +0 -29
- package/src/components/JoinDialog.tsx +0 -53
- package/src/components/RecoveryCredentialsContainer.stories.tsx +0 -42
- package/src/components/ResetDialog.stories.tsx +0 -50
- package/src/components/ResetDialog.tsx +0 -49
- package/src/events.ts +0 -15
- /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,70 @@
|
|
|
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 } from '@dxos/cli-util';
|
|
11
|
+
import { print } from '@dxos/cli-util';
|
|
12
|
+
import { ClientService } from '@dxos/client';
|
|
13
|
+
|
|
14
|
+
import { printDevice } from '../util';
|
|
15
|
+
|
|
16
|
+
export const handler = Effect.fn(function* ({ label }: { label: string }) {
|
|
17
|
+
const { json } = yield* CommandConfig;
|
|
18
|
+
const client = yield* ClientService;
|
|
19
|
+
yield* Effect.tryPromise(() => client.spaces.waitUntilReady());
|
|
20
|
+
|
|
21
|
+
const device = client.halo.device;
|
|
22
|
+
if (!device) {
|
|
23
|
+
if (json) {
|
|
24
|
+
yield* Console.log(JSON.stringify({ error: 'No device found' }, null, 2));
|
|
25
|
+
} else {
|
|
26
|
+
yield* Console.log('No device found.');
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const updatedProfile = {
|
|
32
|
+
...device.profile,
|
|
33
|
+
label,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const devicesService = client.services.services.DevicesService;
|
|
37
|
+
if (!devicesService) {
|
|
38
|
+
if (json) {
|
|
39
|
+
yield* Console.log(JSON.stringify({ error: 'DevicesService not found' }, null, 2));
|
|
40
|
+
} else {
|
|
41
|
+
yield* Console.log('DevicesService not found.');
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const updatedDevice = yield* Effect.tryPromise(() => devicesService.updateDevice(updatedProfile));
|
|
47
|
+
|
|
48
|
+
if (json) {
|
|
49
|
+
yield* Console.log(
|
|
50
|
+
JSON.stringify(
|
|
51
|
+
{
|
|
52
|
+
deviceKey: updatedDevice.deviceKey.toHex(),
|
|
53
|
+
profile: updatedDevice.profile,
|
|
54
|
+
},
|
|
55
|
+
null,
|
|
56
|
+
2,
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
} else {
|
|
60
|
+
yield* Console.log(print(printDevice(updatedDevice)));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const update = Command.make(
|
|
65
|
+
'update',
|
|
66
|
+
{
|
|
67
|
+
label: Options.text('label').pipe(Options.withDescription('The device label.')),
|
|
68
|
+
},
|
|
69
|
+
handler,
|
|
70
|
+
).pipe(Command.withDescription('Update device label.'));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { FormBuilder } from '@dxos/cli-util';
|
|
6
|
+
import { Device, DeviceKind, DeviceType } from '@dxos/client/halo';
|
|
7
|
+
|
|
8
|
+
const maybeTruncateKey = (key: { toHex(): string; truncate(): string }, truncate = false) =>
|
|
9
|
+
truncate ? key.truncate() : key.toHex();
|
|
10
|
+
|
|
11
|
+
const getDeviceTitle = (device: Device): string => {
|
|
12
|
+
if (device.profile?.label) {
|
|
13
|
+
return device.profile.label;
|
|
14
|
+
}
|
|
15
|
+
const platform = device.profile?.platform ?? 'Unknown';
|
|
16
|
+
const os = device.profile?.os ?? 'Unknown';
|
|
17
|
+
return `${platform} on ${os}`;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const mapDevices = (devices: Device[], truncateKeys = false) => {
|
|
21
|
+
return devices.map((device) => ({
|
|
22
|
+
label: device.profile?.label,
|
|
23
|
+
type: device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN',
|
|
24
|
+
key: maybeTruncateKey(device.deviceKey, truncateKeys),
|
|
25
|
+
kind: DeviceKind[device.kind],
|
|
26
|
+
platform: device.profile?.platform,
|
|
27
|
+
platformVersion: device.profile?.platformVersion,
|
|
28
|
+
architecture: device.profile?.architecture,
|
|
29
|
+
os: device.profile?.os,
|
|
30
|
+
osVersion: device.profile?.osVersion,
|
|
31
|
+
presence: device?.kind === DeviceKind.CURRENT ? 'THIS DEVICE' : Device.PresenceState[device.presence],
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const printDevice = (device: Device) =>
|
|
36
|
+
FormBuilder.make({ title: getDeviceTitle(device) }).pipe(
|
|
37
|
+
FormBuilder.set('deviceKey', device.deviceKey.truncate()),
|
|
38
|
+
FormBuilder.set('label', device.profile?.label ?? '<none>'),
|
|
39
|
+
FormBuilder.set('type', device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN'),
|
|
40
|
+
FormBuilder.set('kind', DeviceKind[device.kind]),
|
|
41
|
+
FormBuilder.set(
|
|
42
|
+
'presence',
|
|
43
|
+
device?.kind === DeviceKind.CURRENT ? 'THIS DEVICE' : Device.PresenceState[device.presence],
|
|
44
|
+
),
|
|
45
|
+
FormBuilder.set('platform', device.profile?.platform ?? '<none>'),
|
|
46
|
+
FormBuilder.set('platformVersion', device.profile?.platformVersion ?? '<none>'),
|
|
47
|
+
FormBuilder.set('architecture', device.profile?.architecture ?? '<none>'),
|
|
48
|
+
FormBuilder.set('os', device.profile?.os ?? '<none>'),
|
|
49
|
+
FormBuilder.set('osVersion', device.profile?.osVersion ?? '<none>'),
|
|
50
|
+
FormBuilder.build,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const printDevices = (devices: Device[]) => {
|
|
54
|
+
return devices.map(printDevice);
|
|
55
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { status } from './status';
|
|
8
|
+
|
|
9
|
+
export const edge = Command.make('edge').pipe(
|
|
10
|
+
Command.withDescription('EDGE commands.'),
|
|
11
|
+
Command.withSubcommands([status]),
|
|
12
|
+
);
|
|
@@ -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
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
|
|
10
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
11
|
+
import { ClientService } from '@dxos/client';
|
|
12
|
+
import { createEdgeIdentity } from '@dxos/client/edge';
|
|
13
|
+
|
|
14
|
+
export const getStatus = () =>
|
|
15
|
+
Effect.gen(function* () {
|
|
16
|
+
const client = yield* ClientService;
|
|
17
|
+
const identity = createEdgeIdentity(client);
|
|
18
|
+
client.edge.http.setIdentity(identity);
|
|
19
|
+
const status = yield* Effect.tryPromise(() => client.edge.http.getStatus());
|
|
20
|
+
|
|
21
|
+
if (yield* CommandConfig.isJson) {
|
|
22
|
+
yield* Console.log(JSON.stringify(status, null, 2));
|
|
23
|
+
} else if (status.problems.length > 0) {
|
|
24
|
+
for (const problem of status.problems) {
|
|
25
|
+
yield* Console.error(problem);
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
yield* Console.log('No problems found.');
|
|
29
|
+
}
|
|
30
|
+
}).pipe(
|
|
31
|
+
// TODO(wittjosiah): Tagged error.
|
|
32
|
+
Effect.catchSome((error) => {
|
|
33
|
+
if (error instanceof Error && error.message === 'Identity not available') {
|
|
34
|
+
// TODO(wittjosiah): Error coloring for logs.
|
|
35
|
+
return Option.some(Console.error(error.message));
|
|
36
|
+
} else {
|
|
37
|
+
return Option.none();
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// TODO(wittjosiah): Admin functionality to provide to specify an identity.
|
|
43
|
+
export const status = Command.make('status', {}, getStatus).pipe(
|
|
44
|
+
Command.withDescription('Get the EDGE status for the current identity.'),
|
|
45
|
+
);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
|
|
10
|
+
import { OperationPlugin } from '@dxos/app-framework';
|
|
11
|
+
import { fromPlugins } from '@dxos/app-framework/testing';
|
|
12
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
13
|
+
import { ClientService } from '@dxos/client';
|
|
14
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
15
|
+
import { ObservabilityPlugin } from '@dxos/plugin-observability/cli';
|
|
16
|
+
|
|
17
|
+
import { ClientPlugin } from '../../../plugin';
|
|
18
|
+
|
|
19
|
+
import { handler } from './create';
|
|
20
|
+
|
|
21
|
+
const layer = Layer.merge(TestLayer, fromPlugins([ClientPlugin({}), OperationPlugin(), ObservabilityPlugin()]));
|
|
22
|
+
|
|
23
|
+
// TODO(wittjosiah): Fix these tests.
|
|
24
|
+
describe.skip('halo create', () => {
|
|
25
|
+
it('should create an identity without a display name', () =>
|
|
26
|
+
Effect.gen(function* () {
|
|
27
|
+
const client = yield* ClientService;
|
|
28
|
+
yield* handler({ agent: false, displayName: Option.none() });
|
|
29
|
+
const logger = yield* TestConsole.TestConsole;
|
|
30
|
+
const logs = logger.logs;
|
|
31
|
+
expect(logs).toHaveLength(1);
|
|
32
|
+
const parsedIdentity = TestConsole.parseJson(logs[0]);
|
|
33
|
+
expect(parsedIdentity).toEqual({
|
|
34
|
+
identityKey: client.halo.identity.get()?.identityKey.toHex(),
|
|
35
|
+
displayName: client.halo.identity.get()?.profile?.displayName,
|
|
36
|
+
});
|
|
37
|
+
}).pipe(Effect.provide(layer), Effect.scoped, runAndForwardErrors));
|
|
38
|
+
|
|
39
|
+
it('should create an identity with a display name', () =>
|
|
40
|
+
Effect.gen(function* () {
|
|
41
|
+
const client = yield* ClientService;
|
|
42
|
+
yield* handler({ agent: false, displayName: Option.some('Example') });
|
|
43
|
+
const logger = yield* TestConsole.TestConsole;
|
|
44
|
+
const logs = logger.logs;
|
|
45
|
+
expect(logs).toHaveLength(1);
|
|
46
|
+
const parsedIdentity = TestConsole.parseJson(logs[0]);
|
|
47
|
+
expect(parsedIdentity).toEqual({
|
|
48
|
+
identityKey: client.halo.identity.get()?.identityKey.toHex(),
|
|
49
|
+
displayName: client.halo.identity.get()?.profile?.displayName,
|
|
50
|
+
});
|
|
51
|
+
}).pipe(Effect.provide(layer), Effect.scoped, runAndForwardErrors));
|
|
52
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
import * as Option from 'effect/Option';
|
|
10
|
+
|
|
11
|
+
import { Capabilities, Plugin } from '@dxos/app-framework';
|
|
12
|
+
import { CommandConfig, flushAndSync, spaceLayer } from '@dxos/cli-util';
|
|
13
|
+
import { print } from '@dxos/cli-util';
|
|
14
|
+
import { ClientService } from '@dxos/client';
|
|
15
|
+
import { invariant } from '@dxos/invariant';
|
|
16
|
+
|
|
17
|
+
import { ClientOperation } from '../../../../types';
|
|
18
|
+
import { printIdentity } from '../util';
|
|
19
|
+
|
|
20
|
+
export const handler = Effect.fn(function* ({
|
|
21
|
+
agent,
|
|
22
|
+
displayName,
|
|
23
|
+
}: {
|
|
24
|
+
agent: boolean;
|
|
25
|
+
displayName: Option.Option<string>;
|
|
26
|
+
}) {
|
|
27
|
+
const { json } = yield* CommandConfig;
|
|
28
|
+
const client = yield* ClientService;
|
|
29
|
+
// TODO(wittjosiah): How to surface this error to the user cleanly?
|
|
30
|
+
invariant(!client.halo.identity.get(), 'Identity already exists');
|
|
31
|
+
|
|
32
|
+
const manager = yield* Plugin.Service;
|
|
33
|
+
const { invoke } = manager.capabilities.get(Capabilities.OperationInvoker);
|
|
34
|
+
const identity = yield* invoke(ClientOperation.CreateIdentity, {
|
|
35
|
+
displayName: Option.getOrUndefined(displayName),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
if (agent) {
|
|
39
|
+
yield* invoke(ClientOperation.CreateAgent);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
43
|
+
yield* Effect.promise(() => client.spaces.default.waitUntilReady());
|
|
44
|
+
const space = client.spaces.default;
|
|
45
|
+
yield* flushAndSync({ indexes: true }).pipe(Effect.provide(spaceLayer(Option.some(space.id))));
|
|
46
|
+
|
|
47
|
+
if (json) {
|
|
48
|
+
yield* Console.log(
|
|
49
|
+
JSON.stringify(
|
|
50
|
+
{
|
|
51
|
+
identityKey: identity.identityKey.toHex(),
|
|
52
|
+
displayName: identity.profile?.displayName,
|
|
53
|
+
},
|
|
54
|
+
null,
|
|
55
|
+
2,
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
} else {
|
|
59
|
+
yield* Console.log(print(printIdentity(identity)));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const create = Command.make(
|
|
64
|
+
'create',
|
|
65
|
+
{
|
|
66
|
+
agent: Options.boolean('noAgent', { ifPresent: false }).pipe(
|
|
67
|
+
Options.withDescription('Do not create an EDGE agent for the identity.'),
|
|
68
|
+
),
|
|
69
|
+
displayName: Options.text('displayName').pipe(
|
|
70
|
+
Options.withDescription('The display name of the identity.'),
|
|
71
|
+
Options.optional,
|
|
72
|
+
),
|
|
73
|
+
},
|
|
74
|
+
handler,
|
|
75
|
+
).pipe(Command.withDescription('Create a new identity.'));
|
|
@@ -0,0 +1,97 @@
|
|
|
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 Option from 'effect/Option';
|
|
11
|
+
|
|
12
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
13
|
+
import { ClientService } from '@dxos/client';
|
|
14
|
+
import { invariant } from '@dxos/invariant';
|
|
15
|
+
import { schema } from '@dxos/protocols/proto';
|
|
16
|
+
|
|
17
|
+
export const handler = Effect.fn(function* ({ credential }: { credential: Option.Option<string> }) {
|
|
18
|
+
const { json } = yield* CommandConfig;
|
|
19
|
+
const client = yield* ClientService;
|
|
20
|
+
|
|
21
|
+
let credentialHex = Option.getOrUndefined(credential);
|
|
22
|
+
if (!credentialHex) {
|
|
23
|
+
credentialHex = yield* Prompt.text({ message: 'Enter credential (hex string)' }).pipe(Prompt.run);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
invariant(credentialHex, 'Invalid credential.');
|
|
27
|
+
|
|
28
|
+
const identity = client.halo.identity;
|
|
29
|
+
if (!identity) {
|
|
30
|
+
if (json) {
|
|
31
|
+
yield* Console.log(JSON.stringify({ error: 'Profile not initialized' }, null, 2));
|
|
32
|
+
} else {
|
|
33
|
+
yield* Console.log('Profile not initialized.');
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
yield* Effect.gen(function* () {
|
|
39
|
+
const codec = schema.getCodecForType('dxos.halo.credentials.Credential');
|
|
40
|
+
const credentialBytes = yield* Effect.try({
|
|
41
|
+
try: () => Buffer.from(credentialHex, 'hex'),
|
|
42
|
+
catch: (error) => new Error(`Failed to parse hex string: ${error}`),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const verifyError = codec.protoType.verify(credentialBytes);
|
|
46
|
+
if (verifyError) {
|
|
47
|
+
yield* Effect.fail(new Error(verifyError));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const credentialObj = yield* Effect.try({
|
|
51
|
+
try: () => codec.decode(credentialBytes),
|
|
52
|
+
catch: (error) => new Error(`Failed to decode credential: ${error}`),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
yield* Effect.tryPromise({
|
|
56
|
+
try: () => client.halo.writeCredentials([credentialObj]),
|
|
57
|
+
catch: (error) => new Error(`Failed to write credential: ${error}`),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (json) {
|
|
61
|
+
yield* Console.log(JSON.stringify({ success: true }, null, 2));
|
|
62
|
+
} else {
|
|
63
|
+
yield* Console.log('Credential added successfully.');
|
|
64
|
+
}
|
|
65
|
+
}).pipe(
|
|
66
|
+
Effect.catchAll((error) =>
|
|
67
|
+
Effect.gen(function* () {
|
|
68
|
+
if (json) {
|
|
69
|
+
yield* Console.log(
|
|
70
|
+
JSON.stringify(
|
|
71
|
+
{
|
|
72
|
+
error: 'Invalid credential',
|
|
73
|
+
message: error instanceof Error ? error.message : String(error),
|
|
74
|
+
},
|
|
75
|
+
null,
|
|
76
|
+
2,
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
} else {
|
|
80
|
+
yield* Console.log('Invalid credential.');
|
|
81
|
+
}
|
|
82
|
+
yield* Effect.fail(error);
|
|
83
|
+
}),
|
|
84
|
+
),
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export const add = Command.make(
|
|
89
|
+
'add',
|
|
90
|
+
{
|
|
91
|
+
credential: Args.text({ name: 'credential' }).pipe(
|
|
92
|
+
Args.withDescription('Credential as hex string.'),
|
|
93
|
+
Args.optional,
|
|
94
|
+
),
|
|
95
|
+
},
|
|
96
|
+
handler,
|
|
97
|
+
).pipe(Command.withDescription('Import credential into HALO.'));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { add } from './add';
|
|
8
|
+
import { list } from './list';
|
|
9
|
+
|
|
10
|
+
export const credential = Command.make('credential').pipe(
|
|
11
|
+
Command.withDescription('Manage HALO credentials.'),
|
|
12
|
+
Command.withSubcommands([add, list]),
|
|
13
|
+
);
|
|
@@ -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
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
|
|
9
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
10
|
+
import { ClientService } from '@dxos/client';
|
|
11
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
12
|
+
|
|
13
|
+
import { handler } from './list';
|
|
14
|
+
|
|
15
|
+
describe('halo credential list', () => {
|
|
16
|
+
it('should list HALO credentials', () =>
|
|
17
|
+
Effect.gen(function* () {
|
|
18
|
+
const client = yield* ClientService;
|
|
19
|
+
yield* Effect.tryPromise(() => client.halo.createIdentity());
|
|
20
|
+
yield* Effect.tryPromise(() => client.spaces.waitUntilReady());
|
|
21
|
+
yield* handler({ type: Option.none(), spaceId: Option.none(), timeout: 500, delay: 250 });
|
|
22
|
+
const logger = yield* TestConsole.TestConsole;
|
|
23
|
+
const logs = logger.logs;
|
|
24
|
+
expect(logs).toHaveLength(1);
|
|
25
|
+
const parsed = TestConsole.parseJson(logs[0]);
|
|
26
|
+
expect(Array.isArray(parsed)).toBe(true);
|
|
27
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
28
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
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, spaceIdWithDefault } 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<string>;
|
|
45
|
+
timeout: number;
|
|
46
|
+
delay: number;
|
|
47
|
+
}) {
|
|
48
|
+
const { json } = yield* CommandConfig;
|
|
49
|
+
const client = yield* ClientService;
|
|
50
|
+
yield* Effect.tryPromise(() => client.spaces.waitUntilReady());
|
|
51
|
+
|
|
52
|
+
let credentials: Credential[];
|
|
53
|
+
|
|
54
|
+
const resolvedSpaceId = yield* spaceIdWithDefault(spaceId as Option.Option<Key.SpaceId>);
|
|
55
|
+
if (Option.isSome(spaceId)) {
|
|
56
|
+
// If space ID was provided, get credentials from that space
|
|
57
|
+
const space = yield* getSpace(resolvedSpaceId);
|
|
58
|
+
credentials = yield* Effect.tryPromise(() => space.internal.getCredentials());
|
|
59
|
+
} else {
|
|
60
|
+
// Get credentials from HALO
|
|
61
|
+
const identity = client.halo.identity;
|
|
62
|
+
if (!identity) {
|
|
63
|
+
if (json) {
|
|
64
|
+
yield* Console.log(JSON.stringify({ error: 'Profile not initialized' }, null, 2));
|
|
65
|
+
} else {
|
|
66
|
+
yield* Console.log('Profile not initialized.');
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Wait for at least one credential
|
|
72
|
+
const latch = yield* Effect.makeLatch();
|
|
73
|
+
const subscription = client.halo.credentials.subscribe((creds) => {
|
|
74
|
+
if (creds.length > 0) {
|
|
75
|
+
Effect.runSync(latch.open);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
yield* latch.await.pipe(
|
|
80
|
+
Effect.timeout(Duration.millis(timeout)),
|
|
81
|
+
Effect.catchAll(() => Effect.void),
|
|
82
|
+
Effect.ensuring(
|
|
83
|
+
Effect.sync(() => {
|
|
84
|
+
subscription.unsubscribe();
|
|
85
|
+
}),
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// Wait a bit more to ensure all credentials are loaded
|
|
90
|
+
yield* Effect.sleep(Duration.millis(delay));
|
|
91
|
+
|
|
92
|
+
credentials = client.halo.queryCredentials({ type: Option.getOrUndefined(type) });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (json) {
|
|
96
|
+
yield* Console.log(JSON.stringify(mapCredentials(credentials), null, 2));
|
|
97
|
+
} else {
|
|
98
|
+
const formatted = credentials.map(printCredential);
|
|
99
|
+
yield* Console.log(printList(formatted));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export const list = Command.make(
|
|
104
|
+
'list',
|
|
105
|
+
{
|
|
106
|
+
type: Options.text('type').pipe(Options.withDescription('Filter by credential type.'), Options.optional),
|
|
107
|
+
spaceId: Common.spaceId.pipe(Options.withDescription('Space ID to show credentials from.'), Options.optional),
|
|
108
|
+
timeout: Options.integer('timeout').pipe(
|
|
109
|
+
Options.withDescription('Time in milliseconds to wait for at least one credential before listing.'),
|
|
110
|
+
Options.withDefault(500),
|
|
111
|
+
),
|
|
112
|
+
delay: Options.integer('delay').pipe(
|
|
113
|
+
Options.withDescription('Delay in milliseconds before listing.'),
|
|
114
|
+
Options.withDefault(250),
|
|
115
|
+
),
|
|
116
|
+
},
|
|
117
|
+
handler,
|
|
118
|
+
).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,46 @@
|
|
|
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
|
+
yield* Effect.tryPromise(() => client.spaces.waitUntilReady());
|
|
27
|
+
if (json) {
|
|
28
|
+
yield* Console.log(
|
|
29
|
+
JSON.stringify(
|
|
30
|
+
{
|
|
31
|
+
identityKey: identity.identityKey.toHex(),
|
|
32
|
+
displayName: identity.profile?.displayName,
|
|
33
|
+
},
|
|
34
|
+
null,
|
|
35
|
+
2,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
} else {
|
|
39
|
+
yield* Console.log(print(printIdentity(identity)));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const identity = Command.make('identity', {}, handler).pipe(
|
|
45
|
+
Command.withDescription('Get the current identity.'),
|
|
46
|
+
);
|