@dxos/shell 0.6.13-main.548ca8d → 0.6.13-main.ed424a1

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.
@@ -1238,10 +1238,10 @@ import { Dialog, useId as useId10 } from "@dxos/react-ui";
1238
1238
 
1239
1239
  // packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
1240
1240
  import { Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
1241
- import React29, { useEffect as useEffect3, useMemo as useMemo3, useState as useState8 } from "react";
1241
+ import React29, { useEffect as useEffect4, useMemo as useMemo3, useState as useState9 } from "react";
1242
1242
  import { generateName as generateName3 } from "@dxos/display-name";
1243
1243
  import { log as log6 } from "@dxos/log";
1244
- import { useClient as useClient4 } from "@dxos/react-client";
1244
+ import { useClient as useClient6 } from "@dxos/react-client";
1245
1245
  import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
1246
1246
  import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
1247
1247
  import { useNetworkStatus, ConnectionState as ConnectionState2 } from "@dxos/react-client/mesh";
@@ -1423,17 +1423,105 @@ import { useTranslation as useTranslation11 } from "@dxos/react-ui";
1423
1423
  import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
1424
1424
 
1425
1425
  // packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
1426
- import { useCallback as useCallback4, useEffect as useEffect2, useState as useState6 } from "react";
1426
+ import { useClient as useClient5 } from "@dxos/react-client";
1427
+
1428
+ // packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
1429
+ import { useEffect as useEffect2, useState as useState6 } from "react";
1427
1430
  import { invariant } from "@dxos/invariant";
1428
- import { log as log4 } from "@dxos/log";
1429
- import { useClient as useClient3, useAgentHostingClient } from "@dxos/react-client";
1430
- import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
1431
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts";
1432
- var useAgentHandlers = ({ invitations, identity }) => {
1431
+ import { QueryAgentStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
1432
+ import { useClient as useClient3 } from "@dxos/react-client";
1433
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
1434
+ var useEdgeAgentHandlers = ({ identity }) => {
1433
1435
  const [validationMessage, setValidationMessage] = useState6("");
1436
+ const [lastReceivedStatus, setLastReceivedStatus] = useState6(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
1434
1437
  const [agentStatus, setAgentStatus] = useState6("getting");
1435
- const agentHostingProviderClient = useAgentHostingClient();
1436
1438
  const client = useClient3();
1439
+ const agentHostingEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
1440
+ const handleStatus = (status) => {
1441
+ switch (status) {
1442
+ case QueryAgentStatusResponse.AgentStatus.ACTIVE:
1443
+ case QueryAgentStatusResponse.AgentStatus.INACTIVE:
1444
+ setAgentStatus("created");
1445
+ break;
1446
+ case QueryAgentStatusResponse.AgentStatus.NOT_FOUND:
1447
+ setAgentStatus("creatable");
1448
+ break;
1449
+ case QueryAgentStatusResponse.AgentStatus.UNKNOWN:
1450
+ setAgentStatus("getting");
1451
+ break;
1452
+ }
1453
+ };
1454
+ useEffect2(() => {
1455
+ const stream = client.services.services.EdgeAgentService?.queryAgentStatus();
1456
+ stream?.subscribe(({ status }) => {
1457
+ setLastReceivedStatus(status);
1458
+ handleStatus(status);
1459
+ });
1460
+ return () => {
1461
+ void stream?.close().catch(() => {
1462
+ });
1463
+ };
1464
+ }, []);
1465
+ const onAgentCreate = async () => {
1466
+ invariant(identity, "Identity not found", {
1467
+ F: __dxlog_file3,
1468
+ L: 56,
1469
+ S: void 0,
1470
+ A: [
1471
+ "identity",
1472
+ "'Identity not found'"
1473
+ ]
1474
+ });
1475
+ const service = client.services.services.EdgeAgentService;
1476
+ if (!service) {
1477
+ setAgentStatus("error");
1478
+ setValidationMessage("Agent service not initialized.");
1479
+ return;
1480
+ }
1481
+ if (!agentHostingEnabled) {
1482
+ setAgentStatus("error");
1483
+ setValidationMessage("Edge agents are disabled in config.");
1484
+ return;
1485
+ }
1486
+ setAgentStatus("creating");
1487
+ setValidationMessage("");
1488
+ try {
1489
+ await service.createAgent();
1490
+ setAgentStatus("created");
1491
+ } catch (err) {
1492
+ setAgentStatus("error");
1493
+ setValidationMessage(`Error creating an agent: ${err.message}`);
1494
+ }
1495
+ };
1496
+ const onAgentDestroy = async () => {
1497
+ setValidationMessage("Agents are non-destructible.");
1498
+ };
1499
+ const onAgentRefresh = async () => {
1500
+ setValidationMessage("");
1501
+ handleStatus(lastReceivedStatus);
1502
+ };
1503
+ return {
1504
+ onAgentCreate,
1505
+ onAgentDestroy,
1506
+ onAgentRefresh,
1507
+ validationMessage,
1508
+ agentStatus,
1509
+ agentHostingEnabled
1510
+ };
1511
+ };
1512
+
1513
+ // packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts
1514
+ import { useCallback as useCallback4, useEffect as useEffect3, useState as useState7 } from "react";
1515
+ import { invariant as invariant2 } from "@dxos/invariant";
1516
+ import { log as log4 } from "@dxos/log";
1517
+ import { useClient as useClient4, useAgentHostingClient } from "@dxos/react-client";
1518
+ import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
1519
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
1520
+ var useKubeAgentHandlers = ({ invitations, identity }) => {
1521
+ const [validationMessage, setValidationMessage] = useState7("");
1522
+ const [agentStatus, setAgentStatus] = useState7("getting");
1523
+ const agentHostingProviderClient = useAgentHostingClient();
1524
+ const client = useClient4();
1437
1525
  const updateAgentStatus = async () => {
1438
1526
  if (agentHostingProviderClient) {
1439
1527
  setAgentStatus("getting");
@@ -1454,8 +1542,8 @@ var useAgentHandlers = ({ invitations, identity }) => {
1454
1542
  }
1455
1543
  };
1456
1544
  const createAgent = async (invitationCode) => {
1457
- invariant(identity, "Identity not found", {
1458
- F: __dxlog_file3,
1545
+ invariant2(identity, "Identity not found", {
1546
+ F: __dxlog_file4,
1459
1547
  L: 50,
1460
1548
  S: void 0,
1461
1549
  A: [
@@ -1484,8 +1572,8 @@ var useAgentHandlers = ({ invitations, identity }) => {
1484
1572
  }
1485
1573
  };
1486
1574
  const destroyAgent = async () => {
1487
- invariant(identity, "Identity not found", {
1488
- F: __dxlog_file3,
1575
+ invariant2(identity, "Identity not found", {
1576
+ F: __dxlog_file4,
1489
1577
  L: 73,
1490
1578
  S: void 0,
1491
1579
  A: [
@@ -1508,7 +1596,7 @@ var useAgentHandlers = ({ invitations, identity }) => {
1508
1596
  setValidationMessage("No agent provider configured.");
1509
1597
  }
1510
1598
  };
1511
- useEffect2(() => {
1599
+ useEffect3(() => {
1512
1600
  void updateAgentStatus();
1513
1601
  }, []);
1514
1602
  const handleAgentCreate = useCallback4(async (invitation) => {
@@ -1518,7 +1606,7 @@ var useAgentHandlers = ({ invitations, identity }) => {
1518
1606
  invitationCode,
1519
1607
  authCode: invitation.authCode
1520
1608
  }), void 0, {
1521
- F: __dxlog_file3,
1609
+ F: __dxlog_file4,
1522
1610
  L: 97,
1523
1611
  S: void 0,
1524
1612
  C: (f, a) => f(...a)
@@ -1549,6 +1637,16 @@ var useAgentHandlers = ({ invitations, identity }) => {
1549
1637
  };
1550
1638
  };
1551
1639
 
1640
+ // packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
1641
+ var useAgentHandlers = (params) => {
1642
+ const client = useClient5();
1643
+ if (client.config.values?.runtime?.client?.edgeFeatures?.agents) {
1644
+ return useEdgeAgentHandlers(params);
1645
+ } else {
1646
+ return useKubeAgentHandlers(params);
1647
+ }
1648
+ };
1649
+
1552
1650
  // packages/sdk/shell/src/steps/InvitationManager.tsx
1553
1651
  import { Check as Check4, X as X3 } from "@phosphor-icons/react";
1554
1652
  import React27, { useMemo as useMemo2 } from "react";
@@ -1680,20 +1778,20 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
1680
1778
 
1681
1779
  // packages/sdk/shell/src/steps/ConfirmReset.tsx
1682
1780
  import { Warning } from "@phosphor-icons/react";
1683
- import React28, { useState as useState7 } from "react";
1781
+ import React28, { useState as useState8 } from "react";
1684
1782
  import { log as log5 } from "@dxos/log";
1685
1783
  import { Message, useTranslation as useTranslation13 } from "@dxos/react-ui";
1686
1784
  import { getSize as getSize12, mx as mx21 } from "@dxos/react-ui-theme";
1687
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
1785
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
1688
1786
  var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
1689
1787
  const { t } = useTranslation13("os");
1690
- const [validationMessage, setValidationMessage] = useState7("");
1691
- const [pending, setPending] = useState7(false);
1788
+ const [validationMessage, setValidationMessage] = useState8("");
1789
+ const [pending, setPending] = useState8(false);
1692
1790
  const processReset = async () => {
1693
1791
  setPending(true);
1694
1792
  return onConfirm?.().then(() => setPending(false), (error) => {
1695
1793
  log5.catch(error, void 0, {
1696
- F: __dxlog_file4,
1794
+ F: __dxlog_file5,
1697
1795
  L: 38,
1698
1796
  S: void 0,
1699
1797
  C: (f, a) => f(...a)
@@ -1714,7 +1812,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
1714
1812
  var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
1715
1813
  const { t } = useTranslation13("os");
1716
1814
  const confirmationValue = t("confirmation value");
1717
- const [inputValue, setInputValue] = useState7("");
1815
+ const [inputValue, setInputValue] = useState8("");
1718
1816
  const testIdAffix = mode === "join new identity" ? "join-new-identity" : "reset-storage";
1719
1817
  return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
1720
1818
  role: "none",
@@ -1749,16 +1847,16 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
1749
1847
  };
1750
1848
 
1751
1849
  // packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
1752
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
1850
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
1753
1851
  var viewStyles = "pbs-1 pbe-3 pli-3";
1754
1852
  var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identity?.identityKey.toHex() ?? "0");
1755
1853
  var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
1756
1854
  var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
1757
1855
  const fallbackValue = keyToFallback3(identity.identityKey);
1758
1856
  const { t } = useTranslation14("os");
1759
- const [displayName, setDisplayName] = useState8(identity.profile?.displayName ?? "");
1760
- const [emoji, setEmojiDirectly] = useState8(getEmojiValue(identity));
1761
- const [hue, setHueDirectly] = useState8(getHueValue(identity));
1857
+ const [displayName, setDisplayName] = useState9(identity.profile?.displayName ?? "");
1858
+ const [emoji, setEmojiDirectly] = useState9(getEmojiValue(identity));
1859
+ const [hue, setHueDirectly] = useState9(getHueValue(identity));
1762
1860
  const { textValue, setTextValue } = useClipboardContext();
1763
1861
  const identityHex = identity.identityKey.toHex();
1764
1862
  const copied = textValue === identityHex;
@@ -1929,7 +2027,7 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
1929
2027
  };
1930
2028
  var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
1931
2029
  const titleId = useId6("identityPanel__heading", propsTitleId);
1932
- const client = useClient4();
2030
+ const client = useClient6();
1933
2031
  const devices = useDevices();
1934
2032
  const identity = useIdentity();
1935
2033
  const invitations = useHaloInvitations2();
@@ -1939,7 +2037,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
1939
2037
  });
1940
2038
  if (!identity) {
1941
2039
  log6.error("IdentityPanel rendered with no active identity.", void 0, {
1942
- F: __dxlog_file5,
2040
+ F: __dxlog_file6,
1943
2041
  L: 246,
1944
2042
  S: void 0,
1945
2043
  C: (f, a) => f(...a)
@@ -1953,10 +2051,10 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
1953
2051
  });
1954
2052
  const { swarm: connectionState } = useNetworkStatus();
1955
2053
  const handleChangeConnectionState = async (nextState) => client?.mesh.updateConfig(nextState);
1956
- useEffect3(() => {
2054
+ useEffect4(() => {
1957
2055
  const subscription = identityService.subscribe((state) => {
1958
2056
  log6("[state]", state, {
1959
- F: __dxlog_file5,
2057
+ F: __dxlog_file6,
1960
2058
  L: 259,
1961
2059
  S: void 0,
1962
2060
  C: (f, a) => f(...a)
@@ -2008,9 +2106,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
2008
2106
  };
2009
2107
 
2010
2108
  // packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
2011
- import React38, { useCallback as useCallback6, useEffect as useEffect5, useMemo as useMemo4 } from "react";
2109
+ import React38, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo4 } from "react";
2012
2110
  import { log as log10 } from "@dxos/log";
2013
- import { useClient as useClient6, useMulticastObservable } from "@dxos/react-client";
2111
+ import { useClient as useClient8, useMulticastObservable } from "@dxos/react-client";
2014
2112
  import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
2015
2113
  import { DensityProvider as DensityProvider2, useId as useId8, useThemeContext as useThemeContext5 } from "@dxos/react-ui";
2016
2114
 
@@ -2054,10 +2152,10 @@ import { assign as assign2, createMachine as createMachine2 } from "xstate";
2054
2152
  import { log as log7 } from "@dxos/log";
2055
2153
  import { AlreadyJoinedError } from "@dxos/react-client";
2056
2154
  import { Invitation as Invitation5, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
2057
- var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
2155
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
2058
2156
  var getInvitationSubscribable = (Kind, invitation) => {
2059
2157
  log7("[subscribing to invitation]", invitation, {
2060
- F: __dxlog_file6,
2158
+ F: __dxlog_file7,
2061
2159
  L: 90,
2062
2160
  S: void 0,
2063
2161
  C: (f, a) => f(...a)
@@ -2070,7 +2168,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2070
2168
  Kind,
2071
2169
  invitation: invitation2
2072
2170
  }, {
2073
- F: __dxlog_file6,
2171
+ F: __dxlog_file7,
2074
2172
  L: 101,
2075
2173
  S: void 0,
2076
2174
  C: (f, a) => f(...a)
@@ -2085,7 +2183,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2085
2183
  Kind,
2086
2184
  invitation: invitation2
2087
2185
  }, {
2088
- F: __dxlog_file6,
2186
+ F: __dxlog_file7,
2089
2187
  L: 106,
2090
2188
  S: void 0,
2091
2189
  C: (f, a) => f(...a)
@@ -2100,7 +2198,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2100
2198
  Kind,
2101
2199
  invitation: invitation2
2102
2200
  }, {
2103
- F: __dxlog_file6,
2201
+ F: __dxlog_file7,
2104
2202
  L: 111,
2105
2203
  S: void 0,
2106
2204
  C: (f, a) => f(...a)
@@ -2115,7 +2213,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2115
2213
  Kind,
2116
2214
  invitation: invitation2
2117
2215
  }, {
2118
- F: __dxlog_file6,
2216
+ F: __dxlog_file7,
2119
2217
  L: 116,
2120
2218
  S: void 0,
2121
2219
  C: (f, a) => f(...a)
@@ -2130,7 +2228,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2130
2228
  Kind,
2131
2229
  invitation: invitation2
2132
2230
  }, {
2133
- F: __dxlog_file6,
2231
+ F: __dxlog_file7,
2134
2232
  L: 121,
2135
2233
  S: void 0,
2136
2234
  C: (f, a) => f(...a)
@@ -2145,7 +2243,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2145
2243
  log7.warn("[invitation cancelled]", {
2146
2244
  Kind
2147
2245
  }, {
2148
- F: __dxlog_file6,
2246
+ F: __dxlog_file7,
2149
2247
  L: 127,
2150
2248
  S: void 0,
2151
2249
  C: (f, a) => f(...a)
@@ -2159,7 +2257,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2159
2257
  log7.error("[invitation timeout]", {
2160
2258
  Kind
2161
2259
  }, {
2162
- F: __dxlog_file6,
2260
+ F: __dxlog_file7,
2163
2261
  L: 132,
2164
2262
  S: void 0,
2165
2263
  C: (f, a) => f(...a)
@@ -2176,7 +2274,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2176
2274
  Kind,
2177
2275
  error
2178
2276
  }, {
2179
- F: __dxlog_file6,
2277
+ F: __dxlog_file7,
2180
2278
  L: 139,
2181
2279
  S: void 0,
2182
2280
  C: (f, a) => f(...a)
@@ -2191,7 +2289,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
2191
2289
  Kind,
2192
2290
  error
2193
2291
  }, {
2194
- F: __dxlog_file6,
2292
+ F: __dxlog_file7,
2195
2293
  L: 144,
2196
2294
  S: void 0,
2197
2295
  C: (f, a) => f(...a)
@@ -2523,7 +2621,7 @@ var joinMachine = createMachine2({
2523
2621
  haloInvitation: context.halo.invitation,
2524
2622
  spaceInvitation: context.space.invitation
2525
2623
  }, {
2526
- F: __dxlog_file6,
2624
+ F: __dxlog_file7,
2527
2625
  L: 416,
2528
2626
  S: void 0,
2529
2627
  C: (f, a) => f(...a)
@@ -2537,7 +2635,7 @@ var defaultCodeFromUrl = (invitationType, text) => {
2537
2635
  return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
2538
2636
  } catch (err) {
2539
2637
  log7.catch(err, void 0, {
2540
- F: __dxlog_file6,
2638
+ F: __dxlog_file7,
2541
2639
  L: 443,
2542
2640
  S: void 0,
2543
2641
  C: (f, a) => f(...a)
@@ -2558,7 +2656,7 @@ var useJoinMachine = (client, options) => {
2558
2656
  };
2559
2657
  } catch (err) {
2560
2658
  log7.error("Could not redeem device invitation code", err, {
2561
- F: __dxlog_file6,
2659
+ F: __dxlog_file7,
2562
2660
  L: 464,
2563
2661
  S: void 0,
2564
2662
  C: (f, a) => f(...a)
@@ -2583,7 +2681,7 @@ var useJoinMachine = (client, options) => {
2583
2681
  };
2584
2682
  } catch (err) {
2585
2683
  log7.error("Could not redeem space invitation code", err, {
2586
- F: __dxlog_file6,
2684
+ F: __dxlog_file7,
2587
2685
  L: 486,
2588
2686
  S: void 0,
2589
2687
  C: (f, a) => f(...a)
@@ -2747,17 +2845,17 @@ var IdentityAdded = (props) => {
2747
2845
  };
2748
2846
 
2749
2847
  // packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
2750
- import React33, { useState as useState9 } from "react";
2848
+ import React33, { useState as useState10 } from "react";
2751
2849
  import { log as log8 } from "@dxos/log";
2752
- import { useClient as useClient5 } from "@dxos/react-client";
2850
+ import { useClient as useClient7 } from "@dxos/react-client";
2753
2851
  import { useTranslation as useTranslation18 } from "@dxos/react-ui";
2754
- var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
2852
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
2755
2853
  var IdentityInput = (props) => {
2756
2854
  const { send, method } = props;
2757
2855
  const isRecover = method === "recover identity";
2758
- const client = useClient5();
2856
+ const client = useClient7();
2759
2857
  const { t } = useTranslation18("os");
2760
- const [validationMessage, setValidationMessage] = useState9("");
2858
+ const [validationMessage, setValidationMessage] = useState10("");
2761
2859
  const createIdentity = (displayName) => {
2762
2860
  void client.halo.createIdentity({
2763
2861
  [isRecover ? "seedphrase" : "displayName"]: displayName
@@ -2768,7 +2866,7 @@ var IdentityInput = (props) => {
2768
2866
  });
2769
2867
  }, (error) => {
2770
2868
  log8.catch(error, void 0, {
2771
- F: __dxlog_file7,
2869
+ F: __dxlog_file8,
2772
2870
  L: 37,
2773
2871
  S: void 0,
2774
2872
  C: (f, a) => f(...a)
@@ -2786,7 +2884,7 @@ var IdentityInputImpl = (props) => {
2786
2884
  const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
2787
2885
  const disabled = !active;
2788
2886
  const { t } = useTranslation18("os");
2789
- const [inputValue, setInputValue] = useState9("");
2887
+ const [inputValue, setInputValue] = useState10("");
2790
2888
  const isRecover = method === "recover identity";
2791
2889
  return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
2792
2890
  role: "none",
@@ -2836,10 +2934,10 @@ var InvitationAccepted = (props) => {
2836
2934
  };
2837
2935
 
2838
2936
  // packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
2839
- import React35, { useState as useState10, useEffect as useEffect4, cloneElement as cloneElement4 } from "react";
2937
+ import React35, { useState as useState11, useEffect as useEffect5, cloneElement as cloneElement4 } from "react";
2840
2938
  import { log as log9 } from "@dxos/log";
2841
2939
  import { useTranslation as useTranslation20 } from "@dxos/react-ui";
2842
- var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
2940
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
2843
2941
  var invitationCodeFromUrl = (text) => {
2844
2942
  try {
2845
2943
  const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
@@ -2847,7 +2945,7 @@ var invitationCodeFromUrl = (text) => {
2847
2945
  return invitation ?? text;
2848
2946
  } catch (err) {
2849
2947
  log9.catch(err, void 0, {
2850
- F: __dxlog_file8,
2948
+ F: __dxlog_file9,
2851
2949
  L: 25,
2852
2950
  S: void 0,
2853
2951
  C: (f, a) => f(...a)
@@ -2859,8 +2957,8 @@ var InvitationInput = (props) => {
2859
2957
  const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
2860
2958
  const disabled = !active;
2861
2959
  const { t } = useTranslation20("os");
2862
- const [inputValue, setInputValue] = useState10(unredeemedCode ?? "");
2863
- useEffect4(() => {
2960
+ const [inputValue, setInputValue] = useState11(unredeemedCode ?? "");
2961
+ useEffect5(() => {
2864
2962
  unredeemedCode && setInputValue(unredeemedCode ?? "");
2865
2963
  }, [
2866
2964
  unredeemedCode
@@ -2978,7 +3076,7 @@ var InvitationRescuer = (props) => {
2978
3076
  };
2979
3077
 
2980
3078
  // packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
2981
- import React37, { useState as useState11 } from "react";
3079
+ import React37, { useState as useState12 } from "react";
2982
3080
  import { Input as Input3, useTranslation as useTranslation22 } from "@dxos/react-ui";
2983
3081
  import { hexToEmoji as hexToEmoji5 } from "@dxos/util";
2984
3082
  var pinLength = 6;
@@ -2986,7 +3084,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
2986
3084
  const disabled = !active || pending;
2987
3085
  const { t } = useTranslation22("os");
2988
3086
  const invitationType = Kind.toLowerCase();
2989
- const [authCode, setAuthCode] = useState11("");
3087
+ const [authCode, setAuthCode] = useState12("");
2990
3088
  const onChange = ({ target: { value } }) => {
2991
3089
  setAuthCode(value);
2992
3090
  if (value.length === pinLength) {
@@ -3056,7 +3154,7 @@ var resolvedBgColor = (status) => status === Invitation6.State.ERROR ? errorBgCo
3056
3154
  var resolvedTextColor = (status) => status === Invitation6.State.ERROR ? errorTextColor : status === Invitation6.State.CANCELLED || status === Invitation6.State.TIMEOUT ? cancelledTextColor : successTextColor;
3057
3155
 
3058
3156
  // packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
3059
- var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
3157
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
3060
3158
  var JoinPanelImpl = (props) => {
3061
3159
  const { titleId, send, activeView, failed, mode, unredeemedCodes, invitationIds, invitationStates, succeededKeys, failReasons, onExit, onHaloDone, onSpaceDone, exitActionParent, doneActionParent, onHaloInvitationCancel, onSpaceInvitationCancel, onHaloInvitationAuthenticate, onSpaceInvitationAuthenticate, onCancelResetStorage, onConfirmResetStorage, IdentityInput: IdentityInputComponent = IdentityInput, ConfirmReset: ConfirmResetComponent = ConfirmReset } = props;
3062
3160
  return /* @__PURE__ */ React38.createElement(DensityProvider2, {
@@ -3201,7 +3299,7 @@ var JoinPanelImpl = (props) => {
3201
3299
  })))));
3202
3300
  };
3203
3301
  var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
3204
- const client = useClient6();
3302
+ const client = useClient8();
3205
3303
  const identity = useIdentity2();
3206
3304
  const { hasIosKeyboard } = useThemeContext5();
3207
3305
  const titleId = useId8("joinPanel__heading", propsTitleId);
@@ -3217,10 +3315,10 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
3217
3315
  }
3218
3316
  }
3219
3317
  });
3220
- useEffect5(() => {
3318
+ useEffect6(() => {
3221
3319
  const subscription = joinService.subscribe((state) => {
3222
3320
  log10("[state]", state, {
3223
- F: __dxlog_file9,
3321
+ F: __dxlog_file10,
3224
3322
  L: 208,
3225
3323
  S: void 0,
3226
3324
  C: (f, a) => f(...a)
@@ -3230,7 +3328,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
3230
3328
  }, [
3231
3329
  joinService
3232
3330
  ]);
3233
- useEffect5(() => {
3331
+ useEffect6(() => {
3234
3332
  const stateStack = joinState.configuration[0].id.split(".");
3235
3333
  const innermostState = stateStack[stateStack.length - 1];
3236
3334
  const autoFocusValue = innermostState === "finishingJoining" ? "successSpaceInvitation" : innermostState;
@@ -3489,7 +3587,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
3489
3587
 
3490
3588
  // packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
3491
3589
  import { Planet } from "@phosphor-icons/react";
3492
- import React40, { useEffect as useEffect6, useMemo as useMemo5 } from "react";
3590
+ import React40, { useEffect as useEffect7, useMemo as useMemo5 } from "react";
3493
3591
  import { log as log13 } from "@dxos/log";
3494
3592
  import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
3495
3593
  import { DensityProvider as DensityProvider3, useId as useId9, useTranslation as useTranslation24 } from "@dxos/react-ui";
@@ -3498,7 +3596,7 @@ import { DensityProvider as DensityProvider3, useId as useId9, useTranslation as
3498
3596
  import { useMachine as useMachine3 } from "@xstate/react";
3499
3597
  import { assign as assign3, createMachine as createMachine3 } from "xstate";
3500
3598
  import { log as log11 } from "@dxos/log";
3501
- var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts";
3599
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts";
3502
3600
  var spaceMachine = createMachine3({
3503
3601
  id: "space",
3504
3602
  predictableActionArguments: true,
@@ -3539,7 +3637,7 @@ var spaceMachine = createMachine3({
3539
3637
  event,
3540
3638
  context
3541
3639
  }, {
3542
- F: __dxlog_file10,
3640
+ F: __dxlog_file11,
3543
3641
  L: 53,
3544
3642
  S: void 0,
3545
3643
  C: (f, a) => f(...a)
@@ -3558,14 +3656,14 @@ var useSpaceMachine = (options) => {
3558
3656
 
3559
3657
  // packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
3560
3658
  import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
3561
- import React39, { useCallback as useCallback7, useState as useState12 } from "react";
3659
+ import React39, { useCallback as useCallback7, useState as useState13 } from "react";
3562
3660
  import { log as log12 } from "@dxos/log";
3563
3661
  import { useConfig } from "@dxos/react-client";
3564
3662
  import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
3565
3663
  import { Invitation as Invitation7, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
3566
3664
  import { ScrollArea, useTranslation as useTranslation23 } from "@dxos/react-ui";
3567
3665
  import { descriptionText as descriptionText11, mx as mx24 } from "@dxos/react-ui-theme";
3568
- var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
3666
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
3569
3667
  var activeActionKey = "dxos:react-shell/space-manager/active-action";
3570
3668
  var handleInvitationEvent = (invitation, subscription) => {
3571
3669
  const invitationCode = InvitationEncoder4.encode(invitation);
@@ -3574,7 +3672,7 @@ var handleInvitationEvent = (invitation, subscription) => {
3574
3672
  invitationCode,
3575
3673
  authCode: invitation.authCode
3576
3674
  }), void 0, {
3577
- F: __dxlog_file11,
3675
+ F: __dxlog_file12,
3578
3676
  L: 40,
3579
3677
  S: void 0,
3580
3678
  C: (f, a) => f(...a)
@@ -3644,7 +3742,7 @@ var SpaceManagerImpl = (props) => {
3644
3742
  }
3645
3743
  }
3646
3744
  };
3647
- const [activeAction, setInternalActiveAction] = useState12(localStorage.getItem(activeActionKey) ?? "inviteOne");
3745
+ const [activeAction, setInternalActiveAction] = useState13(localStorage.getItem(activeActionKey) ?? "inviteOne");
3648
3746
  const setActiveAction = (nextAction) => {
3649
3747
  setInternalActiveAction(nextAction);
3650
3748
  localStorage.setItem(activeActionKey, nextAction);
@@ -3681,7 +3779,7 @@ var SpaceManagerImpl = (props) => {
3681
3779
  };
3682
3780
 
3683
3781
  // packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
3684
- var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
3782
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
3685
3783
  var SpacePanelHeading = ({ titleId, space, onDone }) => {
3686
3784
  const { t } = useTranslation24("os");
3687
3785
  const name = space.properties.name;
@@ -3744,10 +3842,10 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
3744
3842
  space: props.space
3745
3843
  }
3746
3844
  });
3747
- useEffect6(() => {
3845
+ useEffect7(() => {
3748
3846
  const subscription = spaceService.subscribe((state) => {
3749
3847
  log13("[state]", state, {
3750
- F: __dxlog_file12,
3848
+ F: __dxlog_file13,
3751
3849
  L: 94,
3752
3850
  S: void 0,
3753
3851
  C: (f, a) => f(...a)
@@ -3858,9 +3956,9 @@ import { defaultTx } from "@dxos/react-ui-theme";
3858
3956
  import { createIFramePort } from "@dxos/rpc-tunnel";
3859
3957
 
3860
3958
  // packages/sdk/shell/src/composites/Shell/Shell.tsx
3861
- import React46, { useEffect as useEffect7, useState as useState13 } from "react";
3959
+ import React46, { useEffect as useEffect8, useState as useState14 } from "react";
3862
3960
  import { log as log14 } from "@dxos/log";
3863
- import { useClient as useClient7 } from "@dxos/react-client";
3961
+ import { useClient as useClient9 } from "@dxos/react-client";
3864
3962
  import { ShellDisplay, ShellLayout } from "@dxos/react-client";
3865
3963
  import { useSpace as useSpace2 } from "@dxos/react-client/echo";
3866
3964
 
@@ -3898,22 +3996,22 @@ var StatusDialog = () => {
3898
3996
  };
3899
3997
 
3900
3998
  // packages/sdk/shell/src/composites/Shell/Shell.tsx
3901
- var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
3999
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
3902
4000
  var blurActiveElement = () => document.activeElement?.blur?.();
3903
4001
  var Shell = ({ runtime }) => {
3904
- const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState13({
4002
+ const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState14({
3905
4003
  layout: runtime.layout,
3906
4004
  invitationCode: runtime.invitationCode,
3907
4005
  spaceKey: runtime.spaceKey,
3908
4006
  spaceId: runtime.spaceId,
3909
4007
  target: runtime.target
3910
4008
  });
3911
- const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState13({
4009
+ const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState14({
3912
4010
  invitationUrl: runtime.invitationUrl,
3913
4011
  deviceInvitationParam: runtime.deviceInvitationParam,
3914
4012
  spaceInvitationParam: runtime.spaceInvitationParam
3915
4013
  });
3916
- const client = useClient7();
4014
+ const client = useClient9();
3917
4015
  const space = useSpace2(spaceId ?? spaceKey);
3918
4016
  const createDeviceInvitationUrl = (invitationCode2) => {
3919
4017
  const baseUrl = new URL(invitationUrl);
@@ -3925,7 +4023,7 @@ var Shell = ({ runtime }) => {
3925
4023
  baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
3926
4024
  return baseUrl.toString();
3927
4025
  };
3928
- useEffect7(() => {
4026
+ useEffect8(() => {
3929
4027
  const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
3930
4028
  const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
3931
4029
  return () => {
@@ -3935,10 +4033,10 @@ var Shell = ({ runtime }) => {
3935
4033
  }, [
3936
4034
  runtime
3937
4035
  ]);
3938
- useEffect7(() => {
4036
+ useEffect8(() => {
3939
4037
  if (layout === ShellLayout.SPACE && !space) {
3940
4038
  log14.warn("No space found for shell space invitations.", void 0, {
3941
- F: __dxlog_file13,
4039
+ F: __dxlog_file14,
3942
4040
  L: 67,
3943
4041
  S: void 0,
3944
4042
  C: (f, a) => f(...a)
@@ -4063,10 +4161,10 @@ var Shell = ({ runtime }) => {
4063
4161
  // packages/sdk/shell/src/composites/Shell/shell-runtime.ts
4064
4162
  import { Event } from "@dxos/async";
4065
4163
  import { appServiceBundle, shellServiceBundle } from "@dxos/client-protocol";
4066
- import { invariant as invariant2 } from "@dxos/invariant";
4164
+ import { invariant as invariant3 } from "@dxos/invariant";
4067
4165
  import { ShellLayout as ShellLayout2 } from "@dxos/protocols/proto/dxos/iframe";
4068
4166
  import { createProtoRpcPeer } from "@dxos/rpc";
4069
- var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
4167
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
4070
4168
  var ShellRuntimeImpl = class {
4071
4169
  constructor(_port) {
4072
4170
  this._port = _port;
@@ -4122,8 +4220,8 @@ var ShellRuntimeImpl = class {
4122
4220
  });
4123
4221
  }
4124
4222
  async setAppContext(context) {
4125
- invariant2(this._appRpc, "runtime not open", {
4126
- F: __dxlog_file14,
4223
+ invariant3(this._appRpc, "runtime not open", {
4224
+ F: __dxlog_file15,
4127
4225
  L: 83,
4128
4226
  S: this,
4129
4227
  A: [
@@ -4371,8 +4469,8 @@ var Fallback = ({ onClose }) => {
4371
4469
  };
4372
4470
 
4373
4471
  // packages/sdk/shell/src/composites/Shell/ShellContext.tsx
4374
- import React48, { createContext as createContext2, useCallback as useCallback8, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState14 } from "react";
4375
- import { useClient as useClient8, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
4472
+ import React48, { createContext as createContext2, useCallback as useCallback8, useContext as useContext2, useEffect as useEffect9, useMemo as useMemo6, useState as useState15 } from "react";
4473
+ import { useClient as useClient10, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
4376
4474
  import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
4377
4475
  import { mx as mx25 } from "@dxos/react-ui-theme";
4378
4476
 
@@ -4429,7 +4527,7 @@ var MemoryShellRuntime = class {
4429
4527
  // packages/sdk/shell/src/composites/Shell/ShellContext.tsx
4430
4528
  var ShellContext = /* @__PURE__ */ createContext2({});
4431
4529
  var useShell = () => {
4432
- const client = useClient8();
4530
+ const client = useClient10();
4433
4531
  const { runtime, setDisplay } = useContext2(ShellContext);
4434
4532
  const setLayout = async (layout, options) => {
4435
4533
  if (runtime) {
@@ -4450,9 +4548,9 @@ var useShell = () => {
4450
4548
  };
4451
4549
  };
4452
4550
  var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
4453
- const client = useClient8();
4551
+ const client = useClient10();
4454
4552
  const identity = useIdentity3();
4455
- const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
4553
+ const [display, setDisplay] = useState15(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
4456
4554
  const shellRuntime = useMemo6(() => {
4457
4555
  if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
4458
4556
  return;
@@ -4499,7 +4597,7 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
4499
4597
  space,
4500
4598
  shellRuntime
4501
4599
  ]);
4502
- useEffect8(() => {
4600
+ useEffect9(() => {
4503
4601
  if (!shellRuntime) {
4504
4602
  return;
4505
4603
  }
@@ -4509,7 +4607,7 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
4509
4607
  shellRuntime,
4510
4608
  handleKeyDown
4511
4609
  ]);
4512
- useEffect8(() => {
4610
+ useEffect9(() => {
4513
4611
  if (!shellRuntime) {
4514
4612
  return;
4515
4613
  }