@dxos/plugin-client 0.7.2 → 0.7.3-staging.0905f03
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-VCPHSTE7.mjs → chunk-FGUXUNOK.mjs} +3 -1
- package/dist/lib/browser/{chunk-VCPHSTE7.mjs.map → chunk-FGUXUNOK.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +112 -25
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/node/{chunk-JYQZCE2U.cjs → chunk-XYLDQWFV.cjs} +6 -4
- package/dist/lib/node/{chunk-JYQZCE2U.cjs.map → chunk-XYLDQWFV.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +124 -40
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +5 -5
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/{chunk-4FDLD5H4.mjs → chunk-C6X363FK.mjs} +3 -1
- package/dist/lib/node-esm/{chunk-4FDLD5H4.mjs.map → chunk-C6X363FK.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +112 -25
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -1
- package/dist/types/src/ClientPlugin.d.ts +0 -7
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +6 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +5 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/ClientPlugin.tsx +34 -18
- package/src/components/IdentityDialog.tsx +4 -4
- package/src/components/RecoveryCodeDialog.tsx +58 -0
- package/src/components/index.ts +1 -0
- package/src/meta.ts +2 -0
- package/src/translations.ts +7 -0
package/dist/lib/node/index.cjs
CHANGED
|
@@ -30,16 +30,15 @@ var node_exports = {};
|
|
|
30
30
|
__export(node_exports, {
|
|
31
31
|
ClientPlugin: () => ClientPlugin,
|
|
32
32
|
default: () => src_default,
|
|
33
|
-
parseClientPlugin: () => parseClientPlugin
|
|
34
|
-
parseSchemaPlugin: () => parseSchemaPlugin
|
|
33
|
+
parseClientPlugin: () => parseClientPlugin
|
|
35
34
|
});
|
|
36
35
|
module.exports = __toCommonJS(node_exports);
|
|
37
|
-
var
|
|
36
|
+
var import_chunk_XYLDQWFV = require("./chunk-XYLDQWFV.cjs");
|
|
38
37
|
var import_react = __toESM(require("react"));
|
|
39
38
|
var import_app_framework = require("@dxos/app-framework");
|
|
40
39
|
var import_config = require("@dxos/config");
|
|
41
40
|
var import_react2 = require("@dxos/echo-signals/react");
|
|
42
|
-
var
|
|
41
|
+
var import_invariant = require("@dxos/invariant");
|
|
43
42
|
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
44
43
|
var import_react_client = require("@dxos/react-client");
|
|
45
44
|
var import_react3 = __toESM(require("react"));
|
|
@@ -51,6 +50,8 @@ var import_react5 = __toESM(require("react"));
|
|
|
51
50
|
var import_app_framework3 = require("@dxos/app-framework");
|
|
52
51
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
53
52
|
var import_react6 = require("@dxos/shell/react");
|
|
53
|
+
var import_react7 = __toESM(require("react"));
|
|
54
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
54
55
|
var IdentityDialog = (props) => {
|
|
55
56
|
const dispatch = (0, import_app_framework2.useIntentDispatcher)();
|
|
56
57
|
const client = (0, import_react_client2.useClient)();
|
|
@@ -66,7 +67,7 @@ var IdentityDialog = (props) => {
|
|
|
66
67
|
const handleResetStorage = (0, import_react3.useCallback)(async () => {
|
|
67
68
|
await client.reset();
|
|
68
69
|
await dispatch({
|
|
69
|
-
action:
|
|
70
|
+
action: import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE
|
|
70
71
|
});
|
|
71
72
|
}, [
|
|
72
73
|
dispatch
|
|
@@ -74,7 +75,7 @@ var IdentityDialog = (props) => {
|
|
|
74
75
|
const handleRecover = (0, import_react3.useCallback)(async () => {
|
|
75
76
|
await client.reset();
|
|
76
77
|
await dispatch({
|
|
77
|
-
action:
|
|
78
|
+
action: import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE,
|
|
78
79
|
data: {
|
|
79
80
|
target: "recoverIdentity"
|
|
80
81
|
}
|
|
@@ -85,7 +86,7 @@ var IdentityDialog = (props) => {
|
|
|
85
86
|
const handleJoinNewIdentity = (0, import_react3.useCallback)(async () => {
|
|
86
87
|
await client.reset();
|
|
87
88
|
await dispatch({
|
|
88
|
-
action:
|
|
89
|
+
action: import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE,
|
|
89
90
|
data: {
|
|
90
91
|
target: "deviceInvitation"
|
|
91
92
|
}
|
|
@@ -93,7 +94,7 @@ var IdentityDialog = (props) => {
|
|
|
93
94
|
}, [
|
|
94
95
|
dispatch
|
|
95
96
|
]);
|
|
96
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react3.default.createElement(
|
|
97
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Clipboard.Provider, null, /* @__PURE__ */ import_react3.default.createElement(import_react4.IdentityPanel, {
|
|
97
98
|
...props,
|
|
98
99
|
doneActionParent: /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Dialog.Close, {
|
|
99
100
|
asChild: true
|
|
@@ -107,8 +108,8 @@ var IdentityDialog = (props) => {
|
|
|
107
108
|
var JoinDialog = (props) => {
|
|
108
109
|
const dispatch = (0, import_app_framework3.useIntentDispatcher)();
|
|
109
110
|
const handleCancelResetStorage = (0, import_react5.useCallback)(() => dispatch({
|
|
110
|
-
plugin:
|
|
111
|
-
action:
|
|
111
|
+
plugin: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
|
|
112
|
+
action: import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY
|
|
112
113
|
}), [
|
|
113
114
|
dispatch
|
|
114
115
|
]);
|
|
@@ -123,7 +124,7 @@ var JoinDialog = (props) => {
|
|
|
123
124
|
}
|
|
124
125
|
}),
|
|
125
126
|
dispatch({
|
|
126
|
-
action:
|
|
127
|
+
action: import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
|
|
127
128
|
data: {
|
|
128
129
|
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
129
130
|
}
|
|
@@ -146,18 +147,62 @@ var JoinDialog = (props) => {
|
|
|
146
147
|
onDone: handleDone
|
|
147
148
|
}));
|
|
148
149
|
};
|
|
150
|
+
var RecoveryCodeDialog = ({ code }) => {
|
|
151
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_XYLDQWFV.CLIENT_PLUGIN);
|
|
152
|
+
const [confirmation, setConfirmation] = (0, import_react7.useState)(false);
|
|
153
|
+
const handleConfirmation = (0, import_react7.useCallback)((checked) => setConfirmation(checked), []);
|
|
154
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Content, {
|
|
155
|
+
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
156
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Title, {
|
|
157
|
+
classNames: ""
|
|
158
|
+
}, t("recovery code dialog title")), /* @__PURE__ */ import_react7.default.createElement("p", {
|
|
159
|
+
className: "py-4"
|
|
160
|
+
}, t("recovery code dialog description")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Clipboard.Provider, null, /* @__PURE__ */ import_react7.default.createElement(Code, {
|
|
161
|
+
value: code
|
|
162
|
+
})), /* @__PURE__ */ import_react7.default.createElement("p", {
|
|
163
|
+
className: "py-4"
|
|
164
|
+
}, t("recovery code dialog warning")), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
165
|
+
className: "flex items-center gap-2 pbe-4"
|
|
166
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Input.Checkbox, {
|
|
167
|
+
"data-testid": "recoveryCode.confirm",
|
|
168
|
+
checked: confirmation,
|
|
169
|
+
onCheckedChange: handleConfirmation
|
|
170
|
+
}), /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
171
|
+
className: "flex justify-end"
|
|
172
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Action, {
|
|
173
|
+
asChild: true
|
|
174
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Button, {
|
|
175
|
+
"data-testid": "recoveryCode.continue",
|
|
176
|
+
variant: "primary",
|
|
177
|
+
disabled: !confirmation
|
|
178
|
+
}, t("continue label")))));
|
|
179
|
+
};
|
|
180
|
+
var Code = ({ value }) => {
|
|
181
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
182
|
+
className: "relative p-2 border border-separator rounded group"
|
|
183
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Clipboard.IconButton, {
|
|
184
|
+
value,
|
|
185
|
+
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
186
|
+
}), /* @__PURE__ */ import_react7.default.createElement("code", {
|
|
187
|
+
className: "whitespace-pre-wrap"
|
|
188
|
+
}, value));
|
|
189
|
+
};
|
|
149
190
|
var translations_default = [
|
|
150
191
|
{
|
|
151
192
|
"en-US": {
|
|
152
|
-
[
|
|
153
|
-
"open shell label": "Open HALO"
|
|
193
|
+
[import_chunk_XYLDQWFV.CLIENT_PLUGIN]: {
|
|
194
|
+
"open shell label": "Open HALO",
|
|
195
|
+
"recovery code dialog title": "Recovery Code",
|
|
196
|
+
"recovery code dialog description": "This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.",
|
|
197
|
+
"recovery code dialog warning": "Please note: This code will not be displayed again and cannot be replaced. It is your private key for recovering DXOS data. Anyone with this key will also be able to gain access to your account.",
|
|
198
|
+
"recovery code confirmation label": "Confirm the code has been saved",
|
|
199
|
+
"continue label": "Continue"
|
|
154
200
|
}
|
|
155
201
|
}
|
|
156
202
|
}
|
|
157
203
|
];
|
|
158
204
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/ClientPlugin.tsx";
|
|
159
205
|
var parseClientPlugin = (plugin) => (plugin?.provides).client instanceof import_react_client.Client ? plugin : void 0;
|
|
160
|
-
var parseSchemaPlugin = (plugin) => Array.isArray(plugin?.provides.echo?.schema) ? plugin : void 0;
|
|
161
206
|
var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitationParam = "deviceInvitationCode", onClientInitialized, onReady, onReset, ...options }) => {
|
|
162
207
|
(0, import_react2.registerSignalsRuntime)();
|
|
163
208
|
let client;
|
|
@@ -168,7 +213,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
168
213
|
return baseUrl.toString();
|
|
169
214
|
};
|
|
170
215
|
return {
|
|
171
|
-
meta:
|
|
216
|
+
meta: import_chunk_XYLDQWFV.meta_default,
|
|
172
217
|
initialize: async () => {
|
|
173
218
|
const config = new import_config.Config(await (0, import_config.Storage)(), (0, import_config.Envs)(), (0, import_config.Local)(), (0, import_config.Defaults)());
|
|
174
219
|
client = new import_react_client.Client({
|
|
@@ -200,17 +245,6 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
200
245
|
throw error;
|
|
201
246
|
}
|
|
202
247
|
await onReady?.(client, plugins);
|
|
203
|
-
(0, import_app_framework.filterPlugins)(plugins, parseSchemaPlugin).forEach((plugin) => {
|
|
204
|
-
(0, import_log.log)("ready", {
|
|
205
|
-
id: plugin.meta.id
|
|
206
|
-
}, {
|
|
207
|
-
F: __dxlog_file,
|
|
208
|
-
L: 141,
|
|
209
|
-
S: void 0,
|
|
210
|
-
C: (f, a) => f(...a)
|
|
211
|
-
});
|
|
212
|
-
client.addTypes(plugin.provides.echo.schema);
|
|
213
|
-
});
|
|
214
248
|
},
|
|
215
249
|
unload: async () => {
|
|
216
250
|
await client.destroy();
|
|
@@ -228,6 +262,8 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
228
262
|
});
|
|
229
263
|
} else if (data.component === "dxos.org/plugin/client/JoinDialog") {
|
|
230
264
|
return /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject);
|
|
265
|
+
} else if (data.component === "dxos.org/plugin/client/RecoveryCodeDialog") {
|
|
266
|
+
return /* @__PURE__ */ import_react.default.createElement(RecoveryCodeDialog, data.subject);
|
|
231
267
|
}
|
|
232
268
|
break;
|
|
233
269
|
}
|
|
@@ -237,9 +273,9 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
237
273
|
graph: {
|
|
238
274
|
builder: (plugins) => {
|
|
239
275
|
const intentPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin);
|
|
240
|
-
const id = `${
|
|
276
|
+
const id = `${import_chunk_XYLDQWFV.CLIENT_PLUGIN}/open-shell`;
|
|
241
277
|
return (0, import_plugin_graph.createExtension)({
|
|
242
|
-
id:
|
|
278
|
+
id: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
|
|
243
279
|
filter: (node) => node.id === "root",
|
|
244
280
|
actions: () => [
|
|
245
281
|
{
|
|
@@ -247,8 +283,8 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
247
283
|
data: async () => {
|
|
248
284
|
await intentPlugin?.provides.intent.dispatch([
|
|
249
285
|
{
|
|
250
|
-
plugin:
|
|
251
|
-
action:
|
|
286
|
+
plugin: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
|
|
287
|
+
action: import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY
|
|
252
288
|
}
|
|
253
289
|
]);
|
|
254
290
|
},
|
|
@@ -256,7 +292,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
256
292
|
label: [
|
|
257
293
|
"open shell label",
|
|
258
294
|
{
|
|
259
|
-
ns:
|
|
295
|
+
ns: import_chunk_XYLDQWFV.CLIENT_PLUGIN
|
|
260
296
|
}
|
|
261
297
|
],
|
|
262
298
|
icon: "ph--address-book--regular",
|
|
@@ -276,14 +312,14 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
276
312
|
intent: {
|
|
277
313
|
resolver: async (intent) => {
|
|
278
314
|
switch (intent.action) {
|
|
279
|
-
case
|
|
315
|
+
case import_chunk_XYLDQWFV.ClientAction.CREATE_IDENTITY: {
|
|
280
316
|
const data = await client.halo.createIdentity();
|
|
281
317
|
return {
|
|
282
318
|
data,
|
|
283
319
|
intents: [
|
|
284
320
|
[
|
|
285
321
|
{
|
|
286
|
-
action:
|
|
322
|
+
action: import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
|
|
287
323
|
data: {
|
|
288
324
|
name: "identity.create"
|
|
289
325
|
}
|
|
@@ -292,7 +328,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
292
328
|
]
|
|
293
329
|
};
|
|
294
330
|
}
|
|
295
|
-
case
|
|
331
|
+
case import_chunk_XYLDQWFV.ClientAction.JOIN_IDENTITY: {
|
|
296
332
|
return {
|
|
297
333
|
data: true,
|
|
298
334
|
intents: [
|
|
@@ -313,7 +349,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
313
349
|
]
|
|
314
350
|
};
|
|
315
351
|
}
|
|
316
|
-
case
|
|
352
|
+
case import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY: {
|
|
317
353
|
return {
|
|
318
354
|
data: true,
|
|
319
355
|
intents: [
|
|
@@ -329,7 +365,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
329
365
|
],
|
|
330
366
|
[
|
|
331
367
|
{
|
|
332
|
-
action:
|
|
368
|
+
action: import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
|
|
333
369
|
data: {
|
|
334
370
|
name: "identity.share"
|
|
335
371
|
}
|
|
@@ -338,7 +374,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
338
374
|
]
|
|
339
375
|
};
|
|
340
376
|
}
|
|
341
|
-
case
|
|
377
|
+
case import_chunk_XYLDQWFV.ClientAction.RECOVER_IDENTITY: {
|
|
342
378
|
return {
|
|
343
379
|
data: true,
|
|
344
380
|
intents: [
|
|
@@ -358,7 +394,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
358
394
|
]
|
|
359
395
|
};
|
|
360
396
|
}
|
|
361
|
-
case
|
|
397
|
+
case import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE: {
|
|
362
398
|
await onReset?.({
|
|
363
399
|
target: intent.data?.target
|
|
364
400
|
});
|
|
@@ -366,6 +402,55 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
366
402
|
data: true
|
|
367
403
|
};
|
|
368
404
|
}
|
|
405
|
+
case import_chunk_XYLDQWFV.ClientAction.CREATE_AGENT: {
|
|
406
|
+
(0, import_invariant.invariant)(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
407
|
+
F: __dxlog_file,
|
|
408
|
+
L: 283,
|
|
409
|
+
S: void 0,
|
|
410
|
+
A: [
|
|
411
|
+
"client.services.services.EdgeAgentService",
|
|
412
|
+
"'Missing EdgeAgentService'"
|
|
413
|
+
]
|
|
414
|
+
});
|
|
415
|
+
await client.services.services.EdgeAgentService.createAgent(null, {
|
|
416
|
+
timeout: 1e4
|
|
417
|
+
});
|
|
418
|
+
return {
|
|
419
|
+
data: true
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
case import_chunk_XYLDQWFV.ClientAction.CREATE_RECOVERY_CODE: {
|
|
423
|
+
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
424
|
+
F: __dxlog_file,
|
|
425
|
+
L: 289,
|
|
426
|
+
S: void 0,
|
|
427
|
+
A: [
|
|
428
|
+
"client.services.services.IdentityService",
|
|
429
|
+
"'IdentityService not available'"
|
|
430
|
+
]
|
|
431
|
+
});
|
|
432
|
+
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
433
|
+
return {
|
|
434
|
+
data: true,
|
|
435
|
+
intents: [
|
|
436
|
+
[
|
|
437
|
+
{
|
|
438
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
439
|
+
data: {
|
|
440
|
+
element: "dialog",
|
|
441
|
+
dialogBlockAlign: "start",
|
|
442
|
+
dialogType: "alert",
|
|
443
|
+
state: true,
|
|
444
|
+
component: "dxos.org/plugin/client/RecoveryCodeDialog",
|
|
445
|
+
subject: {
|
|
446
|
+
code: seedphrase
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
]
|
|
451
|
+
]
|
|
452
|
+
};
|
|
453
|
+
}
|
|
369
454
|
}
|
|
370
455
|
}
|
|
371
456
|
}
|
|
@@ -376,7 +461,6 @@ var src_default = ClientPlugin;
|
|
|
376
461
|
// Annotate the CommonJS export names for ESM import in node:
|
|
377
462
|
0 && (module.exports = {
|
|
378
463
|
ClientPlugin,
|
|
379
|
-
parseClientPlugin
|
|
380
|
-
parseSchemaPlugin
|
|
464
|
+
parseClientPlugin
|
|
381
465
|
});
|
|
382
466
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/ClientPlugin.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n filterPlugins,\n LayoutAction,\n parseIntentPlugin,\n resolvePlugin,\n type SurfaceProvides,\n type GraphBuilderProvides,\n type IntentResolverProvides,\n type Plugin,\n type PluginDefinition,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { type AbstractTypedObject } from '@dxos/echo-schema';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { IdentityDialog, JoinDialog } from './components';\nimport meta, { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from './meta';\nimport translations from './translations';\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Used to track app-specific state in spaces.\n */\n appKey: string;\n\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (client: Client) => Promise<void>;\n\n /**\n * Run after the identity has been successfully initialized.\n * Run with client during plugin ready phase.\n */\n onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => Promise<void>;\n};\n\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\n SurfaceProvides &\n TranslationsProvides & {\n client: Client;\n };\n\nexport const parseClientPlugin = (plugin?: Plugin) =>\n (plugin?.provides as any).client instanceof Client ? (plugin as Plugin<ClientPluginProvides>) : undefined;\n\nexport type SchemaProvides = {\n echo: {\n schema: AbstractTypedObject[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) ? (plugin as Plugin<SchemaProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onClientInitialized,\n onReady,\n onReset,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalsRuntime();\n\n let client: Client;\n let error: unknown = null;\n\n const createDeviceInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return {\n meta,\n initialize: async () => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n client = new Client({ config, ...options });\n\n try {\n await client.initialize();\n await onClientInitialized?.(client);\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n } catch (err) {\n error = err;\n }\n\n return {\n client,\n context: ({ children }) => <ClientProvider client={client}>{children}</ClientProvider>,\n };\n },\n ready: async (plugins) => {\n if (error) {\n throw error;\n }\n\n await onReady?.(client, plugins);\n\n filterPlugins(plugins, parseSchemaPlugin).forEach((plugin) => {\n log('ready', { id: plugin.meta.id });\n client.addTypes(plugin.provides.echo.schema);\n });\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\n surface: {\n component: ({ data, role, ...rest }) => {\n switch (role) {\n case 'dialog':\n if (data.component === 'dxos.org/plugin/client/IdentityDialog') {\n return (\n <IdentityDialog\n {...(data.subject as IdentityPanelProps)}\n createInvitationUrl={createDeviceInvitationUrl}\n />\n );\n } else if (data.component === 'dxos.org/plugin/client/JoinDialog') {\n return <JoinDialog {...(data.subject as JoinPanelProps)} />;\n }\n break;\n }\n\n return null;\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n const id = `${CLIENT_PLUGIN}/open-shell`;\n\n return createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch([\n { plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY },\n ]);\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n testId: 'clientPlugin.openShell',\n },\n },\n ],\n });\n },\n },\n intent: {\n resolver: async (intent) => {\n switch (intent.action) {\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.create',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: intent.data?.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/IdentityDialog',\n dialogBlockAlign: 'start',\n },\n },\n ],\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.share',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RECOVER_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RESET_STORAGE: {\n await onReset?.({ target: intent.data?.target });\n return { data: true };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Dialog } from '@dxos/react-ui';\nimport { ClipboardProvider, IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { ClientAction } from '../meta';\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const dispatch = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE });\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'recoverIdentity' } });\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'deviceInvitation' } });\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <ClipboardProvider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n />\n </ClipboardProvider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from '../meta';\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const dispatch = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(\n () => dispatch({ plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY }),\n [dispatch],\n );\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n dispatch({\n action: OBSERVABILITY_ACTION,\n data: {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n },\n }),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClientPlugin } from './ClientPlugin';\n\nexport default ClientPlugin;\n\nexport * from './ClientPlugin';\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["import_react", "import_app_framework", "import_react_client", "import_react_ui", "IdentityDialog", "props", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "action", "LayoutAction", "SET_LAYOUT", "data", "element", "state", "handleResetStorage", "reset", "ClientAction", "RESET_STORAGE", "handleRecover", "target", "handleJoinNewIdentity", "React", "Dialog", "Content", "
|
|
3
|
+
"sources": ["../../../src/ClientPlugin.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n LayoutAction,\n parseIntentPlugin,\n resolvePlugin,\n type SurfaceProvides,\n type GraphBuilderProvides,\n type IntentResolverProvides,\n type Plugin,\n type PluginDefinition,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { invariant } from '@dxos/invariant';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { IdentityDialog, JoinDialog, RecoveryCodeDialog, type RecoveryCodeDialogProps } from './components';\nimport meta, { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from './meta';\nimport translations from './translations';\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Used to track app-specific state in spaces.\n */\n appKey: string;\n\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (client: Client) => Promise<void>;\n\n /**\n * Run after the identity has been successfully initialized.\n * Run with client during plugin ready phase.\n */\n onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => Promise<void>;\n};\n\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\n SurfaceProvides &\n TranslationsProvides & {\n client: Client;\n };\n\nexport const parseClientPlugin = (plugin?: Plugin) =>\n (plugin?.provides as any).client instanceof Client ? (plugin as Plugin<ClientPluginProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onClientInitialized,\n onReady,\n onReset,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalsRuntime();\n\n let client: Client;\n let error: unknown = null;\n\n const createDeviceInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return {\n meta,\n initialize: async () => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n client = new Client({ config, ...options });\n\n try {\n await client.initialize();\n await onClientInitialized?.(client);\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n } catch (err) {\n error = err;\n }\n\n return {\n client,\n context: ({ children }) => <ClientProvider client={client}>{children}</ClientProvider>,\n };\n },\n ready: async (plugins) => {\n if (error) {\n throw error;\n }\n\n await onReady?.(client, plugins);\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\n surface: {\n component: ({ data, role, ...rest }) => {\n switch (role) {\n case 'dialog':\n if (data.component === 'dxos.org/plugin/client/IdentityDialog') {\n return (\n <IdentityDialog\n {...(data.subject as IdentityPanelProps)}\n createInvitationUrl={createDeviceInvitationUrl}\n />\n );\n } else if (data.component === 'dxos.org/plugin/client/JoinDialog') {\n return <JoinDialog {...(data.subject as JoinPanelProps)} />;\n } else if (data.component === 'dxos.org/plugin/client/RecoveryCodeDialog') {\n return <RecoveryCodeDialog {...(data.subject as RecoveryCodeDialogProps)} />;\n }\n break;\n }\n\n return null;\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n const id = `${CLIENT_PLUGIN}/open-shell`;\n\n return createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch([\n { plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY },\n ]);\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n testId: 'clientPlugin.openShell',\n },\n },\n ],\n });\n },\n },\n intent: {\n resolver: async (intent) => {\n switch (intent.action) {\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.create',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: intent.data?.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/IdentityDialog',\n dialogBlockAlign: 'start',\n },\n },\n ],\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.share',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RECOVER_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RESET_STORAGE: {\n await onReset?.({ target: intent.data?.target });\n return { data: true };\n }\n\n case ClientAction.CREATE_AGENT: {\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n return { data: true };\n }\n\n case ClientAction.CREATE_RECOVERY_CODE: {\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: 'dxos.org/plugin/client/RecoveryCodeDialog',\n subject: { code: seedphrase },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { ClientAction } from '../meta';\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const dispatch = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE });\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'recoverIdentity' } });\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'deviceInvitation' } });\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from '../meta';\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const dispatch = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(\n () => dispatch({ plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY }),\n [dispatch],\n );\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n dispatch({\n action: OBSERVABILITY_ACTION,\n data: {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n },\n }),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title classNames=''>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code value={code} />\n </Clipboard.Provider>\n <p className='py-4'>{t('recovery code dialog warning')}</p>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\n// TODO(wittjosiah): Factor out.\nconst Code = ({ value }: { value: string }) => {\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={value} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <code className='whitespace-pre-wrap'>{value}</code>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'recovery code dialog title': 'Recovery Code',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning':\n 'Please note: This code will not be displayed again and cannot be replaced. It is your private key for recovering DXOS data. Anyone with this key will also be able to gain access to your account.',\n 'recovery code confirmation label': 'Confirm the code has been saved',\n 'continue label': 'Continue',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClientPlugin } from './ClientPlugin';\n\nexport default ClientPlugin;\n\nexport * from './ClientPlugin';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAUO;AACP,oBAAuD;AACvD,IAAAA,gBAAuC;AACvC,uBAA0B;AAC1B,0BAA2C;AAC3C,0BAA2D;ACjB3D,IAAAA,gBAAmC;AAEnC,IAAAC,wBAAkD;AAClD,IAAAC,uBAA0B;AAC1B,sBAAkC;AAClC,IAAAF,gBAAuD;ACLvD,IAAAA,gBAAmC;AAEnC,IAAAC,wBAAkD;AAElD,IAAAE,mBAAuB;AACvB,IAAAH,gBAA+C;ACL/C,IAAAA,gBAA6C;AAE7C,IAAAG,mBAAsE;AFO/D,IAAMC,iBAAiB,CAACC,UAAAA;AAC7B,QAAMC,eAAWC,2CAAAA;AACjB,QAAMC,aAASC,gCAAAA;AAEf,QAAMC,iBAAaC,2BACjB,MACEL,SAAS;IACPM,QAAQC,mCAAaC;IACrBC,MAAM;MACJC,SAAS;MACTC,OAAO;IACT;EACF,CAAA,GACF;IAACX;GAAS;AAGZ,QAAMY,yBAAqBP,2BAAY,YAAA;AACrC,UAAMH,OAAOW,MAAK;AAClB,UAAMb,SAAS;MAAEM,QAAQQ,mCAAaC;IAAc,CAAA;EACtD,GAAG;IAACf;GAAS;AAEb,QAAMgB,oBAAgBX,2BAAY,YAAA;AAChC,UAAMH,OAAOW,MAAK;AAClB,UAAMb,SAAS;MAAEM,QAAQQ,mCAAaC;MAAeN,MAAM;QAAEQ,QAAQ;MAAkB;IAAE,CAAA;EAC3F,GAAG;IAACjB;GAAS;AAEb,QAAMkB,4BAAwBb,2BAAY,YAA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BAClB3B,SAAS;0BACPpF,oBAAoB;wBACtB;sBACF;oBACF;;;cAGN;YACF;YAEA,KAAK7B,mCAAaC,eAAe;AAC/B,oBAAM0E,UAAU;gBAAExE,QAAQ0H,OAAOlI,MAAMQ;cAAO,CAAA;AAC9C,qBAAO;gBAAER,MAAM;cAAK;YACtB;YAEA,KAAKK,mCAAa+I,cAAc;AAC9BC,8CAAU5J,OAAO6J,SAASA,SAASC,kBAAkB,4BAAA;;;;;;;;;AACrD,oBAAM9J,OAAO6J,SAASA,SAASC,iBAAiBC,YAAY,MAAa;gBAAEC,SAAS;cAAO,CAAA;AAC3F,qBAAO;gBAAEzJ,MAAM;cAAK;YACtB;YAEA,KAAKK,mCAAaqJ,sBAAsB;AACtCL,8CAAU5J,OAAO6J,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AAEpD,oBAAM,EAAEC,WAAU,IAAK,MAAMnK,OAAO6J,SAASA,SAASK,gBAAgBE,qBAAoB;AAC1F,qBAAO;gBACL7J,MAAM;gBACN+I,SAAS;kBACP;oBACE;sBACElJ,QAAQC,qBAAAA,aAAaC;sBACrBC,MAAM;wBACJC,SAAS;wBACTgJ,kBAAkB;wBAClBa,YAAY;wBACZ5J,OAAO;wBACPiH,WAAW;wBACXG,SAAS;0BAAE9E,MAAMoH;wBAAW;sBAC9B;oBACF;;;cAGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;AKrTA,IAAA,cAAerF;",
|
|
6
|
+
"names": ["import_react", "import_app_framework", "import_react_client", "import_react_ui", "IdentityDialog", "props", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "action", "LayoutAction", "SET_LAYOUT", "data", "element", "state", "handleResetStorage", "reset", "ClientAction", "RESET_STORAGE", "handleRecover", "target", "handleJoinNewIdentity", "React", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "JoinDialog", "handleCancelResetStorage", "plugin", "CLIENT_PLUGIN", "SHARE_IDENTITY", "result", "identityKey", "Promise", "all", "OBSERVABILITY_ACTION", "name", "initialDisposition", "JoinPanel", "mode", "exitActionParent", "onCancelResetStorage", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "checked", "AlertDialog", "classNames", "Title", "p", "className", "Code", "value", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "Button", "variant", "disabled", "IconButton", "parseClientPlugin", "provides", "Client", "undefined", "ClientPlugin", "appKey", "invitationUrl", "window", "location", "origin", "invitationParam", "onClientInitialized", "onReady", "onReset", "options", "registerSignalsRuntime", "error", "createDeviceInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "href", "err", "context", "children", "ClientProvider", "ready", "plugins", "unload", "destroy", "translations", "surface", "component", "role", "rest", "subject", "createInvitationUrl", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "id", "createExtension", "filter", "node", "actions", "intent", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "CREATE_IDENTITY", "createIdentity", "intents", "JOIN_IDENTITY", "dialogBlockAlign", "initialInvitationCode", "RECOVER_IDENTITY", "CREATE_AGENT", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CREATE_RECOVERY_CODE", "IdentityService", "seedphrase", "createRecoveryPhrase", "dialogType"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.cjs
CHANGED
|
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var meta_exports = {};
|
|
20
20
|
__export(meta_exports, {
|
|
21
|
-
CLIENT_PLUGIN: () =>
|
|
22
|
-
ClientAction: () =>
|
|
23
|
-
OBSERVABILITY_ACTION: () =>
|
|
24
|
-
default: () =>
|
|
21
|
+
CLIENT_PLUGIN: () => import_chunk_XYLDQWFV.CLIENT_PLUGIN,
|
|
22
|
+
ClientAction: () => import_chunk_XYLDQWFV.ClientAction,
|
|
23
|
+
OBSERVABILITY_ACTION: () => import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
|
|
24
|
+
default: () => import_chunk_XYLDQWFV.meta_default
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(meta_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_chunk_XYLDQWFV = require("./chunk-XYLDQWFV.cjs");
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
29
|
0 && (module.exports = {
|
|
30
30
|
CLIENT_PLUGIN,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["meta.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n CLIENT_PLUGIN,\n ClientAction,\n OBSERVABILITY_ACTION,\n meta_default\n} from \"./chunk-
|
|
4
|
+
"sourcesContent": ["import {\n CLIENT_PLUGIN,\n ClientAction,\n OBSERVABILITY_ACTION,\n meta_default\n} from \"./chunk-XYLDQWFV.cjs\";\nexport {\n CLIENT_PLUGIN,\n ClientAction,\n OBSERVABILITY_ACTION,\n meta_default as default\n};\n//# sourceMappingURL=meta.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":3419,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytes":6572,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytes":6031,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytes":7403,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/plugin-client/src/components/IdentityDialog.tsx","kind":"import-statement","original":"./IdentityDialog"},{"path":"packages/plugins/plugin-client/src/components/JoinDialog.tsx","kind":"import-statement","original":"./JoinDialog"},{"path":"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx","kind":"import-statement","original":"./RecoveryCodeDialog"}],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":2616,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":35879,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-client/src/index.ts":{"bytes":782,"imports":[{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"},{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-client/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27352},"packages/plugins/plugin-client/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node/chunk-XYLDQWFV.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":9038},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytesInOutput":1642},"packages/plugins/plugin-client/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytesInOutput":1474},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytesInOutput":2208},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":735},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":15772},"packages/plugins/plugin-client/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node/chunk-XYLDQWFV.cjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","OBSERVABILITY_ACTION","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":241},"packages/plugins/plugin-client/dist/lib/node/chunk-XYLDQWFV.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1464},"packages/plugins/plugin-client/dist/lib/node/chunk-XYLDQWFV.cjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","OBSERVABILITY_ACTION","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":1062}},"bytes":1237}}}
|
|
@@ -14,6 +14,8 @@ var ClientAction;
|
|
|
14
14
|
ClientAction2[ClientAction2["SHARE_IDENTITY"] = `${CLIENT_ACTION}/SHARE_IDENTITY`] = "SHARE_IDENTITY";
|
|
15
15
|
ClientAction2[ClientAction2["RECOVER_IDENTITY"] = `${CLIENT_ACTION}/RECOVER_IDENTITY`] = "RECOVER_IDENTITY";
|
|
16
16
|
ClientAction2[ClientAction2["RESET_STORAGE"] = `${CLIENT_ACTION}/RESET_STORAGE`] = "RESET_STORAGE";
|
|
17
|
+
ClientAction2[ClientAction2["CREATE_AGENT"] = `${CLIENT_ACTION}/CREATE_AGENT`] = "CREATE_AGENT";
|
|
18
|
+
ClientAction2[ClientAction2["CREATE_RECOVERY_CODE"] = `${CLIENT_ACTION}/CREATE_RECOVERY_CODE`] = "CREATE_RECOVERY_CODE";
|
|
17
19
|
})(ClientAction || (ClientAction = {}));
|
|
18
20
|
var OBSERVABILITY_ACTION = "dxos.org/plugin/observability/send-event";
|
|
19
21
|
|
|
@@ -23,4 +25,4 @@ export {
|
|
|
23
25
|
ClientAction,
|
|
24
26
|
OBSERVABILITY_ACTION
|
|
25
27
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-C6X363FK.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CLIENT_PLUGIN = 'dxos.org/plugin/client';\n\nexport default {\n id: CLIENT_PLUGIN,\n name: 'Client',\n} satisfies PluginMeta;\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport enum ClientAction {\n CREATE_IDENTITY = `${CLIENT_ACTION}/CREATE_IDENTITY`,\n JOIN_IDENTITY = `${CLIENT_ACTION}/JOIN_IDENTITY`,\n SHARE_IDENTITY = `${CLIENT_ACTION}/SHARE_IDENTITY`,\n RECOVER_IDENTITY = `${CLIENT_ACTION}/RECOVER_IDENTITY`,\n RESET_STORAGE = `${CLIENT_ACTION}/RESET_STORAGE`,\n}\n\n// NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\nexport const OBSERVABILITY_ACTION = 'dxos.org/plugin/observability/send-event';\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,gBAAgB;AAE7B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,gBAAgB,GAAGH,aAAAA;;UACbI,eAAAA;mDACQ,GAAGD,aAAAA,kBAA+B,IAAA;iDACpC,GAAGA,aAAAA,gBAA6B,IAAA;kDAC/B,GAAGA,aAAAA,iBAA8B,IAAA;oDAC/B,GAAGA,aAAAA,mBAAgC,IAAA;iDACtC,GAAGA,aAAAA,gBAA6B,IAAA;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CLIENT_PLUGIN = 'dxos.org/plugin/client';\n\nexport default {\n id: CLIENT_PLUGIN,\n name: 'Client',\n} satisfies PluginMeta;\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport enum ClientAction {\n CREATE_IDENTITY = `${CLIENT_ACTION}/CREATE_IDENTITY`,\n JOIN_IDENTITY = `${CLIENT_ACTION}/JOIN_IDENTITY`,\n SHARE_IDENTITY = `${CLIENT_ACTION}/SHARE_IDENTITY`,\n RECOVER_IDENTITY = `${CLIENT_ACTION}/RECOVER_IDENTITY`,\n RESET_STORAGE = `${CLIENT_ACTION}/RESET_STORAGE`,\n CREATE_AGENT = `${CLIENT_ACTION}/CREATE_AGENT`,\n CREATE_RECOVERY_CODE = `${CLIENT_ACTION}/CREATE_RECOVERY_CODE`,\n}\n\n// NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\nexport const OBSERVABILITY_ACTION = 'dxos.org/plugin/observability/send-event';\n"],
|
|
5
|
+
"mappings": ";;;AAMO,IAAMA,gBAAgB;AAE7B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,gBAAgB,GAAGH,aAAAA;;UACbI,eAAAA;mDACQ,GAAGD,aAAAA,kBAA+B,IAAA;iDACpC,GAAGA,aAAAA,gBAA6B,IAAA;kDAC/B,GAAGA,aAAAA,iBAA8B,IAAA;oDAC/B,GAAGA,aAAAA,mBAAgC,IAAA;iDACtC,GAAGA,aAAAA,gBAA6B,IAAA;gDACjC,GAAGA,aAAAA,eAA4B,IAAA;wDACvB,GAAGA,aAAAA,uBAAoC,IAAA;GAPpDC,iBAAAA,eAAAA,CAAAA,EAAAA;AAWL,IAAMC,uBAAuB;",
|
|
6
6
|
"names": ["CLIENT_PLUGIN", "id", "name", "CLIENT_ACTION", "ClientAction", "OBSERVABILITY_ACTION"]
|
|
7
7
|
}
|