@dxos/shell 0.5.1-main.f02b2c7 → 0.5.1-main.f2d5836

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/bundle/shell.mjs +7059 -7017
  2. package/dist/bundle/shell.mjs.map +1 -1
  3. package/dist/bundle/shell.umd.js +64 -64
  4. package/dist/bundle/shell.umd.js.map +1 -1
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/react.mjs +148 -80
  7. package/dist/lib/browser/react.mjs.map +3 -3
  8. package/dist/lib/browser/testing/index.mjs +3 -2
  9. package/dist/lib/browser/testing/index.mjs.map +3 -3
  10. package/dist/types/src/components/DeviceList/DeviceListItem.js +1 -1
  11. package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -1
  12. package/dist/types/src/composites/Shell/Shell.d.ts +1 -2
  13. package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
  14. package/dist/types/src/composites/Shell/Shell.js +24 -4
  15. package/dist/types/src/composites/Shell/Shell.js.map +1 -1
  16. package/dist/types/src/composites/Shell/ShellContext.js +1 -1
  17. package/dist/types/src/composites/Shell/ShellContext.js.map +1 -1
  18. package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts +10 -2
  19. package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts.map +1 -1
  20. package/dist/types/src/composites/Shell/memory-shell-runtime.js +20 -1
  21. package/dist/types/src/composites/Shell/memory-shell-runtime.js.map +1 -1
  22. package/dist/types/src/composites/Shell/run-shell.d.ts.map +1 -1
  23. package/dist/types/src/composites/Shell/run-shell.js +29 -9
  24. package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
  25. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +1 -1
  26. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
  27. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +1 -1
  28. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
  29. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts +1 -3
  30. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
  31. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +3 -2
  32. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
  33. package/dist/types/src/panels/JoinPanel/JoinPanel.js +2 -2
  34. package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
  35. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
  36. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +2 -18
  37. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
  38. package/dist/types/src/steps/ConfirmReset.js +1 -1
  39. package/dist/types/src/steps/ConfirmReset.js.map +1 -1
  40. package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
  41. package/dist/types/src/steps/InvitationManager.js +3 -0
  42. package/dist/types/src/steps/InvitationManager.js.map +1 -1
  43. package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
  44. package/dist/types/src/testing/shell-manager.js +3 -2
  45. package/dist/types/src/testing/shell-manager.js.map +1 -1
  46. package/dist/types/src/translations/locales/en-US.d.ts +2 -0
  47. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  48. package/dist/types/src/translations/locales/en-US.js +11 -9
  49. package/dist/types/src/translations/locales/en-US.js.map +1 -1
  50. package/package.json +21 -21
  51. package/src/components/DeviceList/DeviceListItem.tsx +1 -1
  52. package/src/composites/Shell/Shell.tsx +36 -5
  53. package/src/composites/Shell/ShellContext.tsx +1 -1
  54. package/src/composites/Shell/memory-shell-runtime.ts +36 -2
  55. package/src/composites/Shell/run-shell.tsx +59 -18
  56. package/src/panels/IdentityPanel/IdentityPanel.tsx +1 -1
  57. package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +2 -2
  58. package/src/panels/IdentityPanel/useAgentHandlers.ts +3 -4
  59. package/src/panels/JoinPanel/JoinPanel.tsx +2 -2
  60. package/src/panels/SpacePanel/steps/SpaceManager.tsx +2 -18
  61. package/src/steps/ConfirmReset.tsx +1 -1
  62. package/src/steps/InvitationManager.tsx +3 -0
  63. package/src/testing/shell-manager.ts +4 -2
  64. package/src/translations/locales/en-US.ts +11 -9
@@ -582,11 +582,11 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
582
582
  DeviceType.AGENT_MANAGED
583
583
  ].includes(device.profile.type) ? /* @__PURE__ */ React9.createElement(Robot, iconProps) : device.profile.type === DeviceType.MOBILE ? /* @__PURE__ */ React9.createElement(DeviceMobile, iconProps) : /* @__PURE__ */ React9.createElement(Devices, iconProps) : /* @__PURE__ */ React9.createElement(Avatar3.Fallback, {
584
584
  text: fallbackValue.emoji
585
- })), isCurrent && /* @__PURE__ */ React9.createElement(Tag, {
586
- color: "primary"
587
- }, t("current device tag label")), /* @__PURE__ */ React9.createElement(Avatar3.Label, {
585
+ })), /* @__PURE__ */ React9.createElement(Avatar3.Label, {
588
586
  classNames: "flex-1 text-sm truncate"
589
- }, displayName), device.kind === DeviceKind.CURRENT && /* @__PURE__ */ React9.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React9.createElement(DropdownMenu2.Trigger, {
587
+ }, displayName), isCurrent && /* @__PURE__ */ React9.createElement(Tag, {
588
+ color: "primary"
589
+ }, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */ React9.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React9.createElement(DropdownMenu2.Trigger, {
590
590
  asChild: true
591
591
  }, /* @__PURE__ */ React9.createElement(Button5, {
592
592
  variant: "ghost",
@@ -1178,7 +1178,7 @@ import { CopySimple, Plugs, PlugsConnected } from "@phosphor-icons/react";
1178
1178
  import React29, { useEffect as useEffect3, useMemo as useMemo3, useState as useState8 } from "react";
1179
1179
  import { generateName as generateName3 } from "@dxos/display-name";
1180
1180
  import { log as log6 } from "@dxos/log";
1181
- import { useClient as useClient3 } from "@dxos/react-client";
1181
+ import { useClient as useClient4 } from "@dxos/react-client";
1182
1182
  import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
1183
1183
  import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
1184
1184
  import { useNetworkStatus, ConnectionState } from "@dxos/react-client/mesh";
@@ -1296,7 +1296,7 @@ var useIdentityMachine = (client, options) => {
1296
1296
  // packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
1297
1297
  import React25, { useCallback as useCallback4 } from "react";
1298
1298
  import { log as log2 } from "@dxos/log";
1299
- import { useAgentHostingProviderClient, useClient as useClient2 } from "@dxos/react-client";
1299
+ import { useAgentHostingClient, useClient as useClient2 } from "@dxos/react-client";
1300
1300
  import { useHaloInvitations } from "@dxos/react-client/halo";
1301
1301
  import { Invitation as Invitation2, InvitationEncoder } from "@dxos/react-client/invitations";
1302
1302
  var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx";
@@ -1304,7 +1304,7 @@ var IdentityActionChooser = (props) => {
1304
1304
  const { send } = props;
1305
1305
  const client = useClient2();
1306
1306
  const invitations = useHaloInvitations();
1307
- const agentHostingProviderClient = useAgentHostingProviderClient(client.config);
1307
+ const agentHostingProviderClient = useAgentHostingClient();
1308
1308
  const onInvitationEvent = useCallback4((invitation) => {
1309
1309
  const invitationCode = InvitationEncoder.encode(invitation);
1310
1310
  if (invitation.state === Invitation2.State.CONNECTING) {
@@ -1364,14 +1364,15 @@ import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
1364
1364
  import { useCallback as useCallback5, useEffect as useEffect2, useState as useState6 } from "react";
1365
1365
  import { invariant } from "@dxos/invariant";
1366
1366
  import { log as log4 } from "@dxos/log";
1367
- import { useAgentHostingProviderClient as useAgentHostingProviderClient2 } from "@dxos/react-client";
1367
+ import { useAgentHostingClient as useAgentHostingClient2, useClient as useClient3 } from "@dxos/react-client";
1368
1368
  import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
1369
1369
  var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts";
1370
- var useAgentHandlers = ({ client, invitations, identity }) => {
1370
+ var useAgentHandlers = ({ invitations, identity }) => {
1371
1371
  const [validationMessage, setValidationMessage] = useState6("");
1372
1372
  const [agentStatus, setAgentStatus] = useState6("");
1373
1373
  const [agentActive, setAgentActive] = useState6(false);
1374
- const agentHostingProviderClient = useAgentHostingProviderClient2(client.config);
1374
+ const agentHostingProviderClient = useAgentHostingClient2();
1375
+ const client = useClient3();
1375
1376
  useEffect2(() => {
1376
1377
  const fetchAgentStatus = async () => {
1377
1378
  if (agentHostingProviderClient) {
@@ -1397,13 +1398,13 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
1397
1398
  authCode: invitation.authCode
1398
1399
  }), void 0, {
1399
1400
  F: __dxlog_file3,
1400
- L: 50,
1401
+ L: 49,
1401
1402
  S: void 0,
1402
1403
  C: (f, a) => f(...a)
1403
1404
  });
1404
1405
  invariant(identity, "Identity not found", {
1405
1406
  F: __dxlog_file3,
1406
- L: 51,
1407
+ L: 50,
1407
1408
  S: void 0,
1408
1409
  A: [
1409
1410
  "identity",
@@ -1435,7 +1436,7 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
1435
1436
  const identity2 = client.halo.identity.get();
1436
1437
  invariant(identity2, "Identity not found", {
1437
1438
  F: __dxlog_file3,
1438
- L: 81,
1439
+ L: 80,
1439
1440
  S: void 0,
1440
1441
  A: [
1441
1442
  "identity",
@@ -1523,6 +1524,9 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
1523
1524
  const showAuthCode = statusValue === 3;
1524
1525
  const emoji = hexToEmoji3(id);
1525
1526
  const activeView = useMemo2(() => {
1527
+ if (multiUse) {
1528
+ return "showing qr";
1529
+ }
1526
1530
  switch (true) {
1527
1531
  case statusValue === 5:
1528
1532
  case statusValue < 0:
@@ -1640,7 +1644,9 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
1640
1644
  })),
1641
1645
  disabled,
1642
1646
  "data-testid": `${testIdAffix}.reset-identity-input`,
1643
- placeholder: confirmationValue,
1647
+ placeholder: t("confirmation placeholder", {
1648
+ confirmationValue
1649
+ }),
1644
1650
  onChange: ({ target: { value } }) => setInputValue(value)
1645
1651
  })), /* @__PURE__ */ React28.createElement(Actions, null, onCancel && /* @__PURE__ */ React28.createElement(Action, {
1646
1652
  disabled,
@@ -1833,12 +1839,11 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
1833
1839
  };
1834
1840
  var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
1835
1841
  const titleId = useId6("identityPanel__heading", propsTitleId);
1836
- const client = useClient3();
1842
+ const client = useClient4();
1837
1843
  const devices = useDevices();
1838
1844
  const identity = useIdentity();
1839
1845
  const invitations = useHaloInvitations2();
1840
1846
  const agentProps = useAgentHandlers({
1841
- client,
1842
1847
  identity,
1843
1848
  invitations
1844
1849
  });
@@ -1915,7 +1920,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
1915
1920
  // packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
1916
1921
  import React38, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo4 } from "react";
1917
1922
  import { log as log10 } from "@dxos/log";
1918
- import { useClient as useClient5, useMulticastObservable } from "@dxos/react-client";
1923
+ import { useClient as useClient6, useMulticastObservable } from "@dxos/react-client";
1919
1924
  import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
1920
1925
  import { DensityProvider as DensityProvider2, useId as useId8, useThemeContext as useThemeContext4 } from "@dxos/react-ui";
1921
1926
 
@@ -2654,13 +2659,13 @@ var IdentityAdded = (props) => {
2654
2659
  // packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
2655
2660
  import React33, { useState as useState9 } from "react";
2656
2661
  import { log as log8 } from "@dxos/log";
2657
- import { useClient as useClient4 } from "@dxos/react-client";
2662
+ import { useClient as useClient5 } from "@dxos/react-client";
2658
2663
  import { useTranslation as useTranslation18 } from "@dxos/react-ui";
2659
2664
  var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
2660
2665
  var IdentityInput = (props) => {
2661
2666
  const { send, method } = props;
2662
2667
  const isRecover = method === "recover identity";
2663
- const client = useClient4();
2668
+ const client = useClient5();
2664
2669
  const { t } = useTranslation18("os");
2665
2670
  const [validationMessage, setValidationMessage] = useState9("");
2666
2671
  const createIdentity = (displayName) => {
@@ -2983,7 +2988,7 @@ var JoinPanelImpl = (props) => {
2983
2988
  id: "reset storage confirmation"
2984
2989
  }, /* @__PURE__ */ React38.createElement(ConfirmResetComponent, {
2985
2990
  send,
2986
- active: activeView === "reset identity confirmation",
2991
+ active: activeView === "reset storage confirmation",
2987
2992
  onCancel: onCancelResetStorage,
2988
2993
  onConfirm: onConfirmResetStorage
2989
2994
  })), /* @__PURE__ */ React38.createElement(Viewport.View, {
@@ -3102,7 +3107,7 @@ var JoinPanelImpl = (props) => {
3102
3107
  })))));
3103
3108
  };
3104
3109
  var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
3105
- const client = useClient5();
3110
+ const client = useClient6();
3106
3111
  const identity = useIdentity2();
3107
3112
  const { hasIosKeyboard } = useThemeContext4();
3108
3113
  const titleId = useId8("joinPanel__heading", propsTitleId);
@@ -3150,7 +3155,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
3150
3155
  }):
3151
3156
  return "addition method chooser";
3152
3157
  case joinState.matches("resettingIdentity"):
3153
- return "reset identity confirmation";
3158
+ return "reset storage confirmation";
3154
3159
  case joinState.matches({
3155
3160
  choosingIdentity: "creatingIdentity"
3156
3161
  }):
@@ -3505,8 +3510,8 @@ var SpaceManager = (props) => {
3505
3510
  icon: UsersThree,
3506
3511
  onClick: useCallback8(() => {
3507
3512
  const invitation = space.share?.({
3508
- type: Invitation7.Type.INTERACTIVE,
3509
- authMethod: Invitation7.AuthMethod.NONE,
3513
+ type: Invitation7.Type.DELEGATED,
3514
+ authMethod: Invitation7.AuthMethod.KNOWN_PUBLIC_KEY,
3510
3515
  multiUse: true,
3511
3516
  target
3512
3517
  });
@@ -3746,15 +3751,15 @@ import React47, { StrictMode } from "react";
3746
3751
  import { createRoot } from "react-dom/client";
3747
3752
  import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
3748
3753
  import { ShellRuntimeImpl } from "@dxos/client-services";
3749
- import { Client, ClientContext, ClientServicesProxy, Config, SystemStatus } from "@dxos/react-client";
3750
- import { ThemeProvider, Tooltip as Tooltip7 } from "@dxos/react-ui";
3754
+ import { AgentHostingProvider, Client, ClientContext, ClientServicesProxy, Config, ShellDisplay as ShellDisplay2, SystemStatus } from "@dxos/react-client";
3755
+ import { Button as Button11, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip7, useTranslation as useTranslation26 } from "@dxos/react-ui";
3751
3756
  import { defaultTx } from "@dxos/react-ui-theme";
3752
3757
  import { createIFramePort } from "@dxos/rpc-tunnel";
3753
3758
 
3754
3759
  // packages/sdk/shell/src/composites/Shell/Shell.tsx
3755
3760
  import React46, { useEffect as useEffect7, useState as useState13 } from "react";
3756
3761
  import { log as log14 } from "@dxos/log";
3757
- import { ShellDisplay, ShellLayout, useClient as useClient6 } from "@dxos/react-client";
3762
+ import { ShellDisplay, ShellLayout, useClient as useClient7 } from "@dxos/react-client";
3758
3763
  import { useSpace as useSpace2 } from "@dxos/react-client/echo";
3759
3764
 
3760
3765
  // packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
@@ -3792,17 +3797,37 @@ var StatusDialog = () => {
3792
3797
 
3793
3798
  // packages/sdk/shell/src/composites/Shell/Shell.tsx
3794
3799
  var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
3795
- var Shell = ({ runtime, origin }) => {
3800
+ var Shell = ({ runtime }) => {
3796
3801
  const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState13({
3797
3802
  layout: runtime.layout,
3798
3803
  invitationCode: runtime.invitationCode,
3799
3804
  spaceKey: runtime.spaceKey,
3800
3805
  target: runtime.target
3801
3806
  });
3802
- const client = useClient6();
3807
+ const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState13({
3808
+ invitationUrl: runtime.invitationUrl,
3809
+ deviceInvitationParam: runtime.deviceInvitationParam,
3810
+ spaceInvitationParam: runtime.spaceInvitationParam
3811
+ });
3812
+ const client = useClient7();
3803
3813
  const space = useSpace2(spaceKey);
3814
+ const createDeviceInvitationUrl = (invitationCode2) => {
3815
+ const baseUrl = new URL(invitationUrl);
3816
+ baseUrl.searchParams.set(deviceInvitationParam, invitationCode2);
3817
+ return baseUrl.toString();
3818
+ };
3819
+ const createSpaceInvitationUrl = (invitationCode2) => {
3820
+ const baseUrl = new URL(invitationUrl);
3821
+ baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
3822
+ return baseUrl.toString();
3823
+ };
3804
3824
  useEffect7(() => {
3805
- return runtime.layoutUpdate.on((request) => setLayout(request));
3825
+ const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
3826
+ const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
3827
+ return () => {
3828
+ unsubscribeLayout();
3829
+ unsubscribeInvitationUrl();
3830
+ };
3806
3831
  }, [
3807
3832
  runtime
3808
3833
  ]);
@@ -3810,7 +3835,7 @@ var Shell = ({ runtime, origin }) => {
3810
3835
  if (layout === ShellLayout.SPACE && !space) {
3811
3836
  log14.warn("No space found for shell space invitations.", void 0, {
3812
3837
  F: __dxlog_file13,
3813
- L: 33,
3838
+ L: 64,
3814
3839
  S: void 0,
3815
3840
  C: (f, a) => f(...a)
3816
3841
  });
@@ -3854,7 +3879,7 @@ var Shell = ({ runtime, origin }) => {
3854
3879
  case ShellLayout.SHARE_IDENTITY:
3855
3880
  case ShellLayout.EDIT_PROFILE:
3856
3881
  return /* @__PURE__ */ React46.createElement(IdentityDialog, {
3857
- createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
3882
+ createInvitationUrl: createDeviceInvitationUrl,
3858
3883
  onResetStorage: async () => {
3859
3884
  runtime.setLayout({
3860
3885
  layout: ShellLayout.STATUS
@@ -3888,7 +3913,7 @@ var Shell = ({ runtime, origin }) => {
3888
3913
  return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
3889
3914
  space,
3890
3915
  target,
3891
- createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
3916
+ createInvitationUrl: createSpaceInvitationUrl,
3892
3917
  onDone: async () => {
3893
3918
  await runtime.setAppContext({
3894
3919
  display: ShellDisplay.NONE
@@ -4014,21 +4039,22 @@ var os = {
4014
4039
  "auth code message": "Enter the following auth code on the joining device.",
4015
4040
  "display name input label": "Display name",
4016
4041
  "display name input placeholder": "Enter a display name",
4017
- "invite one label": "Invite one",
4042
+ "invite one label": "Single-use invitation",
4018
4043
  "invite one description": "Only one user may join.",
4019
- "invite one qr label": "Single-use",
4044
+ "invite one qr label": "Single-use invitation",
4020
4045
  "invite one list item label": "Active single-use invitation",
4021
- "invite many label": "Invite many",
4046
+ "invite many label": "Standing invitation",
4022
4047
  "invite many description": "Anyone with the link can join.",
4023
- "invite many qr label": "Multiple-use",
4024
- "invite many list item label": "Active multiple-use invitation",
4048
+ "invite many qr label": "Standing invitation",
4049
+ "invite many list item label": "Active standing invitation",
4025
4050
  "invite options label": "Change the active invite option.",
4026
4051
  "reset in progress label": "Resetting...",
4027
4052
  "confirm label": "Confirm",
4028
- "reset storage input label": "This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.",
4029
- "join new identity input label": "In order to join an existing device, storage on this device must be cleared first. Type {{confirmationValue}} to continue.",
4053
+ "reset storage input label": "WARNING: This will delete all data on this device. Type {{confirmationValue}} to continue.",
4054
+ "join new identity input label": "WARNING: To join an existing device all data on this device will be deleted. Type {{confirmationValue}} to continue.",
4030
4055
  "failed to reset identity message": "Failed to reset identity.",
4031
- "confirmation value": "CONFIRM",
4056
+ "confirmation value": "RESET",
4057
+ "confirmation placeholder": "Enter {{confirmationValue}} to continue.",
4032
4058
  "sign out chooser title": "Danger zone",
4033
4059
  "sign out chooser message": "Proceeding with the action below will erase all data on this device.",
4034
4060
  "join new identity label": "Join a new identity",
@@ -4038,7 +4064,7 @@ var os = {
4038
4064
  "clear label": "Use default",
4039
4065
  "select emoji label": "Choose an emoji to use in your avatar",
4040
4066
  "select hue label": "Choose a hue to use in your avatar",
4041
- "resetting message": "One moment while things are reset\u2026",
4067
+ "resetting message": "One moment while the device is reset\u2026",
4042
4068
  "red label": "Red",
4043
4069
  "orange label": "Orange",
4044
4070
  "amber label": "Amber",
@@ -4067,7 +4093,8 @@ var os = {
4067
4093
  "agent message body": "Creating an agent helps keep your devices and peers in-sync. An agent is like any other device, but since it\u2019s always online your changes will sync even when all your physical devices are\xA0asleep.",
4068
4094
  "create agent label": "Start an agent",
4069
4095
  "destroy agent label": "Shut down agent",
4070
- "agent device label": "Your agent"
4096
+ "agent device label": "Your agent",
4097
+ "shell fallback title": "Shell failed to connect"
4071
4098
  };
4072
4099
 
4073
4100
  // packages/sdk/shell/src/translations/index.ts
@@ -4077,39 +4104,62 @@ var osTranslations = {
4077
4104
 
4078
4105
  // packages/sdk/shell/src/composites/Shell/run-shell.tsx
4079
4106
  var runShell = async (config = new Config()) => {
4080
- const services = new ClientServicesProxy(createIFramePort({
4081
- channel: DEFAULT_CLIENT_CHANNEL
4082
- }));
4083
- const client = new Client({
4084
- config,
4085
- services
4086
- });
4087
4107
  const runtime = new ShellRuntimeImpl(createIFramePort({
4088
4108
  channel: DEFAULT_SHELL_CHANNEL
4089
4109
  }));
4090
- await Promise.all([
4091
- runtime.open(),
4092
- client.initialize()
4093
- ]);
4094
- createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
4095
- tx: defaultTx,
4096
- resourceExtensions: [
4097
- osTranslations
4098
- ]
4099
- }, /* @__PURE__ */ React47.createElement(ClientContext.Provider, {
4100
- value: {
4101
- client,
4102
- status: SystemStatus.ACTIVE
4103
- }
4104
- }, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(Shell, {
4105
- runtime,
4106
- origin: location.origin
4107
- })))))));
4110
+ await runtime.open();
4111
+ try {
4112
+ const services = new ClientServicesProxy(createIFramePort({
4113
+ channel: DEFAULT_CLIENT_CHANNEL
4114
+ }));
4115
+ const client = new Client({
4116
+ config,
4117
+ services
4118
+ });
4119
+ await client.initialize();
4120
+ createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
4121
+ tx: defaultTx,
4122
+ resourceExtensions: [
4123
+ osTranslations
4124
+ ]
4125
+ }, /* @__PURE__ */ React47.createElement(ClientContext.Provider, {
4126
+ value: {
4127
+ client,
4128
+ status: SystemStatus.ACTIVE
4129
+ }
4130
+ }, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
4131
+ runtime
4132
+ }))))))));
4133
+ } catch {
4134
+ createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
4135
+ tx: defaultTx,
4136
+ resourceExtensions: [
4137
+ osTranslations
4138
+ ]
4139
+ }, /* @__PURE__ */ React47.createElement(Fallback, {
4140
+ onClose: () => runtime.setAppContext({
4141
+ display: ShellDisplay2.NONE
4142
+ })
4143
+ }))));
4144
+ }
4145
+ };
4146
+ var Fallback = ({ onClose }) => {
4147
+ const { t } = useTranslation26("os");
4148
+ return /* @__PURE__ */ React47.createElement(Dialog3.Root, {
4149
+ modal: true,
4150
+ open: true,
4151
+ onOpenChange: () => onClose?.()
4152
+ }, /* @__PURE__ */ React47.createElement(Dialog3.Overlay, null, /* @__PURE__ */ React47.createElement(Dialog3.Content, null, /* @__PURE__ */ React47.createElement(Dialog3.Title, null, t("shell fallback title")), /* @__PURE__ */ React47.createElement(Dialog3.Close, {
4153
+ asChild: true,
4154
+ onClick: () => onClose?.()
4155
+ }, /* @__PURE__ */ React47.createElement(Button11, {
4156
+ variant: "primary"
4157
+ }, t("close label"))))));
4108
4158
  };
4109
4159
 
4110
4160
  // packages/sdk/shell/src/composites/Shell/ShellContext.tsx
4111
4161
  import React48, { createContext as createContext2, useCallback as useCallback9, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState14 } from "react";
4112
- import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as useClient7 } from "@dxos/react-client";
4162
+ import { ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout3, useClient as useClient8 } from "@dxos/react-client";
4113
4163
  import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
4114
4164
  import { mx as mx25 } from "@dxos/react-ui-theme";
4115
4165
 
@@ -4117,12 +4167,16 @@ import { mx as mx25 } from "@dxos/react-ui-theme";
4117
4167
  import { Event } from "@dxos/async";
4118
4168
  import { ShellLayout as ShellLayout2 } from "@dxos/react-client";
4119
4169
  var MemoryShellRuntime = class {
4120
- constructor({ layout, invitationCode, spaceKey } = {}) {
4170
+ constructor({ layout, invitationCode, spaceKey, invitationUrl, deviceInvitationParam, spaceInvitationParam } = {}) {
4121
4171
  this.layoutUpdate = new Event();
4172
+ this.invitationUrlUpdate = new Event();
4122
4173
  this.contextUpdate = new Event();
4123
4174
  this._layout = layout ?? ShellLayout2.DEFAULT;
4124
4175
  this._invitationCode = invitationCode;
4125
4176
  this._spaceKey = spaceKey;
4177
+ this._invitationUrl = invitationUrl ?? window.location.origin;
4178
+ this._deviceInvitationParam = deviceInvitationParam ?? "deviceInvitationCode";
4179
+ this._spaceInvitationParam = spaceInvitationParam ?? "spaceInvitationCode";
4126
4180
  }
4127
4181
  get layout() {
4128
4182
  return this._layout;
@@ -4133,12 +4187,27 @@ var MemoryShellRuntime = class {
4133
4187
  get spaceKey() {
4134
4188
  return this._spaceKey;
4135
4189
  }
4190
+ get invitationUrl() {
4191
+ return this._invitationUrl;
4192
+ }
4193
+ get deviceInvitationParam() {
4194
+ return this._deviceInvitationParam;
4195
+ }
4196
+ get spaceInvitationParam() {
4197
+ return this._spaceInvitationParam;
4198
+ }
4136
4199
  setLayout(request) {
4137
4200
  this._layout = request.layout;
4138
4201
  this._invitationCode = request.invitationCode;
4139
4202
  this._spaceKey = request.spaceKey;
4140
4203
  this.layoutUpdate.emit(request);
4141
4204
  }
4205
+ setInvitationUrl(request) {
4206
+ this._invitationUrl = request.invitationUrl;
4207
+ this._deviceInvitationParam = request.deviceInvitationParam;
4208
+ this._spaceInvitationParam = request.spaceInvitationParam;
4209
+ this.invitationUrlUpdate.emit(request);
4210
+ }
4142
4211
  async setAppContext(context) {
4143
4212
  this.contextUpdate.emit(context);
4144
4213
  }
@@ -4147,14 +4216,14 @@ var MemoryShellRuntime = class {
4147
4216
  // packages/sdk/shell/src/composites/Shell/ShellContext.tsx
4148
4217
  var ShellContext = /* @__PURE__ */ createContext2({});
4149
4218
  var useShell = () => {
4150
- const client = useClient7();
4219
+ const client = useClient8();
4151
4220
  const { runtime, setDisplay } = useContext2(ShellContext);
4152
4221
  const setLayout = async (layout, options) => {
4153
4222
  if (runtime) {
4154
4223
  if (layout === ShellLayout3.DEFAULT) {
4155
- setDisplay?.(ShellDisplay2.NONE);
4224
+ setDisplay?.(ShellDisplay3.NONE);
4156
4225
  } else {
4157
- setDisplay?.(ShellDisplay2.FULLSCREEN);
4226
+ setDisplay?.(ShellDisplay3.FULLSCREEN);
4158
4227
  }
4159
4228
  runtime.setLayout({
4160
4229
  layout,
@@ -4168,9 +4237,9 @@ var useShell = () => {
4168
4237
  };
4169
4238
  };
4170
4239
  var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
4171
- const client = useClient7();
4240
+ const client = useClient8();
4172
4241
  const identity = useIdentity3();
4173
- const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay2.FULLSCREEN : ShellDisplay2.NONE);
4242
+ const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
4174
4243
  const shellRuntime = useMemo6(() => {
4175
4244
  if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
4176
4245
  return;
@@ -4205,13 +4274,13 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
4205
4274
  shellRuntime.setLayout({
4206
4275
  layout: ShellLayout3.SHARE_IDENTITY
4207
4276
  });
4208
- setDisplay(ShellDisplay2.FULLSCREEN);
4277
+ setDisplay(ShellDisplay3.FULLSCREEN);
4209
4278
  } else if (event.key === "." && modifier) {
4210
4279
  shellRuntime.setLayout({
4211
4280
  layout: ShellLayout3.SPACE,
4212
4281
  spaceKey: space.key
4213
4282
  });
4214
- setDisplay(ShellDisplay2.FULLSCREEN);
4283
+ setDisplay(ShellDisplay3.FULLSCREEN);
4215
4284
  }
4216
4285
  }, [
4217
4286
  space,
@@ -4241,10 +4310,9 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
4241
4310
  shellRuntime
4242
4311
  ]);
4243
4312
  return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
4244
- className: mx25(display === ShellDisplay2.NONE ? "hidden" : "")
4313
+ className: mx25(display === ShellDisplay3.NONE ? "hidden" : "")
4245
4314
  }, /* @__PURE__ */ React48.createElement(Shell, {
4246
- runtime: shellRuntime,
4247
- origin: window.location.origin
4315
+ runtime: shellRuntime
4248
4316
  })), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
4249
4317
  value: {
4250
4318
  runtime: shellRuntime,