@dxos/shell 0.6.14-staging.e15392e → 0.7.1-staging.599df14

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 +5291 -5188
  2. package/dist/bundle/shell.mjs.map +1 -1
  3. package/dist/bundle/shell.umd.js +57 -57
  4. package/dist/bundle/shell.umd.js.map +1 -1
  5. package/dist/bundle/style.css +1 -1
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/browser/react.mjs +97 -91
  8. package/dist/lib/browser/react.mjs.map +3 -3
  9. package/dist/lib/browser/testing/index.mjs +2 -0
  10. package/dist/lib/browser/testing/index.mjs.map +2 -2
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/react.cjs +78 -72
  13. package/dist/lib/node/react.cjs.map +3 -3
  14. package/dist/lib/node/testing/index.cjs +2 -0
  15. package/dist/lib/node/testing/index.cjs.map +2 -2
  16. package/dist/lib/node-esm/meta.json +1 -1
  17. package/dist/lib/node-esm/react.mjs +97 -91
  18. package/dist/lib/node-esm/react.mjs.map +3 -3
  19. package/dist/lib/node-esm/testing/index.mjs +2 -0
  20. package/dist/lib/node-esm/testing/index.mjs.map +2 -2
  21. package/dist/types/src/components/DeviceList/DeviceListItem.d.ts.map +1 -1
  22. package/dist/types/src/components/DeviceList/DeviceListItem.js +4 -10
  23. package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -1
  24. package/dist/types/src/components/Panel/Action.d.ts +2 -0
  25. package/dist/types/src/components/Panel/Action.d.ts.map +1 -1
  26. package/dist/types/src/components/Panel/Action.js +16 -14
  27. package/dist/types/src/components/Panel/Action.js.map +1 -1
  28. package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
  29. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +13 -6
  30. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
  31. package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +1 -0
  32. package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
  33. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
  34. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +3 -3
  35. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
  36. package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.d.ts.map +1 -1
  37. package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js +8 -1
  38. package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js.map +1 -1
  39. package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -1
  40. package/dist/types/src/panels/SpacePanel/SpacePanel.js +2 -2
  41. package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -1
  42. package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts +1 -0
  43. package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts.map +1 -1
  44. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
  45. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +5 -3
  46. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
  47. package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
  48. package/dist/types/src/playwright/invitations-manager.js +9 -1
  49. package/dist/types/src/playwright/invitations-manager.js.map +1 -1
  50. package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
  51. package/dist/types/src/testing/shell-manager.js +2 -0
  52. package/dist/types/src/testing/shell-manager.js.map +1 -1
  53. package/package.json +25 -25
  54. package/src/components/DeviceList/DeviceListItem.tsx +38 -42
  55. package/src/components/Panel/Action.tsx +40 -31
  56. package/src/panels/IdentityPanel/IdentityPanel.tsx +13 -3
  57. package/src/panels/IdentityPanel/IdentityPanelProps.ts +1 -0
  58. package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +5 -3
  59. package/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts +10 -1
  60. package/src/panels/SpacePanel/SpacePanel.tsx +2 -1
  61. package/src/panels/SpacePanel/SpacePanelProps.ts +1 -0
  62. package/src/panels/SpacePanel/steps/SpaceManager.tsx +5 -3
  63. package/src/playwright/invitations-manager.ts +8 -1
  64. package/src/testing/shell-manager.ts +2 -0
@@ -224,11 +224,13 @@ var import_util6 = require("@dxos/util");
224
224
  var import_react_client4 = require("@dxos/react-client");
225
225
  var import_react41 = require("react");
226
226
  var import_invariant2 = require("@dxos/invariant");
227
+ var import_log5 = require("@dxos/log");
227
228
  var import_services = require("@dxos/protocols/proto/dxos/client/services");
229
+ var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
228
230
  var import_react_client5 = require("@dxos/react-client");
229
231
  var import_react42 = require("react");
230
232
  var import_invariant3 = require("@dxos/invariant");
231
- var import_log5 = require("@dxos/log");
233
+ var import_log6 = require("@dxos/log");
232
234
  var import_react_client6 = require("@dxos/react-client");
233
235
  var import_invitations4 = require("@dxos/react-client/invitations");
234
236
  var import_react43 = require("@phosphor-icons/react");
@@ -240,11 +242,11 @@ var import_util7 = require("@dxos/util");
240
242
  var import_invitations5 = require("@dxos/react-client/invitations");
241
243
  var import_react45 = require("@phosphor-icons/react");
242
244
  var import_react46 = __toESM(require("react"));
243
- var import_log6 = require("@dxos/log");
245
+ var import_log7 = require("@dxos/log");
244
246
  var import_react_ui21 = require("@dxos/react-ui");
245
247
  var import_react_ui_theme24 = require("@dxos/react-ui-theme");
246
248
  var import_react47 = __toESM(require("react"));
247
- var import_log7 = require("@dxos/log");
249
+ var import_log8 = require("@dxos/log");
248
250
  var import_react_client7 = require("@dxos/react-client");
249
251
  var import_halo4 = require("@dxos/react-client/halo");
250
252
  var import_react_ui22 = require("@dxos/react-ui");
@@ -255,7 +257,7 @@ var import_react_ui_theme25 = require("@dxos/react-ui-theme");
255
257
  var import_react50 = require("@xstate/react");
256
258
  var import_react51 = require("react");
257
259
  var import_xstate2 = require("xstate");
258
- var import_log8 = require("@dxos/log");
260
+ var import_log9 = require("@dxos/log");
259
261
  var import_react_client8 = require("@dxos/react-client");
260
262
  var import_invitations6 = require("@dxos/react-client/invitations");
261
263
  var import_react52 = require("@phosphor-icons/react");
@@ -268,13 +270,13 @@ var import_react_ui25 = require("@dxos/react-ui");
268
270
  var import_react_ui_theme27 = require("@dxos/react-ui-theme");
269
271
  var import_util8 = require("@dxos/util");
270
272
  var import_react55 = __toESM(require("react"));
271
- var import_log9 = require("@dxos/log");
273
+ var import_log10 = require("@dxos/log");
272
274
  var import_react_client9 = require("@dxos/react-client");
273
275
  var import_react_ui26 = require("@dxos/react-ui");
274
276
  var import_react56 = __toESM(require("react"));
275
277
  var import_react_ui27 = require("@dxos/react-ui");
276
278
  var import_react57 = __toESM(require("react"));
277
- var import_log10 = require("@dxos/log");
279
+ var import_log11 = require("@dxos/log");
278
280
  var import_react_ui28 = require("@dxos/react-ui");
279
281
  var import_react58 = __toESM(require("react"));
280
282
  var import_react_ui29 = require("@dxos/react-ui");
@@ -287,15 +289,15 @@ var import_util9 = require("@dxos/util");
287
289
  var import_invitations8 = require("@dxos/react-client/invitations");
288
290
  var import_react60 = require("@phosphor-icons/react");
289
291
  var import_react61 = __toESM(require("react"));
290
- var import_log11 = require("@dxos/log");
292
+ var import_log12 = require("@dxos/log");
291
293
  var import_invitations9 = require("@dxos/react-client/invitations");
292
294
  var import_react_ui31 = require("@dxos/react-ui");
293
295
  var import_react62 = require("@xstate/react");
294
296
  var import_xstate3 = require("xstate");
295
- var import_log12 = require("@dxos/log");
297
+ var import_log13 = require("@dxos/log");
296
298
  var import_react63 = require("@phosphor-icons/react");
297
299
  var import_react64 = __toESM(require("react"));
298
- var import_log13 = require("@dxos/log");
300
+ var import_log14 = require("@dxos/log");
299
301
  var import_react_client10 = require("@dxos/react-client");
300
302
  var import_echo4 = require("@dxos/react-client/echo");
301
303
  var import_invitations10 = require("@dxos/react-client/invitations");
@@ -313,7 +315,7 @@ var import_react_ui35 = require("@dxos/react-ui");
313
315
  var import_react_ui_theme31 = require("@dxos/react-ui-theme");
314
316
  var import_rpc_tunnel = require("@dxos/rpc-tunnel");
315
317
  var import_react68 = __toESM(require("react"));
316
- var import_log14 = require("@dxos/log");
318
+ var import_log15 = require("@dxos/log");
317
319
  var import_react_client12 = require("@dxos/react-client");
318
320
  var import_react_client13 = require("@dxos/react-client");
319
321
  var import_echo5 = require("@dxos/react-client/echo");
@@ -848,7 +850,7 @@ var iconProps = {
848
850
  x: 8,
849
851
  y: 8
850
852
  };
851
- var DeviceListItem = /* @__PURE__ */ (0, import_react17.forwardRef)(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy, ...props }, forwardedRef) => {
853
+ var DeviceListItem = /* @__PURE__ */ (0, import_react17.forwardRef)(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy: _, ...props }, forwardedRef) => {
852
854
  const { t } = (0, import_react_ui9.useTranslation)("os");
853
855
  const fallbackValue = (0, import_util2.keyToFallback)(device.deviceKey);
854
856
  const labelId = (0, import_react_ui9.useId)("identityListItem__label");
@@ -882,21 +884,7 @@ var DeviceListItem = /* @__PURE__ */ (0, import_react17.forwardRef)(({ device, o
882
884
  classNames: "flex-1 text-sm truncate"
883
885
  }, displayName), isCurrent && /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tag, {
884
886
  color: "primary"
885
- }, t("current device tag label")), device.profile?.type === import_halo.DeviceType.AGENT_MANAGED ? /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Trigger, {
886
- asChild: true
887
- }, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Button, {
888
- variant: "ghost",
889
- classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
890
- "data-testid": "agent.destroy",
891
- onClick: onAgentDestroy
892
- }, /* @__PURE__ */ import_react17.default.createElement("span", {
893
- className: "sr-only"
894
- }, t("destroy agent label")), /* @__PURE__ */ import_react17.default.createElement(import_react16.Power, {
895
- className: (0, import_react_ui_theme9.getSize)(5)
896
- }))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Portal, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Content, {
897
- side: "bottom",
898
- classNames: "z-50"
899
- }, t("destroy agent label")))) : device.kind === import_halo.DeviceKind.CURRENT && /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Trigger, {
887
+ }, t("current device tag label")), device.kind === import_halo.DeviceKind.CURRENT && /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Trigger, {
900
888
  asChild: true
901
889
  }, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Button, {
902
890
  variant: "ghost",
@@ -1187,7 +1175,8 @@ var defaultActions = {
1187
1175
  }
1188
1176
  };
1189
1177
  var BifurcatedAction = /* @__PURE__ */ (0, import_react24.forwardRef)((props, forwardedRef) => {
1190
- const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, ...rest } = props;
1178
+ const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, "data-testid": testId, ...rest } = props;
1179
+ const dropdownTestId = testId && `${testId}.more`;
1191
1180
  const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] = (0, import_react_use_controllable_state3.useControllableState)({
1192
1181
  prop: propsActiveAction,
1193
1182
  onChange: onChangeActiveAction,
@@ -1206,6 +1195,7 @@ var BifurcatedAction = /* @__PURE__ */ (0, import_react24.forwardRef)((props, fo
1206
1195
  ],
1207
1196
  ref: forwardedRef,
1208
1197
  variant,
1198
+ "data-testid": testId,
1209
1199
  onClick: activeAction.onClick
1210
1200
  }, activeAction.icon && /* @__PURE__ */ import_react24.default.createElement(activeAction.icon, {
1211
1201
  className: (0, import_react_ui_theme13.getSize)(5)
@@ -1215,19 +1205,21 @@ var BifurcatedAction = /* @__PURE__ */ (0, import_react24.forwardRef)((props, fo
1215
1205
  classNames: [
1216
1206
  "bs-11 flex-none rounded-is-none",
1217
1207
  classNames
1218
- ]
1208
+ ],
1209
+ "data-testid": dropdownTestId
1219
1210
  }, /* @__PURE__ */ import_react24.default.createElement("span", {
1220
1211
  className: "sr-only"
1221
1212
  }, t("invite options label")), /* @__PURE__ */ import_react24.default.createElement(import_react23.CaretDown, {
1222
1213
  className: (0, import_react_ui_theme13.getSize)(4)
1223
- }))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Content, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Viewport, null, Object.entries(actions).map(([id, action]) => {
1214
+ }))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Portal, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Content, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Viewport, null, Object.entries(actions).map(([id, action]) => {
1224
1215
  return /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.CheckboxItem, {
1225
1216
  key: id,
1226
1217
  "aria-labelledby": `${id}__label`,
1227
1218
  "aria-describedby": `${id}__description`,
1228
1219
  checked: activeActionKey2 === id,
1229
1220
  onCheckedChange: (checked) => checked && setActiveAction(id),
1230
- classNames: "gap-2"
1221
+ classNames: "gap-2",
1222
+ "data-testid": action.testId
1231
1223
  }, action.icon && /* @__PURE__ */ import_react24.default.createElement(action.icon, {
1232
1224
  className: (0, import_react_ui_theme13.getSize)(5)
1233
1225
  }), /* @__PURE__ */ import_react24.default.createElement("div", {
@@ -1244,7 +1236,7 @@ var BifurcatedAction = /* @__PURE__ */ (0, import_react24.forwardRef)((props, fo
1244
1236
  weight: "bold",
1245
1237
  className: (0, import_react_ui_theme13.getSize)(4)
1246
1238
  })));
1247
- })), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Arrow, null))));
1239
+ })), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Arrow, null)))));
1248
1240
  });
1249
1241
  var Action = /* @__PURE__ */ (0, import_react24.forwardRef)((props, forwardedRef) => {
1250
1242
  const { children, classNames, variant, isFull = true, ...rest } = props;
@@ -1573,7 +1565,7 @@ var IdentityActionChooser = (props) => {
1573
1565
  });
1574
1566
  };
1575
1567
  var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
1576
- const managedDeviceAvailable = devices.find((device) => device.profile?.type === import_halo3.DeviceType.AGENT_MANAGED);
1568
+ const edgeDeviceAvailable = devices.find((device) => device.profile?.type === import_halo3.DeviceType.AGENT_MANAGED && device.profile?.os?.toUpperCase() === "EDGE");
1577
1569
  return /* @__PURE__ */ import_react39.default.createElement("div", {
1578
1570
  role: "none",
1579
1571
  className: "bs-40 grow overflow-y-auto overflow-x-hidden"
@@ -1582,10 +1574,10 @@ var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled
1582
1574
  connectionState,
1583
1575
  onClickAdd,
1584
1576
  onClickJoinExisting,
1585
- onClickRecover,
1577
+ onClickRecover: agentProps.agentStatus === "created" ? onClickRecover : void 0,
1586
1578
  onClickReset,
1587
1579
  onAgentDestroy: agentProps.onAgentDestroy
1588
- }), !managedDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ import_react39.default.createElement(AgentConfig, agentProps));
1580
+ }), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ import_react39.default.createElement(AgentConfig, agentProps));
1589
1581
  };
1590
1582
  var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
1591
1583
  var useEdgeAgentHandlers = ({ identity }) => {
@@ -1622,7 +1614,7 @@ var useEdgeAgentHandlers = ({ identity }) => {
1622
1614
  const onAgentCreate = async () => {
1623
1615
  (0, import_invariant2.invariant)(identity, "Identity not found", {
1624
1616
  F: __dxlog_file3,
1625
- L: 56,
1617
+ L: 59,
1626
1618
  S: void 0,
1627
1619
  A: [
1628
1620
  "identity",
@@ -1643,9 +1635,18 @@ var useEdgeAgentHandlers = ({ identity }) => {
1643
1635
  setAgentStatus("creating");
1644
1636
  setValidationMessage("");
1645
1637
  try {
1646
- await service.createAgent();
1638
+ await service.createAgent(null, {
1639
+ timeout: 7500
1640
+ });
1641
+ await Promise.all(client.spaces.get().map((space) => space?.internal.setEdgeReplicationPreference(import_metadata.EdgeReplicationSetting.ENABLED)));
1647
1642
  setAgentStatus("created");
1648
1643
  } catch (err) {
1644
+ import_log5.log.catch(err, void 0, {
1645
+ F: __dxlog_file3,
1646
+ L: 82,
1647
+ S: void 0,
1648
+ C: (f, a) => f(...a)
1649
+ });
1649
1650
  setAgentStatus("error");
1650
1651
  setValidationMessage(`Error creating an agent: ${err.message}`);
1651
1652
  }
@@ -1752,7 +1753,7 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
1752
1753
  const handleAgentCreate = (0, import_react42.useCallback)(async (invitation) => {
1753
1754
  const invitationCode = import_invitations4.InvitationEncoder.encode(invitation);
1754
1755
  if (invitation.state === import_invitations4.Invitation.State.CONNECTING) {
1755
- import_log5.log.info(JSON.stringify({
1756
+ import_log6.log.info(JSON.stringify({
1756
1757
  invitationCode,
1757
1758
  authCode: invitation.authCode
1758
1759
  }), void 0, {
@@ -1918,7 +1919,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
1918
1919
  const processReset = async () => {
1919
1920
  setPending(true);
1920
1921
  return onConfirm?.().then(() => setPending(false), (error) => {
1921
- import_log6.log.catch(error, void 0, {
1922
+ import_log7.log.catch(error, void 0, {
1922
1923
  F: __dxlog_file5,
1923
1924
  L: 38,
1924
1925
  S: void 0,
@@ -1977,7 +1978,7 @@ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/I
1977
1978
  var viewStyles = "pbs-1 pbe-3 pli-3";
1978
1979
  var getHueValue = (identity) => identity?.profile?.data?.hue || (0, import_util5.hexToHue)(identity?.identityKey.toHex() ?? "0");
1979
1980
  var getEmojiValue = (identity) => identity?.profile?.data?.emoji || (0, import_util5.hexToEmoji)(identity?.identityKey.toHex() ?? "0");
1980
- var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
1981
+ var IdentityHeading = ({ titleId, title, identity, hideRecover, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
1981
1982
  const client = (0, import_react_client2.useClient)();
1982
1983
  const fallbackValue = (0, import_util5.keyToFallback)(identity.identityKey);
1983
1984
  const { t } = (0, import_react_ui18.useTranslation)("os");
@@ -2010,7 +2011,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
2010
2011
  const handleRecoveryCode = async () => {
2011
2012
  (0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
2012
2013
  F: __dxlog_file6,
2013
- L: 76,
2014
+ L: 77,
2014
2015
  S: void 0,
2015
2016
  A: [
2016
2017
  "client.services.services.IdentityService",
@@ -2021,7 +2022,6 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
2021
2022
  void setTextValue(seedphrase);
2022
2023
  };
2023
2024
  const isConnected = connectionState === import_mesh2.ConnectionState.ONLINE;
2024
- const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
2025
2025
  return /* @__PURE__ */ import_react37.default.createElement(Heading, {
2026
2026
  titleId,
2027
2027
  title,
@@ -2078,7 +2078,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
2078
2078
  }))), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Portal, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Content, {
2079
2079
  side: "bottom",
2080
2080
  classNames: "z-50"
2081
- }, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Arrow, null)))), !isProduction && /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Root, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Trigger, {
2081
+ }, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Arrow, null)))), !hideRecover && /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Root, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Trigger, {
2082
2082
  asChild: true
2083
2083
  }, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Toolbar.Button, {
2084
2084
  classNames: "bs-[--rail-action]",
@@ -2122,10 +2122,12 @@ var IdentityPanelImpl = (props) => {
2122
2122
  t
2123
2123
  ]);
2124
2124
  const onCancelReset = () => rest.send?.("unchooseAction");
2125
+ const hideRecover = rest.agentStatus !== "created";
2125
2126
  return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(IdentityHeading, {
2126
2127
  identity,
2127
2128
  titleId,
2128
2129
  title,
2130
+ hideRecover,
2129
2131
  onDone,
2130
2132
  onUpdateProfile,
2131
2133
  connectionState,
@@ -2195,7 +2197,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
2195
2197
  if (!identity) {
2196
2198
  import_log.log.error("IdentityPanel rendered with no active identity.", void 0, {
2197
2199
  F: __dxlog_file6,
2198
- L: 278,
2200
+ L: 288,
2199
2201
  S: void 0,
2200
2202
  C: (f, a) => f(...a)
2201
2203
  });
@@ -2212,7 +2214,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
2212
2214
  const subscription = identityService.subscribe((state) => {
2213
2215
  (0, import_log.log)("[state]", state, {
2214
2216
  F: __dxlog_file6,
2215
- L: 291,
2217
+ L: 301,
2216
2218
  S: void 0,
2217
2219
  C: (f, a) => f(...a)
2218
2220
  });
@@ -2292,7 +2294,7 @@ var JoinHeading = /* @__PURE__ */ (0, import_react49.forwardRef)(({ mode, titleI
2292
2294
  });
2293
2295
  var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
2294
2296
  var getInvitationSubscribable = (Kind, invitation) => {
2295
- (0, import_log8.log)("[subscribing to invitation]", invitation, {
2297
+ (0, import_log9.log)("[subscribing to invitation]", invitation, {
2296
2298
  F: __dxlog_file7,
2297
2299
  L: 90,
2298
2300
  S: void 0,
@@ -2302,7 +2304,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2302
2304
  subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
2303
2305
  switch (invitation2.state) {
2304
2306
  case import_invitations6.Invitation.State.CONNECTING: {
2305
- (0, import_log8.log)("[invitation connecting]", {
2307
+ (0, import_log9.log)("[invitation connecting]", {
2306
2308
  Kind,
2307
2309
  invitation: invitation2
2308
2310
  }, {
@@ -2317,7 +2319,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2317
2319
  });
2318
2320
  }
2319
2321
  case import_invitations6.Invitation.State.CONNECTED: {
2320
- (0, import_log8.log)("[invitation connected]", {
2322
+ (0, import_log9.log)("[invitation connected]", {
2321
2323
  Kind,
2322
2324
  invitation: invitation2
2323
2325
  }, {
@@ -2332,7 +2334,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2332
2334
  });
2333
2335
  }
2334
2336
  case import_invitations6.Invitation.State.READY_FOR_AUTHENTICATION: {
2335
- (0, import_log8.log)("[invitation ready for authentication]", {
2337
+ (0, import_log9.log)("[invitation ready for authentication]", {
2336
2338
  Kind,
2337
2339
  invitation: invitation2
2338
2340
  }, {
@@ -2347,7 +2349,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2347
2349
  });
2348
2350
  }
2349
2351
  case import_invitations6.Invitation.State.AUTHENTICATING: {
2350
- (0, import_log8.log)("[invitation authenticating]", {
2352
+ (0, import_log9.log)("[invitation authenticating]", {
2351
2353
  Kind,
2352
2354
  invitation: invitation2
2353
2355
  }, {
@@ -2362,7 +2364,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2362
2364
  });
2363
2365
  }
2364
2366
  case import_invitations6.Invitation.State.SUCCESS: {
2365
- (0, import_log8.log)("[invitation success]", {
2367
+ (0, import_log9.log)("[invitation success]", {
2366
2368
  Kind,
2367
2369
  invitation: invitation2
2368
2370
  }, {
@@ -2378,7 +2380,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2378
2380
  return complete?.();
2379
2381
  }
2380
2382
  case import_invitations6.Invitation.State.CANCELLED: {
2381
- import_log8.log.warn("[invitation cancelled]", {
2383
+ import_log9.log.warn("[invitation cancelled]", {
2382
2384
  Kind
2383
2385
  }, {
2384
2386
  F: __dxlog_file7,
@@ -2392,7 +2394,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2392
2394
  });
2393
2395
  }
2394
2396
  case import_invitations6.Invitation.State.TIMEOUT: {
2395
- import_log8.log.error("[invitation timeout]", {
2397
+ import_log9.log.error("[invitation timeout]", {
2396
2398
  Kind
2397
2399
  }, {
2398
2400
  F: __dxlog_file7,
@@ -2408,7 +2410,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2408
2410
  }
2409
2411
  }, (error) => {
2410
2412
  if (error instanceof import_react_client8.AlreadyJoinedError) {
2411
- (0, import_log8.log)("[already joined]", {
2413
+ (0, import_log9.log)("[already joined]", {
2412
2414
  Kind,
2413
2415
  error
2414
2416
  }, {
@@ -2423,7 +2425,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2423
2425
  });
2424
2426
  return complete?.();
2425
2427
  }
2426
- import_log8.log.error("[invitation errored]", {
2428
+ import_log9.log.error("[invitation errored]", {
2427
2429
  Kind,
2428
2430
  error
2429
2431
  }, {
@@ -2762,7 +2764,7 @@ var joinMachine = (0, import_xstate2.createMachine)({
2762
2764
  } : context.space
2763
2765
  }),
2764
2766
  log: (context, event) => {
2765
- (0, import_log8.log)("[transition]", {
2767
+ (0, import_log9.log)("[transition]", {
2766
2768
  event,
2767
2769
  haloInvitation: context.halo.invitation,
2768
2770
  spaceInvitation: context.space.invitation
@@ -2780,7 +2782,7 @@ var defaultCodeFromUrl = (invitationType, text) => {
2780
2782
  const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
2781
2783
  return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
2782
2784
  } catch (err) {
2783
- import_log8.log.catch(err, void 0, {
2785
+ import_log9.log.catch(err, void 0, {
2784
2786
  F: __dxlog_file7,
2785
2787
  L: 452,
2786
2788
  S: void 0,
@@ -2801,7 +2803,7 @@ var useJoinMachine = (client, options) => {
2801
2803
  invitationSubscribable: getInvitationSubscribable("Halo", invitationObservable)
2802
2804
  };
2803
2805
  } catch (err) {
2804
- import_log8.log.error("Could not redeem device invitation code", err, {
2806
+ import_log9.log.error("Could not redeem device invitation code", err, {
2805
2807
  F: __dxlog_file7,
2806
2808
  L: 473,
2807
2809
  S: void 0,
@@ -2826,7 +2828,7 @@ var useJoinMachine = (client, options) => {
2826
2828
  invitationSubscribable: getInvitationSubscribable("Space", invitationObservable)
2827
2829
  };
2828
2830
  } catch (err) {
2829
- import_log8.log.error("Could not redeem space invitation code", err, {
2831
+ import_log9.log.error("Could not redeem space invitation code", err, {
2830
2832
  F: __dxlog_file7,
2831
2833
  L: 495,
2832
2834
  S: void 0,
@@ -2991,7 +2993,7 @@ var IdentityInput = (props) => {
2991
2993
  identity
2992
2994
  });
2993
2995
  }, (error) => {
2994
- import_log9.log.catch(error, void 0, {
2996
+ import_log10.log.catch(error, void 0, {
2995
2997
  F: __dxlog_file8,
2996
2998
  L: 38,
2997
2999
  S: void 0,
@@ -3008,7 +3010,7 @@ var IdentityInput = (props) => {
3008
3010
  identity
3009
3011
  });
3010
3012
  }, (error) => {
3011
- import_log9.log.catch(error, void 0, {
3013
+ import_log10.log.catch(error, void 0, {
3012
3014
  F: __dxlog_file8,
3013
3015
  L: 48,
3014
3016
  S: void 0,
@@ -3061,7 +3063,7 @@ var invitationCodeFromUrl = (text) => {
3061
3063
  const invitation = searchParams.get("spaceInvitationCode") ?? searchParams.get("deviceInvitationCode");
3062
3064
  return invitation ?? text;
3063
3065
  } catch (err) {
3064
- import_log10.log.catch(err, void 0, {
3066
+ import_log11.log.catch(err, void 0, {
3065
3067
  F: __dxlog_file9,
3066
3068
  L: 25,
3067
3069
  S: void 0,
@@ -3422,7 +3424,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
3422
3424
  });
3423
3425
  (0, import_react47.useEffect)(() => {
3424
3426
  const subscription = joinService.subscribe((state) => {
3425
- (0, import_log7.log)("[state]", state, {
3427
+ (0, import_log8.log)("[state]", state, {
3426
3428
  F: __dxlog_file10,
3427
3429
  L: 210,
3428
3430
  S: void 0,
@@ -3745,7 +3747,7 @@ var spaceMachine = (0, import_xstate3.createMachine)({
3745
3747
  invitation: () => void 0
3746
3748
  }),
3747
3749
  log: (context, event) => {
3748
- (0, import_log12.log)("[transition]", {
3750
+ (0, import_log13.log)("[transition]", {
3749
3751
  event,
3750
3752
  context
3751
3753
  }, {
@@ -3770,7 +3772,7 @@ var activeActionKey = "dxos:react-shell/space-manager/active-action";
3770
3772
  var handleInvitationEvent = (invitation, subscription) => {
3771
3773
  const invitationCode = import_invitations10.InvitationEncoder.encode(invitation);
3772
3774
  if (invitation.state === import_invitations10.Invitation.State.CONNECTING) {
3773
- import_log13.log.info(JSON.stringify({
3775
+ import_log14.log.info(JSON.stringify({
3774
3776
  invitationCode,
3775
3777
  authCode: invitation.authCode
3776
3778
  }), void 0, {
@@ -3792,6 +3794,7 @@ var SpaceManager = (props) => {
3792
3794
  label: t("invite one label"),
3793
3795
  description: t("invite one description"),
3794
3796
  icon: import_react63.UserPlus,
3797
+ testId: "spaces-panel.invite-one",
3795
3798
  onClick: (0, import_react64.useCallback)(() => {
3796
3799
  const invitation = space.share?.({
3797
3800
  type: import_invitations10.Invitation.Type.INTERACTIVE,
@@ -3803,13 +3806,15 @@ var SpaceManager = (props) => {
3803
3806
  const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
3804
3807
  }
3805
3808
  }, [
3806
- space
3809
+ space,
3810
+ target
3807
3811
  ])
3808
3812
  },
3809
3813
  inviteMany: {
3810
3814
  label: t("invite many label"),
3811
3815
  description: t("invite many description"),
3812
3816
  icon: import_react63.UsersThree,
3817
+ testId: "spaces-panel.invite-many",
3813
3818
  onClick: (0, import_react64.useCallback)(() => {
3814
3819
  const invitation = space.share?.({
3815
3820
  type: import_invitations10.Invitation.Type.DELEGATED,
@@ -3821,7 +3826,8 @@ var SpaceManager = (props) => {
3821
3826
  const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
3822
3827
  }
3823
3828
  }, [
3824
- space
3829
+ space,
3830
+ target
3825
3831
  ])
3826
3832
  }
3827
3833
  };
@@ -3844,7 +3850,7 @@ var SpaceManagerImpl = (props) => {
3844
3850
  }
3845
3851
  }
3846
3852
  };
3847
- const [activeAction, setInternalActiveAction] = (0, import_react64.useState)(localStorage.getItem(activeActionKey) ?? "inviteOne");
3853
+ const [activeAction, setInternalActiveAction] = (0, import_react64.useState)(localStorage.getItem(activeActionKey) ?? "inviteMany");
3848
3854
  const setActiveAction = (nextAction) => {
3849
3855
  setInternalActiveAction(nextAction);
3850
3856
  localStorage.setItem(activeActionKey, nextAction);
@@ -3901,8 +3907,8 @@ var SpacePanelHeading = ({ titleId, space, onDone }) => {
3901
3907
  }, name ?? space.key.truncate())));
3902
3908
  };
3903
3909
  var SpacePanelImpl = (props) => {
3904
- const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
3905
- return /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, /* @__PURE__ */ import_react61.default.createElement(SpacePanelHeading, {
3910
+ const { titleId, activeView, space, hideHeading, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
3911
+ return /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, !hideHeading && /* @__PURE__ */ import_react61.default.createElement(SpacePanelHeading, {
3906
3912
  ...rest,
3907
3913
  titleId,
3908
3914
  space
@@ -3942,9 +3948,9 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
3942
3948
  });
3943
3949
  (0, import_react61.useEffect)(() => {
3944
3950
  const subscription = spaceService.subscribe((state) => {
3945
- (0, import_log11.log)("[state]", state, {
3951
+ (0, import_log12.log)("[state]", state, {
3946
3952
  F: __dxlog_file13,
3947
- L: 94,
3953
+ L: 95,
3948
3954
  S: void 0,
3949
3955
  C: (f, a) => f(...a)
3950
3956
  });
@@ -4097,7 +4103,7 @@ var Shell = ({ runtime }) => {
4097
4103
  ]);
4098
4104
  (0, import_react68.useEffect)(() => {
4099
4105
  if (layout === import_react_client13.ShellLayout.SPACE && !space) {
4100
- import_log14.log.warn("No space found for shell space invitations.", void 0, {
4106
+ import_log15.log.warn("No space found for shell space invitations.", void 0, {
4101
4107
  F: __dxlog_file14,
4102
4108
  L: 67,
4103
4109
  S: void 0,