@dxos/shell 0.5.1-main.ff7d242 → 0.5.1-next.0ef769d

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 (56) hide show
  1. package/dist/bundle/shell.mjs +82506 -9
  2. package/dist/bundle/shell.mjs.map +1 -1
  3. package/dist/bundle/shell.umd.js +91 -146
  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 +136 -71
  7. package/dist/lib/browser/react.mjs.map +3 -3
  8. package/dist/types/src/composites/Shell/Shell.d.ts +1 -2
  9. package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
  10. package/dist/types/src/composites/Shell/Shell.js +24 -4
  11. package/dist/types/src/composites/Shell/Shell.js.map +1 -1
  12. package/dist/types/src/composites/Shell/ShellContext.js +1 -1
  13. package/dist/types/src/composites/Shell/ShellContext.js.map +1 -1
  14. package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts +10 -2
  15. package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts.map +1 -1
  16. package/dist/types/src/composites/Shell/memory-shell-runtime.js +20 -1
  17. package/dist/types/src/composites/Shell/memory-shell-runtime.js.map +1 -1
  18. package/dist/types/src/composites/Shell/run-shell.d.ts.map +1 -1
  19. package/dist/types/src/composites/Shell/run-shell.js +29 -9
  20. package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
  21. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +1 -1
  22. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
  23. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +1 -1
  24. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
  25. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts +1 -3
  26. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
  27. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +3 -2
  28. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
  29. package/dist/types/src/panels/JoinPanel/JoinPanel.js +2 -2
  30. package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
  31. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
  32. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +2 -18
  33. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
  34. package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
  35. package/dist/types/src/steps/InvitationManager.js +3 -0
  36. package/dist/types/src/steps/InvitationManager.js.map +1 -1
  37. package/dist/types/src/translations/locales/en-US.d.ts +1 -0
  38. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  39. package/dist/types/src/translations/locales/en-US.js +6 -5
  40. package/dist/types/src/translations/locales/en-US.js.map +1 -1
  41. package/package.json +22 -21
  42. package/src/composites/Shell/Shell.tsx +36 -5
  43. package/src/composites/Shell/ShellContext.tsx +1 -1
  44. package/src/composites/Shell/memory-shell-runtime.ts +36 -2
  45. package/src/composites/Shell/run-shell.tsx +59 -18
  46. package/src/panels/IdentityPanel/IdentityPanel.tsx +1 -1
  47. package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +2 -2
  48. package/src/panels/IdentityPanel/useAgentHandlers.ts +3 -4
  49. package/src/panels/JoinPanel/JoinPanel.tsx +2 -2
  50. package/src/panels/SpacePanel/steps/SpaceManager.tsx +2 -18
  51. package/src/steps/InvitationManager.tsx +3 -0
  52. package/src/translations/locales/en-US.ts +6 -5
  53. package/dist/bundle/index-Ba9TfOfV.mjs +0 -110
  54. package/dist/bundle/index-Ba9TfOfV.mjs.map +0 -1
  55. package/dist/bundle/index-DaiI_12x.mjs +0 -96628
  56. package/dist/bundle/index-DaiI_12x.mjs.map +0 -1
@@ -135,5 +135,6 @@ export declare const os: {
135
135
  'create agent label': string;
136
136
  'destroy agent label': string;
137
137
  'agent device label': string;
138
+ 'shell fallback title': string;
138
139
  };
139
140
  //# sourceMappingURL=en-US.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Id,CAAC"}
1
+ {"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Id,CAAC"}
@@ -87,14 +87,14 @@ exports.os = {
87
87
  'auth code message': 'Enter the following auth code on the joining device.',
88
88
  'display name input label': 'Display name',
89
89
  'display name input placeholder': 'Enter a display name',
90
- 'invite one label': 'Invite one',
90
+ 'invite one label': 'Single-use invitation',
91
91
  'invite one description': 'Only one user may join.',
92
- 'invite one qr label': 'Single-use',
92
+ 'invite one qr label': 'Single-use invitation',
93
93
  'invite one list item label': 'Active single-use invitation',
94
- 'invite many label': 'Invite many',
94
+ 'invite many label': 'Standing invitation',
95
95
  'invite many description': 'Anyone with the link can join.',
96
- 'invite many qr label': 'Multiple-use',
97
- 'invite many list item label': 'Active multiple-use invitation',
96
+ 'invite many qr label': 'Standing invitation',
97
+ 'invite many list item label': 'Active standing invitation',
98
98
  'invite options label': 'Change the active invite option.',
99
99
  'reset in progress label': 'Resetting...',
100
100
  'confirm label': 'Confirm',
@@ -141,5 +141,6 @@ exports.os = {
141
141
  'create agent label': 'Start an agent',
142
142
  'destroy agent label': 'Shut down agent',
143
143
  'agent device label': 'Your agent',
144
+ 'shell fallback title': 'Shell failed to connect',
144
145
  };
145
146
  //# sourceMappingURL=en-US.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,EAAE,GAAG;IAChB,sBAAsB,EAAE,iBAAiB;IACzC,8BAA8B,EAAE,SAAS;IACzC,eAAe,EAAE,cAAc;IAC/B,4BAA4B,EAAE,UAAU;IACxC,oBAAoB,EAAE,QAAQ;IAC9B,4BAA4B,EAAE,iBAAiB;IAC/C,wBAAwB,EAAE,cAAc;IACxC,uBAAuB,EAAE,eAAe;IACxC,oBAAoB,EAAE,wBAAwB;IAC9C,cAAc,EAAE,4BAA4B;IAC5C,YAAY,EAAE,MAAM;IACpB,yBAAyB,EAAE,SAAS;IACpC,4BAA4B,EAAE,+DAA+D;IAC7F,oBAAoB,EAAE,KAAK;IAC3B,gBAAgB,EAAE,UAAU;IAC5B,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,OAAO;IACtB,oBAAoB,EAAE,oBAAoB;IAC1C,uBAAuB,EAAE,oBAAoB;IAC7C,6BAA6B,EAAE,wBAAwB;IACvD,wBAAwB,EAAE,mBAAmB;IAC7C,8BAA8B,EAAE,4CAA4C;IAC5E,qBAAqB,EAAE,oBAAoB;IAC3C,2BAA2B,EAAE,8EAA8E;IAC3G,yBAAyB,EAAE,oBAAoB;IAC/C,+BAA+B,EAAE,qCAAqC;IACtE,0BAA0B,EAAE,kBAAkB;IAC9C,8BAA8B,EAAE,gCAAgC;IAChE,mCAAmC,EAAE,+BAA+B;IACpE,oCAAoC,EAAE,8DAA8D;IACpG,gCAAgC,EAAE,gBAAgB;IAClD,sBAAsB,EAAE,0CAA0C;IAClE,gCAAgC,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AY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,0BAA0B,EAAE,aAAa;IACzC,yBAAyB,EAAE,wBAAwB;IACnD,oBAAoB,EAAE,cAAc;IACpC,kBAAkB,EAAE,wCAAwC;IAC5D,eAAe,EAAE,wCAAwC;IACzD,mBAAmB,EAAE,2BAA2B;IAChD,eAAe,EAAE,OAAO;IACxB,qBAAqB,EAAE,yBAAyB;IAChD,oBAAoB,EAClB,qMAAqM;IACvM,oBAAoB,EAAE,gBAAgB;IACtC,qBAAqB,EAAE,iBAAiB;IACxC,oBAAoB,EAAE,YAAY;IAClC,sBAAsB,EAAE,yBAAyB;CAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/shell",
3
- "version": "0.5.1-main.ff7d242",
3
+ "version": "0.5.1-next.0ef769d",
4
4
  "description": "DXOS’s OS experiences",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -42,19 +42,18 @@
42
42
  "react-qr-rounded": "^1.0.0",
43
43
  "url-join": "^5.0.0",
44
44
  "xstate": "^4.37.0",
45
- "@dxos/async": "0.5.1-main.ff7d242",
46
- "@dxos/client-protocol": "0.5.1-main.ff7d242",
47
- "@dxos/debug": "0.5.1-main.ff7d242",
48
- "@dxos/display-name": "0.5.1-main.ff7d242",
49
- "@dxos/invariant": "0.5.1-main.ff7d242",
50
- "@dxos/client-services": "0.5.1-main.ff7d242",
51
- "@dxos/log": "0.5.1-main.ff7d242",
52
- "@dxos/react-client": "0.5.1-main.ff7d242",
53
- "@dxos/react-ui": "0.5.1-main.ff7d242",
54
- "@dxos/react-ui-theme": "0.5.1-main.ff7d242",
55
- "@dxos/react-ui-types": "0.5.1-main.ff7d242",
56
- "@dxos/rpc-tunnel": "0.5.1-main.ff7d242",
57
- "@dxos/util": "0.5.1-main.ff7d242"
45
+ "@dxos/debug": "0.5.1-next.0ef769d",
46
+ "@dxos/async": "0.5.1-next.0ef769d",
47
+ "@dxos/client-services": "0.5.1-next.0ef769d",
48
+ "@dxos/display-name": "0.5.1-next.0ef769d",
49
+ "@dxos/invariant": "0.5.1-next.0ef769d",
50
+ "@dxos/log": "0.5.1-next.0ef769d",
51
+ "@dxos/react-ui": "0.5.1-next.0ef769d",
52
+ "@dxos/client-protocol": "0.5.1-next.0ef769d",
53
+ "@dxos/react-ui-theme": "0.5.1-next.0ef769d",
54
+ "@dxos/react-ui-types": "0.5.1-next.0ef769d",
55
+ "@dxos/util": "0.5.1-next.0ef769d",
56
+ "@dxos/rpc-tunnel": "0.5.1-next.0ef769d"
58
57
  },
59
58
  "devDependencies": {
60
59
  "@phosphor-icons/react": "^2.1.5",
@@ -65,17 +64,19 @@
65
64
  "react-dom": "^18.2.0",
66
65
  "vite": "^5.2.9",
67
66
  "vite-plugin-turbosnap": "^1.0.2",
68
- "@dxos/config": "0.5.1-main.ff7d242",
69
- "@dxos/random": "0.5.1-main.ff7d242",
70
- "@dxos/protocols": "0.5.1-main.ff7d242",
71
- "@dxos/react-ui-theme": "0.5.1-main.ff7d242",
72
- "@dxos/storybook-utils": "0.5.1-main.ff7d242",
73
- "@dxos/react-async": "0.5.1-main.ff7d242"
67
+ "@dxos/config": "0.5.1-next.0ef769d",
68
+ "@dxos/protocols": "0.5.1-next.0ef769d",
69
+ "@dxos/random": "0.5.1-next.0ef769d",
70
+ "@dxos/react-async": "0.5.1-next.0ef769d",
71
+ "@dxos/react-ui-theme": "0.5.1-next.0ef769d",
72
+ "@dxos/storybook-utils": "0.5.1-next.0ef769d",
73
+ "@dxos/react-client": "0.5.1-next.0ef769d"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "@phosphor-icons/react": "^2.0.5",
77
77
  "react": "^18.2.0",
78
- "react-dom": "^18.2.0"
78
+ "react-dom": "^18.2.0",
79
+ "@dxos/react-client": "0.5.1-next.0ef769d"
79
80
  },
80
81
  "publishConfig": {
81
82
  "access": "public"
@@ -5,7 +5,14 @@
5
5
  import React, { useEffect, useState } from 'react';
6
6
 
7
7
  import { log } from '@dxos/log';
8
- import { type LayoutRequest, ShellDisplay, ShellLayout, type ShellRuntime, useClient } from '@dxos/react-client';
8
+ import {
9
+ type LayoutRequest,
10
+ ShellDisplay,
11
+ ShellLayout,
12
+ type ShellRuntime,
13
+ useClient,
14
+ type InvitationUrlRequest,
15
+ } from '@dxos/react-client';
9
16
  import { useSpace } from '@dxos/react-client/echo';
10
17
 
11
18
  import { IdentityDialog } from '../IdentityDialog';
@@ -13,19 +20,43 @@ import { JoinDialog } from '../JoinDialog';
13
20
  import { SpaceDialog } from '../SpaceDialog';
14
21
  import { StatusDialog } from '../StatusDialog';
15
22
 
16
- export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: string }) => {
23
+ export const Shell = ({ runtime }: { runtime: ShellRuntime }) => {
17
24
  const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState<LayoutRequest>({
18
25
  layout: runtime.layout,
19
26
  invitationCode: runtime.invitationCode,
20
27
  spaceKey: runtime.spaceKey,
21
28
  target: runtime.target,
22
29
  });
30
+ const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
31
+ useState<InvitationUrlRequest>({
32
+ invitationUrl: runtime.invitationUrl,
33
+ deviceInvitationParam: runtime.deviceInvitationParam,
34
+ spaceInvitationParam: runtime.spaceInvitationParam,
35
+ });
23
36
 
24
37
  const client = useClient();
25
38
  const space = useSpace(spaceKey);
26
39
 
40
+ const createDeviceInvitationUrl = (invitationCode: string) => {
41
+ const baseUrl = new URL(invitationUrl);
42
+ baseUrl.searchParams.set(deviceInvitationParam, invitationCode);
43
+ return baseUrl.toString();
44
+ };
45
+
46
+ const createSpaceInvitationUrl = (invitationCode: string) => {
47
+ const baseUrl = new URL(invitationUrl);
48
+ baseUrl.searchParams.set(spaceInvitationParam, invitationCode);
49
+ return baseUrl.toString();
50
+ };
51
+
27
52
  useEffect(() => {
28
- return runtime.layoutUpdate.on((request) => setLayout(request));
53
+ const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
54
+ const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
55
+
56
+ return () => {
57
+ unsubscribeLayout();
58
+ unsubscribeInvitationUrl();
59
+ };
29
60
  }, [runtime]);
30
61
 
31
62
  useEffect(() => {
@@ -66,7 +97,7 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
66
97
  case ShellLayout.EDIT_PROFILE:
67
98
  return (
68
99
  <IdentityDialog
69
- createInvitationUrl={(invitationCode) => `${origin}?deviceInvitationCode=${invitationCode}`}
100
+ createInvitationUrl={createDeviceInvitationUrl}
70
101
  onResetStorage={async () => {
71
102
  runtime.setLayout({ layout: ShellLayout.STATUS });
72
103
  await client.reset();
@@ -90,7 +121,7 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
90
121
  <SpaceDialog
91
122
  space={space}
92
123
  target={target}
93
- createInvitationUrl={(invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`}
124
+ createInvitationUrl={createSpaceInvitationUrl}
94
125
  onDone={async () => {
95
126
  await runtime.setAppContext({ display: ShellDisplay.NONE });
96
127
  runtime.setLayout({ layout: ShellLayout.DEFAULT });
@@ -153,7 +153,7 @@ export const ShellProvider = ({
153
153
  <>
154
154
  {shellRuntime && (
155
155
  <div className={mx(display === ShellDisplay.NONE ? 'hidden' : '')}>
156
- <Shell runtime={shellRuntime} origin={window.location.origin} />
156
+ <Shell runtime={shellRuntime} />
157
157
  </div>
158
158
  )}
159
159
 
@@ -4,25 +4,40 @@
4
4
 
5
5
  import { Event } from '@dxos/async';
6
6
  import {
7
+ ShellLayout,
7
8
  type AppContextRequest,
9
+ type InvitationUrlRequest,
8
10
  type LayoutRequest,
9
11
  type PublicKey,
10
- ShellLayout,
11
12
  type ShellRuntime,
12
13
  } from '@dxos/react-client';
13
14
 
14
15
  // TODO(wittjosiah): Remove?
15
16
  export class MemoryShellRuntime implements ShellRuntime {
16
17
  readonly layoutUpdate = new Event<LayoutRequest>();
18
+ readonly invitationUrlUpdate = new Event<InvitationUrlRequest>();
17
19
  readonly contextUpdate = new Event<AppContextRequest>();
18
20
  private _layout: ShellLayout;
19
21
  private _invitationCode?: string;
20
22
  private _spaceKey?: PublicKey;
23
+ private _invitationUrl: string;
24
+ private _deviceInvitationParam: string;
25
+ private _spaceInvitationParam: string;
21
26
 
22
- constructor({ layout, invitationCode, spaceKey }: Partial<LayoutRequest> & Partial<AppContextRequest> = {}) {
27
+ constructor({
28
+ layout,
29
+ invitationCode,
30
+ spaceKey,
31
+ invitationUrl,
32
+ deviceInvitationParam,
33
+ spaceInvitationParam,
34
+ }: Partial<LayoutRequest> & Partial<AppContextRequest> & Partial<InvitationUrlRequest> = {}) {
23
35
  this._layout = layout ?? ShellLayout.DEFAULT;
24
36
  this._invitationCode = invitationCode;
25
37
  this._spaceKey = spaceKey;
38
+ this._invitationUrl = invitationUrl ?? window.location.origin;
39
+ this._deviceInvitationParam = deviceInvitationParam ?? 'deviceInvitationCode';
40
+ this._spaceInvitationParam = spaceInvitationParam ?? 'spaceInvitationCode';
26
41
  }
27
42
 
28
43
  get layout() {
@@ -37,6 +52,18 @@ export class MemoryShellRuntime implements ShellRuntime {
37
52
  return this._spaceKey;
38
53
  }
39
54
 
55
+ get invitationUrl() {
56
+ return this._invitationUrl;
57
+ }
58
+
59
+ get deviceInvitationParam() {
60
+ return this._deviceInvitationParam;
61
+ }
62
+
63
+ get spaceInvitationParam() {
64
+ return this._spaceInvitationParam;
65
+ }
66
+
40
67
  setLayout(request: LayoutRequest) {
41
68
  this._layout = request.layout;
42
69
  this._invitationCode = request.invitationCode;
@@ -44,6 +71,13 @@ export class MemoryShellRuntime implements ShellRuntime {
44
71
  this.layoutUpdate.emit(request);
45
72
  }
46
73
 
74
+ setInvitationUrl(request: InvitationUrlRequest) {
75
+ this._invitationUrl = request.invitationUrl;
76
+ this._deviceInvitationParam = request.deviceInvitationParam;
77
+ this._spaceInvitationParam = request.spaceInvitationParam;
78
+ this.invitationUrlUpdate.emit(request);
79
+ }
80
+
47
81
  async setAppContext(context: AppContextRequest) {
48
82
  this.contextUpdate.emit(context);
49
83
  }
@@ -7,8 +7,16 @@ import { createRoot } from 'react-dom/client';
7
7
 
8
8
  import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from '@dxos/client-protocol';
9
9
  import { ShellRuntimeImpl } from '@dxos/client-services';
10
- import { Client, ClientContext, ClientServicesProxy, Config, SystemStatus } from '@dxos/react-client';
11
- import { ThemeProvider, Tooltip } from '@dxos/react-ui';
10
+ import {
11
+ AgentHostingProvider,
12
+ Client,
13
+ ClientContext,
14
+ ClientServicesProxy,
15
+ Config,
16
+ ShellDisplay,
17
+ SystemStatus,
18
+ } from '@dxos/react-client';
19
+ import { Button, Dialog, ThemeProvider, Tooltip, useTranslation } from '@dxos/react-ui';
12
20
  import { defaultTx } from '@dxos/react-ui-theme';
13
21
  import { createIFramePort } from '@dxos/rpc-tunnel';
14
22
 
@@ -17,22 +25,55 @@ import { ClipboardProvider } from '../../components';
17
25
  import { osTranslations } from '../../translations';
18
26
 
19
27
  export const runShell = async (config: Config = new Config()) => {
20
- const services = new ClientServicesProxy(createIFramePort({ channel: DEFAULT_CLIENT_CHANNEL }));
21
- const client = new Client({ config, services });
28
+ // If runtime fails to open then the shell will not be openable.
22
29
  const runtime = new ShellRuntimeImpl(createIFramePort({ channel: DEFAULT_SHELL_CHANNEL }));
23
- await Promise.all([runtime.open(), client.initialize()]);
24
-
25
- createRoot(document.getElementById('root')!).render(
26
- <StrictMode>
27
- <ThemeProvider tx={defaultTx} resourceExtensions={[osTranslations]}>
28
- <ClientContext.Provider value={{ client, status: SystemStatus.ACTIVE }}>
29
- <ClipboardProvider>
30
- <Tooltip.Provider>
31
- <Shell runtime={runtime} origin={location.origin} />
32
- </Tooltip.Provider>
33
- </ClipboardProvider>
34
- </ClientContext.Provider>
35
- </ThemeProvider>
36
- </StrictMode>,
30
+ await runtime.open();
31
+
32
+ try {
33
+ const services = new ClientServicesProxy(createIFramePort({ channel: DEFAULT_CLIENT_CHANNEL }));
34
+ const client = new Client({ config, services });
35
+ await client.initialize();
36
+
37
+ createRoot(document.getElementById('root')!).render(
38
+ <StrictMode>
39
+ <ThemeProvider tx={defaultTx} resourceExtensions={[osTranslations]}>
40
+ <ClientContext.Provider value={{ client, status: SystemStatus.ACTIVE }}>
41
+ <ClipboardProvider>
42
+ <Tooltip.Provider>
43
+ <AgentHostingProvider>
44
+ <Shell runtime={runtime} />
45
+ </AgentHostingProvider>
46
+ </Tooltip.Provider>
47
+ </ClipboardProvider>
48
+ </ClientContext.Provider>
49
+ </ThemeProvider>
50
+ </StrictMode>,
51
+ );
52
+ } catch {
53
+ // If shell's client fails to initialize, ensure that the shell is still closeable.
54
+ createRoot(document.getElementById('root')!).render(
55
+ <StrictMode>
56
+ <ThemeProvider tx={defaultTx} resourceExtensions={[osTranslations]}>
57
+ <Fallback onClose={() => runtime.setAppContext({ display: ShellDisplay.NONE })} />
58
+ </ThemeProvider>
59
+ </StrictMode>,
60
+ );
61
+ }
62
+ };
63
+
64
+ const Fallback = ({ onClose }: { onClose?: () => void }) => {
65
+ const { t } = useTranslation('os');
66
+
67
+ return (
68
+ <Dialog.Root modal open onOpenChange={() => onClose?.()}>
69
+ <Dialog.Overlay>
70
+ <Dialog.Content>
71
+ <Dialog.Title>{t('shell fallback title')}</Dialog.Title>
72
+ <Dialog.Close asChild onClick={() => onClose?.()}>
73
+ <Button variant='primary'>{t('close label')}</Button>
74
+ </Dialog.Close>
75
+ </Dialog.Content>
76
+ </Dialog.Overlay>
77
+ </Dialog.Root>
37
78
  );
38
79
  };
@@ -235,7 +235,7 @@ export const IdentityPanel = ({
235
235
  const devices = useDevices();
236
236
  const identity = useIdentity();
237
237
  const invitations = useHaloInvitations();
238
- const agentProps = useAgentHandlers({ client, identity, invitations });
238
+ const agentProps = useAgentHandlers({ identity, invitations });
239
239
  if (!identity) {
240
240
  log.error('IdentityPanel rendered with no active identity.');
241
241
  return null;
@@ -5,7 +5,7 @@
5
5
  import React, { useCallback } from 'react';
6
6
 
7
7
  import { log } from '@dxos/log';
8
- import { useAgentHostingProviderClient, useClient } from '@dxos/react-client';
8
+ import { useAgentHostingClient, useClient } from '@dxos/react-client';
9
9
  import { useHaloInvitations } from '@dxos/react-client/halo';
10
10
  import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
11
11
 
@@ -18,7 +18,7 @@ export const IdentityActionChooser = (props: IdentityPanelStepProps) => {
18
18
  const { send } = props;
19
19
  const client = useClient();
20
20
  const invitations = useHaloInvitations();
21
- const agentHostingProviderClient = useAgentHostingProviderClient(client.config);
21
+ const agentHostingProviderClient = useAgentHostingClient();
22
22
  const onInvitationEvent = useCallback((invitation: Invitation) => {
23
23
  const invitationCode = InvitationEncoder.encode(invitation);
24
24
  if (invitation.state === Invitation.State.CONNECTING) {
@@ -7,23 +7,22 @@ import { useCallback, useEffect, useState } from 'react';
7
7
  import { type CancellableInvitation } from '@dxos/client-protocol';
8
8
  import { invariant } from '@dxos/invariant';
9
9
  import { log } from '@dxos/log';
10
- import { useAgentHostingProviderClient, type Client } from '@dxos/react-client';
10
+ import { useAgentHostingClient, useClient } from '@dxos/react-client';
11
11
  import { type Identity } from '@dxos/react-client/halo';
12
12
  import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
13
13
 
14
14
  export const useAgentHandlers = ({
15
- client,
16
15
  invitations,
17
16
  identity,
18
17
  }: {
19
- client: Client;
20
18
  invitations: CancellableInvitation[];
21
19
  identity: Identity | null;
22
20
  }) => {
23
21
  const [validationMessage, setValidationMessage] = useState('');
24
22
  const [agentStatus, setAgentStatus] = useState('');
25
23
  const [agentActive, setAgentActive] = useState(false);
26
- const agentHostingProviderClient = useAgentHostingProviderClient(client.config);
24
+ const agentHostingProviderClient = useAgentHostingClient();
25
+ const client = useClient();
27
26
 
28
27
  useEffect(() => {
29
28
  const fetchAgentStatus = async () => {
@@ -60,7 +60,7 @@ export const JoinPanelImpl = (props: JoinPanelImplProps) => {
60
60
  <Viewport.View classNames={stepStyles} id='reset storage confirmation'>
61
61
  <ConfirmResetComponent
62
62
  send={send}
63
- active={activeView === 'reset identity confirmation'}
63
+ active={activeView === 'reset storage confirmation'}
64
64
  onCancel={onCancelResetStorage}
65
65
  onConfirm={onConfirmResetStorage}
66
66
  />
@@ -222,7 +222,7 @@ export const JoinPanel = ({
222
222
  case joinState.matches({ choosingIdentity: 'choosingAuthMethod' }):
223
223
  return 'addition method chooser';
224
224
  case joinState.matches('resettingIdentity'):
225
- return 'reset identity confirmation';
225
+ return 'reset storage confirmation';
226
226
  case joinState.matches({ choosingIdentity: 'creatingIdentity' }):
227
227
  return 'create identity input';
228
228
  case joinState.matches({ choosingIdentity: 'recoveringIdentity' }):
@@ -73,8 +73,8 @@ export const SpaceManager = (props: SpaceManagerProps) => {
73
73
  icon: UsersThree,
74
74
  onClick: useCallback(() => {
75
75
  const invitation = space.share?.({
76
- type: Invitation.Type.INTERACTIVE,
77
- authMethod: Invitation.AuthMethod.NONE,
76
+ type: Invitation.Type.DELEGATED,
77
+ authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
78
78
  multiUse: true,
79
79
  target,
80
80
  });
@@ -83,22 +83,6 @@ export const SpaceManager = (props: SpaceManagerProps) => {
83
83
  }
84
84
  }, [space]),
85
85
  },
86
- // inviteNonPersistent: {
87
- // label: 'Invite one (nonpersistent)',
88
- // description: 'Only one user may join. Invitation does not resume if client is restarted.',
89
- // icon: UserPlus,
90
- // onClick: useCallback(() => {
91
- // const invitation = space.share?.({
92
- // type: Invitation.Type.INTERACTIVE,
93
- // authMethod: Invitation.AuthMethod.SHARED_SECRET,
94
- // persistent: false,
95
- // target,
96
- // });
97
- // if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
98
- // invitation.subscribe(onInvitationEvent);
99
- // }
100
- // }, [space]),
101
- // },
102
86
  };
103
87
 
104
88
  return <SpaceManagerImpl {...props} invitations={invitations} inviteActions={inviteActions} />;
@@ -53,6 +53,9 @@ export const InvitationManager = ({
53
53
  const showAuthCode = statusValue === 3;
54
54
  const emoji = hexToEmoji(id);
55
55
  const activeView = useMemo(() => {
56
+ if (multiUse) {
57
+ return 'showing qr';
58
+ }
56
59
  switch (true) {
57
60
  case statusValue === 5:
58
61
  case statusValue < 0:
@@ -85,14 +85,14 @@ export const os = {
85
85
  'auth code message': 'Enter the following auth code on the joining device.',
86
86
  'display name input label': 'Display name',
87
87
  'display name input placeholder': 'Enter a display name',
88
- 'invite one label': 'Invite one',
88
+ 'invite one label': 'Single-use invitation',
89
89
  'invite one description': 'Only one user may join.',
90
- 'invite one qr label': 'Single-use',
90
+ 'invite one qr label': 'Single-use invitation',
91
91
  'invite one list item label': 'Active single-use invitation',
92
- 'invite many label': 'Invite many',
92
+ 'invite many label': 'Standing invitation',
93
93
  'invite many description': 'Anyone with the link can join.',
94
- 'invite many qr label': 'Multiple-use',
95
- 'invite many list item label': 'Active multiple-use invitation',
94
+ 'invite many qr label': 'Standing invitation',
95
+ 'invite many list item label': 'Active standing invitation',
96
96
  'invite options label': 'Change the active invite option.',
97
97
  'reset in progress label': 'Resetting...',
98
98
  'confirm label': 'Confirm',
@@ -142,4 +142,5 @@ export const os = {
142
142
  'create agent label': 'Start an agent',
143
143
  'destroy agent label': 'Shut down agent',
144
144
  'agent device label': 'Your agent',
145
+ 'shell fallback title': 'Shell failed to connect',
145
146
  };
@@ -1,110 +0,0 @@
1
- import { T as d, E as p, c as u, e as l, W as _, l as a, a as f } from "./index-DaiI_12x.mjs";
2
- var m = "/home/runner/work/dxos/dxos/packages/core/mesh/websocket-rpc/src/token-auth.ts", k = class extends _ {
3
- constructor(t, e) {
4
- const r = l.from(e).toString("base64").replace(/=*$/, ""), s = [
5
- `base64url.bearer.authorization.dxos.org.${r}`
6
- ];
7
- super(t, s), a("encodedToken", {
8
- encodedToken: r
9
- }, {
10
- F: m,
11
- L: 55,
12
- S: this,
13
- C: (c, o) => c(...o)
14
- });
15
- }
16
- };
17
- function w(t, e, r, s) {
18
- var c = arguments.length, o = c < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, r) : s, i;
19
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
20
- o = Reflect.decorate(t, e, r, s);
21
- else
22
- for (var h = t.length - 1; h >= 0; h--)
23
- (i = t[h]) && (o = (c < 3 ? i(o) : c > 3 ? i(e, r, o) : i(e, r)) || o);
24
- return c > 3 && o && Object.defineProperty(e, r, o), o;
25
- }
26
- var n = "/home/runner/work/dxos/dxos/packages/core/mesh/websocket-rpc/src/client.ts", g = class {
27
- constructor(t) {
28
- this._params = t, this._connectTrigger = new d(), this.connected = new p(), this.disconnected = new p(), this.error = new p(), this._rpc = u({
29
- requested: this._params.requested,
30
- exposed: this._params.exposed,
31
- handlers: this._params.handlers,
32
- port: {
33
- send: (e) => {
34
- this._socket.send(e);
35
- },
36
- subscribe: (e) => {
37
- this._socket.onmessage = async (r) => {
38
- typeof Blob < "u" && r.data instanceof Blob ? e(l.from(await r.data.arrayBuffer())) : e(r.data);
39
- };
40
- }
41
- }
42
- });
43
- }
44
- get url() {
45
- return this._params.url;
46
- }
47
- async open() {
48
- this._params.authenticationToken ? this._socket = new k(this._params.url, this._params.authenticationToken) : this._socket = new _(this._params.url), this._socket.onopen = async () => {
49
- a("Socket open", void 0, {
50
- F: n,
51
- L: 61,
52
- S: this,
53
- C: (t, e) => t(...e)
54
- });
55
- try {
56
- await this._rpc.open(), a(`RPC open ${this._params.url}`, void 0, {
57
- F: n,
58
- L: 64,
59
- S: this,
60
- C: (t, e) => t(...e)
61
- }), this.connected.emit(), this._connectTrigger.wake();
62
- } catch (t) {
63
- this.error.emit(t);
64
- }
65
- }, this._socket.onclose = async () => {
66
- a(`Disconnected ${this._params.url}`, void 0, {
67
- F: n,
68
- L: 73,
69
- S: this,
70
- C: (t, e) => t(...e)
71
- }), this.disconnected.emit(), await this.close();
72
- }, this._socket.onerror = (t) => {
73
- a.error(t.message ?? "Socket error", {
74
- url: this._params.url
75
- }, {
76
- F: n,
77
- L: 80,
78
- S: this,
79
- C: (r, s) => r(...s)
80
- });
81
- const e = t.error ?? new Error(t.message);
82
- this.error.emit(e), this._connectTrigger.throw(e);
83
- }, await this._connectTrigger.wait();
84
- }
85
- async close() {
86
- var t, e;
87
- try {
88
- await ((t = this._rpc) == null ? void 0 : t.close());
89
- } catch (r) {
90
- a.catch(r, void 0, {
91
- F: n,
92
- L: 93,
93
- S: this,
94
- C: (s, c) => s(...c)
95
- });
96
- }
97
- (e = this._socket) == null || e.close();
98
- }
99
- get rpc() {
100
- return this._rpc.rpc;
101
- }
102
- };
103
- w([
104
- f
105
- ], g.prototype, "url", null);
106
- export {
107
- k as WebSocketWithTokenAuth,
108
- g as WebsocketRpcClient
109
- };
110
- //# sourceMappingURL=index-Ba9TfOfV.mjs.map