@dxos/plugin-client 0.8.3 → 0.8.4-main.84f28bd

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 (106) hide show
  1. package/dist/lib/browser/{app-graph-builder-CBRN2DMK.mjs → app-graph-builder-3EILEBWW.mjs} +5 -5
  2. package/dist/lib/browser/{chunk-5MC5HCIM.mjs → chunk-64ANQXYZ.mjs} +10 -10
  3. package/dist/lib/browser/{chunk-PSSNS4C6.mjs → chunk-AWXKL4UR.mjs} +3 -3
  4. package/dist/lib/browser/{chunk-UCVFWBKT.mjs → chunk-CAF2COXW.mjs} +3 -3
  5. package/dist/lib/browser/{chunk-MCEXD5XH.mjs → chunk-GS3LDHYD.mjs} +2 -2
  6. package/dist/lib/browser/{chunk-IA3AVM4I.mjs → chunk-Q7TFRFHI.mjs} +3 -3
  7. package/dist/lib/browser/{client-NMS3MSFP.mjs → client-JFNMEFOK.mjs} +5 -5
  8. package/dist/lib/browser/index.mjs +17 -17
  9. package/dist/lib/browser/index.mjs.map +3 -3
  10. package/dist/lib/browser/{intent-resolver-SLQZMO6I.mjs → intent-resolver-YGAQVXI2.mjs} +8 -8
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/{migrations-QRQV6ZAM.mjs → migrations-5COKGS4E.mjs} +4 -4
  13. package/dist/lib/browser/{react-context-IE2O2OYK.mjs → react-context-GBNYT5QK.mjs} +4 -4
  14. package/dist/lib/browser/{react-surface-QFC2G27R.mjs → react-surface-YKQAUE2M.mjs} +5 -5
  15. package/dist/lib/browser/{schema-defs-DNRDVQQJ.mjs → schema-defs-6L7W2RHL.mjs} +4 -4
  16. package/dist/lib/browser/types.mjs +2 -2
  17. package/dist/lib/node-esm/{app-graph-builder-OZEAAKNT.mjs → app-graph-builder-GINHOE7A.mjs} +5 -5
  18. package/dist/lib/node-esm/{chunk-37E3EI46.mjs → chunk-3BUB64JB.mjs} +3 -3
  19. package/dist/lib/node-esm/{chunk-STGGUFV2.mjs → chunk-GDJMDBWM.mjs} +3 -3
  20. package/dist/lib/node-esm/{chunk-WHKQMAO5.mjs → chunk-K4PIKBQQ.mjs} +10 -10
  21. package/dist/lib/node-esm/{chunk-HM7VB4ZV.mjs → chunk-SZLX4BVJ.mjs} +2 -2
  22. package/dist/lib/node-esm/{chunk-FJYSQRBO.mjs → chunk-UMO3ETDV.mjs} +3 -3
  23. package/dist/lib/node-esm/{client-EBFQZRSF.mjs → client-XDYQARBL.mjs} +5 -5
  24. package/dist/lib/node-esm/index.mjs +17 -17
  25. package/dist/lib/node-esm/index.mjs.map +3 -3
  26. package/dist/lib/node-esm/{intent-resolver-MV55C5ED.mjs → intent-resolver-IN7YG7N7.mjs} +8 -8
  27. package/dist/lib/node-esm/meta.json +1 -1
  28. package/dist/lib/node-esm/{migrations-AK43ZE6G.mjs → migrations-FE4PDX6W.mjs} +4 -4
  29. package/dist/lib/node-esm/{react-context-6N7NMUJE.mjs → react-context-UCK43H3Z.mjs} +4 -4
  30. package/dist/lib/node-esm/{react-surface-JUYTGBEM.mjs → react-surface-HDHC6XHQ.mjs} +5 -5
  31. package/dist/lib/node-esm/{schema-defs-O2KQQXJH.mjs → schema-defs-GZIVMHLW.mjs} +4 -4
  32. package/dist/lib/node-esm/types.mjs +2 -2
  33. package/dist/types/src/components/DevicesContainer.stories.d.ts +1 -1
  34. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
  35. package/dist/types/src/components/ProfileContainer.stories.d.ts +1 -1
  36. package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +1 -1
  38. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
  39. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +1 -1
  40. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
  41. package/dist/types/src/components/ResetDialog.stories.d.ts +1 -1
  42. package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
  43. package/dist/types/src/translations.d.ts +46 -46
  44. package/dist/types/src/translations.d.ts.map +1 -1
  45. package/dist/types/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +28 -29
  47. package/src/ClientPlugin.ts +1 -1
  48. package/src/components/DevicesContainer.stories.tsx +4 -4
  49. package/src/components/ProfileContainer.stories.tsx +2 -2
  50. package/src/components/RecoveryCodeDialog.stories.tsx +2 -2
  51. package/src/components/RecoveryCredentialsContainer.stories.tsx +2 -2
  52. package/src/components/ResetDialog.stories.tsx +2 -2
  53. package/src/translations.ts +6 -4
  54. package/dist/lib/node/app-graph-builder-BEEYM3A5.cjs +0 -134
  55. package/dist/lib/node/app-graph-builder-BEEYM3A5.cjs.map +0 -7
  56. package/dist/lib/node/chunk-BEJWU2NE.cjs +0 -718
  57. package/dist/lib/node/chunk-BEJWU2NE.cjs.map +0 -7
  58. package/dist/lib/node/chunk-BL6EBWOS.cjs +0 -131
  59. package/dist/lib/node/chunk-BL6EBWOS.cjs.map +0 -7
  60. package/dist/lib/node/chunk-CIYUKY3J.cjs +0 -37
  61. package/dist/lib/node/chunk-CIYUKY3J.cjs.map +0 -7
  62. package/dist/lib/node/chunk-DJKWB5L6.cjs +0 -35
  63. package/dist/lib/node/chunk-DJKWB5L6.cjs.map +0 -7
  64. package/dist/lib/node/chunk-DNKJCPU7.cjs +0 -38
  65. package/dist/lib/node/chunk-DNKJCPU7.cjs.map +0 -7
  66. package/dist/lib/node/client-Q3EQS4HA.cjs +0 -51
  67. package/dist/lib/node/client-Q3EQS4HA.cjs.map +0 -7
  68. package/dist/lib/node/index.cjs +0 -175
  69. package/dist/lib/node/index.cjs.map +0 -7
  70. package/dist/lib/node/intent-resolver-QURURONO.cjs +0 -312
  71. package/dist/lib/node/intent-resolver-QURURONO.cjs.map +0 -7
  72. package/dist/lib/node/meta.json +0 -1
  73. package/dist/lib/node/migrations-6FEWMF7U.cjs +0 -39
  74. package/dist/lib/node/migrations-6FEWMF7U.cjs.map +0 -7
  75. package/dist/lib/node/react-context-JS7Y5ZOK.cjs +0 -48
  76. package/dist/lib/node/react-context-JS7Y5ZOK.cjs.map +0 -7
  77. package/dist/lib/node/react-surface-RGRHOPVK.cjs +0 -82
  78. package/dist/lib/node/react-surface-RGRHOPVK.cjs.map +0 -7
  79. package/dist/lib/node/schema-defs-TA52ARBO.cjs +0 -41
  80. package/dist/lib/node/schema-defs-TA52ARBO.cjs.map +0 -7
  81. package/dist/lib/node/types.cjs +0 -32
  82. package/dist/lib/node/types.cjs.map +0 -7
  83. /package/dist/lib/browser/{app-graph-builder-CBRN2DMK.mjs.map → app-graph-builder-3EILEBWW.mjs.map} +0 -0
  84. /package/dist/lib/browser/{chunk-5MC5HCIM.mjs.map → chunk-64ANQXYZ.mjs.map} +0 -0
  85. /package/dist/lib/browser/{chunk-PSSNS4C6.mjs.map → chunk-AWXKL4UR.mjs.map} +0 -0
  86. /package/dist/lib/browser/{chunk-UCVFWBKT.mjs.map → chunk-CAF2COXW.mjs.map} +0 -0
  87. /package/dist/lib/browser/{chunk-MCEXD5XH.mjs.map → chunk-GS3LDHYD.mjs.map} +0 -0
  88. /package/dist/lib/browser/{chunk-IA3AVM4I.mjs.map → chunk-Q7TFRFHI.mjs.map} +0 -0
  89. /package/dist/lib/browser/{client-NMS3MSFP.mjs.map → client-JFNMEFOK.mjs.map} +0 -0
  90. /package/dist/lib/browser/{intent-resolver-SLQZMO6I.mjs.map → intent-resolver-YGAQVXI2.mjs.map} +0 -0
  91. /package/dist/lib/browser/{migrations-QRQV6ZAM.mjs.map → migrations-5COKGS4E.mjs.map} +0 -0
  92. /package/dist/lib/browser/{react-context-IE2O2OYK.mjs.map → react-context-GBNYT5QK.mjs.map} +0 -0
  93. /package/dist/lib/browser/{react-surface-QFC2G27R.mjs.map → react-surface-YKQAUE2M.mjs.map} +0 -0
  94. /package/dist/lib/browser/{schema-defs-DNRDVQQJ.mjs.map → schema-defs-6L7W2RHL.mjs.map} +0 -0
  95. /package/dist/lib/node-esm/{app-graph-builder-OZEAAKNT.mjs.map → app-graph-builder-GINHOE7A.mjs.map} +0 -0
  96. /package/dist/lib/node-esm/{chunk-37E3EI46.mjs.map → chunk-3BUB64JB.mjs.map} +0 -0
  97. /package/dist/lib/node-esm/{chunk-STGGUFV2.mjs.map → chunk-GDJMDBWM.mjs.map} +0 -0
  98. /package/dist/lib/node-esm/{chunk-WHKQMAO5.mjs.map → chunk-K4PIKBQQ.mjs.map} +0 -0
  99. /package/dist/lib/node-esm/{chunk-HM7VB4ZV.mjs.map → chunk-SZLX4BVJ.mjs.map} +0 -0
  100. /package/dist/lib/node-esm/{chunk-FJYSQRBO.mjs.map → chunk-UMO3ETDV.mjs.map} +0 -0
  101. /package/dist/lib/node-esm/{client-EBFQZRSF.mjs.map → client-XDYQARBL.mjs.map} +0 -0
  102. /package/dist/lib/node-esm/{intent-resolver-MV55C5ED.mjs.map → intent-resolver-IN7YG7N7.mjs.map} +0 -0
  103. /package/dist/lib/node-esm/{migrations-AK43ZE6G.mjs.map → migrations-FE4PDX6W.mjs.map} +0 -0
  104. /package/dist/lib/node-esm/{react-context-6N7NMUJE.mjs.map → react-context-UCK43H3Z.mjs.map} +0 -0
  105. /package/dist/lib/node-esm/{react-surface-JUYTGBEM.mjs.map → react-surface-HDHC6XHQ.mjs.map} +0 -0
  106. /package/dist/lib/node-esm/{schema-defs-O2KQQXJH.mjs.map → schema-defs-GZIVMHLW.mjs.map} +0 -0
@@ -1,175 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var node_exports = {};
30
- __export(node_exports, {
31
- CLIENT_PLUGIN: () => import_chunk_DJKWB5L6.CLIENT_PLUGIN,
32
- ClientCapabilities: () => import_chunk_CIYUKY3J.ClientCapabilities,
33
- ClientEvents: () => import_chunk_DNKJCPU7.ClientEvents,
34
- ClientPlugin: () => ClientPlugin,
35
- meta: () => import_chunk_DJKWB5L6.meta
36
- });
37
- module.exports = __toCommonJS(node_exports);
38
- var import_chunk_DNKJCPU7 = require("./chunk-DNKJCPU7.cjs");
39
- var import_chunk_CIYUKY3J = require("./chunk-CIYUKY3J.cjs");
40
- var import_chunk_DJKWB5L6 = require("./chunk-DJKWB5L6.cjs");
41
- var import_app_framework = require("@dxos/app-framework");
42
- var import_app_framework2 = require("@dxos/app-framework");
43
- var AppGraphBuilder = (0, import_app_framework2.lazy)(async () => import("./app-graph-builder-BEEYM3A5.cjs"));
44
- var Client = (0, import_app_framework2.lazy)(async () => import("./client-Q3EQS4HA.cjs"));
45
- var IntentResolver = (0, import_app_framework2.lazy)(async () => import("./intent-resolver-QURURONO.cjs"));
46
- var Migrations = (0, import_app_framework2.lazy)(async () => import("./migrations-6FEWMF7U.cjs"));
47
- var ReactContext = (0, import_app_framework2.lazy)(async () => import("./react-context-JS7Y5ZOK.cjs"));
48
- var ReactSurface = (0, import_app_framework2.lazy)(async () => import("./react-surface-RGRHOPVK.cjs"));
49
- var SchemaDefs = (0, import_app_framework2.lazy)(async () => import("./schema-defs-TA52ARBO.cjs"));
50
- var translations_default = [
51
- {
52
- "en-US": {
53
- [import_chunk_DJKWB5L6.CLIENT_PLUGIN]: {
54
- "account label": "User Account",
55
- "profile label": "Profile",
56
- "profile description": "You can adjust how your user settings here.",
57
- "devices label": "Devices",
58
- "devices verbose label": "Manage devices",
59
- "add device description": "Authenticating another device is a two-step process. To get started, create a code using the button below.",
60
- "devices description": "You can add and remove devices, configure your agent in the cloud, reset this device, or log in as a different identity here.",
61
- "create device invitation label": "Create code",
62
- "qr code description": "Scan this QR code using the device you want to log in to, or copy the URL and share it with the new device.",
63
- "security label": "Security",
64
- "reset device description": "Log out from this device, erasing all the data on this\xA0device.",
65
- "join new identity description": "Log out from this device, erasing all the data currently on this device, and use a QR code or URL to log\xA0in.",
66
- "recover identity description": "Log out from this device, erasing all the data currently on this device, and use a passkey or recovery code to log\xA0in.",
67
- "danger zone title": "Log out",
68
- "danger zone description": "Because Composer is decentralized, logging out entails erasing all the data on this device. If you have any data on this device that you\u2019d like to keep, you can log in on a separate device using a passkey or complete a peer-to-peer\xA0device invitation above.",
69
- "display name label": "Display name",
70
- "display name description": "Your name as it appears in the app.",
71
- "display name input placeholder": "Enter a name",
72
- "icon label": "Avatar",
73
- "icon description": "The emoji used to represent you in the app.",
74
- "hue label": "Color",
75
- "hue description": "The color used to represent you in the app, including as your avatar\u2019s background, your cursor as it appears to others, and the messages you send in group threads.",
76
- "did label": "DID",
77
- "did description": "Your unique ID.",
78
- "open user account label": "Open user account",
79
- "manage credentials dialog title": "Manage Account Recovery",
80
- "credentials list label": "Recovery credentials",
81
- "no credentials title": "WARNING: There is currently no way to recover your account.",
82
- "no credentials message": "Create a recovery credential above to secure your\xA0account.",
83
- "recovery setup dialog title": "Account Security",
84
- "recovery setup dialog description": "In order to maintain access to your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password\xA0manager.",
85
- "create passkey label": "Create Passkey",
86
- // TODO(wittjosiah): At link to user-focused passkey information.
87
- // Something like https://www.tomsguide.com/news/what-are-passkeys.
88
- "create passkey description": "A passkey is a secure and easy to use credential that can be used to recover your\xA0account.",
89
- "create recovery code label": "Create Recovery Code",
90
- "create recovery code description": "A recovery code is 12 word phrase representing a private\xA0key.",
91
- "recovery code dialog title": "Recovery Code",
92
- "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\xA0devices.",
93
- "recovery code dialog warning 1": "NOTE: This code will not be displayed\xA0again.",
94
- "recovery code dialog warning 2": "It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your\xA0account.",
95
- "recovery code confirmation label": "Please confirm you have saved the\xA0code.",
96
- "continue label": "Continue"
97
- }
98
- }
99
- }
100
- ];
101
- var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam = "deviceInvitationCode", onReset, ...options }) => {
102
- const createInvitationUrl = (invitationCode) => {
103
- const baseUrl = new URL(invitationUrl);
104
- baseUrl.searchParams.set(invitationParam, invitationCode);
105
- return baseUrl.toString();
106
- };
107
- return (0, import_app_framework.definePlugin)(import_chunk_DJKWB5L6.meta, [
108
- (0, import_app_framework.defineModule)({
109
- id: `${import_chunk_DJKWB5L6.meta.id}/module/client`,
110
- activatesOn: (0, import_app_framework.oneOf)(import_app_framework.Events.Startup, import_app_framework.Events.SetupAppGraph),
111
- activatesAfter: [
112
- import_chunk_DNKJCPU7.ClientEvents.ClientReady
113
- ],
114
- activate: (context) => Client({
115
- ...options,
116
- context
117
- })
118
- }),
119
- (0, import_app_framework.defineModule)({
120
- id: `${import_chunk_DJKWB5L6.meta.id}/module/schema`,
121
- activatesOn: import_chunk_DNKJCPU7.ClientEvents.ClientReady,
122
- activatesBefore: [
123
- import_chunk_DNKJCPU7.ClientEvents.SetupSchema
124
- ],
125
- activate: SchemaDefs
126
- }),
127
- (0, import_app_framework.defineModule)({
128
- id: `${import_chunk_DJKWB5L6.meta.id}/module/migration`,
129
- activatesOn: import_chunk_DNKJCPU7.ClientEvents.ClientReady,
130
- activatesBefore: [
131
- import_chunk_DNKJCPU7.ClientEvents.SetupMigration
132
- ],
133
- activate: Migrations
134
- }),
135
- (0, import_app_framework.defineModule)({
136
- id: `${import_chunk_DJKWB5L6.meta.id}/module/react-context`,
137
- activatesOn: import_app_framework.Events.Startup,
138
- activate: ReactContext
139
- }),
140
- (0, import_app_framework.defineModule)({
141
- id: `${import_chunk_DJKWB5L6.meta.id}/module/react-surface`,
142
- activatesOn: import_app_framework.Events.SetupReactSurface,
143
- activate: () => ReactSurface({
144
- createInvitationUrl,
145
- onReset
146
- })
147
- }),
148
- (0, import_app_framework.defineModule)({
149
- id: `${import_chunk_DJKWB5L6.meta.id}/module/app-graph-builder`,
150
- activatesOn: import_app_framework.Events.SetupAppGraph,
151
- activate: AppGraphBuilder
152
- }),
153
- (0, import_app_framework.defineModule)({
154
- id: `${import_chunk_DJKWB5L6.meta.id}/module/intent-resolver`,
155
- activatesOn: import_app_framework.Events.SetupIntentResolver,
156
- activate: (context) => IntentResolver({
157
- context
158
- })
159
- }),
160
- (0, import_app_framework.defineModule)({
161
- id: `${import_chunk_DJKWB5L6.meta.id}/module/translations`,
162
- activatesOn: import_app_framework.Events.SetupTranslations,
163
- activate: () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.Translations, translations_default)
164
- })
165
- ]);
166
- };
167
- // Annotate the CommonJS export names for ESM import in node:
168
- 0 && (module.exports = {
169
- CLIENT_PLUGIN,
170
- ClientCapabilities,
171
- ClientEvents,
172
- ClientPlugin,
173
- meta
174
- });
175
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/ClientPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\n\nimport {\n Client,\n AppGraphBuilder,\n IntentResolver,\n Migrations,\n ReactContext,\n ReactSurface,\n SchemaDefs,\n} from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupSchema],\n activate: SchemaDefs,\n }),\n defineModule({\n id: `${meta.id}/module/migration`,\n activatesOn: ClientEvents.ClientReady,\n activatesBefore: [ClientEvents.SetupMigration],\n activate: Migrations,\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: () => ReactSurface({ createInvitationUrl, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const Migrations = lazy(async () => import('./migrations'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\nexport const SchemaDefs = lazy(async () => import('./schema-defs'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'account label': 'User Account',\n 'profile label': 'Profile',\n 'profile description': 'You can adjust how your user settings here.',\n 'devices label': 'Devices',\n 'devices verbose label': 'Manage devices',\n 'add device description':\n 'Authenticating another device is a two-step process. To get started, create a code using the button below.',\n 'devices description':\n 'You can add and remove devices, configure your agent in the cloud, reset this device, or log in as a different identity here.',\n 'create device invitation label': 'Create code',\n 'qr code description':\n 'Scan this QR code using the device you want to log in to, or copy the URL and share it with the new device.',\n 'security label': 'Security',\n 'reset device description': 'Log out from this device, erasing all the data on this device.',\n 'join new identity description':\n 'Log out from this device, erasing all the data currently on this device, and use a QR code or URL to log in.',\n 'recover identity description':\n 'Log out from this device, erasing all the data currently on this device, and use a passkey or recovery code to log in.',\n 'danger zone title': 'Log out',\n 'danger zone description':\n 'Because Composer is decentralized, logging out entails erasing all the data on this device. If you have any data on this device that you’d like to keep, you can log in on a separate device using a passkey or complete a peer-to-peer device invitation above.',\n 'display name label': 'Display name',\n 'display name description': 'Your name as it appears in the app.',\n 'display name input placeholder': 'Enter a name',\n 'icon label': 'Avatar',\n 'icon description': 'The emoji used to represent you in the app.',\n 'hue label': 'Color',\n 'hue description':\n 'The color used to represent you in the app, including as your avatar’s background, your cursor as it appears to others, and the messages you send in group threads.',\n 'did label': 'DID',\n 'did description': 'Your unique ID.',\n 'open user account label': 'Open user account',\n 'manage credentials dialog title': 'Manage Account Recovery',\n 'credentials list label': 'Recovery credentials',\n 'no credentials title': 'WARNING: There is currently no way to recover your account.',\n 'no credentials message': 'Create a recovery credential above to secure your account.',\n 'recovery setup dialog title': 'Account Security',\n 'recovery setup dialog description':\n 'In order to maintain access to your account you need to register a recovery credential. Passkeys are the recommended way to do this, they can be stored in your browser or in a password manager.',\n 'create passkey label': 'Create Passkey',\n // TODO(wittjosiah): At link to user-focused passkey information.\n // Something like https://www.tomsguide.com/news/what-are-passkeys.\n 'create passkey description':\n 'A passkey is a secure and easy to use credential that can be used to recover your account.',\n 'create recovery code label': 'Create Recovery Code',\n 'create recovery code description': 'A recovery code is 12 word phrase representing a private key.',\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 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAqF;ACArF,IAAAA,wBAAqB;AAEd,IAAMC,sBAAkBC,4BAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,aAASD,4BAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,qBAAiBF,4BAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,iBAAaH,4BAAK,YAAY,OAAO,2BAAA,CAAA;AAC3C,IAAMI,mBAAeJ,4BAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMK,mBAAeL,4BAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMM,iBAAaN,4BAAK,YAAY,OAAO,4BAAA,CAAA;ACNlD,IAAA,uBAAe;EACb;IACE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Z,CAAA;QACAmB,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaM,mCAAaC;MAC1BG,iBAAiB;QAACJ,mCAAaM;;MAC/BJ,UAAUhC;IACZ,CAAA;QACAsB,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOC;MACpBK,UAAU/B;IACZ,CAAA;QACAqB,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOW;MACpBL,UAAU,MAAM9B,aAAa;QAAEW;QAAqBF;MAAQ,CAAA;IAC9D,CAAA;QACAW,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOE;MACpBI,UAAUpC;IACZ,CAAA;QACA0B,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOY;MACpBN,UAAU,CAACC,YAAYlC,eAAe;QAAEkC;MAAQ,CAAA;IAClD,CAAA;QACAX,mCAAa;MACXC,IAAI,GAAGF,2BAAKE,EAAE;MACdC,aAAaE,4BAAOa;MACpBP,UAAU,UAAMQ,kCAAYC,kCAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
6
- "names": ["import_app_framework", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "Migrations", "ReactContext", "ReactSurface", "SchemaDefs", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "oneOf", "Events", "Startup", "SetupAppGraph", "activatesAfter", "ClientEvents", "ClientReady", "activate", "context", "activatesBefore", "SetupSchema", "SetupMigration", "SetupReactSurface", "SetupIntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
7
- }
@@ -1,312 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var intent_resolver_QURURONO_exports = {};
20
- __export(intent_resolver_QURURONO_exports, {
21
- default: () => intent_resolver_default
22
- });
23
- module.exports = __toCommonJS(intent_resolver_QURURONO_exports);
24
- var import_chunk_DNKJCPU7 = require("./chunk-DNKJCPU7.cjs");
25
- var import_chunk_CIYUKY3J = require("./chunk-CIYUKY3J.cjs");
26
- var import_chunk_BEJWU2NE = require("./chunk-BEJWU2NE.cjs");
27
- var import_chunk_BL6EBWOS = require("./chunk-BL6EBWOS.cjs");
28
- var import_chunk_DJKWB5L6 = require("./chunk-DJKWB5L6.cjs");
29
- var import_effect = require("effect");
30
- var import_app_framework = require("@dxos/app-framework");
31
- var import_invariant = require("@dxos/invariant");
32
- var import_types = require("@dxos/plugin-observability/types");
33
- var import_react_client = require("@dxos/react-client");
34
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/capabilities/intent-resolver.ts";
35
- var RECOVER_IDENTITY_RPC_TIMEOUT = 2e4;
36
- var intent_resolver_default = ({ context, appName = "Composer" }) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.IntentResolver, [
37
- (0, import_app_framework.createResolver)({
38
- intent: import_chunk_BL6EBWOS.ClientAction.CreateIdentity,
39
- resolve: async (profile) => {
40
- const manager = context.getCapability(import_app_framework.Capabilities.PluginManager);
41
- const client = context.getCapability(import_chunk_CIYUKY3J.ClientCapabilities.Client);
42
- const data = await client.halo.createIdentity(profile);
43
- await manager.activate(import_chunk_DNKJCPU7.ClientEvents.IdentityCreated);
44
- return {
45
- data,
46
- intents: [
47
- (0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
48
- name: "identity.create"
49
- })
50
- ]
51
- };
52
- }
53
- }),
54
- (0, import_app_framework.createResolver)({
55
- intent: import_chunk_BL6EBWOS.ClientAction.JoinIdentity,
56
- resolve: async (data) => {
57
- return {
58
- intents: [
59
- (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
60
- part: "dialog",
61
- subject: import_chunk_BEJWU2NE.JOIN_DIALOG,
62
- options: {
63
- blockAlign: "start",
64
- props: {
65
- initialInvitationCode: data.invitationCode,
66
- initialDisposition: "accept-halo-invitation"
67
- }
68
- }
69
- })
70
- ]
71
- };
72
- }
73
- }),
74
- (0, import_app_framework.createResolver)({
75
- intent: import_chunk_BL6EBWOS.ClientAction.ShareIdentity,
76
- resolve: async () => {
77
- return {
78
- intents: [
79
- (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SwitchWorkspace, {
80
- part: "workspace",
81
- subject: import_chunk_BL6EBWOS.Account.id
82
- }), (0, import_app_framework.chain)(import_app_framework.LayoutAction.Open, {
83
- part: "main",
84
- subject: [
85
- import_chunk_BL6EBWOS.Account.Profile
86
- ]
87
- })),
88
- (0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
89
- name: "identity.share"
90
- })
91
- ]
92
- };
93
- }
94
- }),
95
- (0, import_app_framework.createResolver)({
96
- intent: import_chunk_BL6EBWOS.ClientAction.RecoverIdentity,
97
- resolve: async () => {
98
- return {
99
- intents: [
100
- (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
101
- part: "dialog",
102
- subject: import_chunk_BEJWU2NE.JOIN_DIALOG,
103
- options: {
104
- blockAlign: "start",
105
- props: {
106
- initialDisposition: "recover-identity"
107
- }
108
- }
109
- })
110
- ]
111
- };
112
- }
113
- }),
114
- (0, import_app_framework.createResolver)({
115
- intent: import_chunk_BL6EBWOS.ClientAction.ResetStorage,
116
- resolve: async (data) => {
117
- return {
118
- intents: [
119
- (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
120
- part: "dialog",
121
- subject: import_chunk_BEJWU2NE.RESET_DIALOG,
122
- options: {
123
- blockAlign: "start",
124
- props: {
125
- mode: data.mode ?? "reset storage"
126
- }
127
- }
128
- })
129
- ]
130
- };
131
- }
132
- }),
133
- (0, import_app_framework.createResolver)({
134
- intent: import_chunk_BL6EBWOS.ClientAction.CreateAgent,
135
- resolve: async () => {
136
- const client = context.getCapability(import_chunk_CIYUKY3J.ClientCapabilities.Client);
137
- (0, import_invariant.invariant)(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
138
- F: __dxlog_file,
139
- L: 136,
140
- S: void 0,
141
- A: [
142
- "client.services.services.EdgeAgentService",
143
- "'Missing EdgeAgentService'"
144
- ]
145
- });
146
- await client.services.services.EdgeAgentService.createAgent(null, {
147
- timeout: 1e4
148
- });
149
- }
150
- }),
151
- (0, import_app_framework.createResolver)({
152
- intent: import_chunk_BL6EBWOS.ClientAction.CreateRecoveryCode,
153
- resolve: async () => {
154
- const client = context.getCapability(import_chunk_CIYUKY3J.ClientCapabilities.Client);
155
- (0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
156
- F: __dxlog_file,
157
- L: 144,
158
- S: void 0,
159
- A: [
160
- "client.services.services.IdentityService",
161
- "'IdentityService not available'"
162
- ]
163
- });
164
- const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});
165
- return {
166
- intents: [
167
- (0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
168
- part: "dialog",
169
- subject: import_chunk_BEJWU2NE.RECOVERY_CODE_DIALOG,
170
- options: {
171
- blockAlign: "start",
172
- type: "alert",
173
- props: {
174
- code: recoveryCode
175
- }
176
- }
177
- })
178
- ]
179
- };
180
- }
181
- }),
182
- (0, import_app_framework.createResolver)({
183
- intent: import_chunk_BL6EBWOS.ClientAction.CreatePasskey,
184
- resolve: async () => {
185
- const client = context.getCapability(import_chunk_CIYUKY3J.ClientCapabilities.Client);
186
- const identity = client.halo.identity.get();
187
- (0, import_invariant.invariant)(identity, "Identity not available", {
188
- F: __dxlog_file,
189
- L: 167,
190
- S: void 0,
191
- A: [
192
- "identity",
193
- "'Identity not available'"
194
- ]
195
- });
196
- const lookupKey = import_react_client.PublicKey.random();
197
- const credential = await navigator.credentials.create({
198
- publicKey: {
199
- challenge: new Uint8Array(),
200
- rp: {
201
- id: location.hostname,
202
- name: appName
203
- },
204
- user: {
205
- id: lookupKey.asUint8Array(),
206
- name: identity.did,
207
- displayName: identity.profile?.displayName ?? ""
208
- },
209
- pubKeyCredParams: [
210
- {
211
- type: "public-key",
212
- alg: -8
213
- },
214
- {
215
- type: "public-key",
216
- alg: -7
217
- }
218
- ],
219
- // https://web.dev/articles/webauthn-discoverable-credentials#resident-key
220
- authenticatorSelection: {
221
- residentKey: "required",
222
- requireResidentKey: true
223
- }
224
- }
225
- });
226
- (0, import_invariant.invariant)(credential, "Credential not available", {
227
- F: __dxlog_file,
228
- L: 192,
229
- S: void 0,
230
- A: [
231
- "credential",
232
- "'Credential not available'"
233
- ]
234
- });
235
- const recoveryKey = import_react_client.PublicKey.from(new Uint8Array(credential.response.getPublicKey()));
236
- const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
237
- (0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
238
- F: __dxlog_file,
239
- L: 197,
240
- S: void 0,
241
- A: [
242
- "client.services.services.IdentityService",
243
- "'IdentityService not available'"
244
- ]
245
- });
246
- await client.services.services.IdentityService.createRecoveryCredential({
247
- data: {
248
- recoveryKey,
249
- algorithm,
250
- lookupKey
251
- }
252
- });
253
- }
254
- }),
255
- (0, import_app_framework.createResolver)({
256
- intent: import_chunk_BL6EBWOS.ClientAction.RedeemPasskey,
257
- resolve: async () => {
258
- const client = context.getCapability(import_chunk_CIYUKY3J.ClientCapabilities.Client);
259
- (0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
260
- F: __dxlog_file,
261
- L: 212,
262
- S: void 0,
263
- A: [
264
- "client.services.services.IdentityService",
265
- "'IdentityService not available'"
266
- ]
267
- });
268
- const { deviceKey, controlFeedKey, challenge } = await client.services.services.IdentityService.requestRecoveryChallenge();
269
- const credential = await navigator.credentials.get({
270
- publicKey: {
271
- challenge: Buffer.from(challenge, "base64"),
272
- rpId: location.hostname,
273
- userVerification: "required"
274
- }
275
- });
276
- const lookupKey = import_react_client.PublicKey.from(new Uint8Array(credential.response.userHandle));
277
- await client.services.services.IdentityService.recoverIdentity({
278
- external: {
279
- lookupKey,
280
- deviceKey,
281
- controlFeedKey,
282
- signature: Buffer.from(credential.response.signature),
283
- clientDataJson: Buffer.from(credential.response.clientDataJSON),
284
- authenticatorData: Buffer.from(credential.response.authenticatorData)
285
- }
286
- }, {
287
- timeout: RECOVER_IDENTITY_RPC_TIMEOUT
288
- });
289
- }
290
- }),
291
- (0, import_app_framework.createResolver)({
292
- intent: import_chunk_BL6EBWOS.ClientAction.RedeemToken,
293
- resolve: async (data) => {
294
- const client = context.getCapability(import_chunk_CIYUKY3J.ClientCapabilities.Client);
295
- (0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
296
- F: __dxlog_file,
297
- L: 243,
298
- S: void 0,
299
- A: [
300
- "client.services.services.IdentityService",
301
- "'IdentityService not available'"
302
- ]
303
- });
304
- await client.services.services.IdentityService.recoverIdentity({
305
- token: data.token
306
- }, {
307
- timeout: RECOVER_IDENTITY_RPC_TIMEOUT
308
- });
309
- }
310
- })
311
- ]);
312
- //# sourceMappingURL=intent-resolver-QURURONO.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { pipe } from 'effect';\n\nimport {\n Capabilities,\n chain,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { Account, ClientAction } from '../types';\n\ntype IntentResolverOptions = {\n context: PluginContext;\n appName?: string;\n};\n\nconst RECOVER_IDENTITY_RPC_TIMEOUT = 20_000;\n\nexport default ({ context, appName = 'Composer' }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: async (profile) => {\n const manager = context.getCapability(Capabilities.PluginManager);\n const client = context.getCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity(profile);\n await manager.activate(ClientEvents.IdentityCreated);\n return {\n data,\n intents: [\n createIntent(ObservabilityAction.SendEvent, {\n name: 'identity.create',\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n pipe(\n createIntent(LayoutAction.SwitchWorkspace, {\n part: 'workspace',\n subject: Account.id,\n }),\n chain(LayoutAction.Open, {\n part: 'main',\n subject: [Account.Profile],\n }),\n ),\n createIntent(ObservabilityAction.SendEvent, {\n name: 'identity.share',\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RESET_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n mode: data.mode ?? 'reset storage',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n },\n }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVERY_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const lookupKey = PublicKey.random();\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array(),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.getCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n await client.services.services.IdentityService.recoverIdentity(\n {\n external: {\n lookupKey,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n },\n { timeout: RECOVER_IDENTITY_RPC_TIMEOUT },\n );\n },\n }),\n createResolver({\n intent: ClientAction.RedeemToken,\n resolve: async (data) => {\n const client = context.getCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.recoverIdentity(\n { token: data.token },\n { timeout: RECOVER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AAgBtB,UAAS,IAC1C,MAAM9D,OAAOwC,SAASA,SAASK,gBAAgBwC,yBAAwB;AACzE,YAAM5B,aAAa,MAAMC,UAAUC,YAAYN,IAAI;QACjDQ,WAAW;UACTC,WAAWwB,OAAOT,KAAKf,WAAW,QAAA;UAClCyB,MAAMtB,SAASC;UACfsB,kBAAkB;QACpB;MACF,CAAA;AACA,YAAMlC,YAAYC,8BAAUsB,KAAK,IAAId,WAAYN,WAAmBqB,SAASW,UAAU,CAAA;AACvF,YAAMzF,OAAOwC,SAASA,SAASK,gBAAgB6C,gBAC7C;QACEC,UAAU;UACRrC;UACA6B;UACAC;UACAQ,WAAWN,OAAOT,KAAMpB,WAAmBqB,SAASc,SAAS;UAC7DC,gBAAgBP,OAAOT,KAAMpB,WAAmBqB,SAASgB,cAAc;UACvEC,mBAAmBT,OAAOT,KAAMpB,WAAmBqB,SAASiB,iBAAiB;QAC/E;MACF,GACA;QAAEpD,SAAS1D;MAA6B,CAAA;IAE5C;EACF,CAAA;MACAM,qCAAe;IACbC,QAAQC,mCAAauG;IACrBrG,SAAS,OAAOQ,SAAAA;AACd,YAAMH,SAASd,QAAQY,cAAcG,yCAAmBC,MAAM;AAE9DqC,sCAAUvC,OAAOwC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAM7C,OAAOwC,SAASA,SAASK,gBAAgB6C,gBAC7C;QAAEO,OAAO9F,KAAK8F;MAAM,GACpB;QAAEtD,SAAS1D;MAA6B,CAAA;IAE5C;EACF,CAAA;CACD;",
6
- "names": ["RECOVER_IDENTITY_RPC_TIMEOUT", "context", "appName", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "profile", "manager", "getCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "pipe", "SwitchWorkspace", "Account", "id", "chain", "Open", "Profile", "RecoverIdentity", "ResetStorage", "RESET_DIALOG", "mode", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVERY_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "location", "hostname", "user", "asUint8Array", "did", "displayName", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData", "RedeemToken", "token"]
7
- }