@dxos/plugin-client 0.10.0 → 0.11.0
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/ClientPlugin.mjs +65 -0
- package/dist/lib/ClientPlugin.mjs.map +1 -0
- package/dist/lib/ClientPlugin.node.mjs +904 -0
- package/dist/lib/ClientPlugin.node.mjs.map +1 -0
- package/dist/lib/ClientPlugin.workerd.mjs +10 -0
- package/dist/lib/ClientPlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities/node.mjs +13 -0
- package/dist/lib/capabilities/node.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +23 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-AccountContainer.mjs +190 -0
- package/dist/lib/chunk-AccountContainer.mjs.map +1 -0
- package/dist/lib/chunk-DevicesContainer.mjs +275 -0
- package/dist/lib/chunk-DevicesContainer.mjs.map +1 -0
- package/dist/lib/chunk-InvitationsContainer.mjs +149 -0
- package/dist/lib/chunk-InvitationsContainer.mjs.map +1 -0
- package/dist/lib/chunk-JoinDialog.mjs +35 -0
- package/dist/lib/chunk-JoinDialog.mjs.map +1 -0
- package/dist/lib/chunk-ProfileContainer.mjs +145 -0
- package/dist/lib/chunk-ProfileContainer.mjs.map +1 -0
- package/dist/lib/chunk-RecoveryCodeDialog.mjs +72 -0
- package/dist/lib/chunk-RecoveryCodeDialog.mjs.map +1 -0
- package/dist/lib/chunk-RecoveryCredentialsContainer.mjs +65 -0
- package/dist/lib/chunk-RecoveryCredentialsContainer.mjs.map +1 -0
- package/dist/lib/chunk-ResetDialog.mjs +47 -0
- package/dist/lib/chunk-ResetDialog.mjs.map +1 -0
- package/dist/lib/chunk-UsageContainer.mjs +217 -0
- package/dist/lib/chunk-UsageContainer.mjs.map +1 -0
- package/dist/lib/{neutral/account-cache-YVQKLNV2.mjs → chunk-account-cache.mjs} +10 -12
- package/dist/lib/chunk-account-cache.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +111 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-client.mjs +90 -0
- package/dist/lib/chunk-client.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-GSKMAS3S.mjs → chunk-constants.mjs} +5 -8
- package/dist/lib/chunk-constants.mjs.map +1 -0
- package/dist/lib/chunk-create-agent.mjs +23 -0
- package/dist/lib/chunk-create-agent.mjs.map +1 -0
- package/dist/lib/chunk-create-identity.mjs +28 -0
- package/dist/lib/chunk-create-identity.mjs.map +1 -0
- package/dist/lib/chunk-create-passkey.mjs +85 -0
- package/dist/lib/chunk-create-passkey.mjs.map +1 -0
- package/dist/lib/chunk-create-recovery-code.mjs +31 -0
- package/dist/lib/chunk-create-recovery-code.mjs.map +1 -0
- package/dist/lib/chunk-hooks.mjs +29 -0
- package/dist/lib/chunk-hooks.mjs.map +1 -0
- package/dist/lib/chunk-hub-http-client.mjs +14 -0
- package/dist/lib/chunk-hub-http-client.mjs.map +1 -0
- package/dist/lib/chunk-join-identity.mjs +20 -0
- package/dist/lib/chunk-join-identity.mjs.map +1 -0
- package/dist/lib/chunk-layer-specs.mjs +107 -0
- package/dist/lib/chunk-layer-specs.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-6G4KZLBG.mjs → chunk-meta.mjs} +13 -20
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-migrations.mjs +29 -0
- package/dist/lib/chunk-migrations.mjs.map +1 -0
- package/dist/lib/chunk-navigation-handler.mjs +71 -0
- package/dist/lib/chunk-navigation-handler.mjs.map +1 -0
- package/dist/lib/chunk-navigation-target-loader.mjs +46 -0
- package/dist/lib/chunk-navigation-target-loader.mjs.map +1 -0
- package/dist/lib/chunk-open-usage.mjs +14 -0
- package/dist/lib/chunk-open-usage.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +11 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-operations.mjs +212 -0
- package/dist/lib/chunk-operations.mjs.map +1 -0
- package/dist/lib/chunk-progress.mjs +10 -0
- package/dist/lib/chunk-progress.mjs.map +1 -0
- package/dist/lib/chunk-react-context.mjs +30 -0
- package/dist/lib/chunk-react-context.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +70 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-recover-identity.mjs +17 -0
- package/dist/lib/chunk-recover-identity.mjs.map +1 -0
- package/dist/lib/chunk-redeem-passkey.mjs +72 -0
- package/dist/lib/chunk-redeem-passkey.mjs.map +1 -0
- package/dist/lib/chunk-redeem-token.mjs +24 -0
- package/dist/lib/chunk-redeem-token.mjs.map +1 -0
- package/dist/lib/chunk-remote-trace-monitor.mjs +37 -0
- package/dist/lib/chunk-remote-trace-monitor.mjs.map +1 -0
- package/dist/lib/chunk-reset-storage.mjs +17 -0
- package/dist/lib/chunk-reset-storage.mjs.map +1 -0
- package/dist/lib/chunk-resolve-navigation-targets.mjs +32 -0
- package/dist/lib/chunk-resolve-navigation-targets.mjs.map +1 -0
- package/dist/lib/chunk-schema-defs.mjs +53 -0
- package/dist/lib/chunk-schema-defs.mjs.map +1 -0
- package/dist/lib/chunk-share-identity.mjs +16 -0
- package/dist/lib/chunk-share-identity.mjs.map +1 -0
- package/dist/lib/chunk-space-replication-progress.mjs +94 -0
- package/dist/lib/chunk-space-replication-progress.mjs.map +1 -0
- package/dist/lib/chunk-trace-progress.mjs +69 -0
- package/dist/lib/chunk-trace-progress.mjs.map +1 -0
- package/dist/lib/chunk-update-profile.mjs +15 -0
- package/dist/lib/chunk-update-profile.mjs.map +1 -0
- package/dist/lib/components.mjs +0 -0
- package/dist/lib/containers.mjs +15 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +27 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/operations.mjs +2 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/testing.mjs +21 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +111 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +139 -0
- package/dist/lib/types.mjs.map +1 -0
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/account-cache.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/client.d.ts +1 -1
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/hub-http-client.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +1 -1
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +3 -1
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-target-loader.d.ts +11 -0
- package/dist/types/src/capabilities/navigation-target-loader.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +2 -1
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/remote-trace-monitor.d.ts +15 -0
- package/dist/types/src/capabilities/remote-trace-monitor.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/space-replication-progress.d.ts +11 -0
- package/dist/types/src/capabilities/space-replication-progress.d.ts.map +1 -0
- package/dist/types/src/capabilities/trace-progress.d.ts +17 -0
- package/dist/types/src/capabilities/trace-progress.d.ts.map +1 -0
- package/dist/types/src/commands/account/login/login.d.ts +2 -1
- package/dist/types/src/commands/account/login/login.d.ts.map +1 -1
- package/dist/types/src/commands/account/logout/logout.d.ts +1 -1
- package/dist/types/src/commands/account/logout/logout.d.ts.map +1 -1
- package/dist/types/src/commands/halo/index.d.ts.map +1 -1
- package/dist/types/src/commands/halo/share/share.d.ts.map +1 -1
- package/dist/types/src/commands/profile/create.d.ts.map +1 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.d.ts +4 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.d.ts.map +1 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts +4 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.d.ts +4 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts +4 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +4 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts +4 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts +4 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts +4 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts +4 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts.map +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts +4 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageContainer.d.ts +4 -5
- package/dist/types/src/containers/UsageContainer/UsageContainer.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageView.d.ts +4 -7
- package/dist/types/src/containers/UsageContainer/UsageView.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageView.stories.d.ts +4 -2
- package/dist/types/src/containers/UsageContainer/UsageView.stories.d.ts.map +1 -1
- package/dist/types/src/halo-services-layer.d.ts +19 -0
- package/dist/types/src/halo-services-layer.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +9 -1
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/errors.d.ts +109 -0
- package/dist/types/src/operations/errors.d.ts.map +1 -0
- package/dist/types/src/operations/errors.test.d.ts +2 -0
- package/dist/types/src/operations/errors.test.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +1 -0
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/redeem-passkey.d.ts.map +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +5 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/update-profile.d.ts +5 -0
- package/dist/types/src/operations/update-profile.d.ts.map +1 -0
- package/dist/types/src/progress/index.d.ts +2 -0
- package/dist/types/src/progress/index.d.ts.map +1 -0
- package/dist/types/src/progress/progress-keys.d.ts +6 -0
- package/dist/types/src/progress/progress-keys.d.ts.map +1 -0
- package/dist/types/src/testing/initializeIdentity.d.ts +5 -1
- package/dist/types/src/testing/initializeIdentity.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +10 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +6 -0
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -55
- package/src/ClientPlugin.ts +25 -2
- package/src/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/client.ts +26 -0
- package/src/capabilities/index.ts +10 -0
- package/src/capabilities/layer-specs.ts +64 -2
- package/src/capabilities/migrations.ts +9 -1
- package/src/capabilities/navigation-handler/navigation-handler.ts +20 -3
- package/src/capabilities/navigation-target-loader.ts +70 -0
- package/src/capabilities/react-context.tsx +20 -2
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +14 -12
- package/src/capabilities/remote-trace-monitor.ts +62 -0
- package/src/capabilities/space-replication-progress.ts +143 -0
- package/src/capabilities/trace-progress.ts +84 -0
- package/src/commands/account/login/login.ts +48 -6
- package/src/commands/account/logout/logout.ts +4 -0
- package/src/commands/halo/index.ts +6 -2
- package/src/commands/halo/share/share.ts +16 -5
- package/src/commands/profile/create.ts +23 -40
- package/src/containers/AccountContainer/AccountContainer.tsx +6 -5
- package/src/containers/DevicesContainer/DevicesContainer.tsx +2 -0
- package/src/containers/InvitationsContainer/InvitationsContainer.tsx +2 -0
- package/src/containers/JoinDialog/JoinDialog.tsx +2 -0
- package/src/containers/ProfileContainer/ProfileContainer.tsx +19 -13
- package/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.tsx +2 -0
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx +7 -9
- package/src/containers/ResetDialog/ResetDialog.tsx +2 -0
- package/src/containers/UsageContainer/UsageContainer.tsx +10 -1
- package/src/containers/UsageContainer/UsageView.stories.tsx +0 -12
- package/src/containers/UsageContainer/UsageView.tsx +9 -10
- package/src/halo-services-layer.ts +29 -0
- package/src/index.ts +9 -0
- package/src/operations/definitions.ts +9 -1
- package/src/operations/errors.test.ts +27 -0
- package/src/operations/errors.ts +47 -0
- package/src/operations/index.ts +3 -0
- package/src/operations/open-usage.ts +3 -3
- package/src/operations/redeem-passkey.ts +85 -55
- package/src/operations/resolve-navigation-targets.ts +71 -0
- package/src/operations/share-identity.ts +3 -3
- package/src/operations/update-profile.ts +20 -0
- package/src/progress/index.ts +5 -0
- package/src/progress/progress-keys.ts +15 -0
- package/src/testing/initializeIdentity.ts +10 -2
- package/src/translations.ts +2 -0
- package/src/types/capabilities.ts +15 -1
- package/src/types/schema.ts +7 -0
- package/dist/lib/neutral/AccountContainer-7SF53UON.mjs +0 -186
- package/dist/lib/neutral/AccountContainer-7SF53UON.mjs.map +0 -7
- package/dist/lib/neutral/ClientPlugin.mjs +0 -72
- package/dist/lib/neutral/ClientPlugin.mjs.map +0 -7
- package/dist/lib/neutral/ClientPlugin.node.mjs +0 -1156
- package/dist/lib/neutral/ClientPlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/ClientPlugin.workerd.mjs +0 -16
- package/dist/lib/neutral/ClientPlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/DevicesContainer-PRWIN36N.mjs +0 -271
- package/dist/lib/neutral/DevicesContainer-PRWIN36N.mjs.map +0 -7
- package/dist/lib/neutral/InvitationsContainer-BI5RAWET.mjs +0 -143
- package/dist/lib/neutral/InvitationsContainer-BI5RAWET.mjs.map +0 -7
- package/dist/lib/neutral/JoinDialog-4BWV4CYB.mjs +0 -53
- package/dist/lib/neutral/JoinDialog-4BWV4CYB.mjs.map +0 -7
- package/dist/lib/neutral/ProfileContainer-YEAYOTX5.mjs +0 -169
- package/dist/lib/neutral/ProfileContainer-YEAYOTX5.mjs.map +0 -7
- package/dist/lib/neutral/RecoveryCodeDialog-7EPNKCLB.mjs +0 -59
- package/dist/lib/neutral/RecoveryCodeDialog-7EPNKCLB.mjs.map +0 -7
- package/dist/lib/neutral/RecoveryCredentialsContainer-6BZ2IWX7.mjs +0 -60
- package/dist/lib/neutral/RecoveryCredentialsContainer-6BZ2IWX7.mjs.map +0 -7
- package/dist/lib/neutral/ResetDialog-KUWX45JY.mjs +0 -57
- package/dist/lib/neutral/ResetDialog-KUWX45JY.mjs.map +0 -7
- package/dist/lib/neutral/UsageContainer-2DWCVVE4.mjs +0 -241
- package/dist/lib/neutral/UsageContainer-2DWCVVE4.mjs.map +0 -7
- package/dist/lib/neutral/account-cache-YVQKLNV2.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-RVXTD6OE.mjs +0 -159
- package/dist/lib/neutral/app-graph-builder-RVXTD6OE.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -34
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/node.mjs +0 -21
- package/dist/lib/neutral/capabilities/node.mjs.map +0 -7
- package/dist/lib/neutral/chunk-6G4KZLBG.mjs.map +0 -7
- package/dist/lib/neutral/chunk-7DEIKHB7.mjs +0 -199
- package/dist/lib/neutral/chunk-7DEIKHB7.mjs.map +0 -7
- package/dist/lib/neutral/chunk-A7WDDIWY.mjs +0 -162
- package/dist/lib/neutral/chunk-A7WDDIWY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GSKMAS3S.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JY35S2CN.mjs +0 -27
- package/dist/lib/neutral/chunk-JY35S2CN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZFABGG2E.mjs +0 -8
- package/dist/lib/neutral/chunk-ZFABGG2E.mjs.map +0 -7
- package/dist/lib/neutral/client-7I5Y5SOA.mjs +0 -62
- package/dist/lib/neutral/client-7I5Y5SOA.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -1
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -25
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-agent-6UKJMZS5.mjs +0 -26
- package/dist/lib/neutral/create-agent-6UKJMZS5.mjs.map +0 -7
- package/dist/lib/neutral/create-identity-ULCRB3YH.mjs +0 -42
- package/dist/lib/neutral/create-identity-ULCRB3YH.mjs.map +0 -7
- package/dist/lib/neutral/create-passkey-I7VDS3AC.mjs +0 -81
- package/dist/lib/neutral/create-passkey-I7VDS3AC.mjs.map +0 -7
- package/dist/lib/neutral/create-recovery-code-DH2B6EGP.mjs +0 -36
- package/dist/lib/neutral/create-recovery-code-DH2B6EGP.mjs.map +0 -7
- package/dist/lib/neutral/hub-http-client-WOJUCDKV.mjs +0 -19
- package/dist/lib/neutral/hub-http-client-WOJUCDKV.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -25
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/join-identity-PJCHDNLH.mjs +0 -27
- package/dist/lib/neutral/join-identity-PJCHDNLH.mjs.map +0 -7
- package/dist/lib/neutral/layer-specs-YI7BVWKZ.mjs +0 -59
- package/dist/lib/neutral/layer-specs-YI7BVWKZ.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/migrations-7FTW55ER.mjs +0 -23
- package/dist/lib/neutral/migrations-7FTW55ER.mjs.map +0 -7
- package/dist/lib/neutral/navigation-handler-MQ6MZXLX.mjs +0 -46
- package/dist/lib/neutral/navigation-handler-MQ6MZXLX.mjs.map +0 -7
- package/dist/lib/neutral/open-usage-OJVTPGOY.mjs +0 -27
- package/dist/lib/neutral/open-usage-OJVTPGOY.mjs.map +0 -7
- package/dist/lib/neutral/operation-handler-E3HB7E2T.mjs +0 -13
- package/dist/lib/neutral/operation-handler-E3HB7E2T.mjs.map +0 -7
- package/dist/lib/neutral/operations/index.mjs +0 -12
- package/dist/lib/neutral/operations/index.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -17
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-context-V74T6JOJ.mjs +0 -23
- package/dist/lib/neutral/react-context-V74T6JOJ.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-HPXRA65U.mjs +0 -75
- package/dist/lib/neutral/react-surface-HPXRA65U.mjs.map +0 -7
- package/dist/lib/neutral/recover-identity-B7YM2BR4.mjs +0 -26
- package/dist/lib/neutral/recover-identity-B7YM2BR4.mjs.map +0 -7
- package/dist/lib/neutral/redeem-passkey-TYP4XLHO.mjs +0 -66
- package/dist/lib/neutral/redeem-passkey-TYP4XLHO.mjs.map +0 -7
- package/dist/lib/neutral/redeem-token-2J33R3PV.mjs +0 -29
- package/dist/lib/neutral/redeem-token-2J33R3PV.mjs.map +0 -7
- package/dist/lib/neutral/reset-storage-K47HZTGP.mjs +0 -26
- package/dist/lib/neutral/reset-storage-K47HZTGP.mjs.map +0 -7
- package/dist/lib/neutral/schema-defs-IHBCKTMM.mjs +0 -51
- package/dist/lib/neutral/schema-defs-IHBCKTMM.mjs.map +0 -7
- package/dist/lib/neutral/share-identity-TOROBLWL.mjs +0 -31
- package/dist/lib/neutral/share-identity-TOROBLWL.mjs.map +0 -7
- package/dist/lib/neutral/testing/index.mjs +0 -25
- package/dist/lib/neutral/testing/index.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -124
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -16
- package/dist/lib/neutral/types/index.mjs.map +0 -7
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/account-cache.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
1
|
import { Capability } from "@dxos/app-framework";
|
|
6
|
-
import { createKvsStore } from "@dxos/effect";
|
|
7
2
|
import { AccountCache, ClientCapabilities } from "#types";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import { createKvsStore } from "@dxos/effect";
|
|
5
|
+
//#region src/capabilities/account-cache.ts
|
|
8
6
|
var account_cache_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(ClientCapabilities.AccountCache, createKvsStore({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
key: "composer.account",
|
|
8
|
+
schema: AccountCache,
|
|
9
|
+
defaultValue: () => ({})
|
|
12
10
|
}))));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=account-cache
|
|
11
|
+
//#endregion
|
|
12
|
+
export { account_cache_default as default };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=chunk-account-cache.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-account-cache.mjs","names":[],"sources":["../../src/capabilities/account-cache.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { createKvsStore } from '@dxos/effect';\n\nimport { AccountCache, ClientCapabilities } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n ClientCapabilities.AccountCache,\n createKvsStore<AccountCache>({\n key: 'composer.account',\n schema: AccountCache,\n defaultValue: () => ({}),\n }),\n ),\n ),\n);\n"],"mappings":";;;;;AAWA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,YACT,mBAAmB,cACnB,eAA6B;CAC3B,KAAK;CACL,QAAQ;CACR,qBAAqB,CAAC;AACxB,CAAC,CACH,CACF,CACF"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Capability } from "@dxos/app-framework";
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
import { Operation } from "@dxos/compute";
|
|
4
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
5
|
+
import { Account, ClientCapabilities } from "#types";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import { ClientOperation } from "#operations";
|
|
8
|
+
import { ConnectionState } from "@dxos/client/mesh";
|
|
9
|
+
import { CreateAtom, GraphBuilder, Node, NodeMatcher } from "@dxos/plugin-graph";
|
|
10
|
+
//#region src/capabilities/app-graph-builder.ts
|
|
11
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
12
|
+
const extensions = yield* GraphBuilder.createExtension({
|
|
13
|
+
id: "root",
|
|
14
|
+
match: NodeMatcher.whenRoot,
|
|
15
|
+
actions: () => Effect.succeed([{
|
|
16
|
+
id: "openUserAccount",
|
|
17
|
+
data: () => Operation.invoke(ClientOperation.ShareIdentity),
|
|
18
|
+
properties: {
|
|
19
|
+
label: ["open-user-account.label", { ns: meta.profile.key }],
|
|
20
|
+
icon: "ph--user--regular",
|
|
21
|
+
disposition: "menu",
|
|
22
|
+
keyBinding: {
|
|
23
|
+
macos: "meta+shift+.",
|
|
24
|
+
windows: "alt+shift+.",
|
|
25
|
+
linux: "alt+shift+>"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}]),
|
|
29
|
+
connector: (node, get) => Effect.gen(function* () {
|
|
30
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
31
|
+
const identity = get(CreateAtom.fromObservable(client.halo.identity));
|
|
32
|
+
const status = get(CreateAtom.fromObservable(client.mesh.networkStatus));
|
|
33
|
+
return [Node.make({
|
|
34
|
+
id: Account.id,
|
|
35
|
+
type: meta.profile.key,
|
|
36
|
+
properties: {
|
|
37
|
+
label: ["account.label", { ns: meta.profile.key }],
|
|
38
|
+
icon: "ph--user--regular",
|
|
39
|
+
disposition: "user-account",
|
|
40
|
+
testId: "clientPlugin.account",
|
|
41
|
+
userId: identity?.identityKey.toHex(),
|
|
42
|
+
hue: identity?.profile?.data?.hue,
|
|
43
|
+
emoji: identity?.profile?.data?.emoji,
|
|
44
|
+
status: status.swarm === ConnectionState.OFFLINE ? "error" : "active"
|
|
45
|
+
},
|
|
46
|
+
nodes: [
|
|
47
|
+
Node.make({
|
|
48
|
+
id: Account.Profile,
|
|
49
|
+
data: Account.Profile,
|
|
50
|
+
type: meta.profile.key,
|
|
51
|
+
properties: {
|
|
52
|
+
label: ["profile.label", { ns: meta.profile.key }],
|
|
53
|
+
icon: "ph--user--regular"
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
Node.make({
|
|
57
|
+
id: Account.Account,
|
|
58
|
+
data: Account.Account,
|
|
59
|
+
type: meta.profile.key,
|
|
60
|
+
properties: {
|
|
61
|
+
label: ["account-panel.label", { ns: meta.profile.key }],
|
|
62
|
+
icon: "ph--identification-card--regular"
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
Node.make({
|
|
66
|
+
id: Account.Devices,
|
|
67
|
+
data: Account.Devices,
|
|
68
|
+
type: meta.profile.key,
|
|
69
|
+
properties: {
|
|
70
|
+
label: ["devices.label", { ns: meta.profile.key }],
|
|
71
|
+
icon: "ph--devices--regular",
|
|
72
|
+
testId: "clientPlugin.devices"
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
Node.make({
|
|
76
|
+
id: Account.Security,
|
|
77
|
+
data: Account.Security,
|
|
78
|
+
type: meta.profile.key,
|
|
79
|
+
properties: {
|
|
80
|
+
label: ["security.label", { ns: meta.profile.key }],
|
|
81
|
+
icon: "ph--key--regular"
|
|
82
|
+
}
|
|
83
|
+
}),
|
|
84
|
+
Node.make({
|
|
85
|
+
id: Account.Invitations,
|
|
86
|
+
data: Account.Invitations,
|
|
87
|
+
type: meta.profile.key,
|
|
88
|
+
properties: {
|
|
89
|
+
label: ["invitations-panel.label", { ns: meta.profile.key }],
|
|
90
|
+
icon: "ph--ticket--regular"
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
Node.make({
|
|
94
|
+
id: Account.Usage,
|
|
95
|
+
data: Account.Usage,
|
|
96
|
+
type: meta.profile.key,
|
|
97
|
+
properties: {
|
|
98
|
+
label: ["usage-panel.label", { ns: meta.profile.key }],
|
|
99
|
+
icon: "ph--chart-bar--regular"
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
})];
|
|
104
|
+
}).pipe(Effect.orDie)
|
|
105
|
+
});
|
|
106
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
107
|
+
}));
|
|
108
|
+
//#endregion
|
|
109
|
+
export { app_graph_builder_default as default };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=chunk-app-graph-builder.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { ConnectionState } from '@dxos/client/mesh';\nimport { Operation } from '@dxos/compute';\nimport { CreateAtom, GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';\n\nimport { meta } from '#meta';\nimport { ClientOperation } from '#operations';\nimport { Account, ClientCapabilities } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* GraphBuilder.createExtension({\n id: 'root',\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: 'openUserAccount',\n data: () => Operation.invoke(ClientOperation.ShareIdentity),\n properties: {\n label: ['open-user-account.label', { ns: meta.profile.key }],\n icon: 'ph--user--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n },\n },\n ]),\n connector: (node, get) =>\n Effect.gen(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const identity = get(CreateAtom.fromObservable(client.halo.identity));\n const status = get(CreateAtom.fromObservable(client.mesh.networkStatus));\n\n return [\n Node.make({\n id: Account.id,\n type: meta.profile.key,\n properties: {\n label: ['account.label', { ns: meta.profile.key }],\n icon: 'ph--user--regular',\n disposition: 'user-account',\n testId: 'clientPlugin.account',\n // NOTE: This currently needs to be the identity key because the fallback is generated from hex.\n userId: identity?.identityKey.toHex(),\n hue: identity?.profile?.data?.hue,\n emoji: identity?.profile?.data?.emoji,\n status: status.swarm === ConnectionState.OFFLINE ? 'error' : 'active',\n },\n nodes: [\n Node.make({\n id: Account.Profile,\n data: Account.Profile,\n type: meta.profile.key,\n properties: {\n label: ['profile.label', { ns: meta.profile.key }],\n icon: 'ph--user--regular',\n },\n }),\n Node.make({\n id: Account.Account,\n data: Account.Account,\n type: meta.profile.key,\n properties: {\n label: ['account-panel.label', { ns: meta.profile.key }],\n icon: 'ph--identification-card--regular',\n },\n }),\n Node.make({\n id: Account.Devices,\n data: Account.Devices,\n type: meta.profile.key,\n properties: {\n label: ['devices.label', { ns: meta.profile.key }],\n icon: 'ph--devices--regular',\n testId: 'clientPlugin.devices',\n },\n }),\n Node.make({\n id: Account.Security,\n data: Account.Security,\n type: meta.profile.key,\n properties: {\n label: ['security.label', { ns: meta.profile.key }],\n icon: 'ph--key--regular',\n },\n }),\n Node.make({\n id: Account.Invitations,\n data: Account.Invitations,\n type: meta.profile.key,\n properties: {\n label: ['invitations-panel.label', { ns: meta.profile.key }],\n icon: 'ph--ticket--regular',\n },\n }),\n Node.make({\n id: Account.Usage,\n data: Account.Usage,\n type: meta.profile.key,\n properties: {\n label: ['usage-panel.label', { ns: meta.profile.key }],\n icon: 'ph--chart-bar--regular',\n },\n }),\n ],\n }),\n ];\n }).pipe(Effect.orDie),\n });\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;;;AAgBA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,aAAa,OAAO,aAAa,gBAAgB;EACrD,IAAI;EACJ,OAAO,YAAY;EACnB,eACE,OAAO,QAAQ,CACb;GACE,IAAI;GACJ,YAAY,UAAU,OAAO,gBAAgB,aAAa;GAC1D,YAAY;IACV,OAAO,CAAC,2BAA2B,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IAC3D,MAAM;IACN,aAAa;IACb,YAAY;KACV,OAAO;KAEP,SAAS;KACT,OAAO;IACT;GACF;EACF,CACF,CAAC;EACH,YAAY,MAAM,QAChB,OAAO,IAAI,aAAa;GACtB,MAAM,SAAS,OAAO,WAAW,IAAI,mBAAmB,MAAM;GAC9D,MAAM,WAAW,IAAI,WAAW,eAAe,OAAO,KAAK,QAAQ,CAAC;GACpE,MAAM,SAAS,IAAI,WAAW,eAAe,OAAO,KAAK,aAAa,CAAC;GAEvE,OAAO,CACL,KAAK,KAAK;IACR,IAAI,QAAQ;IACZ,MAAM,KAAK,QAAQ;IACnB,YAAY;KACV,OAAO,CAAC,iBAAiB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;KACjD,MAAM;KACN,aAAa;KACb,QAAQ;KAER,QAAQ,UAAU,YAAY,MAAM;KACpC,KAAK,UAAU,SAAS,MAAM;KAC9B,OAAO,UAAU,SAAS,MAAM;KAChC,QAAQ,OAAO,UAAU,gBAAgB,UAAU,UAAU;IAC/D;IACA,OAAO;KACL,KAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM,QAAQ;MACd,MAAM,KAAK,QAAQ;MACnB,YAAY;OACV,OAAO,CAAC,iBAAiB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;OACjD,MAAM;MACR;KACF,CAAC;KACD,KAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM,QAAQ;MACd,MAAM,KAAK,QAAQ;MACnB,YAAY;OACV,OAAO,CAAC,uBAAuB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;OACvD,MAAM;MACR;KACF,CAAC;KACD,KAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM,QAAQ;MACd,MAAM,KAAK,QAAQ;MACnB,YAAY;OACV,OAAO,CAAC,iBAAiB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;OACjD,MAAM;OACN,QAAQ;MACV;KACF,CAAC;KACD,KAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM,QAAQ;MACd,MAAM,KAAK,QAAQ;MACnB,YAAY;OACV,OAAO,CAAC,kBAAkB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;OAClD,MAAM;MACR;KACF,CAAC;KACD,KAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM,QAAQ;MACd,MAAM,KAAK,QAAQ;MACnB,YAAY;OACV,OAAO,CAAC,2BAA2B,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;OAC3D,MAAM;MACR;KACF,CAAC;KACD,KAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM,QAAQ;MACd,MAAM,KAAK,QAAQ;MACnB,YAAY;OACV,OAAO,CAAC,qBAAqB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;OACrD,MAAM;MACR;KACF,CAAC;IACH;GACF,CAAC,CACH;EACF,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK;CACxB,CAAC;CAED,OAAO,WAAW,YAAY,gBAAgB,iBAAiB,UAAU;AAC3E,CAAC,CACH"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Capabilities, Capability, Plugin } from "@dxos/app-framework";
|
|
2
|
+
import { ClientCapabilities, ClientEvents } from "#types";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import { Client, ClientService } from "@dxos/client";
|
|
5
|
+
import { log } from "@dxos/log";
|
|
6
|
+
import { EffectEx } from "@dxos/effect";
|
|
7
|
+
import { makeIdentityService, makeSpaceService } from "@dxos/halo-adapter-client";
|
|
8
|
+
//#region src/capabilities/client.ts
|
|
9
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/capabilities/client.ts";
|
|
10
|
+
var client_default = Capability.makeModule(Effect.fnUntraced(function* ({ onClientInitialized, onSpacesReady, ...options }) {
|
|
11
|
+
const capabilityManager = yield* Capability.Service;
|
|
12
|
+
const pluginManager = yield* Plugin.Service;
|
|
13
|
+
log("creating client", void 0, {
|
|
14
|
+
"~LogMeta": "~LogMeta",
|
|
15
|
+
F: __dxlog_file,
|
|
16
|
+
L: 26,
|
|
17
|
+
S: this
|
|
18
|
+
});
|
|
19
|
+
const client = new Client(options);
|
|
20
|
+
log("initializing client (calling client.initialize())...", void 0, {
|
|
21
|
+
"~LogMeta": "~LogMeta",
|
|
22
|
+
F: __dxlog_file,
|
|
23
|
+
L: 28,
|
|
24
|
+
S: this
|
|
25
|
+
});
|
|
26
|
+
yield* Effect.tryPromise(() => client.initialize());
|
|
27
|
+
log("client.initialize() returned successfully", void 0, {
|
|
28
|
+
"~LogMeta": "~LogMeta",
|
|
29
|
+
F: __dxlog_file,
|
|
30
|
+
L: 30,
|
|
31
|
+
S: this
|
|
32
|
+
});
|
|
33
|
+
if (onClientInitialized) yield* onClientInitialized({ client }).pipe(Effect.provideService(Capability.Service, capabilityManager), Effect.provideService(Plugin.Service, pluginManager));
|
|
34
|
+
log("called client initialized callback", void 0, {
|
|
35
|
+
"~LogMeta": "~LogMeta",
|
|
36
|
+
F: __dxlog_file,
|
|
37
|
+
L: 37,
|
|
38
|
+
S: this
|
|
39
|
+
});
|
|
40
|
+
client.reloaded.on(() => {
|
|
41
|
+
client.halo.identity.subscribe(async (identity) => {
|
|
42
|
+
if (identity) window.location.href = window.location.origin;
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
client.services.reconnected?.on(() => {
|
|
46
|
+
log.info("client reconnected, reloading to re-establish session", void 0, {
|
|
47
|
+
"~LogMeta": "~LogMeta",
|
|
48
|
+
F: __dxlog_file,
|
|
49
|
+
L: 61,
|
|
50
|
+
S: this
|
|
51
|
+
});
|
|
52
|
+
if (client.resetting) window.location.href = window.location.origin;
|
|
53
|
+
else window.location.reload();
|
|
54
|
+
});
|
|
55
|
+
let spacesReadyFired = false;
|
|
56
|
+
const subscription = client.spaces.subscribe(async () => {
|
|
57
|
+
if (!spacesReadyFired) {
|
|
58
|
+
spacesReadyFired = true;
|
|
59
|
+
await Effect.gen(function* () {
|
|
60
|
+
yield* Plugin.activate(ClientEvents.SpacesReady);
|
|
61
|
+
if (onSpacesReady) yield* onSpacesReady({ client });
|
|
62
|
+
}).pipe(Effect.provideService(Capability.Service, capabilityManager), Effect.provideService(Plugin.Service, pluginManager), EffectEx.runAndForwardErrors);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
log("client capability ready", void 0, {
|
|
66
|
+
"~LogMeta": "~LogMeta",
|
|
67
|
+
F: __dxlog_file,
|
|
68
|
+
L: 86,
|
|
69
|
+
S: this
|
|
70
|
+
});
|
|
71
|
+
return [
|
|
72
|
+
Capability.contributes(ClientCapabilities.Client, client, () => Effect.gen(function* () {
|
|
73
|
+
log.info("client capability: destroying client", void 0, {
|
|
74
|
+
"~LogMeta": "~LogMeta",
|
|
75
|
+
F: __dxlog_file,
|
|
76
|
+
L: 93,
|
|
77
|
+
S: this
|
|
78
|
+
});
|
|
79
|
+
subscription.unsubscribe();
|
|
80
|
+
yield* Effect.tryPromise(() => client.destroy());
|
|
81
|
+
})),
|
|
82
|
+
Capability.contributes(Capabilities.Layer, ClientService.fromClient(client)),
|
|
83
|
+
Capability.contributes(ClientCapabilities.IdentityService, makeIdentityService(client)),
|
|
84
|
+
Capability.contributes(ClientCapabilities.SpaceService, makeSpaceService(client))
|
|
85
|
+
];
|
|
86
|
+
}));
|
|
87
|
+
//#endregion
|
|
88
|
+
export { client_default as default };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=chunk-client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-client.mjs","names":[],"sources":["../../src/capabilities/client.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability, Plugin } from '@dxos/app-framework';\nimport { Client, ClientService } from '@dxos/client';\nimport { EffectEx } from '@dxos/effect';\nimport { makeIdentityService, makeSpaceService } from '@dxos/halo-adapter-client';\nimport { log } from '@dxos/log';\n\nimport { ClientEvents } from '#types';\nimport { ClientCapabilities, type ClientPluginOptions } from '#types';\n\ntype ClientCapabilityOptions = Omit<\n ClientPluginOptions,\n 'appKey' | 'shareableLinkOrigin' | 'invitationPath' | 'invitationParam' | 'onReset'\n>;\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ onClientInitialized, onSpacesReady, ...options }: ClientCapabilityOptions) {\n const capabilityManager = yield* Capability.Service;\n const pluginManager = yield* Plugin.Service;\n\n log('creating client');\n const client = new Client(options);\n log('initializing client (calling client.initialize())...');\n yield* Effect.tryPromise(() => client.initialize());\n log('client.initialize() returned successfully');\n if (onClientInitialized) {\n yield* onClientInitialized({ client }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n );\n }\n log('called client initialized callback');\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n\n // Interim fix: when a guest tab reconnects to a newly-elected leader worker (e.g. after the\n // previous leader tab closes), its proxies are left in a broken state. Force a full reload to\n // re-establish a clean session until the reconnect flow can recover in place.\n // TODO(dmaretskyi): Remove once guest tabs recover from a leader handover without reloading.\n //\n // `client.reset()` also fires this event (its teardown reconnects this tab to a fresh worker),\n // and reset must reload too, but to a different URL. `reload()` re-requests the *current* URL\n // (path included); after a reset the current route (e.g. the Devices settings panel where reset\n // was triggered) points at now-deleted data, so reopening it shows stale/broken UI. Navigating\n // to `origin` instead drops the path and boots the app fresh — which is also what the app's own\n // post-reset flow targets. The two branches differ only when the path isn't already `/`; a\n // normal reconnect keeps the user where they were, a reset returns them to the root.\n client.services.reconnected?.on(() => {\n log.info('client reconnected, reloading to re-establish session');\n if (client.resetting) {\n window.location.href = window.location.origin;\n } else {\n window.location.reload();\n }\n });\n\n let spacesReadyFired = false;\n const subscription = client.spaces.subscribe(async () => {\n if (!spacesReadyFired) {\n spacesReadyFired = true;\n await Effect.gen(function* () {\n yield* Plugin.activate(ClientEvents.SpacesReady);\n if (onSpacesReady) {\n yield* onSpacesReady({ client });\n }\n }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n EffectEx.runAndForwardErrors,\n );\n }\n });\n\n log('client capability ready');\n\n return [\n // TODO(wittjosiah): Try to remove and prefer layer?\n // Perhaps move to using layer has source of truth and add a getter capability for the client.\n Capability.contributes(ClientCapabilities.Client, client, () =>\n Effect.gen(function* () {\n log.info('client capability: destroying client');\n // TODO(dmaretskyi): use scope for destroy.\n subscription.unsubscribe();\n yield* Effect.tryPromise(() => client.destroy());\n }),\n ),\n Capability.contributes(Capabilities.Layer, ClientService.fromClient(client)),\n // HALO service instances for imperative consumers (so plugins read identity/spaces\n // through @dxos/halo instead of the client directly).\n Capability.contributes(ClientCapabilities.IdentityService, makeIdentityService(client)),\n Capability.contributes(ClientCapabilities.SpaceService, makeSpaceService(client)),\n ];\n }),\n);\n"],"mappings":";;;;;;;;;AAoBA,IAAA,iBAAe,WAAW,WACxB,OAAO,WAAW,WAAW,EAAE,qBAAqB,eAAe,GAAG,WAAoC;CACxG,MAAM,oBAAoB,OAAO,WAAW;CAC5C,MAAM,gBAAgB,OAAO,OAAO;CAEpC,IAAI,mBAAgB,KAAA,GAAA;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;CAAA,CAAC;CACrB,MAAM,SAAS,IAAI,OAAO,OAAO;CACjC,IAAI,wDAAqD,KAAA,GAAA;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;CAAA,CAAC;CAC1D,OAAO,OAAO,iBAAiB,OAAO,WAAW,CAAC;CAClD,IAAI,6CAA0C,KAAA,GAAA;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;CAAA,CAAC;CAC/C,IAAI,qBACF,OAAO,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAAC,KACrC,OAAO,eAAe,WAAW,SAAS,iBAAiB,GAC3D,OAAO,eAAe,OAAO,SAAS,aAAa,CACrD;CAEF,IAAI,sCAAmC,KAAA,GAAA;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;CAAA,CAAC;CAGxC,OAAO,SAAS,SAAS;EACvB,OAAO,KAAK,SAAS,UAAU,OAAO,aAAa;GACjD,IAAI,UACF,OAAO,SAAS,OAAO,OAAO,SAAS;EAE3C,CAAC;CACH,CAAC;CAcD,OAAO,SAAS,aAAa,SAAS;EACpC,IAAI,KAAK,yDAAsD,KAAA,GAAA;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA;EAAA,CAAC;EAChE,IAAI,OAAO,WACT,OAAO,SAAS,OAAO,OAAO,SAAS;OAEvC,OAAO,SAAS,OAAO;CAE3B,CAAC;CAED,IAAI,mBAAmB;CACvB,MAAM,eAAe,OAAO,OAAO,UAAU,YAAY;EACvD,IAAI,CAAC,kBAAkB;GACrB,mBAAmB;GACnB,MAAM,OAAO,IAAI,aAAa;IAC5B,OAAO,OAAO,SAAS,aAAa,WAAW;IAC/C,IAAI,eACF,OAAO,cAAc,EAAE,OAAO,CAAC;GAEnC,CAAC,CAAC,CAAC,KACD,OAAO,eAAe,WAAW,SAAS,iBAAiB,GAC3D,OAAO,eAAe,OAAO,SAAS,aAAa,GACnD,SAAS,mBACX;EACF;CACF,CAAC;CAED,IAAI,2BAAwB,KAAA,GAAA;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;CAAA,CAAC;CAE7B,OAAO;EAGL,WAAW,YAAY,mBAAmB,QAAQ,cAChD,OAAO,IAAI,aAAa;GACtB,IAAI,KAAK,wCAAqC,KAAA,GAAA;IAAA,YAAA;IAAA,GAAA;IAAA,GAAA;IAAA,GAAA;GAAA,CAAC;GAE/C,aAAa,YAAY;GACzB,OAAO,OAAO,iBAAiB,OAAO,QAAQ,CAAC;EACjD,CAAC,CACH;EACA,WAAW,YAAY,aAAa,OAAO,cAAc,WAAW,MAAM,CAAC;EAG3E,WAAW,YAAY,mBAAmB,iBAAiB,oBAAoB,MAAM,CAAC;EACtF,WAAW,YAAY,mBAAmB,cAAc,iBAAiB,MAAM,CAAC;CAClF;AACF,CAAC,CACH"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
// src/constants.ts
|
|
2
|
-
import { DXN } from "@dxos/keys";
|
|
3
1
|
import { meta } from "#meta";
|
|
2
|
+
import { DXN } from "@dxos/keys";
|
|
3
|
+
//#region src/constants.ts
|
|
4
4
|
var JOIN_DIALOG = DXN.make(`${meta.profile.key}.joinDialog`);
|
|
5
5
|
var RECOVERY_CODE_DIALOG = DXN.make(`${meta.profile.key}.recoveryCodeDialog`);
|
|
6
6
|
var RESET_DIALOG = DXN.make(`${meta.profile.key}.resetDialog`);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { RECOVERY_CODE_DIALOG as n, RESET_DIALOG as r, JOIN_DIALOG as t };
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
JOIN_DIALOG,
|
|
10
|
-
RECOVERY_CODE_DIALOG,
|
|
11
|
-
RESET_DIALOG
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-GSKMAS3S.mjs.map
|
|
10
|
+
//# sourceMappingURL=chunk-constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-constants.mjs","names":[],"sources":["../../src/constants.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { DXN } from '@dxos/keys';\n\nimport { meta } from '#meta';\n\nexport const JOIN_DIALOG = DXN.make(`${meta.profile.key}.joinDialog`);\nexport const RECOVERY_CODE_DIALOG = DXN.make(`${meta.profile.key}.recoveryCodeDialog`);\nexport const RESET_DIALOG = DXN.make(`${meta.profile.key}.resetDialog`);\n"],"mappings":";;;AAQA,IAAa,cAAc,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,YAAY;AACpE,IAAa,uBAAuB,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,oBAAoB;AACrF,IAAa,eAAe,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,aAAa"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { s as CreateAgent } from "./chunk-operations.mjs";
|
|
2
|
+
import { ClientCapabilities } from "./types.mjs";
|
|
3
|
+
import { Capability } from "@dxos/app-framework";
|
|
4
|
+
import { Operation } from "@dxos/compute";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import { invariant } from "@dxos/invariant";
|
|
7
|
+
//#region src/operations/create-agent.ts
|
|
8
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/operations/create-agent.ts";
|
|
9
|
+
var handler = CreateAgent.pipe(Operation.withHandler(Effect.fnUntraced(function* () {
|
|
10
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
11
|
+
invariant(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
12
|
+
"~LogMeta": "~LogMeta",
|
|
13
|
+
F: __dxlog_file,
|
|
14
|
+
L: 18,
|
|
15
|
+
S: this,
|
|
16
|
+
A: ["client.services.services.EdgeAgentService", "'Missing EdgeAgentService'"]
|
|
17
|
+
});
|
|
18
|
+
yield* Effect.promise(() => client.services.services.EdgeAgentService.createAgent(void 0, { timeout: 1e4 }));
|
|
19
|
+
})));
|
|
20
|
+
//#endregion
|
|
21
|
+
export { handler as default };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=chunk-create-agent.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-create-agent.mjs","names":[],"sources":["../../src/operations/create-agent.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { invariant } from '@dxos/invariant';\n\nimport { ClientCapabilities } from '../types';\nimport { CreateAgent } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateAgent> = CreateAgent.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n yield* Effect.promise(() =>\n client.services.services.EdgeAgentService!.createAgent(undefined, { timeout: 10_000 }),\n );\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;AAaA,IAAM,UAAqD,YAAY,KACrE,UAAU,YACR,OAAO,WAAW,aAAa;CAC7B,MAAM,SAAS,OAAO,WAAW,IAAI,mBAAmB,MAAM;CAC9D,UAAU,OAAO,SAAS,SAAS,kBAAkB,4BAAyB;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA,CAAA,6CAAA,4BAAA;CAAA,CAAC;CAC/E,OAAO,OAAO,cACZ,OAAO,SAAS,SAAS,iBAAkB,YAAY,KAAA,GAAW,EAAE,SAAS,IAAO,CAAC,CACvF;AACF,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { c as CreateIdentity } from "./chunk-operations.mjs";
|
|
2
|
+
import { ClientCapabilities, ClientEvents } from "./types.mjs";
|
|
3
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
4
|
+
import { IdentityDid } from "@dxos/keys";
|
|
5
|
+
import { Operation } from "@dxos/compute";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import { EffectEx } from "@dxos/effect";
|
|
8
|
+
import { ObservabilityOperation } from "@dxos/plugin-observability";
|
|
9
|
+
import { createIdFromSpaceKey } from "@dxos/echo-protocol";
|
|
10
|
+
//#region src/operations/create-identity.ts
|
|
11
|
+
var handler = CreateIdentity.pipe(Operation.withHandler(Effect.fnUntraced(function* (profile) {
|
|
12
|
+
const manager = yield* Capability.get(Capabilities.PluginManager);
|
|
13
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
14
|
+
const data = yield* Effect.promise(() => client.halo.createIdentity(profile));
|
|
15
|
+
const spaceKey = data.spaceKey;
|
|
16
|
+
const spaceId = spaceKey ? yield* Effect.promise(() => createIdFromSpaceKey(spaceKey)) : void 0;
|
|
17
|
+
yield* Effect.promise(() => EffectEx.runAndForwardErrors(manager.activate(ClientEvents.IdentityCreated)));
|
|
18
|
+
yield* Operation.schedule(ObservabilityOperation.SendEvent, { name: "identity.create" });
|
|
19
|
+
return {
|
|
20
|
+
identityDid: IdentityDid.make(data.did),
|
|
21
|
+
...spaceId !== void 0 && { spaceId },
|
|
22
|
+
...data.profile !== void 0 && { profile: data.profile }
|
|
23
|
+
};
|
|
24
|
+
})));
|
|
25
|
+
//#endregion
|
|
26
|
+
export { handler as default };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=chunk-create-identity.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-create-identity.mjs","names":[],"sources":["../../src/operations/create-identity.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { createIdFromSpaceKey } from '@dxos/echo-protocol';\nimport { EffectEx } from '@dxos/effect';\nimport { IdentityDid } from '@dxos/keys';\nimport { ObservabilityOperation } from '@dxos/plugin-observability';\n\nimport { ClientEvents } from '../types';\nimport { ClientCapabilities } from '../types';\nimport { CreateIdentity } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateIdentity> = CreateIdentity.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (profile) {\n const manager = yield* Capability.get(Capabilities.PluginManager);\n const client = yield* Capability.get(ClientCapabilities.Client);\n const data = yield* Effect.promise(() => client.halo.createIdentity(profile));\n const spaceKey = data.spaceKey;\n const spaceId = spaceKey ? yield* Effect.promise(() => createIdFromSpaceKey(spaceKey)) : undefined;\n yield* Effect.promise(() => EffectEx.runAndForwardErrors(manager.activate(ClientEvents.IdentityCreated)));\n yield* Operation.schedule(ObservabilityOperation.SendEvent, { name: 'identity.create' });\n return {\n identityDid: IdentityDid.make(data.did),\n ...(spaceId !== undefined && { spaceId }),\n ...(data.profile !== undefined && { profile: data.profile }),\n };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;;AAiBA,IAAM,UAAwD,eAAe,KAC3E,UAAU,YACR,OAAO,WAAW,WAAW,SAAS;CACpC,MAAM,UAAU,OAAO,WAAW,IAAI,aAAa,aAAa;CAChE,MAAM,SAAS,OAAO,WAAW,IAAI,mBAAmB,MAAM;CAC9D,MAAM,OAAO,OAAO,OAAO,cAAc,OAAO,KAAK,eAAe,OAAO,CAAC;CAC5E,MAAM,WAAW,KAAK;CACtB,MAAM,UAAU,WAAW,OAAO,OAAO,cAAc,qBAAqB,QAAQ,CAAC,IAAI,KAAA;CACzF,OAAO,OAAO,cAAc,SAAS,oBAAoB,QAAQ,SAAS,aAAa,eAAe,CAAC,CAAC;CACxG,OAAO,UAAU,SAAS,uBAAuB,WAAW,EAAE,MAAM,kBAAkB,CAAC;CACvF,OAAO;EACL,aAAa,YAAY,KAAK,KAAK,GAAG;EACtC,GAAI,YAAY,KAAA,KAAa,EAAE,QAAQ;EACvC,GAAI,KAAK,YAAY,KAAA,KAAa,EAAE,SAAS,KAAK,QAAQ;CAC5D;AACF,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { l as CreatePasskey } from "./chunk-operations.mjs";
|
|
2
|
+
import { ClientCapabilities } from "./types.mjs";
|
|
3
|
+
import { Capability } from "@dxos/app-framework";
|
|
4
|
+
import { Operation } from "@dxos/compute";
|
|
5
|
+
import { NativePasskey } from "@dxos/app-toolkit";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Match from "effect/Match";
|
|
8
|
+
import { PublicKey } from "@dxos/client";
|
|
9
|
+
import { invariant } from "@dxos/invariant";
|
|
10
|
+
//#region src/operations/create-passkey.ts
|
|
11
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/operations/create-passkey.ts";
|
|
12
|
+
var handler = CreatePasskey.pipe(Operation.withHandler(Effect.fnUntraced(function* () {
|
|
13
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
14
|
+
const identity = client.halo.identity.get();
|
|
15
|
+
invariant(identity, "Identity not available", {
|
|
16
|
+
"~LogMeta": "~LogMeta",
|
|
17
|
+
F: __dxlog_file,
|
|
18
|
+
L: 22,
|
|
19
|
+
S: this,
|
|
20
|
+
A: ["identity", "'Identity not available'"]
|
|
21
|
+
});
|
|
22
|
+
const lookupKey = PublicKey.random();
|
|
23
|
+
const { recoveryKey, algorithm } = yield* Match.value(NativePasskey.supportsNativePasskeys()).pipe(Match.when(true, () => Effect.gen(function* () {
|
|
24
|
+
const result = yield* Effect.promise(() => NativePasskey.createNativePasskey({
|
|
25
|
+
username: identity.did,
|
|
26
|
+
userId: lookupKey.asUint8Array()
|
|
27
|
+
}));
|
|
28
|
+
const { publicKey, algorithm: alg } = NativePasskey.extractPublicKeyFromAttestation(result.attestation_object);
|
|
29
|
+
return {
|
|
30
|
+
recoveryKey: PublicKey.from(publicKey),
|
|
31
|
+
algorithm: alg === -7 ? "ES256" : "ED25519"
|
|
32
|
+
};
|
|
33
|
+
})), Match.orElse(() => Effect.gen(function* () {
|
|
34
|
+
const credential = yield* Effect.promise(() => navigator.credentials.create({ publicKey: {
|
|
35
|
+
challenge: /* @__PURE__ */ new Uint8Array(),
|
|
36
|
+
rp: {
|
|
37
|
+
id: location.hostname,
|
|
38
|
+
name: "Composer"
|
|
39
|
+
},
|
|
40
|
+
user: {
|
|
41
|
+
id: lookupKey.asUint8Array(),
|
|
42
|
+
name: identity.did,
|
|
43
|
+
displayName: identity.profile?.displayName ?? ""
|
|
44
|
+
},
|
|
45
|
+
pubKeyCredParams: [{
|
|
46
|
+
type: "public-key",
|
|
47
|
+
alg: -8
|
|
48
|
+
}, {
|
|
49
|
+
type: "public-key",
|
|
50
|
+
alg: -7
|
|
51
|
+
}],
|
|
52
|
+
authenticatorSelection: {
|
|
53
|
+
residentKey: "required",
|
|
54
|
+
requireResidentKey: true
|
|
55
|
+
}
|
|
56
|
+
} }));
|
|
57
|
+
invariant(credential, "Credential not available", {
|
|
58
|
+
"~LogMeta": "~LogMeta",
|
|
59
|
+
F: __dxlog_file,
|
|
60
|
+
L: 67,
|
|
61
|
+
S: this,
|
|
62
|
+
A: ["credential", "'Credential not available'"]
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
recoveryKey: PublicKey.from(new Uint8Array(credential.response.getPublicKey())),
|
|
66
|
+
algorithm: credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519"
|
|
67
|
+
};
|
|
68
|
+
})));
|
|
69
|
+
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
70
|
+
"~LogMeta": "~LogMeta",
|
|
71
|
+
F: __dxlog_file,
|
|
72
|
+
L: 76,
|
|
73
|
+
S: this,
|
|
74
|
+
A: ["client.services.services.IdentityService", "'IdentityService not available'"]
|
|
75
|
+
});
|
|
76
|
+
yield* Effect.promise(() => client.services.services.IdentityService.createRecoveryCredential({ data: {
|
|
77
|
+
recoveryKey,
|
|
78
|
+
algorithm,
|
|
79
|
+
lookupKey
|
|
80
|
+
} }));
|
|
81
|
+
})));
|
|
82
|
+
//#endregion
|
|
83
|
+
export { handler as default };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=chunk-create-passkey.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-create-passkey.mjs","names":[],"sources":["../../src/operations/create-passkey.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Match from 'effect/Match';\n\nimport { Capability } from '@dxos/app-framework';\nimport { NativePasskey } from '@dxos/app-toolkit';\nimport { PublicKey } from '@dxos/client';\nimport { Operation } from '@dxos/compute';\nimport { invariant } from '@dxos/invariant';\n\nimport { ClientCapabilities } from '../types';\nimport { CreatePasskey } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreatePasskey> = CreatePasskey.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n const lookupKey = PublicKey.random();\n\n const { recoveryKey, algorithm } = yield* Match.value(NativePasskey.supportsNativePasskeys()).pipe(\n Match.when(true, () =>\n Effect.gen(function* () {\n const result = yield* Effect.promise(() =>\n NativePasskey.createNativePasskey({\n username: identity.did,\n userId: lookupKey.asUint8Array(),\n }),\n );\n const { publicKey, algorithm: alg } = NativePasskey.extractPublicKeyFromAttestation(\n result.attestation_object,\n );\n return {\n recoveryKey: PublicKey.from(publicKey),\n algorithm: alg === -7 ? 'ES256' : 'ED25519',\n };\n }),\n ),\n Match.orElse(() =>\n Effect.gen(function* () {\n const credential = yield* Effect.promise(() =>\n navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: 'Composer' },\n user: {\n id: lookupKey.asUint8Array() as Uint8Array<ArrayBuffer>,\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 },\n { type: 'public-key', alg: -7 },\n ],\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n }),\n );\n invariant(credential, 'Credential not available');\n return {\n recoveryKey: PublicKey.from(new Uint8Array((credential as any).response.getPublicKey())),\n algorithm: (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519',\n };\n }),\n ),\n );\n\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n yield* Effect.promise(() =>\n client.services.services.IdentityService!.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n }),\n );\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,UAAuD,cAAc,KACzE,UAAU,YACR,OAAO,WAAW,aAAa;CAC7B,MAAM,SAAS,OAAO,WAAW,IAAI,mBAAmB,MAAM;CAC9D,MAAM,WAAW,OAAO,KAAK,SAAS,IAAI;CAC1C,UAAU,UAAU,0BAAuB;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA,CAAA,YAAA,0BAAA;CAAA,CAAC;CAE5C,MAAM,YAAY,UAAU,OAAO;CAEnC,MAAM,EAAE,aAAa,cAAc,OAAO,MAAM,MAAM,cAAc,uBAAuB,CAAC,CAAC,CAAC,KAC5F,MAAM,KAAK,YACT,OAAO,IAAI,aAAa;EACtB,MAAM,SAAS,OAAO,OAAO,cAC3B,cAAc,oBAAoB;GAChC,UAAU,SAAS;GACnB,QAAQ,UAAU,aAAa;EACjC,CAAC,CACH;EACA,MAAM,EAAE,WAAW,WAAW,QAAQ,cAAc,gCAClD,OAAO,kBACT;EACA,OAAO;GACL,aAAa,UAAU,KAAK,SAAS;GACrC,WAAW,QAAQ,KAAK,UAAU;EACpC;CACF,CAAC,CACH,GACA,MAAM,aACJ,OAAO,IAAI,aAAa;EACtB,MAAM,aAAa,OAAO,OAAO,cAC/B,UAAU,YAAY,OAAO,EAC3B,WAAW;GACT,2BAAW,IAAI,WAAW;GAC1B,IAAI;IAAE,IAAI,SAAS;IAAU,MAAM;GAAW;GAC9C,MAAM;IACJ,IAAI,UAAU,aAAa;IAC3B,MAAM,SAAS;IACf,aAAa,SAAS,SAAS,eAAe;GAChD;GACA,kBAAkB,CAChB;IAAE,MAAM;IAAc,KAAK;GAAG,GAC9B;IAAE,MAAM;IAAc,KAAK;GAAG,CAChC;GACA,wBAAwB;IACtB,aAAa;IACb,oBAAoB;GACtB;EACF,EACF,CAAC,CACH;EACA,UAAU,YAAY,4BAAyB;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA,CAAA,cAAA,4BAAA;EAAA,CAAC;EAChD,OAAO;GACL,aAAa,UAAU,KAAK,IAAI,WAAY,WAAmB,SAAS,aAAa,CAAC,CAAC;GACvF,WAAY,WAAmB,SAAS,sBAAsB,MAAM,KAAK,UAAU;EACrF;CACF,CAAC,CACH,CACF;CAEA,UAAU,OAAO,SAAS,SAAS,iBAAiB,iCAA8B;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA,CAAA,4CAAA,iCAAA;CAAA,CAAC;CACnF,OAAO,OAAO,cACZ,OAAO,SAAS,SAAS,gBAAiB,yBAAyB,EACjE,MAAM;EACJ;EACA;EACA;CACF,EACF,CAAC,CACH;AACF,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { u as CreateRecoveryCode } from "./chunk-operations.mjs";
|
|
2
|
+
import { ClientCapabilities } from "./types.mjs";
|
|
3
|
+
import { n as RECOVERY_CODE_DIALOG } from "./chunk-constants.mjs";
|
|
4
|
+
import { Capability } from "@dxos/app-framework";
|
|
5
|
+
import { Operation } from "@dxos/compute";
|
|
6
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { invariant } from "@dxos/invariant";
|
|
9
|
+
//#region src/operations/create-recovery-code.ts
|
|
10
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/operations/create-recovery-code.ts";
|
|
11
|
+
var handler = CreateRecoveryCode.pipe(Operation.withHandler(Effect.fnUntraced(function* () {
|
|
12
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
13
|
+
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
14
|
+
"~LogMeta": "~LogMeta",
|
|
15
|
+
F: __dxlog_file,
|
|
16
|
+
L: 20,
|
|
17
|
+
S: this,
|
|
18
|
+
A: ["client.services.services.IdentityService", "'IdentityService not available'"]
|
|
19
|
+
});
|
|
20
|
+
const { recoveryCode } = yield* Effect.promise(() => client.services.services.IdentityService.createRecoveryCredential({}));
|
|
21
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
22
|
+
subject: RECOVERY_CODE_DIALOG,
|
|
23
|
+
blockAlign: "start",
|
|
24
|
+
type: "alert",
|
|
25
|
+
props: { code: recoveryCode }
|
|
26
|
+
});
|
|
27
|
+
})));
|
|
28
|
+
//#endregion
|
|
29
|
+
export { handler as default };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=chunk-create-recovery-code.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-create-recovery-code.mjs","names":[],"sources":["../../src/operations/create-recovery-code.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { invariant } from '@dxos/invariant';\n\nimport { RECOVERY_CODE_DIALOG } from '../constants';\nimport { ClientCapabilities } from '../types';\nimport { CreateRecoveryCode } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateRecoveryCode> = CreateRecoveryCode.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { recoveryCode } = yield* Effect.promise(() =>\n client.services.services.IdentityService!.createRecoveryCredential({}),\n );\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: RECOVERY_CODE_DIALOG,\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n });\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;;AAeA,IAAM,UAA4D,mBAAmB,KACnF,UAAU,YACR,OAAO,WAAW,aAAa;CAC7B,MAAM,SAAS,OAAO,WAAW,IAAI,mBAAmB,MAAM;CAC9D,UAAU,OAAO,SAAS,SAAS,iBAAiB,iCAA8B;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA,CAAA,4CAAA,iCAAA;CAAA,CAAC;CACnF,MAAM,EAAE,iBAAiB,OAAO,OAAO,cACrC,OAAO,SAAS,SAAS,gBAAiB,yBAAyB,CAAC,CAAC,CACvE;CACA,OAAO,UAAU,OAAO,gBAAgB,cAAc;EACpD,SAAS;EACT,YAAY;EACZ,MAAM;EACN,OAAO,EAAE,MAAM,aAAa;CAC9B,CAAC;AACH,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ClientCapabilities } from "#types";
|
|
2
|
+
import { createEdgeIdentity } from "@dxos/client/edge";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { useCapabilities } from "@dxos/app-framework/ui";
|
|
5
|
+
import { useClient } from "@dxos/react-client";
|
|
6
|
+
import { useIdentity } from "@dxos/react-client/halo";
|
|
7
|
+
//#region src/hooks/useHubClient.ts
|
|
8
|
+
/**
|
|
9
|
+
* Returns the shared `HubHttpClient` singleton for hub-service API calls.
|
|
10
|
+
* Updates the VP-auth identity whenever the signed-in user changes.
|
|
11
|
+
* Returns `undefined` when the hub URL is unconfigured (no HubHttpClient capability).
|
|
12
|
+
*/
|
|
13
|
+
var useHubHttpClient = () => {
|
|
14
|
+
const client = useClient();
|
|
15
|
+
const identity = useIdentity();
|
|
16
|
+
const [hubHttpClient] = useCapabilities(ClientCapabilities.HubHttpClient);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (hubHttpClient && identity) hubHttpClient.setIdentity(createEdgeIdentity(client));
|
|
19
|
+
}, [
|
|
20
|
+
client,
|
|
21
|
+
identity,
|
|
22
|
+
hubHttpClient
|
|
23
|
+
]);
|
|
24
|
+
return hubHttpClient ?? void 0;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { useHubHttpClient as t };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=chunk-hooks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-hooks.mjs","names":[],"sources":["../../src/hooks/useHubClient.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { useCapabilities } from '@dxos/app-framework/ui';\nimport { createEdgeIdentity } from '@dxos/client/edge';\nimport { type HubHttpClient } from '@dxos/edge-client';\nimport { useClient } from '@dxos/react-client';\nimport { useIdentity } from '@dxos/react-client/halo';\n\nimport { ClientCapabilities } from '#types';\n\n/**\n * Returns the shared `HubHttpClient` singleton for hub-service API calls.\n * Updates the VP-auth identity whenever the signed-in user changes.\n * Returns `undefined` when the hub URL is unconfigured (no HubHttpClient capability).\n */\nexport const useHubHttpClient = (): HubHttpClient | undefined => {\n const client = useClient();\n const identity = useIdentity();\n const [hubHttpClient] = useCapabilities(ClientCapabilities.HubHttpClient);\n\n useEffect(() => {\n if (hubHttpClient && identity) {\n hubHttpClient.setIdentity(createEdgeIdentity(client));\n }\n }, [client, identity, hubHttpClient]);\n\n return hubHttpClient ?? undefined;\n};\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAa,yBAAoD;CAC/D,MAAM,SAAS,UAAU;CACzB,MAAM,WAAW,YAAY;CAC7B,MAAM,CAAC,iBAAiB,gBAAgB,mBAAmB,aAAa;CAExE,gBAAgB;EACd,IAAI,iBAAiB,UACnB,cAAc,YAAY,mBAAmB,MAAM,CAAC;CAExD,GAAG;EAAC;EAAQ;EAAU;CAAa,CAAC;CAEpC,OAAO,iBAAiB,KAAA;AAC1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Capability } from "@dxos/app-framework";
|
|
2
|
+
import { ClientCapabilities } from "#types";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import { HubHttpClient } from "@dxos/edge-client";
|
|
5
|
+
//#region src/capabilities/hub-http-client.ts
|
|
6
|
+
var hub_http_client_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
7
|
+
const hubUrl = (yield* Capability.get(ClientCapabilities.Client)).config.values?.runtime?.app?.env?.DX_HUB_URL;
|
|
8
|
+
if (!hubUrl) return [];
|
|
9
|
+
return Capability.contributes(ClientCapabilities.HubHttpClient, new HubHttpClient(hubUrl));
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { hub_http_client_default as default };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=chunk-hub-http-client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-hub-http-client.mjs","names":[],"sources":["../../src/capabilities/hub-http-client.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { HubHttpClient } from '@dxos/edge-client';\n\nimport { ClientCapabilities } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const hubUrl = client.config.values?.runtime?.app?.env?.DX_HUB_URL;\n if (!hubUrl) {\n return [];\n }\n return Capability.contributes(ClientCapabilities.HubHttpClient, new HubHttpClient(hubUrl));\n }),\n);\n"],"mappings":";;;;;AAWA,IAAA,0BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAE7B,MAAM,UAAS,OADO,WAAW,IAAI,mBAAmB,MAAM,EAAA,CACxC,OAAO,QAAQ,SAAS,KAAK,KAAK;CACxD,IAAI,CAAC,QACH,OAAO,CAAC;CAEV,OAAO,WAAW,YAAY,mBAAmB,eAAe,IAAI,cAAc,MAAM,CAAC;AAC3F,CAAC,CACH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { d as JoinIdentity } from "./chunk-operations.mjs";
|
|
2
|
+
import { t as JOIN_DIALOG } from "./chunk-constants.mjs";
|
|
3
|
+
import { Operation } from "@dxos/compute";
|
|
4
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
//#region src/operations/join-identity.ts
|
|
7
|
+
var handler = JoinIdentity.pipe(Operation.withHandler(Effect.fnUntraced(function* (data) {
|
|
8
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
9
|
+
subject: JOIN_DIALOG,
|
|
10
|
+
blockAlign: "start",
|
|
11
|
+
props: {
|
|
12
|
+
initialInvitationCode: data.invitationCode,
|
|
13
|
+
initialDisposition: "accept-halo-invitation"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
})));
|
|
17
|
+
//#endregion
|
|
18
|
+
export { handler as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=chunk-join-identity.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-join-identity.mjs","names":[],"sources":["../../src/operations/join-identity.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { JOIN_DIALOG } from '../constants';\nimport { JoinIdentity } from './definitions';\n\nconst handler: Operation.WithHandler<typeof JoinIdentity> = JoinIdentity.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (data) {\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: JOIN_DIALOG,\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;AAYA,IAAM,UAAsD,aAAa,KACvE,UAAU,YACR,OAAO,WAAW,WAAW,MAAM;CACjC,OAAO,UAAU,OAAO,gBAAgB,cAAc;EACpD,SAAS;EACT,YAAY;EACZ,OAAO;GACL,uBAAuB,KAAK;GAC5B,oBAAoB;EACtB;CACF,CAAC;AACH,CAAC,CACH,CACF"}
|