@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,1052 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Client,
|
|
4
|
+
OperationResolver,
|
|
5
|
+
SchemaDefs
|
|
6
|
+
} from "../chunk-H2CCMM4Z.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ClientEvents,
|
|
9
|
+
ClientOperation
|
|
10
|
+
} from "../chunk-VEUNEDN5.mjs";
|
|
11
|
+
import {
|
|
12
|
+
meta
|
|
13
|
+
} from "../chunk-RGULICLJ.mjs";
|
|
14
|
+
|
|
15
|
+
// src/cli/plugin.ts
|
|
16
|
+
import { ActivationEvents, Capability, Plugin as Plugin2 } from "@dxos/app-framework";
|
|
17
|
+
import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
|
|
18
|
+
|
|
19
|
+
// src/cli/commands/config/index.ts
|
|
20
|
+
import * as Command2 from "@effect/cli/Command";
|
|
21
|
+
|
|
22
|
+
// src/cli/commands/config/view.ts
|
|
23
|
+
import * as Command from "@effect/cli/Command";
|
|
24
|
+
import * as Console from "effect/Console";
|
|
25
|
+
import * as Effect from "effect/Effect";
|
|
26
|
+
import * as Yaml from "yaml";
|
|
27
|
+
import { CommandConfig } from "@dxos/cli-util";
|
|
28
|
+
import { ConfigService } from "@dxos/client";
|
|
29
|
+
var view = Command.make("view", {}, Effect.fnUntraced(function* () {
|
|
30
|
+
const config2 = yield* ConfigService;
|
|
31
|
+
const { json } = yield* CommandConfig;
|
|
32
|
+
if (json) {
|
|
33
|
+
yield* Console.log(JSON.stringify(config2.values, null, 2));
|
|
34
|
+
} else {
|
|
35
|
+
yield* Console.log(Yaml.stringify(config2.values));
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
// src/cli/commands/config/index.ts
|
|
40
|
+
var config = Command2.make("config").pipe(Command2.withDescription("Config commands."), Command2.withSubcommands([
|
|
41
|
+
view
|
|
42
|
+
]));
|
|
43
|
+
|
|
44
|
+
// src/cli/commands/device/index.ts
|
|
45
|
+
import * as Command6 from "@effect/cli/Command";
|
|
46
|
+
|
|
47
|
+
// src/cli/commands/device/info/info.ts
|
|
48
|
+
import * as Command3 from "@effect/cli/Command";
|
|
49
|
+
import * as Console2 from "effect/Console";
|
|
50
|
+
import * as Effect2 from "effect/Effect";
|
|
51
|
+
import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
|
|
52
|
+
import { print } from "@dxos/cli-util";
|
|
53
|
+
import { ClientService } from "@dxos/client";
|
|
54
|
+
import { DeviceType as DeviceType2 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
55
|
+
|
|
56
|
+
// src/cli/commands/device/util.ts
|
|
57
|
+
import { FormBuilder } from "@dxos/cli-util";
|
|
58
|
+
import { Device, DeviceKind, DeviceType } from "@dxos/client/halo";
|
|
59
|
+
var maybeTruncateKey = (key, truncate = false) => truncate ? key.truncate() : key.toHex();
|
|
60
|
+
var getDeviceTitle = (device2) => {
|
|
61
|
+
if (device2.profile?.label) {
|
|
62
|
+
return device2.profile.label;
|
|
63
|
+
}
|
|
64
|
+
const platform = device2.profile?.platform ?? "Unknown";
|
|
65
|
+
const os = device2.profile?.os ?? "Unknown";
|
|
66
|
+
return `${platform} on ${os}`;
|
|
67
|
+
};
|
|
68
|
+
var mapDevices = (devices, truncateKeys = false) => {
|
|
69
|
+
return devices.map((device2) => ({
|
|
70
|
+
label: device2.profile?.label,
|
|
71
|
+
type: device2.profile?.type ? DeviceType[device2.profile?.type] : "UNKNOWN",
|
|
72
|
+
key: maybeTruncateKey(device2.deviceKey, truncateKeys),
|
|
73
|
+
kind: DeviceKind[device2.kind],
|
|
74
|
+
platform: device2.profile?.platform,
|
|
75
|
+
platformVersion: device2.profile?.platformVersion,
|
|
76
|
+
architecture: device2.profile?.architecture,
|
|
77
|
+
os: device2.profile?.os,
|
|
78
|
+
osVersion: device2.profile?.osVersion,
|
|
79
|
+
presence: device2?.kind === DeviceKind.CURRENT ? "THIS DEVICE" : Device.PresenceState[device2.presence]
|
|
80
|
+
}));
|
|
81
|
+
};
|
|
82
|
+
var printDevice = (device2) => FormBuilder.make({
|
|
83
|
+
title: getDeviceTitle(device2)
|
|
84
|
+
}).pipe(FormBuilder.set("deviceKey", device2.deviceKey.truncate()), FormBuilder.set("label", device2.profile?.label ?? "<none>"), FormBuilder.set("type", device2.profile?.type ? DeviceType[device2.profile?.type] : "UNKNOWN"), FormBuilder.set("kind", DeviceKind[device2.kind]), FormBuilder.set("presence", device2?.kind === DeviceKind.CURRENT ? "THIS DEVICE" : Device.PresenceState[device2.presence]), FormBuilder.set("platform", device2.profile?.platform ?? "<none>"), FormBuilder.set("platformVersion", device2.profile?.platformVersion ?? "<none>"), FormBuilder.set("architecture", device2.profile?.architecture ?? "<none>"), FormBuilder.set("os", device2.profile?.os ?? "<none>"), FormBuilder.set("osVersion", device2.profile?.osVersion ?? "<none>"), FormBuilder.build);
|
|
85
|
+
var printDevices = (devices) => {
|
|
86
|
+
return devices.map(printDevice);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// src/cli/commands/device/info/info.ts
|
|
90
|
+
var handler = Effect2.fn(function* () {
|
|
91
|
+
const { json } = yield* CommandConfig2;
|
|
92
|
+
const client = yield* ClientService;
|
|
93
|
+
yield* Effect2.tryPromise(() => client.spaces.waitUntilReady());
|
|
94
|
+
const device2 = client.halo.device;
|
|
95
|
+
if (!device2) {
|
|
96
|
+
if (json) {
|
|
97
|
+
yield* Console2.log(JSON.stringify({
|
|
98
|
+
error: "No device found"
|
|
99
|
+
}, null, 2));
|
|
100
|
+
} else {
|
|
101
|
+
yield* Console2.log("No device found.");
|
|
102
|
+
}
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (json) {
|
|
106
|
+
yield* Console2.log(JSON.stringify({
|
|
107
|
+
deviceKey: device2.deviceKey.toHex(),
|
|
108
|
+
profile: {
|
|
109
|
+
...device2.profile,
|
|
110
|
+
type: device2.profile?.type ? DeviceType2[device2.profile?.type] : "UNKNOWN"
|
|
111
|
+
}
|
|
112
|
+
}, null, 2));
|
|
113
|
+
} else {
|
|
114
|
+
yield* Console2.log(print(printDevice(device2)));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
var info = Command3.make("info", {}, handler).pipe(Command3.withDescription("Show device info."));
|
|
118
|
+
|
|
119
|
+
// src/cli/commands/device/list/list.ts
|
|
120
|
+
import * as Command4 from "@effect/cli/Command";
|
|
121
|
+
import * as Console3 from "effect/Console";
|
|
122
|
+
import * as Effect3 from "effect/Effect";
|
|
123
|
+
import { CommandConfig as CommandConfig3 } from "@dxos/cli-util";
|
|
124
|
+
import { printList } from "@dxos/cli-util";
|
|
125
|
+
import { ClientService as ClientService2 } from "@dxos/client";
|
|
126
|
+
var handler2 = Effect3.fn(function* () {
|
|
127
|
+
const { json } = yield* CommandConfig3;
|
|
128
|
+
const client = yield* ClientService2;
|
|
129
|
+
yield* Effect3.tryPromise(() => client.spaces.waitUntilReady());
|
|
130
|
+
const devices = client.halo.devices.get();
|
|
131
|
+
if (json) {
|
|
132
|
+
yield* Console3.log(JSON.stringify(mapDevices(devices), null, 2));
|
|
133
|
+
} else {
|
|
134
|
+
const formatted = printDevices(devices);
|
|
135
|
+
yield* Console3.log(printList(formatted));
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
var list = Command4.make("list", {}, handler2).pipe(Command4.withDescription("List devices."));
|
|
139
|
+
|
|
140
|
+
// src/cli/commands/device/update/update.ts
|
|
141
|
+
import * as Command5 from "@effect/cli/Command";
|
|
142
|
+
import * as Options from "@effect/cli/Options";
|
|
143
|
+
import * as Console4 from "effect/Console";
|
|
144
|
+
import * as Effect4 from "effect/Effect";
|
|
145
|
+
import { CommandConfig as CommandConfig4 } from "@dxos/cli-util";
|
|
146
|
+
import { print as print2 } from "@dxos/cli-util";
|
|
147
|
+
import { ClientService as ClientService3 } from "@dxos/client";
|
|
148
|
+
var handler3 = Effect4.fn(function* ({ label }) {
|
|
149
|
+
const { json } = yield* CommandConfig4;
|
|
150
|
+
const client = yield* ClientService3;
|
|
151
|
+
yield* Effect4.tryPromise(() => client.spaces.waitUntilReady());
|
|
152
|
+
const device2 = client.halo.device;
|
|
153
|
+
if (!device2) {
|
|
154
|
+
if (json) {
|
|
155
|
+
yield* Console4.log(JSON.stringify({
|
|
156
|
+
error: "No device found"
|
|
157
|
+
}, null, 2));
|
|
158
|
+
} else {
|
|
159
|
+
yield* Console4.log("No device found.");
|
|
160
|
+
}
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const updatedProfile = {
|
|
164
|
+
...device2.profile,
|
|
165
|
+
label
|
|
166
|
+
};
|
|
167
|
+
const devicesService = client.services.services.DevicesService;
|
|
168
|
+
if (!devicesService) {
|
|
169
|
+
if (json) {
|
|
170
|
+
yield* Console4.log(JSON.stringify({
|
|
171
|
+
error: "DevicesService not found"
|
|
172
|
+
}, null, 2));
|
|
173
|
+
} else {
|
|
174
|
+
yield* Console4.log("DevicesService not found.");
|
|
175
|
+
}
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const updatedDevice = yield* Effect4.tryPromise(() => devicesService.updateDevice(updatedProfile));
|
|
179
|
+
if (json) {
|
|
180
|
+
yield* Console4.log(JSON.stringify({
|
|
181
|
+
deviceKey: updatedDevice.deviceKey.toHex(),
|
|
182
|
+
profile: updatedDevice.profile
|
|
183
|
+
}, null, 2));
|
|
184
|
+
} else {
|
|
185
|
+
yield* Console4.log(print2(printDevice(updatedDevice)));
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
var update = Command5.make("update", {
|
|
189
|
+
label: Options.text("label").pipe(Options.withDescription("The device label."))
|
|
190
|
+
}, handler3).pipe(Command5.withDescription("Update device label."));
|
|
191
|
+
|
|
192
|
+
// src/cli/commands/device/index.ts
|
|
193
|
+
var device = Command6.make("device").pipe(Command6.withDescription("Manage HALO devices."), Command6.withSubcommands([
|
|
194
|
+
info,
|
|
195
|
+
list,
|
|
196
|
+
update
|
|
197
|
+
]));
|
|
198
|
+
|
|
199
|
+
// src/cli/commands/edge/index.ts
|
|
200
|
+
import * as Command8 from "@effect/cli/Command";
|
|
201
|
+
|
|
202
|
+
// src/cli/commands/edge/status.ts
|
|
203
|
+
import * as Command7 from "@effect/cli/Command";
|
|
204
|
+
import * as Console5 from "effect/Console";
|
|
205
|
+
import * as Effect5 from "effect/Effect";
|
|
206
|
+
import * as Option from "effect/Option";
|
|
207
|
+
import { CommandConfig as CommandConfig5 } from "@dxos/cli-util";
|
|
208
|
+
import { ClientService as ClientService4 } from "@dxos/client";
|
|
209
|
+
import { createEdgeIdentity } from "@dxos/client/edge";
|
|
210
|
+
var getStatus = () => Effect5.gen(function* () {
|
|
211
|
+
const client = yield* ClientService4;
|
|
212
|
+
const identity2 = createEdgeIdentity(client);
|
|
213
|
+
client.edge.http.setIdentity(identity2);
|
|
214
|
+
const status2 = yield* Effect5.tryPromise(() => client.edge.http.getStatus());
|
|
215
|
+
if (yield* CommandConfig5.isJson) {
|
|
216
|
+
yield* Console5.log(JSON.stringify(status2, null, 2));
|
|
217
|
+
} else if (status2.problems.length > 0) {
|
|
218
|
+
for (const problem of status2.problems) {
|
|
219
|
+
yield* Console5.error(problem);
|
|
220
|
+
}
|
|
221
|
+
} else {
|
|
222
|
+
yield* Console5.log("No problems found.");
|
|
223
|
+
}
|
|
224
|
+
}).pipe(
|
|
225
|
+
// TODO(wittjosiah): Tagged error.
|
|
226
|
+
Effect5.catchSome((error2) => {
|
|
227
|
+
if (error2 instanceof Error && error2.message === "Identity not available") {
|
|
228
|
+
return Option.some(Console5.error(error2.message));
|
|
229
|
+
} else {
|
|
230
|
+
return Option.none();
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
);
|
|
234
|
+
var status = Command7.make("status", {}, getStatus).pipe(Command7.withDescription("Get the EDGE status for the current identity."));
|
|
235
|
+
|
|
236
|
+
// src/cli/commands/edge/index.ts
|
|
237
|
+
var edge = Command8.make("edge").pipe(Command8.withDescription("EDGE commands."), Command8.withSubcommands([
|
|
238
|
+
status
|
|
239
|
+
]));
|
|
240
|
+
|
|
241
|
+
// src/cli/commands/halo/index.ts
|
|
242
|
+
import * as Command18 from "@effect/cli/Command";
|
|
243
|
+
|
|
244
|
+
// src/cli/commands/halo/create/create.ts
|
|
245
|
+
import * as Command9 from "@effect/cli/Command";
|
|
246
|
+
import * as Options2 from "@effect/cli/Options";
|
|
247
|
+
import * as Console6 from "effect/Console";
|
|
248
|
+
import * as Effect6 from "effect/Effect";
|
|
249
|
+
import * as Option2 from "effect/Option";
|
|
250
|
+
import { Capabilities, Plugin } from "@dxos/app-framework";
|
|
251
|
+
import { CommandConfig as CommandConfig6, flushAndSync, spaceLayer } from "@dxos/cli-util";
|
|
252
|
+
import { print as print3 } from "@dxos/cli-util";
|
|
253
|
+
import { ClientService as ClientService5 } from "@dxos/client";
|
|
254
|
+
import { invariant } from "@dxos/invariant";
|
|
255
|
+
|
|
256
|
+
// src/cli/commands/halo/util.ts
|
|
257
|
+
import { FormBuilder as FormBuilder2 } from "@dxos/cli-util";
|
|
258
|
+
var printIdentity = (identity2) => FormBuilder2.make({
|
|
259
|
+
title: "Identity"
|
|
260
|
+
}).pipe(FormBuilder2.set("identityKey", identity2.identityKey.truncate()), FormBuilder2.set("displayName", identity2.profile?.displayName ?? "<none>"), FormBuilder2.build);
|
|
261
|
+
|
|
262
|
+
// src/cli/commands/halo/create/create.ts
|
|
263
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/halo/create/create.ts";
|
|
264
|
+
var handler4 = Effect6.fn(function* ({ agent, displayName }) {
|
|
265
|
+
const { json } = yield* CommandConfig6;
|
|
266
|
+
const client = yield* ClientService5;
|
|
267
|
+
invariant(!client.halo.identity.get(), "Identity already exists", {
|
|
268
|
+
F: __dxlog_file,
|
|
269
|
+
L: 30,
|
|
270
|
+
S: this,
|
|
271
|
+
A: [
|
|
272
|
+
"!client.halo.identity.get()",
|
|
273
|
+
"'Identity already exists'"
|
|
274
|
+
]
|
|
275
|
+
});
|
|
276
|
+
const manager = yield* Plugin.Service;
|
|
277
|
+
const { invoke } = manager.capabilities.get(Capabilities.OperationInvoker);
|
|
278
|
+
const identity2 = yield* invoke(ClientOperation.CreateIdentity, {
|
|
279
|
+
displayName: Option2.getOrUndefined(displayName)
|
|
280
|
+
});
|
|
281
|
+
if (agent) {
|
|
282
|
+
yield* invoke(ClientOperation.CreateAgent);
|
|
283
|
+
}
|
|
284
|
+
yield* Effect6.promise(() => client.spaces.waitUntilReady());
|
|
285
|
+
yield* Effect6.promise(() => client.spaces.default.waitUntilReady());
|
|
286
|
+
const space = client.spaces.default;
|
|
287
|
+
yield* flushAndSync({
|
|
288
|
+
indexes: true
|
|
289
|
+
}).pipe(Effect6.provide(spaceLayer(Option2.some(space.id))));
|
|
290
|
+
if (json) {
|
|
291
|
+
yield* Console6.log(JSON.stringify({
|
|
292
|
+
identityKey: identity2.identityKey.toHex(),
|
|
293
|
+
displayName: identity2.profile?.displayName
|
|
294
|
+
}, null, 2));
|
|
295
|
+
} else {
|
|
296
|
+
yield* Console6.log(print3(printIdentity(identity2)));
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
var create = Command9.make("create", {
|
|
300
|
+
agent: Options2.boolean("noAgent", {
|
|
301
|
+
ifPresent: false
|
|
302
|
+
}).pipe(Options2.withDescription("Do not create an EDGE agent for the identity.")),
|
|
303
|
+
displayName: Options2.text("displayName").pipe(Options2.withDescription("The display name of the identity."), Options2.optional)
|
|
304
|
+
}, handler4).pipe(Command9.withDescription("Create a new identity."));
|
|
305
|
+
|
|
306
|
+
// src/cli/commands/halo/credential/index.ts
|
|
307
|
+
import * as Command12 from "@effect/cli/Command";
|
|
308
|
+
|
|
309
|
+
// src/cli/commands/halo/credential/add/add.ts
|
|
310
|
+
import * as Args from "@effect/cli/Args";
|
|
311
|
+
import * as Command10 from "@effect/cli/Command";
|
|
312
|
+
import * as Prompt from "@effect/cli/Prompt";
|
|
313
|
+
import * as Console7 from "effect/Console";
|
|
314
|
+
import * as Effect7 from "effect/Effect";
|
|
315
|
+
import * as Option3 from "effect/Option";
|
|
316
|
+
import { CommandConfig as CommandConfig7 } from "@dxos/cli-util";
|
|
317
|
+
import { ClientService as ClientService6 } from "@dxos/client";
|
|
318
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
319
|
+
import { schema } from "@dxos/protocols/proto";
|
|
320
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/halo/credential/add/add.ts";
|
|
321
|
+
var handler5 = Effect7.fn(function* ({ credential: credential2 }) {
|
|
322
|
+
const { json } = yield* CommandConfig7;
|
|
323
|
+
const client = yield* ClientService6;
|
|
324
|
+
let credentialHex = Option3.getOrUndefined(credential2);
|
|
325
|
+
if (!credentialHex) {
|
|
326
|
+
credentialHex = yield* Prompt.text({
|
|
327
|
+
message: "Enter credential (hex string)"
|
|
328
|
+
}).pipe(Prompt.run);
|
|
329
|
+
}
|
|
330
|
+
invariant2(credentialHex, "Invalid credential.", {
|
|
331
|
+
F: __dxlog_file2,
|
|
332
|
+
L: 26,
|
|
333
|
+
S: this,
|
|
334
|
+
A: [
|
|
335
|
+
"credentialHex",
|
|
336
|
+
"'Invalid credential.'"
|
|
337
|
+
]
|
|
338
|
+
});
|
|
339
|
+
const identity2 = client.halo.identity;
|
|
340
|
+
if (!identity2) {
|
|
341
|
+
if (json) {
|
|
342
|
+
yield* Console7.log(JSON.stringify({
|
|
343
|
+
error: "Profile not initialized"
|
|
344
|
+
}, null, 2));
|
|
345
|
+
} else {
|
|
346
|
+
yield* Console7.log("Profile not initialized.");
|
|
347
|
+
}
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
yield* Effect7.gen(function* () {
|
|
351
|
+
const codec = schema.getCodecForType("dxos.halo.credentials.Credential");
|
|
352
|
+
const credentialBytes = yield* Effect7.try({
|
|
353
|
+
try: () => Buffer.from(credentialHex, "hex"),
|
|
354
|
+
catch: (error2) => new Error(`Failed to parse hex string: ${error2}`)
|
|
355
|
+
});
|
|
356
|
+
const verifyError = codec.protoType.verify(credentialBytes);
|
|
357
|
+
if (verifyError) {
|
|
358
|
+
yield* Effect7.fail(new Error(verifyError));
|
|
359
|
+
}
|
|
360
|
+
const credentialObj = yield* Effect7.try({
|
|
361
|
+
try: () => codec.decode(credentialBytes),
|
|
362
|
+
catch: (error2) => new Error(`Failed to decode credential: ${error2}`)
|
|
363
|
+
});
|
|
364
|
+
yield* Effect7.tryPromise({
|
|
365
|
+
try: () => client.halo.writeCredentials([
|
|
366
|
+
credentialObj
|
|
367
|
+
]),
|
|
368
|
+
catch: (error2) => new Error(`Failed to write credential: ${error2}`)
|
|
369
|
+
});
|
|
370
|
+
if (json) {
|
|
371
|
+
yield* Console7.log(JSON.stringify({
|
|
372
|
+
success: true
|
|
373
|
+
}, null, 2));
|
|
374
|
+
} else {
|
|
375
|
+
yield* Console7.log("Credential added successfully.");
|
|
376
|
+
}
|
|
377
|
+
}).pipe(Effect7.catchAll((error2) => Effect7.gen(function* () {
|
|
378
|
+
if (json) {
|
|
379
|
+
yield* Console7.log(JSON.stringify({
|
|
380
|
+
error: "Invalid credential",
|
|
381
|
+
message: error2 instanceof Error ? error2.message : String(error2)
|
|
382
|
+
}, null, 2));
|
|
383
|
+
} else {
|
|
384
|
+
yield* Console7.log("Invalid credential.");
|
|
385
|
+
}
|
|
386
|
+
yield* Effect7.fail(error2);
|
|
387
|
+
})));
|
|
388
|
+
});
|
|
389
|
+
var add = Command10.make("add", {
|
|
390
|
+
credential: Args.text({
|
|
391
|
+
name: "credential"
|
|
392
|
+
}).pipe(Args.withDescription("Credential as hex string."), Args.optional)
|
|
393
|
+
}, handler5).pipe(Command10.withDescription("Import credential into HALO."));
|
|
394
|
+
|
|
395
|
+
// src/cli/commands/halo/credential/list/list.ts
|
|
396
|
+
import * as Command11 from "@effect/cli/Command";
|
|
397
|
+
import * as Options3 from "@effect/cli/Options";
|
|
398
|
+
import * as Console8 from "effect/Console";
|
|
399
|
+
import * as Duration from "effect/Duration";
|
|
400
|
+
import * as Effect8 from "effect/Effect";
|
|
401
|
+
import * as Option4 from "effect/Option";
|
|
402
|
+
import { CommandConfig as CommandConfig8, Common, FormBuilder as FormBuilder3, getSpace, printList as printList2, spaceIdWithDefault } from "@dxos/cli-util";
|
|
403
|
+
import { ClientService as ClientService7 } from "@dxos/client";
|
|
404
|
+
var mapCredentials = (credentials) => {
|
|
405
|
+
return credentials.map((credential2) => ({
|
|
406
|
+
id: credential2.id?.toHex() ?? "<unknown>",
|
|
407
|
+
issuer: credential2.issuer?.toHex() ?? "<unknown>",
|
|
408
|
+
subject: credential2.subject?.id?.toHex() ?? "<unknown>",
|
|
409
|
+
type: credential2.subject.assertion["@type"],
|
|
410
|
+
assertion: credential2.subject.assertion
|
|
411
|
+
}));
|
|
412
|
+
};
|
|
413
|
+
var printCredential = (credential2) => {
|
|
414
|
+
const type = credential2.subject.assertion["@type"] ?? "<unknown>";
|
|
415
|
+
return FormBuilder3.make({
|
|
416
|
+
title: type
|
|
417
|
+
}).pipe(FormBuilder3.option("id", Option4.fromNullable(credential2.id?.truncate())), FormBuilder3.option("issuer", Option4.fromNullable(credential2.issuer?.truncate())), FormBuilder3.option("subject", Option4.fromNullable(credential2.subject?.id?.truncate())), FormBuilder3.build);
|
|
418
|
+
};
|
|
419
|
+
var handler6 = Effect8.fn(function* ({ type, spaceId, timeout: timeout2, delay }) {
|
|
420
|
+
const { json } = yield* CommandConfig8;
|
|
421
|
+
const client = yield* ClientService7;
|
|
422
|
+
yield* Effect8.tryPromise(() => client.spaces.waitUntilReady());
|
|
423
|
+
let credentials;
|
|
424
|
+
const resolvedSpaceId = yield* spaceIdWithDefault(spaceId);
|
|
425
|
+
if (Option4.isSome(spaceId)) {
|
|
426
|
+
const space = yield* getSpace(resolvedSpaceId);
|
|
427
|
+
credentials = yield* Effect8.tryPromise(() => space.internal.getCredentials());
|
|
428
|
+
} else {
|
|
429
|
+
const identity2 = client.halo.identity;
|
|
430
|
+
if (!identity2) {
|
|
431
|
+
if (json) {
|
|
432
|
+
yield* Console8.log(JSON.stringify({
|
|
433
|
+
error: "Profile not initialized"
|
|
434
|
+
}, null, 2));
|
|
435
|
+
} else {
|
|
436
|
+
yield* Console8.log("Profile not initialized.");
|
|
437
|
+
}
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
const latch = yield* Effect8.makeLatch();
|
|
441
|
+
const subscription = client.halo.credentials.subscribe((creds) => {
|
|
442
|
+
if (creds.length > 0) {
|
|
443
|
+
Effect8.runSync(latch.open);
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
yield* latch.await.pipe(Effect8.timeout(Duration.millis(timeout2)), Effect8.catchAll(() => Effect8.void), Effect8.ensuring(Effect8.sync(() => {
|
|
447
|
+
subscription.unsubscribe();
|
|
448
|
+
})));
|
|
449
|
+
yield* Effect8.sleep(Duration.millis(delay));
|
|
450
|
+
credentials = client.halo.queryCredentials({
|
|
451
|
+
type: Option4.getOrUndefined(type)
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
if (json) {
|
|
455
|
+
yield* Console8.log(JSON.stringify(mapCredentials(credentials), null, 2));
|
|
456
|
+
} else {
|
|
457
|
+
const formatted = credentials.map(printCredential);
|
|
458
|
+
yield* Console8.log(printList2(formatted));
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
var list2 = Command11.make("list", {
|
|
462
|
+
type: Options3.text("type").pipe(Options3.withDescription("Filter by credential type."), Options3.optional),
|
|
463
|
+
spaceId: Common.spaceId.pipe(Options3.withDescription("Space ID to show credentials from."), Options3.optional),
|
|
464
|
+
timeout: Options3.integer("timeout").pipe(Options3.withDescription("Time in milliseconds to wait for at least one credential before listing."), Options3.withDefault(500)),
|
|
465
|
+
delay: Options3.integer("delay").pipe(Options3.withDescription("Delay in milliseconds before listing."), Options3.withDefault(250))
|
|
466
|
+
}, handler6).pipe(Command11.withDescription("List HALO credentials."));
|
|
467
|
+
|
|
468
|
+
// src/cli/commands/halo/credential/index.ts
|
|
469
|
+
var credential = Command12.make("credential").pipe(Command12.withDescription("Manage HALO credentials."), Command12.withSubcommands([
|
|
470
|
+
add,
|
|
471
|
+
list2
|
|
472
|
+
]));
|
|
473
|
+
|
|
474
|
+
// src/cli/commands/halo/identity/identity.ts
|
|
475
|
+
import * as Command13 from "@effect/cli/Command";
|
|
476
|
+
import * as Console9 from "effect/Console";
|
|
477
|
+
import * as Effect9 from "effect/Effect";
|
|
478
|
+
import { CommandConfig as CommandConfig9 } from "@dxos/cli-util";
|
|
479
|
+
import { print as print4 } from "@dxos/cli-util";
|
|
480
|
+
import { ClientService as ClientService8 } from "@dxos/client";
|
|
481
|
+
var handler7 = Effect9.fn(function* () {
|
|
482
|
+
const { json } = yield* CommandConfig9;
|
|
483
|
+
const client = yield* ClientService8;
|
|
484
|
+
const identity2 = client.halo.identity.get();
|
|
485
|
+
if (!identity2) {
|
|
486
|
+
if (json) {
|
|
487
|
+
yield* Console9.log(JSON.stringify({
|
|
488
|
+
error: "Identity not initialized"
|
|
489
|
+
}, null, 2));
|
|
490
|
+
} else {
|
|
491
|
+
yield* Console9.log("Identity not initialized.");
|
|
492
|
+
}
|
|
493
|
+
} else {
|
|
494
|
+
yield* Effect9.tryPromise(() => client.spaces.waitUntilReady());
|
|
495
|
+
if (json) {
|
|
496
|
+
yield* Console9.log(JSON.stringify({
|
|
497
|
+
identityKey: identity2.identityKey.toHex(),
|
|
498
|
+
displayName: identity2.profile?.displayName
|
|
499
|
+
}, null, 2));
|
|
500
|
+
} else {
|
|
501
|
+
yield* Console9.log(print4(printIdentity(identity2)));
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
var identity = Command13.make("identity", {}, handler7).pipe(Command13.withDescription("Get the current identity."));
|
|
506
|
+
|
|
507
|
+
// src/cli/commands/halo/keys/keys.ts
|
|
508
|
+
import * as Command14 from "@effect/cli/Command";
|
|
509
|
+
import * as Console10 from "effect/Console";
|
|
510
|
+
import * as Effect10 from "effect/Effect";
|
|
511
|
+
import * as Option5 from "effect/Option";
|
|
512
|
+
import { CommandConfig as CommandConfig10 } from "@dxos/cli-util";
|
|
513
|
+
import { FormBuilder as FormBuilder4, print as print5 } from "@dxos/cli-util";
|
|
514
|
+
import { ClientService as ClientService9 } from "@dxos/client";
|
|
515
|
+
var handler8 = Effect10.fn(function* () {
|
|
516
|
+
const { json } = yield* CommandConfig10;
|
|
517
|
+
const client = yield* ClientService9;
|
|
518
|
+
yield* Effect10.tryPromise(() => client.spaces.waitUntilReady());
|
|
519
|
+
const identity2 = client.halo.identity.get();
|
|
520
|
+
const device2 = client.halo.device;
|
|
521
|
+
if (json) {
|
|
522
|
+
yield* Console10.log(JSON.stringify({
|
|
523
|
+
identityKey: identity2?.identityKey.toHex(),
|
|
524
|
+
deviceKey: device2?.deviceKey.toHex()
|
|
525
|
+
}, null, 2));
|
|
526
|
+
} else {
|
|
527
|
+
const builder = FormBuilder4.make({
|
|
528
|
+
title: "HALO Keys"
|
|
529
|
+
}).pipe(FormBuilder4.option("identityKey", Option5.fromNullable(identity2?.identityKey.truncate())), FormBuilder4.option("deviceKey", Option5.fromNullable(device2?.deviceKey.truncate())));
|
|
530
|
+
yield* Console10.log(print5(FormBuilder4.build(builder)));
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
var keys = Command14.make("keys", {}, handler8).pipe(Command14.withDescription("Show HALO keys."));
|
|
534
|
+
|
|
535
|
+
// src/cli/commands/halo/recover/recover.ts
|
|
536
|
+
import * as Args2 from "@effect/cli/Args";
|
|
537
|
+
import * as Command15 from "@effect/cli/Command";
|
|
538
|
+
import * as Console11 from "effect/Console";
|
|
539
|
+
import * as Effect11 from "effect/Effect";
|
|
540
|
+
import { CommandConfig as CommandConfig11, print as print6 } from "@dxos/cli-util";
|
|
541
|
+
import { ClientService as ClientService10 } from "@dxos/client";
|
|
542
|
+
import { invariant as invariant3 } from "@dxos/invariant";
|
|
543
|
+
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/halo/recover/recover.ts";
|
|
544
|
+
var recover = Command15.make("recover", {
|
|
545
|
+
recoveryCode: Args2.text({
|
|
546
|
+
name: "recoveryCode"
|
|
547
|
+
}).pipe(Args2.withDescription("The recovery code seed phrase."))
|
|
548
|
+
}, Effect11.fn(function* ({ recoveryCode }) {
|
|
549
|
+
const { json } = yield* CommandConfig11;
|
|
550
|
+
const client = yield* ClientService10;
|
|
551
|
+
invariant3(!client.halo.identity.get(), "Identity already exists", {
|
|
552
|
+
F: __dxlog_file3,
|
|
553
|
+
L: 25,
|
|
554
|
+
S: this,
|
|
555
|
+
A: [
|
|
556
|
+
"!client.halo.identity.get()",
|
|
557
|
+
"'Identity already exists'"
|
|
558
|
+
]
|
|
559
|
+
});
|
|
560
|
+
const identity2 = yield* Effect11.tryPromise(() => client.halo.recoverIdentity({
|
|
561
|
+
recoveryCode
|
|
562
|
+
}));
|
|
563
|
+
if (json) {
|
|
564
|
+
yield* Console11.log(JSON.stringify({
|
|
565
|
+
identityKey: identity2.identityKey.toHex(),
|
|
566
|
+
displayName: identity2.profile?.displayName
|
|
567
|
+
}, null, 2));
|
|
568
|
+
} else {
|
|
569
|
+
yield* Console11.log("Identity recovered successfully");
|
|
570
|
+
yield* Console11.log(print6(printIdentity(identity2)));
|
|
571
|
+
}
|
|
572
|
+
})).pipe(Command15.withDescription("Recover an existing identity using a recovery code."));
|
|
573
|
+
|
|
574
|
+
// src/cli/commands/halo/seed/seed.ts
|
|
575
|
+
import * as Command16 from "@effect/cli/Command";
|
|
576
|
+
import * as Console12 from "effect/Console";
|
|
577
|
+
import * as Effect12 from "effect/Effect";
|
|
578
|
+
import { CommandConfig as CommandConfig12 } from "@dxos/cli-util";
|
|
579
|
+
import { ClientService as ClientService11 } from "@dxos/client";
|
|
580
|
+
var handler9 = Effect12.fn(function* () {
|
|
581
|
+
const { json } = yield* CommandConfig12;
|
|
582
|
+
const client = yield* ClientService11;
|
|
583
|
+
yield* Effect12.tryPromise(() => client.spaces.waitUntilReady());
|
|
584
|
+
const identityService = client.services.services.IdentityService;
|
|
585
|
+
if (!identityService) {
|
|
586
|
+
if (json) {
|
|
587
|
+
yield* Console12.log(JSON.stringify({
|
|
588
|
+
error: "IdentityService not found"
|
|
589
|
+
}, null, 2));
|
|
590
|
+
} else {
|
|
591
|
+
yield* Console12.log("IdentityService not found.");
|
|
592
|
+
}
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
const result = yield* Effect12.tryPromise(() => identityService.createRecoveryCredential({}));
|
|
596
|
+
if (json) {
|
|
597
|
+
yield* Console12.log(JSON.stringify({
|
|
598
|
+
recoveryCode: result.recoveryCode
|
|
599
|
+
}, null, 2));
|
|
600
|
+
} else {
|
|
601
|
+
yield* Console12.log(result.recoveryCode);
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
var seed = Command16.make("seed", {}, handler9).pipe(Command16.withDescription("Generate a seedphrase that can be used for identity recovery."));
|
|
605
|
+
|
|
606
|
+
// src/cli/commands/halo/update/update.ts
|
|
607
|
+
import * as Command17 from "@effect/cli/Command";
|
|
608
|
+
import * as Options4 from "@effect/cli/Options";
|
|
609
|
+
import * as Console13 from "effect/Console";
|
|
610
|
+
import * as Effect13 from "effect/Effect";
|
|
611
|
+
import { CommandConfig as CommandConfig13 } from "@dxos/cli-util";
|
|
612
|
+
import { print as print7 } from "@dxos/cli-util";
|
|
613
|
+
import { ClientService as ClientService12 } from "@dxos/client";
|
|
614
|
+
var handler10 = Effect13.fn(function* ({ displayName }) {
|
|
615
|
+
const { json } = yield* CommandConfig13;
|
|
616
|
+
const client = yield* ClientService12;
|
|
617
|
+
yield* Effect13.tryPromise(() => client.spaces.waitUntilReady());
|
|
618
|
+
const identity2 = client.halo.identity.get();
|
|
619
|
+
if (!identity2) {
|
|
620
|
+
if (json) {
|
|
621
|
+
yield* Console13.log(JSON.stringify({
|
|
622
|
+
error: "Identity not initialized"
|
|
623
|
+
}, null, 2));
|
|
624
|
+
} else {
|
|
625
|
+
yield* Console13.log("Identity not initialized.");
|
|
626
|
+
}
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
const identityService = client.services.services.IdentityService;
|
|
630
|
+
if (!identityService) {
|
|
631
|
+
if (json) {
|
|
632
|
+
yield* Console13.log(JSON.stringify({
|
|
633
|
+
error: "IdentityService not found"
|
|
634
|
+
}, null, 2));
|
|
635
|
+
} else {
|
|
636
|
+
yield* Console13.log("IdentityService not found.");
|
|
637
|
+
}
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
const updatedIdentity = yield* Effect13.tryPromise(() => identityService.updateProfile({
|
|
641
|
+
displayName
|
|
642
|
+
}));
|
|
643
|
+
if (json) {
|
|
644
|
+
yield* Console13.log(JSON.stringify({
|
|
645
|
+
identityKey: updatedIdentity.identityKey.toHex(),
|
|
646
|
+
displayName: updatedIdentity.profile?.displayName
|
|
647
|
+
}, null, 2));
|
|
648
|
+
} else {
|
|
649
|
+
yield* Console13.log(print7(printIdentity(updatedIdentity)));
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
var update2 = Command17.make("update", {
|
|
653
|
+
displayName: Options4.text("displayName").pipe(Options4.withDescription("The display name of the identity."))
|
|
654
|
+
}, handler10).pipe(Command17.withDescription("Update identity profile."));
|
|
655
|
+
|
|
656
|
+
// src/cli/commands/halo/index.ts
|
|
657
|
+
var halo = Command18.make("halo").pipe(Command18.withDescription("Manage HALO identity."), Command18.withSubcommands([
|
|
658
|
+
create,
|
|
659
|
+
credential,
|
|
660
|
+
identity,
|
|
661
|
+
keys,
|
|
662
|
+
recover,
|
|
663
|
+
seed,
|
|
664
|
+
update2
|
|
665
|
+
]));
|
|
666
|
+
|
|
667
|
+
// src/cli/commands/profile/index.ts
|
|
668
|
+
import * as Command25 from "@effect/cli/Command";
|
|
669
|
+
|
|
670
|
+
// src/cli/commands/profile/create.ts
|
|
671
|
+
import * as Command19 from "@effect/cli/Command";
|
|
672
|
+
import * as Options5 from "@effect/cli/Options";
|
|
673
|
+
import * as FileSystem from "@effect/platform/FileSystem";
|
|
674
|
+
import * as Console14 from "effect/Console";
|
|
675
|
+
import * as Effect14 from "effect/Effect";
|
|
676
|
+
import * as Option6 from "effect/Option";
|
|
677
|
+
import * as Record from "effect/Record";
|
|
678
|
+
import { CommandConfig as CommandConfig14, print as print8 } from "@dxos/cli-util";
|
|
679
|
+
import { DX_CONFIG, getProfilePath } from "@dxos/client-protocol";
|
|
680
|
+
import { trim } from "@dxos/util";
|
|
681
|
+
|
|
682
|
+
// src/cli/commands/profile/util.ts
|
|
683
|
+
import { FormBuilder as FormBuilder5 } from "@dxos/cli-util";
|
|
684
|
+
var printProfileCreated = (name, path) => FormBuilder5.make({
|
|
685
|
+
title: "Profile created"
|
|
686
|
+
}).pipe(FormBuilder5.set("name", name), FormBuilder5.set("path", path), FormBuilder5.build);
|
|
687
|
+
var printProfileDeleted = (name) => FormBuilder5.make({
|
|
688
|
+
title: "Profile deleted"
|
|
689
|
+
}).pipe(FormBuilder5.set("name", name), FormBuilder5.build);
|
|
690
|
+
var printProfileReset = (profile2) => FormBuilder5.make({
|
|
691
|
+
title: "Profile reset"
|
|
692
|
+
}).pipe(FormBuilder5.set("profile", profile2), FormBuilder5.build);
|
|
693
|
+
var printProfile = (profile2) => {
|
|
694
|
+
const title = profile2.isCurrent ? `${profile2.name} (current)` : profile2.name;
|
|
695
|
+
return FormBuilder5.make({
|
|
696
|
+
title
|
|
697
|
+
}).pipe(FormBuilder5.set("fullPath", profile2.fullPath), FormBuilder5.set("storagePath", profile2.storagePath), FormBuilder5.set("edge", profile2.edge ?? "<none>"), FormBuilder5.build);
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
// src/cli/commands/profile/create.ts
|
|
701
|
+
var TEMPLATES = {
|
|
702
|
+
default: trim`
|
|
703
|
+
version: 1
|
|
704
|
+
runtime:
|
|
705
|
+
client:
|
|
706
|
+
storage:
|
|
707
|
+
persistent: true
|
|
708
|
+
services:
|
|
709
|
+
edge:
|
|
710
|
+
url: https://edge-production.dxos.workers.dev
|
|
711
|
+
`,
|
|
712
|
+
main: trim`
|
|
713
|
+
version: 1
|
|
714
|
+
runtime:
|
|
715
|
+
client:
|
|
716
|
+
storage:
|
|
717
|
+
persistent: true
|
|
718
|
+
services:
|
|
719
|
+
edge:
|
|
720
|
+
url: https://edge-main.dxos.workers.dev
|
|
721
|
+
`,
|
|
722
|
+
dev: trim`
|
|
723
|
+
version: 1
|
|
724
|
+
runtime:
|
|
725
|
+
client:
|
|
726
|
+
storage:
|
|
727
|
+
persistent: true
|
|
728
|
+
services:
|
|
729
|
+
edge:
|
|
730
|
+
url: https://edge.dxos.workers.dev
|
|
731
|
+
`,
|
|
732
|
+
local: trim`
|
|
733
|
+
version: 1
|
|
734
|
+
runtime:
|
|
735
|
+
client:
|
|
736
|
+
storage:
|
|
737
|
+
persistent: true
|
|
738
|
+
services:
|
|
739
|
+
edge:
|
|
740
|
+
url: http://localhost:8787
|
|
741
|
+
`
|
|
742
|
+
};
|
|
743
|
+
var create2 = Command19.make("create", {
|
|
744
|
+
template: Options5.choice("template", Record.keys(TEMPLATES)).pipe(Options5.withDescription("Template to use"), Options5.withDefault("default")),
|
|
745
|
+
name: Options5.text("name").pipe(Options5.withDescription("Profile name"), Options5.optional)
|
|
746
|
+
}, Effect14.fnUntraced(function* ({ template, name }) {
|
|
747
|
+
const { json } = yield* CommandConfig14;
|
|
748
|
+
const fs = yield* FileSystem.FileSystem;
|
|
749
|
+
const profileName = name.pipe(Option6.getOrElse(() => template));
|
|
750
|
+
const profilePath = `${getProfilePath(DX_CONFIG, profileName)}.yml`;
|
|
751
|
+
if (yield* fs.exists(profilePath)) {
|
|
752
|
+
throw new Error(`Profile ${profileName} already exists`);
|
|
753
|
+
}
|
|
754
|
+
yield* fs.writeFileString(profilePath, TEMPLATES[template]);
|
|
755
|
+
if (json) {
|
|
756
|
+
yield* Console14.log(JSON.stringify({
|
|
757
|
+
name: profileName,
|
|
758
|
+
path: profilePath
|
|
759
|
+
}, null, 2));
|
|
760
|
+
} else {
|
|
761
|
+
yield* Console14.log(print8(printProfileCreated(profileName, profilePath)));
|
|
762
|
+
}
|
|
763
|
+
}));
|
|
764
|
+
|
|
765
|
+
// src/cli/commands/profile/delete.ts
|
|
766
|
+
import * as Command20 from "@effect/cli/Command";
|
|
767
|
+
import * as Options6 from "@effect/cli/Options";
|
|
768
|
+
import * as FileSystem3 from "@effect/platform/FileSystem";
|
|
769
|
+
import * as Console15 from "effect/Console";
|
|
770
|
+
import * as Effect15 from "effect/Effect";
|
|
771
|
+
import * as Option7 from "effect/Option";
|
|
772
|
+
import { CommandConfig as CommandConfig15, print as print9 } from "@dxos/cli-util";
|
|
773
|
+
import { DX_CONFIG as DX_CONFIG2, getProfilePath as getProfilePath2 } from "@dxos/client-protocol";
|
|
774
|
+
var del = Command20.make("delete", {
|
|
775
|
+
name: Options6.text("name").pipe(Options6.withDescription("Profile name"), Options6.optional)
|
|
776
|
+
}, Effect15.fnUntraced(function* ({ name }) {
|
|
777
|
+
const { json } = yield* CommandConfig15;
|
|
778
|
+
const fs = yield* FileSystem3.FileSystem;
|
|
779
|
+
const profileName = name.pipe(Option7.getOrElse(() => "default"));
|
|
780
|
+
yield* fs.remove(`${getProfilePath2(DX_CONFIG2, profileName)}.yml`);
|
|
781
|
+
if (json) {
|
|
782
|
+
yield* Console15.log(JSON.stringify({
|
|
783
|
+
name: profileName,
|
|
784
|
+
deleted: true
|
|
785
|
+
}, null, 2));
|
|
786
|
+
} else {
|
|
787
|
+
yield* Console15.log(print9(printProfileDeleted(profileName)));
|
|
788
|
+
}
|
|
789
|
+
}));
|
|
790
|
+
|
|
791
|
+
// src/cli/commands/profile/import.ts
|
|
792
|
+
import * as Command21 from "@effect/cli/Command";
|
|
793
|
+
import * as Options7 from "@effect/cli/Options";
|
|
794
|
+
import * as Prompt2 from "@effect/cli/Prompt";
|
|
795
|
+
import * as FileSystem5 from "@effect/platform/FileSystem";
|
|
796
|
+
import * as Path from "@effect/platform/Path";
|
|
797
|
+
import * as Console16 from "effect/Console";
|
|
798
|
+
import * as Effect16 from "effect/Effect";
|
|
799
|
+
import * as Option8 from "effect/Option";
|
|
800
|
+
import { CommandConfig as CommandConfig16 } from "@dxos/cli-util";
|
|
801
|
+
import { ConfigService as ConfigService2 } from "@dxos/config";
|
|
802
|
+
import { log as log17 } from "@dxos/log";
|
|
803
|
+
var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/profile/import.ts";
|
|
804
|
+
var handler11 = Effect16.fn(function* ({ file, dataDir, force }) {
|
|
805
|
+
const dataDirValue = Option8.getOrUndefined(dataDir);
|
|
806
|
+
const { json, profile: profile2 } = yield* CommandConfig16;
|
|
807
|
+
const fs = yield* FileSystem5.FileSystem;
|
|
808
|
+
const path = yield* Path.Path;
|
|
809
|
+
const config2 = yield* ConfigService2;
|
|
810
|
+
const { createLevel, createStorageObjects, importProfileData, decodeProfileArchive } = yield* Effect16.promise(() => import("@dxos/client-services"));
|
|
811
|
+
let storageConfig;
|
|
812
|
+
if (!dataDirValue) {
|
|
813
|
+
if (!force) {
|
|
814
|
+
yield* Console16.log(`Will overwrite profile: ${profile2}`);
|
|
815
|
+
const confirmed = yield* Prompt2.confirm({
|
|
816
|
+
message: `Delete all data? (Profile: ${profile2})`,
|
|
817
|
+
initial: false
|
|
818
|
+
}).pipe(Prompt2.run);
|
|
819
|
+
if (!confirmed) {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
storageConfig = config2.values.runtime.client.storage;
|
|
824
|
+
} else {
|
|
825
|
+
const fullPath = path.resolve(dataDirValue);
|
|
826
|
+
yield* Console16.log(`Importing into: ${fullPath}`);
|
|
827
|
+
storageConfig = {
|
|
828
|
+
persistent: true,
|
|
829
|
+
dataRoot: fullPath
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
if (yield* fs.exists(storageConfig.dataRoot)) {
|
|
833
|
+
log17.error("data directory already exists", {
|
|
834
|
+
path: storageConfig.dataRoot
|
|
835
|
+
}, {
|
|
836
|
+
F: __dxlog_file4,
|
|
837
|
+
L: 61,
|
|
838
|
+
S: this,
|
|
839
|
+
C: (f, a) => f(...a)
|
|
840
|
+
});
|
|
841
|
+
if (json) {
|
|
842
|
+
yield* Console16.log(JSON.stringify({
|
|
843
|
+
error: "Data directory already exists"
|
|
844
|
+
}, null, 2));
|
|
845
|
+
} else {
|
|
846
|
+
yield* Console16.log("Data directory already exists.");
|
|
847
|
+
}
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
const data = yield* fs.readFile(file);
|
|
851
|
+
const archive = decodeProfileArchive(data);
|
|
852
|
+
yield* Console16.log(`Importing archive with ${archive.storage.length} entries`);
|
|
853
|
+
const { storage } = createStorageObjects(storageConfig);
|
|
854
|
+
const level = yield* Effect16.tryPromise({
|
|
855
|
+
try: () => createLevel(storageConfig),
|
|
856
|
+
catch: (error2) => new Error(`Failed to create level: ${error2}`)
|
|
857
|
+
});
|
|
858
|
+
yield* Console16.log("Beginning profile import...");
|
|
859
|
+
yield* Effect16.tryPromise({
|
|
860
|
+
try: () => importProfileData({
|
|
861
|
+
storage,
|
|
862
|
+
level
|
|
863
|
+
}, archive),
|
|
864
|
+
catch: (error2) => new Error(`Failed to import profile data: ${error2}`)
|
|
865
|
+
});
|
|
866
|
+
yield* Console16.log("Profile import complete");
|
|
867
|
+
if (json) {
|
|
868
|
+
yield* Console16.log(JSON.stringify({
|
|
869
|
+
success: true,
|
|
870
|
+
profile: profile2,
|
|
871
|
+
entries: archive.storage.length
|
|
872
|
+
}, null, 2));
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
var importCommand = Command21.make("import", {
|
|
876
|
+
file: Options7.text("file").pipe(Options7.withDescription("Archive filename."), Options7.withAlias("f")),
|
|
877
|
+
dataDir: Options7.text("data-dir").pipe(Options7.withDescription("Storage directory."), Options7.optional),
|
|
878
|
+
force: Options7.boolean("force", {
|
|
879
|
+
ifPresent: true
|
|
880
|
+
}).pipe(Options7.withDescription("Skip confirmation prompt."))
|
|
881
|
+
}, handler11).pipe(Command21.withDescription("Import profile."));
|
|
882
|
+
|
|
883
|
+
// src/cli/commands/profile/inspect.ts
|
|
884
|
+
import * as Command22 from "@effect/cli/Command";
|
|
885
|
+
import * as Options8 from "@effect/cli/Options";
|
|
886
|
+
import * as FileSystem7 from "@effect/platform/FileSystem";
|
|
887
|
+
import * as Console17 from "effect/Console";
|
|
888
|
+
import * as Effect17 from "effect/Effect";
|
|
889
|
+
import { CommandConfig as CommandConfig17, FormBuilder as FormBuilder6, print as print10 } from "@dxos/cli-util";
|
|
890
|
+
import { ProfileArchiveEntryType } from "@dxos/protocols";
|
|
891
|
+
import { arrayToBuffer } from "@dxos/util";
|
|
892
|
+
var handler12 = Effect17.fn(function* ({ file, storage }) {
|
|
893
|
+
const { json } = yield* CommandConfig17;
|
|
894
|
+
const fs = yield* FileSystem7.FileSystem;
|
|
895
|
+
const { decodeProfileArchive } = yield* Effect17.promise(() => import("@dxos/client-services"));
|
|
896
|
+
const data = yield* fs.readFile(file);
|
|
897
|
+
const archive = decodeProfileArchive(data);
|
|
898
|
+
if (json) {
|
|
899
|
+
yield* Console17.log(JSON.stringify({
|
|
900
|
+
meta: archive.meta,
|
|
901
|
+
...storage ? {
|
|
902
|
+
storage: archive.storage
|
|
903
|
+
} : {}
|
|
904
|
+
}, null, 2));
|
|
905
|
+
} else {
|
|
906
|
+
const builder = FormBuilder6.make({
|
|
907
|
+
title: "Profile Archive"
|
|
908
|
+
}).pipe(FormBuilder6.when(archive.meta, FormBuilder6.each(Object.entries(archive.meta ?? {}), ([key, value]) => FormBuilder6.set(key, String(value)))), FormBuilder6.build);
|
|
909
|
+
yield* Console17.log(print10(builder));
|
|
910
|
+
if (storage) {
|
|
911
|
+
yield* Console17.log("\nStorage entries:\n");
|
|
912
|
+
for (const entry of archive.storage) {
|
|
913
|
+
const key = typeof entry.key === "string" ? entry.key : JSON.stringify(arrayToBuffer(entry.key).toString()).slice(1, -1);
|
|
914
|
+
yield* Console17.log(` ${ProfileArchiveEntryType[entry.type]} ${key}`);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
});
|
|
919
|
+
var inspect = Command22.make("inspect", {
|
|
920
|
+
file: Options8.text("file").pipe(Options8.withDescription("Archive filename."), Options8.withAlias("f")),
|
|
921
|
+
storage: Options8.boolean("storage", {
|
|
922
|
+
ifPresent: true
|
|
923
|
+
}).pipe(Options8.withDescription("List storage entries."))
|
|
924
|
+
}, handler12).pipe(Command22.withDescription("Inspect profile archive."));
|
|
925
|
+
|
|
926
|
+
// src/cli/commands/profile/list.ts
|
|
927
|
+
import * as Command23 from "@effect/cli/Command";
|
|
928
|
+
import * as FileSystem9 from "@effect/platform/FileSystem";
|
|
929
|
+
import * as Path3 from "@effect/platform/Path";
|
|
930
|
+
import * as Console18 from "effect/Console";
|
|
931
|
+
import * as Effect18 from "effect/Effect";
|
|
932
|
+
import * as Yaml2 from "yaml";
|
|
933
|
+
import { CommandConfig as CommandConfig18, printList as printList3 } from "@dxos/cli-util";
|
|
934
|
+
import { Config } from "@dxos/client";
|
|
935
|
+
import { DX_CONFIG as DX_CONFIG3, DX_DATA, getProfilePath as getProfilePath3 } from "@dxos/client-protocol";
|
|
936
|
+
var list3 = Command23.make("list", {}, Effect18.fnUntraced(function* () {
|
|
937
|
+
const { profile: currentProfile } = yield* CommandConfig18;
|
|
938
|
+
const fs = yield* FileSystem9.FileSystem;
|
|
939
|
+
const path = yield* Path3.Path;
|
|
940
|
+
const profileDir = path.join(DX_CONFIG3, "profile");
|
|
941
|
+
const files = yield* fs.readDirectory(profileDir);
|
|
942
|
+
const profiles = yield* Effect18.forEach(files, Effect18.fnUntraced(function* (filename) {
|
|
943
|
+
const ext = path.extname(filename);
|
|
944
|
+
const name = filename.slice(0, -ext.length);
|
|
945
|
+
const fullPath = path.join(DX_CONFIG3, "profile", filename);
|
|
946
|
+
const configContent = yield* fs.readFileString(fullPath);
|
|
947
|
+
const configValues = Yaml2.parse(configContent);
|
|
948
|
+
const config2 = new Config(configValues);
|
|
949
|
+
return {
|
|
950
|
+
name,
|
|
951
|
+
isCurrent: name === currentProfile,
|
|
952
|
+
fullPath,
|
|
953
|
+
storagePath: getProfilePath3(configValues?.runtime?.client?.storage.dataRoot ?? DX_DATA, name),
|
|
954
|
+
edge: config2.values.runtime?.services?.edge?.url
|
|
955
|
+
};
|
|
956
|
+
}));
|
|
957
|
+
const { json } = yield* CommandConfig18;
|
|
958
|
+
if (json) {
|
|
959
|
+
yield* Console18.log(JSON.stringify(profiles, null, 2));
|
|
960
|
+
} else {
|
|
961
|
+
const formatted = profiles.map(printProfile);
|
|
962
|
+
yield* Console18.log(printList3(formatted));
|
|
963
|
+
}
|
|
964
|
+
}));
|
|
965
|
+
|
|
966
|
+
// src/cli/commands/profile/reset.ts
|
|
967
|
+
import * as Command24 from "@effect/cli/Command";
|
|
968
|
+
import * as Options9 from "@effect/cli/Options";
|
|
969
|
+
import * as Prompt3 from "@effect/cli/Prompt";
|
|
970
|
+
import * as FileSystem11 from "@effect/platform/FileSystem";
|
|
971
|
+
import * as Console19 from "effect/Console";
|
|
972
|
+
import * as Effect19 from "effect/Effect";
|
|
973
|
+
import { CommandConfig as CommandConfig19, print as print11 } from "@dxos/cli-util";
|
|
974
|
+
import { DX_DATA as DX_DATA2, getProfilePath as getProfilePath4 } from "@dxos/client-protocol";
|
|
975
|
+
import { ConfigService as ConfigService3 } from "@dxos/config";
|
|
976
|
+
var reset = Command24.make("reset", {
|
|
977
|
+
force: Options9.boolean("force", {
|
|
978
|
+
ifPresent: true
|
|
979
|
+
}).pipe(Options9.withDescription("Skip confirmation prompt"))
|
|
980
|
+
}, Effect19.fnUntraced(function* ({ force }) {
|
|
981
|
+
const fs = yield* FileSystem11.FileSystem;
|
|
982
|
+
const config2 = yield* ConfigService3;
|
|
983
|
+
const { json, profile: profile2 } = yield* CommandConfig19;
|
|
984
|
+
const path = config2.values.runtime?.client?.storage?.dataRoot ?? getProfilePath4(DX_DATA2, profile2);
|
|
985
|
+
if (!force) {
|
|
986
|
+
const confirmed = yield* Prompt3.confirm({
|
|
987
|
+
message: `Are you sure you want to reset the profile (${profile2})?`,
|
|
988
|
+
initial: false
|
|
989
|
+
});
|
|
990
|
+
if (!confirmed) {
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
yield* fs.remove(path, {
|
|
995
|
+
recursive: true
|
|
996
|
+
});
|
|
997
|
+
if (json) {
|
|
998
|
+
yield* Console19.log(JSON.stringify({
|
|
999
|
+
profile: profile2,
|
|
1000
|
+
reset: true
|
|
1001
|
+
}, null, 2));
|
|
1002
|
+
} else {
|
|
1003
|
+
yield* Console19.log(print11(printProfileReset(profile2)));
|
|
1004
|
+
}
|
|
1005
|
+
}));
|
|
1006
|
+
|
|
1007
|
+
// src/cli/commands/profile/index.ts
|
|
1008
|
+
var profile = Command25.make("profile").pipe(Command25.withDescription("Profile commands."), Command25.withSubcommands([
|
|
1009
|
+
create2,
|
|
1010
|
+
del,
|
|
1011
|
+
importCommand,
|
|
1012
|
+
inspect,
|
|
1013
|
+
list3,
|
|
1014
|
+
reset
|
|
1015
|
+
]));
|
|
1016
|
+
|
|
1017
|
+
// src/cli/plugin.ts
|
|
1018
|
+
var ClientPlugin = Plugin2.define(meta).pipe(
|
|
1019
|
+
// TODO(wittjosiah): Could some of these commands make use of operations?
|
|
1020
|
+
AppPlugin.addCommandModule({
|
|
1021
|
+
commands: [
|
|
1022
|
+
config,
|
|
1023
|
+
device,
|
|
1024
|
+
edge,
|
|
1025
|
+
halo,
|
|
1026
|
+
profile
|
|
1027
|
+
]
|
|
1028
|
+
}),
|
|
1029
|
+
AppPlugin.addOperationResolverModule({
|
|
1030
|
+
activate: OperationResolver
|
|
1031
|
+
}),
|
|
1032
|
+
Plugin2.addModule((options) => ({
|
|
1033
|
+
id: Capability.getModuleTag(Client),
|
|
1034
|
+
activatesOn: ActivationEvents.Startup,
|
|
1035
|
+
activatesAfter: [
|
|
1036
|
+
ClientEvents.ClientReady
|
|
1037
|
+
],
|
|
1038
|
+
activate: () => Client(options)
|
|
1039
|
+
})),
|
|
1040
|
+
Plugin2.addModule({
|
|
1041
|
+
activatesOn: ClientEvents.ClientReady,
|
|
1042
|
+
activatesBefore: [
|
|
1043
|
+
AppActivationEvents.SetupSchema
|
|
1044
|
+
],
|
|
1045
|
+
activate: SchemaDefs
|
|
1046
|
+
}),
|
|
1047
|
+
Plugin2.make
|
|
1048
|
+
);
|
|
1049
|
+
export {
|
|
1050
|
+
ClientPlugin
|
|
1051
|
+
};
|
|
1052
|
+
//# sourceMappingURL=index.mjs.map
|