@dxos/plugin-client 0.8.3 → 0.8.4-main.1da679c

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 (164) hide show
  1. package/dist/lib/browser/{app-graph-builder-CBRN2DMK.mjs → app-graph-builder-MCGM4PFO.mjs} +20 -20
  2. package/dist/lib/browser/app-graph-builder-MCGM4PFO.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-PSSNS4C6.mjs → chunk-3F2Q2RKC.mjs} +3 -3
  4. package/dist/lib/browser/chunk-3F2Q2RKC.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-UCVFWBKT.mjs → chunk-CAF2COXW.mjs} +3 -3
  6. package/dist/lib/browser/{chunk-5MC5HCIM.mjs → chunk-FOCQEA72.mjs} +34 -41
  7. package/dist/lib/browser/chunk-FOCQEA72.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-MCEXD5XH.mjs → chunk-GS3LDHYD.mjs} +2 -2
  9. package/dist/lib/browser/{chunk-IA3AVM4I.mjs → chunk-HLWIF3AW.mjs} +14 -15
  10. package/dist/lib/browser/chunk-HLWIF3AW.mjs.map +7 -0
  11. package/dist/lib/browser/{client-NMS3MSFP.mjs → client-H2RZI6UX.mjs} +15 -9
  12. package/dist/lib/browser/client-H2RZI6UX.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +18 -18
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/{intent-resolver-SLQZMO6I.mjs → intent-resolver-IE7KHWIY.mjs} +18 -18
  16. package/dist/lib/browser/intent-resolver-IE7KHWIY.mjs.map +7 -0
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/{migrations-QRQV6ZAM.mjs → migrations-CJY2LQHD.mjs} +6 -6
  19. package/dist/lib/{node-esm/migrations-AK43ZE6G.mjs.map → browser/migrations-CJY2LQHD.mjs.map} +2 -2
  20. package/dist/lib/browser/{react-context-IE2O2OYK.mjs → react-context-TSUCH5YS.mjs} +6 -6
  21. package/dist/lib/browser/{react-context-IE2O2OYK.mjs.map → react-context-TSUCH5YS.mjs.map} +2 -2
  22. package/dist/lib/browser/{react-surface-QFC2G27R.mjs → react-surface-WQD43JR7.mjs} +8 -8
  23. package/dist/lib/browser/{react-surface-QFC2G27R.mjs.map → react-surface-WQD43JR7.mjs.map} +3 -3
  24. package/dist/lib/browser/{schema-defs-DNRDVQQJ.mjs → schema-defs-TLXADNLY.mjs} +6 -6
  25. package/dist/lib/browser/schema-defs-TLXADNLY.mjs.map +7 -0
  26. package/dist/lib/browser/types/index.mjs +10 -0
  27. package/dist/lib/node-esm/{app-graph-builder-OZEAAKNT.mjs → app-graph-builder-BJPS5RD7.mjs} +20 -20
  28. package/dist/lib/node-esm/app-graph-builder-BJPS5RD7.mjs.map +7 -0
  29. package/dist/lib/node-esm/{chunk-37E3EI46.mjs → chunk-IOGTQFLM.mjs} +3 -3
  30. package/dist/lib/node-esm/chunk-IOGTQFLM.mjs.map +7 -0
  31. package/dist/lib/node-esm/{chunk-STGGUFV2.mjs → chunk-JG6AFSFU.mjs} +14 -15
  32. package/dist/lib/node-esm/chunk-JG6AFSFU.mjs.map +7 -0
  33. package/dist/lib/node-esm/{chunk-WHKQMAO5.mjs → chunk-MUWDSQ65.mjs} +34 -41
  34. package/dist/lib/node-esm/chunk-MUWDSQ65.mjs.map +7 -0
  35. package/dist/lib/node-esm/{chunk-HM7VB4ZV.mjs → chunk-SZLX4BVJ.mjs} +2 -2
  36. package/dist/lib/node-esm/{chunk-FJYSQRBO.mjs → chunk-UMO3ETDV.mjs} +3 -3
  37. package/dist/lib/node-esm/{client-EBFQZRSF.mjs → client-AWF6PE6V.mjs} +15 -9
  38. package/dist/lib/node-esm/client-AWF6PE6V.mjs.map +7 -0
  39. package/dist/lib/node-esm/index.mjs +18 -18
  40. package/dist/lib/node-esm/index.mjs.map +3 -3
  41. package/dist/lib/node-esm/{intent-resolver-MV55C5ED.mjs → intent-resolver-ZJ4E3NNT.mjs} +18 -18
  42. package/dist/lib/node-esm/intent-resolver-ZJ4E3NNT.mjs.map +7 -0
  43. package/dist/lib/node-esm/meta.json +1 -1
  44. package/dist/lib/node-esm/{migrations-AK43ZE6G.mjs → migrations-X6RLWYR2.mjs} +6 -6
  45. package/dist/lib/{browser/migrations-QRQV6ZAM.mjs.map → node-esm/migrations-X6RLWYR2.mjs.map} +2 -2
  46. package/dist/lib/node-esm/{react-context-6N7NMUJE.mjs → react-context-M6G62KT3.mjs} +6 -6
  47. package/dist/lib/node-esm/{react-context-6N7NMUJE.mjs.map → react-context-M6G62KT3.mjs.map} +2 -2
  48. package/dist/lib/node-esm/{react-surface-JUYTGBEM.mjs → react-surface-TXSWRGX7.mjs} +8 -8
  49. package/dist/lib/node-esm/{react-surface-JUYTGBEM.mjs.map → react-surface-TXSWRGX7.mjs.map} +3 -3
  50. package/dist/lib/node-esm/{schema-defs-O2KQQXJH.mjs → schema-defs-4PGAJ4RQ.mjs} +6 -6
  51. package/dist/lib/node-esm/schema-defs-4PGAJ4RQ.mjs.map +7 -0
  52. package/dist/lib/node-esm/{types.mjs → types/index.mjs} +3 -3
  53. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  54. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/capabilities.d.ts +2 -3
  56. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/client.d.ts +1 -1
  58. package/dist/types/src/capabilities/client.d.ts.map +1 -1
  59. package/dist/types/src/capabilities/index.d.ts +8 -8
  60. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  61. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  62. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  63. package/dist/types/src/capabilities/migrations.d.ts +1 -1
  64. package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
  65. package/dist/types/src/capabilities/react-context.d.ts +2 -2
  66. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  67. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  68. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  69. package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
  70. package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
  71. package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
  72. package/dist/types/src/components/DevicesContainer.stories.d.ts +225 -4
  73. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
  74. package/dist/types/src/components/ProfileContainer.d.ts.map +1 -1
  75. package/dist/types/src/components/ProfileContainer.stories.d.ts +57 -4
  76. package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
  77. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +59 -4
  78. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
  79. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -1
  80. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +58 -4
  81. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
  82. package/dist/types/src/components/ResetDialog.stories.d.ts +59 -3
  83. package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
  84. package/dist/types/src/translations.d.ts +46 -46
  85. package/dist/types/src/translations.d.ts.map +1 -1
  86. package/dist/types/src/types/index.d.ts +2 -0
  87. package/dist/types/src/types/index.d.ts.map +1 -0
  88. package/dist/types/src/{types.d.ts → types/schema.d.ts} +30 -24
  89. package/dist/types/src/types/schema.d.ts.map +1 -0
  90. package/dist/types/tsconfig.tsbuildinfo +1 -1
  91. package/package.json +35 -36
  92. package/src/ClientPlugin.ts +3 -3
  93. package/src/capabilities/app-graph-builder.ts +16 -15
  94. package/src/capabilities/capabilities.ts +4 -3
  95. package/src/capabilities/client.ts +6 -4
  96. package/src/capabilities/intent-resolver.ts +5 -4
  97. package/src/capabilities/migrations.ts +1 -1
  98. package/src/capabilities/react-context.tsx +2 -1
  99. package/src/capabilities/react-surface.tsx +3 -3
  100. package/src/capabilities/schema-defs.ts +3 -3
  101. package/src/components/DevicesContainer.stories.tsx +11 -10
  102. package/src/components/DevicesContainer.tsx +59 -68
  103. package/src/components/JoinDialog.tsx +1 -1
  104. package/src/components/ProfileContainer.stories.tsx +7 -6
  105. package/src/components/ProfileContainer.tsx +20 -23
  106. package/src/components/RecoveryCodeDialog.stories.tsx +9 -8
  107. package/src/components/RecoveryCredentialsContainer.stories.tsx +9 -8
  108. package/src/components/RecoveryCredentialsContainer.tsx +44 -47
  109. package/src/components/ResetDialog.stories.tsx +7 -6
  110. package/src/components/ResetDialog.tsx +1 -1
  111. package/src/translations.ts +6 -4
  112. package/src/types/index.ts +5 -0
  113. package/src/{types.ts → types/schema.ts} +14 -15
  114. package/dist/lib/browser/app-graph-builder-CBRN2DMK.mjs.map +0 -7
  115. package/dist/lib/browser/chunk-5MC5HCIM.mjs.map +0 -7
  116. package/dist/lib/browser/chunk-IA3AVM4I.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-PSSNS4C6.mjs.map +0 -7
  118. package/dist/lib/browser/client-NMS3MSFP.mjs.map +0 -7
  119. package/dist/lib/browser/intent-resolver-SLQZMO6I.mjs.map +0 -7
  120. package/dist/lib/browser/schema-defs-DNRDVQQJ.mjs.map +0 -7
  121. package/dist/lib/browser/types.mjs +0 -10
  122. package/dist/lib/node/app-graph-builder-BEEYM3A5.cjs +0 -134
  123. package/dist/lib/node/app-graph-builder-BEEYM3A5.cjs.map +0 -7
  124. package/dist/lib/node/chunk-BEJWU2NE.cjs +0 -718
  125. package/dist/lib/node/chunk-BEJWU2NE.cjs.map +0 -7
  126. package/dist/lib/node/chunk-BL6EBWOS.cjs +0 -131
  127. package/dist/lib/node/chunk-BL6EBWOS.cjs.map +0 -7
  128. package/dist/lib/node/chunk-CIYUKY3J.cjs +0 -37
  129. package/dist/lib/node/chunk-CIYUKY3J.cjs.map +0 -7
  130. package/dist/lib/node/chunk-DJKWB5L6.cjs +0 -35
  131. package/dist/lib/node/chunk-DJKWB5L6.cjs.map +0 -7
  132. package/dist/lib/node/chunk-DNKJCPU7.cjs +0 -38
  133. package/dist/lib/node/chunk-DNKJCPU7.cjs.map +0 -7
  134. package/dist/lib/node/client-Q3EQS4HA.cjs +0 -51
  135. package/dist/lib/node/client-Q3EQS4HA.cjs.map +0 -7
  136. package/dist/lib/node/index.cjs +0 -175
  137. package/dist/lib/node/index.cjs.map +0 -7
  138. package/dist/lib/node/intent-resolver-QURURONO.cjs +0 -312
  139. package/dist/lib/node/intent-resolver-QURURONO.cjs.map +0 -7
  140. package/dist/lib/node/meta.json +0 -1
  141. package/dist/lib/node/migrations-6FEWMF7U.cjs +0 -39
  142. package/dist/lib/node/migrations-6FEWMF7U.cjs.map +0 -7
  143. package/dist/lib/node/react-context-JS7Y5ZOK.cjs +0 -48
  144. package/dist/lib/node/react-context-JS7Y5ZOK.cjs.map +0 -7
  145. package/dist/lib/node/react-surface-RGRHOPVK.cjs +0 -82
  146. package/dist/lib/node/react-surface-RGRHOPVK.cjs.map +0 -7
  147. package/dist/lib/node/schema-defs-TA52ARBO.cjs +0 -41
  148. package/dist/lib/node/schema-defs-TA52ARBO.cjs.map +0 -7
  149. package/dist/lib/node/types.cjs +0 -32
  150. package/dist/lib/node/types.cjs.map +0 -7
  151. package/dist/lib/node-esm/app-graph-builder-OZEAAKNT.mjs.map +0 -7
  152. package/dist/lib/node-esm/chunk-37E3EI46.mjs.map +0 -7
  153. package/dist/lib/node-esm/chunk-STGGUFV2.mjs.map +0 -7
  154. package/dist/lib/node-esm/chunk-WHKQMAO5.mjs.map +0 -7
  155. package/dist/lib/node-esm/client-EBFQZRSF.mjs.map +0 -7
  156. package/dist/lib/node-esm/intent-resolver-MV55C5ED.mjs.map +0 -7
  157. package/dist/lib/node-esm/schema-defs-O2KQQXJH.mjs.map +0 -7
  158. package/dist/types/src/types.d.ts.map +0 -1
  159. /package/dist/lib/browser/{chunk-UCVFWBKT.mjs.map → chunk-CAF2COXW.mjs.map} +0 -0
  160. /package/dist/lib/browser/{chunk-MCEXD5XH.mjs.map → chunk-GS3LDHYD.mjs.map} +0 -0
  161. /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
  162. /package/dist/lib/node-esm/{chunk-HM7VB4ZV.mjs.map → chunk-SZLX4BVJ.mjs.map} +0 -0
  163. /package/dist/lib/node-esm/{chunk-FJYSQRBO.mjs.map → chunk-UMO3ETDV.mjs.map} +0 -0
  164. /package/dist/lib/node-esm/{types.mjs.map → types/index.mjs.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
- CLIENT_PLUGIN
3
- } from "./chunk-MCEXD5XH.mjs";
2
+ meta
3
+ } from "./chunk-GS3LDHYD.mjs";
4
4
 
5
- // packages/plugins/plugin-client/src/types.ts
5
+ // src/types/schema.ts
6
6
  import { Schema } from "effect";
7
7
  import { PublicKey } from "@dxos/react-client";
8
8
  var IdentitySchema = Schema.Struct({
@@ -17,7 +17,6 @@ var IdentitySchema = Schema.Struct({
17
17
  }))
18
18
  }))
19
19
  });
20
- var CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
21
20
  (function(ClientAction2) {
22
21
  const ProfileSchema = Schema.Struct({
23
22
  displayName: Schema.optional(Schema.String),
@@ -27,13 +26,13 @@ var CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
27
26
  value: Schema.Any
28
27
  }))
29
28
  });
30
- class CreateIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-identity`, {
29
+ class CreateIdentity extends Schema.TaggedClass()(`${meta.id}/action/create-identity`, {
31
30
  input: ProfileSchema,
32
31
  output: IdentitySchema
33
32
  }) {
34
33
  }
35
34
  ClientAction2.CreateIdentity = CreateIdentity;
36
- class JoinIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
35
+ class JoinIdentity extends Schema.TaggedClass()(`${meta.id}/action/join-identity`, {
37
36
  input: Schema.Struct({
38
37
  invitationCode: Schema.optional(Schema.String)
39
38
  }),
@@ -41,19 +40,19 @@ var CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
41
40
  }) {
42
41
  }
43
42
  ClientAction2.JoinIdentity = JoinIdentity;
44
- class ShareIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/share-identity`, {
43
+ class ShareIdentity extends Schema.TaggedClass()(`${meta.id}/action/share-identity`, {
45
44
  input: Schema.Void,
46
45
  output: Schema.Void
47
46
  }) {
48
47
  }
49
48
  ClientAction2.ShareIdentity = ShareIdentity;
50
- class RecoverIdentity extends Schema.TaggedClass()(`${CLIENT_ACTION}/recover-identity`, {
49
+ class RecoverIdentity extends Schema.TaggedClass()(`${meta.id}/action/recover-identity`, {
51
50
  input: Schema.Void,
52
51
  output: Schema.Void
53
52
  }) {
54
53
  }
55
54
  ClientAction2.RecoverIdentity = RecoverIdentity;
56
- class ResetStorage extends Schema.TaggedClass()(`${CLIENT_ACTION}/reset-storage`, {
55
+ class ResetStorage extends Schema.TaggedClass()(`${meta.id}/action/reset-storage`, {
57
56
  input: Schema.Struct({
58
57
  mode: Schema.optional(Schema.String)
59
58
  }),
@@ -61,31 +60,31 @@ var CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
61
60
  }) {
62
61
  }
63
62
  ClientAction2.ResetStorage = ResetStorage;
64
- class CreateAgent extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-agent`, {
63
+ class CreateAgent extends Schema.TaggedClass()(`${meta.id}/action/create-agent`, {
65
64
  input: Schema.Void,
66
65
  output: Schema.Void
67
66
  }) {
68
67
  }
69
68
  ClientAction2.CreateAgent = CreateAgent;
70
- class CreateRecoveryCode extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-recovery-code`, {
69
+ class CreateRecoveryCode extends Schema.TaggedClass()(`${meta.id}/action/create-recovery-code`, {
71
70
  input: Schema.Void,
72
71
  output: Schema.Void
73
72
  }) {
74
73
  }
75
74
  ClientAction2.CreateRecoveryCode = CreateRecoveryCode;
76
- class CreatePasskey extends Schema.TaggedClass()(`${CLIENT_ACTION}/create-passkey`, {
75
+ class CreatePasskey extends Schema.TaggedClass()(`${meta.id}/action/create-passkey`, {
77
76
  input: Schema.Void,
78
77
  output: Schema.Void
79
78
  }) {
80
79
  }
81
80
  ClientAction2.CreatePasskey = CreatePasskey;
82
- class RedeemPasskey extends Schema.TaggedClass()(`${CLIENT_ACTION}/redeem-passkey`, {
81
+ class RedeemPasskey extends Schema.TaggedClass()(`${meta.id}/action/redeem-passkey`, {
83
82
  input: Schema.Void,
84
83
  output: Schema.Void
85
84
  }) {
86
85
  }
87
86
  ClientAction2.RedeemPasskey = RedeemPasskey;
88
- class RedeemToken extends Schema.TaggedClass()(`${CLIENT_ACTION}/redeem-token`, {
87
+ class RedeemToken extends Schema.TaggedClass()(`${meta.id}/action/redeem-token`, {
89
88
  input: Schema.Struct({
90
89
  token: Schema.String
91
90
  }),
@@ -108,4 +107,4 @@ export {
108
107
  ClientAction,
109
108
  Account
110
109
  };
111
- //# sourceMappingURL=chunk-IA3AVM4I.mjs.map
110
+ //# sourceMappingURL=chunk-HLWIF3AW.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/schema.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { type PluginContext } from '@dxos/app-framework';\nimport { type Client, type ClientOptions, PublicKey } from '@dxos/react-client';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { meta } from '../meta';\n\n// TODO(wittjosiah): Factor out. Generate?\nconst IdentitySchema = Schema.Struct({\n identityKey: Schema.instanceOf(PublicKey),\n spaceKey: Schema.optional(Schema.instanceOf(PublicKey)),\n profile: Schema.optional(\n Schema.Struct({\n displayName: Schema.optional(Schema.String),\n avatarCid: Schema.optional(Schema.String),\n data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n ),\n});\n\nexport namespace ClientAction {\n const ProfileSchema = Schema.Struct({\n displayName: Schema.optional(Schema.String),\n avatarCid: Schema.optional(Schema.String),\n data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n });\n\n export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${meta.id}/action/create-identity`, {\n input: ProfileSchema,\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${meta.id}/action/join-identity`, {\n input: Schema.Struct({\n invitationCode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${meta.id}/action/share-identity`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${meta.id}/action/recover-identity`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${meta.id}/action/reset-storage`, {\n input: Schema.Struct({\n mode: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${meta.id}/action/create-agent`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class CreateRecoveryCode extends Schema.TaggedClass<CreateRecoveryCode>()(\n `${meta.id}/action/create-recovery-code`,\n {\n input: Schema.Void,\n output: Schema.Void,\n },\n ) {}\n\n export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${meta.id}/action/create-passkey`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${meta.id}/action/redeem-passkey`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n\n export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${meta.id}/action/redeem-token`, {\n input: Schema.Struct({\n token: Schema.String,\n }),\n output: Schema.Void,\n }) {}\n}\n\nexport type ClientPluginOptions = ClientOptions & {\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?: (params: { context: PluginContext; client: Client }) => MaybePromise<void>;\n\n /**\n * Called when spaces are ready.\n */\n onSpacesReady?: (params: { context: PluginContext; client: Client }) => MaybePromise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => MaybePromise<void>;\n};\n\nexport namespace Account {\n // TODO(wittjosiah): Cannot use slashes in ids until we have a router which decouples ids from url paths.\n const _id = 'dxos.org.plugin.client.account';\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n export const id = `!${_id}`;\n\n export const Profile = `${_id}.profile`;\n export const Devices = `${_id}.devices`;\n export const Security = `${_id}.security`;\n}\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,cAAc;AAGvB,SAA0CC,iBAAiB;AAM3D,IAAMC,iBAAiBC,OAAOC,OAAO;EACnCC,aAAaF,OAAOG,WAAWC,SAAAA;EAC/BC,UAAUL,OAAOM,SAASN,OAAOG,WAAWC,SAAAA,CAAAA;EAC5CG,SAASP,OAAOM,SACdN,OAAOC,OAAO;IACZO,aAAaR,OAAOM,SAASN,OAAOS,MAAM;IAC1CC,WAAWV,OAAOM,SAASN,OAAOS,MAAM;IACxCE,MAAMX,OAAOM,SAASN,OAAOY,OAAO;MAAEC,KAAKb,OAAOS;MAAQK,OAAOd,OAAOe;IAAI,CAAA,CAAA;EAC9E,CAAA,CAAA;AAEJ,CAAA;UAEiBC,eAAAA;AACf,QAAMC,gBAAgBjB,OAAOC,OAAO;IAClCO,aAAaR,OAAOM,SAASN,OAAOS,MAAM;IAC1CC,WAAWV,OAAOM,SAASN,OAAOS,MAAM;IACxCE,MAAMX,OAAOM,SAASN,OAAOY,OAAO;MAAEC,KAAKb,OAAOS;MAAQK,OAAOd,OAAOe;IAAI,CAAA,CAAA;EAC9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AAA;EAQN,MAAMC,sBAAsBjC,OAAOmB,YAAW,EAAkB,GAAGC,KAAKC,EAAE,0BAA0B;IACzGC,OAAOtB,OAAO0B;IACdH,QAAQvB,OAAO0B;EACjB,CAAA,EAAA;EAAI;gBAHSO,gBAAAA;EAKN,MAAMC,sBAAsBlC,OAAOmB,YAAW,EAAkB,GAAGC,KAAKC,EAAE,0BAA0B;IACzGC,OAAOtB,OAAO0B;IACdH,QAAQvB,OAAO0B;EACjB,CAAA,EAAA;EAAI;gBAHSQ,gBAAAA;EAKN,MAAMC,oBAAoBnC,OAAOmB,YAAW,EAAgB,GAAGC,KAAKC,EAAE,wBAAwB;IACnGC,OAAOtB,OAAOC,OAAO;MACnBmC,OAAOpC,OAAOS;IAChB,CAAA;IACAc,QAAQvB,OAAO0B;EACjB,CAAA,EAAA;EAAI;gBALSS,cAAAA;AAMf,GAjEiBnB,iBAAAA,eAAAA,CAAAA,EAAAA;UA8FAqB,UAAAA;AAEf,QAAMC,MAAM;WAGCjB,KAAK,IAAIiB,GAAAA;WAETC,UAAU,GAAGD,GAAAA;WACbE,UAAU,GAAGF,GAAAA;WACbG,WAAW,GAAGH,GAAAA;AAC7B,GAViBD,YAAAA,UAAAA,CAAAA,EAAAA;;;",
6
+ "names": ["Schema", "PublicKey", "IdentitySchema", "Schema", "Struct", "identityKey", "instanceOf", "PublicKey", "spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "ClientAction", "ProfileSchema", "CreateIdentity", "TaggedClass", "meta", "id", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "mode", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey", "RedeemToken", "token", "Account", "_id", "Profile", "Devices", "Security"]
7
+ }
@@ -1,18 +1,21 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-UCVFWBKT.mjs";
3
+ } from "./chunk-CAF2COXW.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-PSSNS4C6.mjs";
7
- import "./chunk-MCEXD5XH.mjs";
6
+ } from "./chunk-3F2Q2RKC.mjs";
7
+ import "./chunk-GS3LDHYD.mjs";
8
8
 
9
- // packages/plugins/plugin-client/src/capabilities/client.ts
9
+ // src/capabilities/client.ts
10
10
  import { contributes } from "@dxos/app-framework";
11
11
  import { Client } from "@dxos/react-client";
12
- var client_default = async ({ context, onClientInitialized, onSpacesReady, ...options }) => {
12
+ var client_default = (async ({ context, onClientInitialized, onSpacesReady, ...options }) => {
13
13
  const client = new Client(options);
14
14
  await client.initialize();
15
- await onClientInitialized?.(context, client);
15
+ await onClientInitialized?.({
16
+ context,
17
+ client
18
+ });
16
19
  client.reloaded.on(() => {
17
20
  client.halo.identity.subscribe(async (identity) => {
18
21
  if (identity) {
@@ -23,15 +26,18 @@ var client_default = async ({ context, onClientInitialized, onSpacesReady, ...op
23
26
  const subscription = client.spaces.isReady.subscribe(async (ready) => {
24
27
  if (ready) {
25
28
  await context.activatePromise(ClientEvents.SpacesReady);
26
- await onSpacesReady?.(context, client);
29
+ await onSpacesReady?.({
30
+ context,
31
+ client
32
+ });
27
33
  }
28
34
  });
29
35
  return contributes(ClientCapabilities.Client, client, async () => {
30
36
  subscription.unsubscribe();
31
37
  await client.destroy();
32
38
  });
33
- };
39
+ });
34
40
  export {
35
41
  client_default as default
36
42
  };
37
- //# sourceMappingURL=client-NMS3MSFP.mjs.map
43
+ //# sourceMappingURL=client-H2RZI6UX.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/client.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type PluginContext, contributes } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\nimport { ClientCapabilities } from './capabilities';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginContext;\n};\n\nexport default async ({ context, onClientInitialized, onSpacesReady, ...options }: ClientCapabilityOptions) => {\n const client = new Client(options);\n await client.initialize();\n await onClientInitialized?.({ context, 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\n // TODO(burdon): The callback isn't called?\n const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activatePromise(ClientEvents.SpacesReady);\n await onSpacesReady?.({ context, client });\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;AAIA,SAA6BA,mBAAmB;AAChD,SAASC,cAAc;AAWvB,IAAA,kBAAe,OAAO,EAAEC,SAASC,qBAAqBC,eAAe,GAAGC,QAAAA,MAAkC;AACxG,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAML,sBAAsB;IAAED;IAASI;EAAO,CAAA;AAG9CA,SAAOG,SAASC,GAAG,MAAA;AACjBJ,WAAOK,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,UAAIA,UAAU;AACZE,eAAOC,SAASC,OAAOF,OAAOC,SAASE;MACzC;IACF,CAAA;EACF,CAAA;AAGA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMnB,QAAQoB,gBAAgBC,aAAaC,WAAW;AACtD,YAAMpB,gBAAgB;QAAEF;QAASI;MAAO,CAAA;IAC1C;EACF,CAAA;AAEA,SAAOmB,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
6
+ "names": ["contributes", "Client", "context", "onClientInitialized", "onSpacesReady", "options", "client", "Client", "initialize", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activatePromise", "ClientEvents", "SpacesReady", "contributes", "ClientCapabilities", "unsubscribe", "destroy"]
7
+ }
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-UCVFWBKT.mjs";
3
+ } from "./chunk-CAF2COXW.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-PSSNS4C6.mjs";
6
+ } from "./chunk-3F2Q2RKC.mjs";
7
7
  import {
8
8
  CLIENT_PLUGIN,
9
9
  meta
10
- } from "./chunk-MCEXD5XH.mjs";
10
+ } from "./chunk-GS3LDHYD.mjs";
11
11
 
12
- // packages/plugins/plugin-client/src/ClientPlugin.ts
13
- import { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from "@dxos/app-framework";
12
+ // src/ClientPlugin.ts
13
+ import { Capabilities, Events, contributes, defineModule, definePlugin, oneOf } from "@dxos/app-framework";
14
14
 
15
- // packages/plugins/plugin-client/src/capabilities/index.ts
15
+ // src/capabilities/index.ts
16
16
  import { lazy } from "@dxos/app-framework";
17
- var AppGraphBuilder = lazy(async () => import("./app-graph-builder-CBRN2DMK.mjs"));
18
- var Client = lazy(async () => import("./client-NMS3MSFP.mjs"));
19
- var IntentResolver = lazy(async () => import("./intent-resolver-SLQZMO6I.mjs"));
20
- var Migrations = lazy(async () => import("./migrations-QRQV6ZAM.mjs"));
21
- var ReactContext = lazy(async () => import("./react-context-IE2O2OYK.mjs"));
22
- var ReactSurface = lazy(async () => import("./react-surface-QFC2G27R.mjs"));
23
- var SchemaDefs = lazy(async () => import("./schema-defs-DNRDVQQJ.mjs"));
17
+ var AppGraphBuilder = lazy(async () => import("./app-graph-builder-MCGM4PFO.mjs"));
18
+ var Client = lazy(async () => import("./client-H2RZI6UX.mjs"));
19
+ var IntentResolver = lazy(async () => import("./intent-resolver-IE7KHWIY.mjs"));
20
+ var Migrations = lazy(async () => import("./migrations-CJY2LQHD.mjs"));
21
+ var ReactContext = lazy(async () => import("./react-context-TSUCH5YS.mjs"));
22
+ var ReactSurface = lazy(async () => import("./react-surface-WQD43JR7.mjs"));
23
+ var SchemaDefs = lazy(async () => import("./schema-defs-TLXADNLY.mjs"));
24
24
 
25
- // packages/plugins/plugin-client/src/translations.ts
26
- var translations_default = [
25
+ // src/translations.ts
26
+ var translations = [
27
27
  {
28
28
  "en-US": {
29
- [CLIENT_PLUGIN]: {
29
+ [meta.id]: {
30
30
  "account label": "User Account",
31
31
  "profile label": "Profile",
32
32
  "profile description": "You can adjust how your user settings here.",
@@ -75,7 +75,7 @@ var translations_default = [
75
75
  }
76
76
  ];
77
77
 
78
- // packages/plugins/plugin-client/src/ClientPlugin.ts
78
+ // src/ClientPlugin.ts
79
79
  var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam = "deviceInvitationCode", onReset, ...options }) => {
80
80
  const createInvitationUrl = (invitationCode) => {
81
81
  const baseUrl = new URL(invitationUrl);
@@ -138,7 +138,7 @@ var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam =
138
138
  defineModule({
139
139
  id: `${meta.id}/module/translations`,
140
140
  activatesOn: Events.SetupTranslations,
141
- activate: () => contributes(Capabilities.Translations, translations_default)
141
+ activate: () => contributes(Capabilities.Translations, translations)
142
142
  })
143
143
  ]);
144
144
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,QAAQC,aAAa;;;ACArF,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,SAASD,KAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,iBAAiBF,KAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,aAAaH,KAAK,YAAY,OAAO,2BAAA,CAAA;AAC3C,IAAMI,eAAeJ,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMK,eAAeL,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMM,aAAaN,KAAK,YAAY,OAAO,4BAAA,CAAA;;;ACNlD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACO,aAAAA,GAAgB;QACf,iBAAiB;QACjB,iBAAiB;QACjB,uBAAuB;QACvB,iBAAiB;QACjB,yBAAyB;QACzB,0BACE;QACF,uBACE;QACF,kCAAkC;QAClC,uBACE;QACF,kBAAkB;QAClB,4BAA4B;QAC5B,iCACE;QACF,gCACE;QACF,qBAAqB;QACrB,2B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;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOe;MACpBT,UAAU,MAAMU,aAAa;QAAE7B;QAAqBF;MAAQ,CAAA;IAC9D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOE;MACpBI,UAAUW;IACZ,CAAA;IACArB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOkB;MACpBZ,UAAU,CAACC,YAAYY,eAAe;QAAEZ;MAAQ,CAAA;IAClD,CAAA;IACAX,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
6
- "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "lazy", "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", "Client", "activatesBefore", "SetupSchema", "SchemaDefs", "SetupMigration", "Migrations", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, Events, contributes, defineModule, definePlugin, oneOf } from '@dxos/app-framework';\n\nimport {\n AppGraphBuilder,\n Client,\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 { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\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] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;;;;;;;AAIA,SAASA,cAAcC,QAAQC,aAAaC,cAAcC,cAAcC,aAAa;;;ACArF,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,SAASD,KAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,iBAAiBF,KAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,aAAaH,KAAK,YAAY,OAAO,2BAAA,CAAA;AAC3C,IAAMI,eAAeJ,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMK,eAAeL,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMM,aAAaN,KAAK,YAAY,OAAO,4BAAA,CAAA;;;ACJ3C,IAAMO,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,iBAAiB;QACjB,iBAAiB;QACjB,uBAAuB;QACvB,iBAAiB;QACjB,yBAAyB;QACzB,0BACE;QACF,uBACE;QACF,kCAAkC;QAClC,uBACE;QACF,kBAAkB;QAClB,4BAA4B;QAC5B,iCACE;QACF,gCACE;QACF,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AAA;IACAlB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOe;MACpBT,UAAU,MAAMU,aAAa;QAAE7B;QAAqBF;MAAQ,CAAA;IAC9D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOE;MACpBI,UAAUW;IACZ,CAAA;IACArB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOkB;MACpBZ,UAAU,CAACC,YAAYY,eAAe;QAAEZ;MAAQ,CAAA;IAClD,CAAA;IACAX,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaE,OAAOoB;MACpBd,UAAU,MAAMe,YAAYC,aAAaC,cAAcC,YAAAA;IACzD,CAAA;GACD;AACH;",
6
+ "names": ["Capabilities", "Events", "contributes", "defineModule", "definePlugin", "oneOf", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "Migrations", "ReactContext", "ReactSurface", "SchemaDefs", "translations", "meta", "id", "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", "Client", "activatesBefore", "SetupSchema", "SchemaDefs", "SetupMigration", "Migrations", "ReactContext", "SetupReactSurface", "ReactSurface", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
7
7
  }
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  ClientEvents
3
- } from "./chunk-UCVFWBKT.mjs";
3
+ } from "./chunk-CAF2COXW.mjs";
4
4
  import {
5
5
  ClientCapabilities
6
- } from "./chunk-PSSNS4C6.mjs";
6
+ } from "./chunk-3F2Q2RKC.mjs";
7
7
  import {
8
8
  JOIN_DIALOG,
9
9
  RECOVERY_CODE_DIALOG,
10
10
  RESET_DIALOG
11
- } from "./chunk-5MC5HCIM.mjs";
11
+ } from "./chunk-FOCQEA72.mjs";
12
12
  import {
13
13
  Account,
14
14
  ClientAction
15
- } from "./chunk-IA3AVM4I.mjs";
16
- import "./chunk-MCEXD5XH.mjs";
15
+ } from "./chunk-HLWIF3AW.mjs";
16
+ import "./chunk-GS3LDHYD.mjs";
17
17
 
18
- // packages/plugins/plugin-client/src/capabilities/intent-resolver.ts
18
+ // src/capabilities/intent-resolver.ts
19
19
  import { pipe } from "effect";
20
- import { Capabilities, chain, contributes, createIntent, createResolver, LayoutAction } from "@dxos/app-framework";
20
+ import { Capabilities, LayoutAction, chain, contributes, createIntent, createResolver } from "@dxos/app-framework";
21
21
  import { invariant } from "@dxos/invariant";
22
22
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
23
23
  import { PublicKey } from "@dxos/react-client";
24
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/capabilities/intent-resolver.ts";
24
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/capabilities/intent-resolver.ts";
25
25
  var RECOVER_IDENTITY_RPC_TIMEOUT = 2e4;
26
- var intent_resolver_default = ({ context, appName = "Composer" }) => contributes(Capabilities.IntentResolver, [
26
+ var intent_resolver_default = (({ context, appName = "Composer" }) => contributes(Capabilities.IntentResolver, [
27
27
  createResolver({
28
28
  intent: ClientAction.CreateIdentity,
29
29
  resolve: async (profile) => {
@@ -126,7 +126,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
126
126
  const client = context.getCapability(ClientCapabilities.Client);
127
127
  invariant(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
128
128
  F: __dxlog_file,
129
- L: 136,
129
+ L: 137,
130
130
  S: void 0,
131
131
  A: [
132
132
  "client.services.services.EdgeAgentService",
@@ -144,7 +144,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
144
144
  const client = context.getCapability(ClientCapabilities.Client);
145
145
  invariant(client.services.services.IdentityService, "IdentityService not available", {
146
146
  F: __dxlog_file,
147
- L: 144,
147
+ L: 145,
148
148
  S: void 0,
149
149
  A: [
150
150
  "client.services.services.IdentityService",
@@ -176,7 +176,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
176
176
  const identity = client.halo.identity.get();
177
177
  invariant(identity, "Identity not available", {
178
178
  F: __dxlog_file,
179
- L: 167,
179
+ L: 168,
180
180
  S: void 0,
181
181
  A: [
182
182
  "identity",
@@ -215,7 +215,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
215
215
  });
216
216
  invariant(credential, "Credential not available", {
217
217
  F: __dxlog_file,
218
- L: 192,
218
+ L: 193,
219
219
  S: void 0,
220
220
  A: [
221
221
  "credential",
@@ -226,7 +226,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
226
226
  const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
227
227
  invariant(client.services.services.IdentityService, "IdentityService not available", {
228
228
  F: __dxlog_file,
229
- L: 197,
229
+ L: 198,
230
230
  S: void 0,
231
231
  A: [
232
232
  "client.services.services.IdentityService",
@@ -248,7 +248,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
248
248
  const client = context.getCapability(ClientCapabilities.Client);
249
249
  invariant(client.services.services.IdentityService, "IdentityService not available", {
250
250
  F: __dxlog_file,
251
- L: 212,
251
+ L: 213,
252
252
  S: void 0,
253
253
  A: [
254
254
  "client.services.services.IdentityService",
@@ -284,7 +284,7 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
284
284
  const client = context.getCapability(ClientCapabilities.Client);
285
285
  invariant(client.services.services.IdentityService, "IdentityService not available", {
286
286
  F: __dxlog_file,
287
- L: 243,
287
+ L: 244,
288
288
  S: void 0,
289
289
  A: [
290
290
  "client.services.services.IdentityService",
@@ -298,8 +298,8 @@ var intent_resolver_default = ({ context, appName = "Composer" }) => contributes
298
298
  });
299
299
  }
300
300
  })
301
- ]);
301
+ ]));
302
302
  export {
303
303
  intent_resolver_default as default
304
304
  };
305
- //# sourceMappingURL=intent-resolver-SLQZMO6I.mjs.map
305
+ //# sourceMappingURL=intent-resolver-IE7KHWIY.mjs.map
@@ -0,0 +1,7 @@
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 LayoutAction,\n type PluginContext,\n chain,\n contributes,\n createIntent,\n createResolver,\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 { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { Account, ClientAction } from '../types';\n\nimport { ClientCapabilities } from './capabilities';\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() as Uint8Array<ArrayBuffer>,\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_IDENTITY_RPC_TIMEOUT },\n );\n },\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAIA,SAASA,YAAY;AAErB,SACEC,cACAC,cAEAC,OACAC,aACAC,cACAC,sBACK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAc1B,IAAMC,+BAA+B;AAErC,IAAA,2BAAe,CAAC,EAAEC,SAASC,UAAU,WAAU,MAC7CC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,aAAaC;IACrBC,SAAS,OAAOC,YAAAA;AACd,YAAMC,UAAUX,QAAQY,cAAcT,aAAaU,aAAa;AAChE,YAAMC,SAASd,QAAQY,cAAcG,mBAAmBC,MAAM;AAC9D,YAAMC,OAAO,MAAMH,OAAOI,KAAKC,eAAeT,OAAAA;AAC9C,YAAMC,QAAQS,SAASC,aAAaC,eAAe;AACnD,aAAO;QACLL;QACAM,SAAS;UACPC,aAAaC,oBAAoBC,WAAW;YAC1CC,MAAM;UACR,CAAA;;MAEJ;IACF;EACF,CAAA;EACAtB,eAAe;IACbC,QAAQC,aAAaqB;IACrBnB,SAAS,OAAOQ,SAAAA;AACd,aAAO;QACLM,SAAS;UACPC,aAAaK,aAAaC,cAAc;YACtCC,MAAM;YACNC,SAASC;YACTC,SAAS;cACPC,YAAY;cACZC,OAAO;gBACLC,uBAAuBpB,KAAKqB;gBAC5BC,oBAAoB;cACtB;YACF;UACF,CAAA;;MAEJ;IACF;EACF,CAAA;EACAlC,eAAe;IACbC,QAAQC,aAAaiC;IACrB/B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Intent", "createResolver", "invariant", "ObservabilityAction", "PublicKey", "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
+ }